Author: arty
Date: Sun Jun 25 02:07:06 2006
New Revision: 22596
URL:
http://svn.reactos.org/svn/reactos?rev=22596&view=rev
Log:
Added simple main function for powerpc.
Added:
branches/powerpc/reactos/ntoskrnl/ke/powerpc/
branches/powerpc/reactos/ntoskrnl/ke/powerpc/main_asm.S
Added: branches/powerpc/reactos/ntoskrnl/ke/powerpc/main_asm.S
URL:
http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/ntoskrnl/ke/pow…
==============================================================================
--- branches/powerpc/reactos/ntoskrnl/ke/powerpc/main_asm.S (added)
+++ branches/powerpc/reactos/ntoskrnl/ke/powerpc/main_asm.S Sun Jun 25 02:07:06 2006
@@ -1,0 +1,57 @@
+#include <roscfg.h>
+#include <ndk/asm.h>
+
+#define AP_MAGIC (0x12481020)
+
+.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
+_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:
+
+ .text
+ .globl NtProcessStartup
+NtProcessStartup:
+ lis 0,AP_MAGIC@ha
+ ori 0,0,AP_MAGIC@l
+ cmpw 0,0,3
+ bne .m1
+
+ /*
+ * Reserve space for the floating point save area.
+ */
+ addi 1,1,-SIZEOF_FX_SAVE_AREA
+
+ /*
+ * Call the application processor initialization code
+ */
+ bl _KiSystemStartup
+
+.m1:
+ /* 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 */
+ mr 3,5
+ mr 4,6
+ bl __main
+