mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 18:42:56 +00:00
[NTOS]
- Make assembly ML64 safe - remove 2 stubs, add 2 others svn path=/branches/ros-amd64-bringup/; revision=45427
This commit is contained in:
parent
139c298d14
commit
bf7d707939
4 changed files with 31 additions and 37 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <reactos/asm.h>
|
#include <reactos/asm.h>
|
||||||
#include <ndk/amd64/asm.h>
|
#include <ndk/amd64/asm.h>
|
||||||
|
|
||||||
|
EXTERN KiInitializeKernelAndGotoIdleLoop:PROC
|
||||||
|
|
||||||
/* GLOBALS *******************************************************************/
|
/* GLOBALS *******************************************************************/
|
||||||
|
|
||||||
|
@ -37,13 +38,15 @@ PUBLIC KiSetupStackAndInitializeKernel
|
||||||
mov rsi, rsp
|
mov rsi, rsp
|
||||||
|
|
||||||
/* Setup the new stack */
|
/* Setup the new stack */
|
||||||
mov ax, 0x18
|
mov ax, HEX(18)
|
||||||
mov ss, ax
|
mov ss, ax
|
||||||
mov rsp, r8
|
mov rsp, r8
|
||||||
sub rsp, 0x300 // FIXME
|
sub rsp, HEX(300) // FIXME
|
||||||
|
|
||||||
/* Copy stack parameters to the new stack */
|
/* Copy stack parameters to the new stack */
|
||||||
sub rsp, 0x38
|
sub rsp, HEX(38)
|
||||||
|
.ENDPROLOG
|
||||||
|
|
||||||
mov rdi, rsp
|
mov rdi, rsp
|
||||||
movsq
|
movsq
|
||||||
movsq
|
movsq
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
/* FUNCTIONS ****************************************************************/
|
||||||
|
|
||||||
|
.code64
|
||||||
|
|
||||||
/*++
|
/*++
|
||||||
* KiThreadStartup
|
* KiThreadStartup
|
||||||
*
|
*
|
||||||
|
@ -43,8 +45,7 @@
|
||||||
* If a return from a system thread is detected, a bug check will occur.
|
* If a return from a system thread is detected, a bug check will occur.
|
||||||
*
|
*
|
||||||
*--*/
|
*--*/
|
||||||
.func KiThreadStartup
|
PUBLIC KiThreadStartup
|
||||||
.globl KiThreadStartup
|
|
||||||
KiThreadStartup:
|
KiThreadStartup:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -85,13 +86,12 @@ KiThreadStartup:
|
||||||
|
|
||||||
/* Exit back to user-mode */
|
/* Exit back to user-mode */
|
||||||
// jmp _KiServiceExit2
|
// jmp _KiServiceExit2
|
||||||
UNIMPLEMENTED KiThreadStartup->KiServiceExit2
|
UNIMPLEMENTED KiThreadStartup_KiServiceExit2
|
||||||
|
|
||||||
BadThread:
|
BadThread:
|
||||||
|
|
||||||
/* A system thread returned...this is very bad! */
|
/* A system thread returned...this is very bad! */
|
||||||
int 3
|
int 3
|
||||||
.endfunc
|
|
||||||
|
|
||||||
|
|
||||||
/*++
|
/*++
|
||||||
|
@ -112,13 +112,11 @@ BadThread:
|
||||||
* Absolutely all registers except ESP can be trampled here for maximum code flexibility.
|
* Absolutely all registers except ESP can be trampled here for maximum code flexibility.
|
||||||
*
|
*
|
||||||
*--*/
|
*--*/
|
||||||
.globl KiSwapContextInternal
|
PUBLIC KiSwapContextInternal
|
||||||
.func KiSwapContextInternal
|
|
||||||
KiSwapContextInternal:
|
KiSwapContextInternal:
|
||||||
UNIMPLEMENTED KiSwapContextInternal
|
UNIMPLEMENTED KiSwapContextInternal
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.endfunc
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* KiSwapContext
|
* KiSwapContext
|
||||||
|
@ -147,8 +145,7 @@ KiSwapContextInternal:
|
||||||
* another thread switches to IT.
|
* another thread switches to IT.
|
||||||
*
|
*
|
||||||
*--*/
|
*--*/
|
||||||
.globl KiSwapContext
|
PUBLIC KiSwapContext
|
||||||
.func KiSwapContext
|
|
||||||
KiSwapContext:
|
KiSwapContext:
|
||||||
|
|
||||||
/* Save 10 registers */
|
/* Save 10 registers */
|
||||||
|
@ -198,4 +195,5 @@ KiSwapContext:
|
||||||
/* Clean stack */
|
/* Clean stack */
|
||||||
add esp, 10 * 8
|
add esp, 10 * 8
|
||||||
ret
|
ret
|
||||||
.endfunc
|
|
||||||
|
END
|
||||||
|
|
|
@ -165,22 +165,15 @@ __security_check_cookie()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOLEAN CcPfEnablePrefetcher;
|
||||||
|
|
||||||
NTKERNELAPI
|
unsigned long __readfsdword(const unsigned long Offset)
|
||||||
PSLIST_ENTRY
|
|
||||||
ExpInterlockedPopEntrySList(
|
|
||||||
PSLIST_HEADER ListHead)
|
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTKERNELAPI
|
void main()
|
||||||
PSLIST_ENTRY
|
|
||||||
ExpInterlockedPushEntrySList(
|
|
||||||
PSLIST_HEADER ListHead,
|
|
||||||
PSLIST_ENTRY ListEntry)
|
|
||||||
{
|
{
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,28 +24,28 @@ EXTERN KiXmmExceptionHandler:PROC
|
||||||
.data
|
.data
|
||||||
|
|
||||||
PUBLIC MsgUnimplemented
|
PUBLIC MsgUnimplemented
|
||||||
_MsgUnimplemented:
|
MsgUnimplemented:
|
||||||
.ascii "WARNING: %s at %s:%d is UNIMPLEMENTED!\n"
|
.ascii "WARNING: %s at %s:%d is UNIMPLEMENTED!\n"
|
||||||
|
|
||||||
_MsgPageFault:
|
MsgPageFault:
|
||||||
.ascii "Page fault! Code = 0x%x, RIP = %p, FaultingAddress = %p\n\0"
|
.ascii "Page fault! Code = 0x%x, RIP = %p, FaultingAddress = %p\n\0"
|
||||||
|
|
||||||
_MsgGeneralProtFault:
|
MsgGeneralProtFault:
|
||||||
.ascii "General protection fault at %p!\n\0"
|
.ascii "General protection fault at %p!\n\0"
|
||||||
|
|
||||||
_MsgBreakpointTrap:
|
MsgBreakpointTrap:
|
||||||
.ascii "BreakpointTrap at %p\n\0"
|
.ascii "BreakpointTrap at %p\n\0"
|
||||||
|
|
||||||
_MsgUnexpectedInterrupt:
|
MsgUnexpectedInterrupt:
|
||||||
.ascii "UnexpectedInterrupt Vector=0x%02lx\n\0"
|
.ascii "UnexpectedInterrupt Vector=0x%02lx\n\0"
|
||||||
|
|
||||||
_MsgInvalidOpcodeFault:
|
MsgInvalidOpcodeFault:
|
||||||
.ascii "Invalid opcode fault at %p!\n\0"
|
.ascii "Invalid opcode fault at %p!\n\0"
|
||||||
|
|
||||||
_MsgDoubleFault:
|
MsgDoubleFault:
|
||||||
.ascii "Double fault at %p, rbp=%p!\n\0"
|
.ascii "Double fault at %p, rbp=%p!\n\0"
|
||||||
|
|
||||||
_MsgTrapInfo:
|
MsgTrapInfo:
|
||||||
.ascii "Trap: %s at %p\n\0"
|
.ascii "Trap: %s at %p\n\0"
|
||||||
|
|
||||||
MACRO(TRAPINFO, func)
|
MACRO(TRAPINFO, func)
|
||||||
|
@ -55,7 +55,7 @@ LOCAL label1, label2
|
||||||
label1: .asciz "\func"
|
label1: .asciz "\func"
|
||||||
label2:
|
label2:
|
||||||
sub rsp, 32
|
sub rsp, 32
|
||||||
lea rcx, _MsgTrapInfo[rip]
|
lea rcx, MsgTrapInfo[rip]
|
||||||
lea rdx, 1b[rip]
|
lea rdx, 1b[rip]
|
||||||
mov r8, [rbp + KTRAP_FRAME_Rip]
|
mov r8, [rbp + KTRAP_FRAME_Rip]
|
||||||
call qword ptr FrLdrDbgPrint[rip]
|
call qword ptr FrLdrDbgPrint[rip]
|
||||||
|
@ -421,7 +421,7 @@ PUBLIC KiBreakpointTrap
|
||||||
|
|
||||||
TRAPINFO KiBreakpointTrap
|
TRAPINFO KiBreakpointTrap
|
||||||
|
|
||||||
// lea rcx, _MsgBreakpointTrap[rip]
|
// lea rcx, MsgBreakpointTrap[rip]
|
||||||
// mov rdx, rsp
|
// mov rdx, rsp
|
||||||
// call qword ptr FrLdrDbgPrint[rip]
|
// call qword ptr FrLdrDbgPrint[rip]
|
||||||
|
|
||||||
|
@ -501,7 +501,7 @@ PUBLIC KiInvalidOpcodeFault
|
||||||
TRAPINFO KiInvalidOpcodeFault
|
TRAPINFO KiInvalidOpcodeFault
|
||||||
|
|
||||||
mov rdx, [rbp + KTRAP_FRAME_Rip]
|
mov rdx, [rbp + KTRAP_FRAME_Rip]
|
||||||
lea rcx, _MsgInvalidOpcodeFault[rip]
|
lea rcx, MsgInvalidOpcodeFault[rip]
|
||||||
call qword ptr FrLdrDbgPrint[rip]
|
call qword ptr FrLdrDbgPrint[rip]
|
||||||
|
|
||||||
/* Enable interrupts */
|
/* Enable interrupts */
|
||||||
|
@ -562,7 +562,7 @@ PUBLIC KiDoubleFaultAbort
|
||||||
/* Push pseudo error code */
|
/* Push pseudo error code */
|
||||||
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
ENTER_TRAP_FRAME TRAPFLAG_ALL
|
||||||
|
|
||||||
lea rcx, _MsgDoubleFault[rip]
|
lea rcx, MsgDoubleFault[rip]
|
||||||
mov rdx, [rbp + KTRAP_FRAME_FaultAddress]
|
mov rdx, [rbp + KTRAP_FRAME_FaultAddress]
|
||||||
mov r8, rbp
|
mov r8, rbp
|
||||||
call qword ptr FrLdrDbgPrint[rip]
|
call qword ptr FrLdrDbgPrint[rip]
|
||||||
|
@ -639,7 +639,7 @@ PUBLIC KiGeneralProtectionFault
|
||||||
|
|
||||||
TRAPINFO KiGeneralProtectionFault
|
TRAPINFO KiGeneralProtectionFault
|
||||||
mov rdx, [rbp + KTRAP_FRAME_Rip]
|
mov rdx, [rbp + KTRAP_FRAME_Rip]
|
||||||
lea rcx, _MsgGeneralProtFault[rip]
|
lea rcx, MsgGeneralProtFault[rip]
|
||||||
call qword ptr FrLdrDbgPrint[rip]
|
call qword ptr FrLdrDbgPrint[rip]
|
||||||
|
|
||||||
/* Call the C handler */
|
/* Call the C handler */
|
||||||
|
@ -682,7 +682,7 @@ PUBLIC KiPageFault
|
||||||
TRAPINFO KiPageFault
|
TRAPINFO KiPageFault
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
lea rcx, _MsgPageFault[rip]
|
lea rcx, MsgPageFault[rip]
|
||||||
mov rdx, [rbp + KTRAP_FRAME_ErrorCode]
|
mov rdx, [rbp + KTRAP_FRAME_ErrorCode]
|
||||||
mov r8, [rbp + KTRAP_FRAME_Rip]
|
mov r8, [rbp + KTRAP_FRAME_Rip]
|
||||||
mov r9, [rbp + KTRAP_FRAME_FaultAddress]
|
mov r9, [rbp + KTRAP_FRAME_FaultAddress]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue