summaryrefslogtreecommitdiffstats
path: root/start.S
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-05-18 11:34:54 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-05-18 11:34:54 -0500
commit512cc04b8f681a7583fff88bd903f327d549bd3d (patch)
tree3efc0f86654708fb17c58b2c8d7eb88bda01e29d /start.S
parent4324ee74d2a77c20704323dae57762b36301ea8a (diff)
downloadtalos-hostboot-512cc04b8f681a7583fff88bd903f327d549bd3d.tar.gz
talos-hostboot-512cc04b8f681a7583fff88bd903f327d549bd3d.zip
Move stack init to asm stub.
Diffstat (limited to 'start.S')
-rw-r--r--start.S36
1 files changed, 31 insertions, 5 deletions
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
OpenPOWER on IntegriCloud