2007-10-06 07:53:20 +00:00
|
|
|
#include <ndk/asm.h>
|
|
|
|
|
|
|
|
#define AP_MAGIC (0x12481020)
|
|
|
|
|
|
|
|
.global P0BootStack
|
|
|
|
.global KiDoubleFaultStack
|
|
|
|
.global _kernel_stack
|
|
|
|
.global _kernel_stack_top
|
|
|
|
.global _kernel_trap_stack
|
|
|
|
.global _kernel_trap_stack_top
|
|
|
|
|
|
|
|
.section .bss
|
|
|
|
.align 12
|
|
|
|
|
|
|
|
|
|
|
|
/* guard page for the kernel stack */
|
|
|
|
.fill 4096, 1, 0
|
|
|
|
|
|
|
|
_kernel_stack:
|
|
|
|
.fill 3*4096, 1, 0
|
|
|
|
P0BootStack:
|
|
|
|
_kernel_stack_top:
|
|
|
|
|
|
|
|
/* guard page for the trap stack */
|
|
|
|
.fill 4096, 1, 0
|
|
|
|
|
|
|
|
_kernel_trap_stack:
|
|
|
|
.fill 3*4096, 1, 0
|
|
|
|
_kernel_trap_stack_top:
|
|
|
|
|
|
|
|
.fill 3*4096, 1, 0
|
|
|
|
KiDoubleFaultStack:
|
|
|
|
|
|
|
|
.text
|
|
|
|
.globl KiSystemStartup
|
|
|
|
.globl KiRosPrepareForSystemStartup
|
|
|
|
.globl DrawNumber
|
|
|
|
|
2008-02-22 13:41:37 +00:00
|
|
|
KiSystemStartup:
|
2007-10-06 07:53:20 +00:00
|
|
|
/*
|
|
|
|
* Set a normal MSR value
|
|
|
|
*/
|
|
|
|
xor 0,0,0
|
2008-01-06 14:52:00 +00:00
|
|
|
ori 30,0,0x3030
|
2007-10-06 07:53:20 +00:00
|
|
|
mtmsr 30
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Reserve space for the floating point save area.
|
|
|
|
*/
|
|
|
|
addi 1,1,-SIZEOF_FX_SAVE_AREA
|
|
|
|
|
|
|
|
/* Bye bye asm land! */
|
|
|
|
mr 4,3
|
|
|
|
|
|
|
|
/* Load the initial kernel stack */
|
|
|
|
lis 1,_kernel_stack_top@ha
|
|
|
|
ori 1,1,_kernel_stack_top@l
|
|
|
|
addi 1,1,-SIZEOF_FX_SAVE_AREA
|
|
|
|
|
|
|
|
/* Call the main kernel initialization */
|
|
|
|
bl KiRosPrepareForSystemStartup
|
|
|
|
|
|
|
|
.global NtCurrentTeb
|
|
|
|
NtCurrentTeb:
|
|
|
|
mr 3,12
|
|
|
|
blr
|
|
|
|
|
|
|
|
.globl KeSynchronizeExecution
|
|
|
|
|
|
|
|
KeSynchronizeExecution:
|
|
|
|
blr
|
2008-01-06 14:52:00 +00:00
|
|
|
|
|
|
|
.globl PearPCDebug
|
|
|
|
PearPCDebug:
|
|
|
|
// .long 0x00333303
|
|
|
|
blr
|