- Make assembly ML64 safe
- remove 2 stubs, add 2 others

svn path=/branches/ros-amd64-bringup/; revision=45427
This commit is contained in:
Timo Kreuzer 2010-02-05 01:39:05 +00:00
parent 139c298d14
commit bf7d707939
4 changed files with 31 additions and 37 deletions

View file

@ -11,6 +11,7 @@
#include <reactos/asm.h>
#include <ndk/amd64/asm.h>
EXTERN KiInitializeKernelAndGotoIdleLoop:PROC
/* GLOBALS *******************************************************************/
@ -37,13 +38,15 @@ PUBLIC KiSetupStackAndInitializeKernel
mov rsi, rsp
/* Setup the new stack */
mov ax, 0x18
mov ax, HEX(18)
mov ss, ax
mov rsp, r8
sub rsp, 0x300 // FIXME
sub rsp, HEX(300) // FIXME
/* Copy stack parameters to the new stack */
sub rsp, 0x38
sub rsp, HEX(38)
.ENDPROLOG
mov rdi, rsp
movsq
movsq

View file

@ -14,6 +14,8 @@
/* FUNCTIONS ****************************************************************/
.code64
/*++
* KiThreadStartup
*
@ -43,8 +45,7 @@
* If a return from a system thread is detected, a bug check will occur.
*
*--*/
.func KiThreadStartup
.globl KiThreadStartup
PUBLIC KiThreadStartup
KiThreadStartup:
/*
@ -85,13 +86,12 @@ KiThreadStartup:
/* Exit back to user-mode */
// jmp _KiServiceExit2
UNIMPLEMENTED KiThreadStartup->KiServiceExit2
UNIMPLEMENTED KiThreadStartup_KiServiceExit2
BadThread:
/* A system thread returned...this is very bad! */
int 3
.endfunc
/*++
@ -112,13 +112,11 @@ BadThread:
* Absolutely all registers except ESP can be trampled here for maximum code flexibility.
*
*--*/
.globl KiSwapContextInternal
.func KiSwapContextInternal
PUBLIC KiSwapContextInternal
KiSwapContextInternal:
UNIMPLEMENTED KiSwapContextInternal
ret
.endfunc
/**
* KiSwapContext
@ -147,8 +145,7 @@ KiSwapContextInternal:
* another thread switches to IT.
*
*--*/
.globl KiSwapContext
.func KiSwapContext
PUBLIC KiSwapContext
KiSwapContext:
/* Save 10 registers */
@ -198,4 +195,5 @@ KiSwapContext:
/* Clean stack */
add esp, 10 * 8
ret
.endfunc
END

View file

@ -165,22 +165,15 @@ __security_check_cookie()
{
}
BOOLEAN CcPfEnablePrefetcher;
NTKERNELAPI
PSLIST_ENTRY
ExpInterlockedPopEntrySList(
PSLIST_HEADER ListHead)
unsigned long __readfsdword(const unsigned long Offset)
{
return 0;
}
NTKERNELAPI
PSLIST_ENTRY
ExpInterlockedPushEntrySList(
PSLIST_HEADER ListHead,
PSLIST_ENTRY ListEntry)
void main()
{
return 0;
}
#endif

View file

@ -24,28 +24,28 @@ EXTERN KiXmmExceptionHandler:PROC
.data
PUBLIC MsgUnimplemented
_MsgUnimplemented:
MsgUnimplemented:
.ascii "WARNING: %s at %s:%d is UNIMPLEMENTED!\n"
_MsgPageFault:
MsgPageFault:
.ascii "Page fault! Code = 0x%x, RIP = %p, FaultingAddress = %p\n\0"
_MsgGeneralProtFault:
MsgGeneralProtFault:
.ascii "General protection fault at %p!\n\0"
_MsgBreakpointTrap:
MsgBreakpointTrap:
.ascii "BreakpointTrap at %p\n\0"
_MsgUnexpectedInterrupt:
MsgUnexpectedInterrupt:
.ascii "UnexpectedInterrupt Vector=0x%02lx\n\0"
_MsgInvalidOpcodeFault:
MsgInvalidOpcodeFault:
.ascii "Invalid opcode fault at %p!\n\0"
_MsgDoubleFault:
MsgDoubleFault:
.ascii "Double fault at %p, rbp=%p!\n\0"
_MsgTrapInfo:
MsgTrapInfo:
.ascii "Trap: %s at %p\n\0"
MACRO(TRAPINFO, func)
@ -55,7 +55,7 @@ LOCAL label1, label2
label1: .asciz "\func"
label2:
sub rsp, 32
lea rcx, _MsgTrapInfo[rip]
lea rcx, MsgTrapInfo[rip]
lea rdx, 1b[rip]
mov r8, [rbp + KTRAP_FRAME_Rip]
call qword ptr FrLdrDbgPrint[rip]
@ -421,7 +421,7 @@ PUBLIC KiBreakpointTrap
TRAPINFO KiBreakpointTrap
// lea rcx, _MsgBreakpointTrap[rip]
// lea rcx, MsgBreakpointTrap[rip]
// mov rdx, rsp
// call qword ptr FrLdrDbgPrint[rip]
@ -501,7 +501,7 @@ PUBLIC KiInvalidOpcodeFault
TRAPINFO KiInvalidOpcodeFault
mov rdx, [rbp + KTRAP_FRAME_Rip]
lea rcx, _MsgInvalidOpcodeFault[rip]
lea rcx, MsgInvalidOpcodeFault[rip]
call qword ptr FrLdrDbgPrint[rip]
/* Enable interrupts */
@ -562,7 +562,7 @@ PUBLIC KiDoubleFaultAbort
/* Push pseudo error code */
ENTER_TRAP_FRAME TRAPFLAG_ALL
lea rcx, _MsgDoubleFault[rip]
lea rcx, MsgDoubleFault[rip]
mov rdx, [rbp + KTRAP_FRAME_FaultAddress]
mov r8, rbp
call qword ptr FrLdrDbgPrint[rip]
@ -639,7 +639,7 @@ PUBLIC KiGeneralProtectionFault
TRAPINFO KiGeneralProtectionFault
mov rdx, [rbp + KTRAP_FRAME_Rip]
lea rcx, _MsgGeneralProtFault[rip]
lea rcx, MsgGeneralProtFault[rip]
call qword ptr FrLdrDbgPrint[rip]
/* Call the C handler */
@ -682,7 +682,7 @@ PUBLIC KiPageFault
TRAPINFO KiPageFault
#if 0
lea rcx, _MsgPageFault[rip]
lea rcx, MsgPageFault[rip]
mov rdx, [rbp + KTRAP_FRAME_ErrorCode]
mov r8, [rbp + KTRAP_FRAME_Rip]
mov r9, [rbp + KTRAP_FRAME_FaultAddress]