From 512cc04b8f681a7583fff88bd903f327d549bd3d Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Tue, 18 May 2010 11:34:54 -0500 Subject: Move stack init to asm stub. --- start.S | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'start.S') diff --git a/start.S b/start.S index 86eed054a..53604eec5 100644 --- a/start.S +++ b/start.S @@ -60,11 +60,6 @@ relocate_loop: blr finished_relocate: - ;// Set up initial TOC Base - lis 2, opd_load_address@h - ori 2, 2, opd_load_address@l - ld 2,8(2) - ;// Jump to main. b _main @@ -72,6 +67,37 @@ finished_relocate: intvect_system_reset: b _start +.section .text +_main: + ;// Set up initial TOC Base + lis 2, opd_load_address@h + ori 2, 2, opd_load_address@l + ld 2,8(2) + + ;// Set up initial stack + lis 1, kernel_stack@h + ori 1, 1, kernel_stack@l + addi 1, 1, 16368 + + ;// Set up exception stack + lis 3, exception_stack@h + ori 3, 3, exception_stack@l + addi 3, 3, 16368 + mtsprg0 3 + + ;// Call main. + bl main +_main_loop: + b _main_loop + + +.section .data + .balign 1024 +kernel_stack: + .space 16*1024 +exception_stack: + .space 16*1024 + .section .text.hreset hreset: b _start -- cgit v1.2.1