diff options
author | DJ Delorie <dj@redhat.com> | 2009-04-21 18:13:32 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2009-04-21 18:13:32 +0000 |
commit | 6e9c1e8dd52d8b43e57b8b664e4cd087b0566cd2 (patch) | |
tree | 66583c063e67a17c899ddecc7dd6c2b24163b1f7 /libgloss/mep/sim-crt0.S | |
parent | 90791a187977e7c0c6e935a97a7675ab0e67492a (diff) | |
download | newlib-6e9c1e8dd52d8b43e57b8b664e4cd087b0566cd2.zip newlib-6e9c1e8dd52d8b43e57b8b664e4cd087b0566cd2.tar.gz newlib-6e9c1e8dd52d8b43e57b8b664e4cd087b0566cd2.tar.bz2 |
* mep/Makefile.in (SCRIPTS): Update to new config.
* mep/default.ld: New.
* mep/gmap_default.ld: Change default endian to little.
* mep/sim-crt0.S: Maintain 8-byte stack alignment.
* mep/sim-crtn.S: Likewise.
Diffstat (limited to 'libgloss/mep/sim-crt0.S')
-rw-r--r-- | libgloss/mep/sim-crt0.S | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/libgloss/mep/sim-crt0.S b/libgloss/mep/sim-crt0.S index 0ce5f48..c96ce23 100644 --- a/libgloss/mep/sim-crt0.S +++ b/libgloss/mep/sim-crt0.S @@ -113,6 +113,17 @@ _start: movh $sp, %uhi(__stack_table) or3 $sp, $sp, %lo(__stack_table) + # initialize sp, gp, tp + # get CPU ID + ldc $0, $id + srl $0, 16 + + # load ID-specific stack pointer + sl2ad3 $0, $0, $sp # $0 = ($0 << 2) + $sp + lw $sp,($0) # $sp = *($0) + mov $0,0xfff8 + and $sp, $0 + #ifndef NOVEC # copy exception vector table @@ -294,14 +305,6 @@ _start: .Lend_dc: # NOVEC #endif - # initialize sp, gp, tp - # get CPU ID - ldc $0, $id - srl $0, 16 - - # load ID-specific stack pointer - sl2ad3 $0, $0, $sp # $0 = ($0 << 2) + $sp - lw $sp,($0) # $sp = *($0) mov $0, 0 movh $gp, %uhi(__sdabase) @@ -385,13 +388,13 @@ _exit_in_progress: .word 0 .section .init __invoke_init_section: - add $sp, -4 + add $sp, -8 ldc $0, $lp sw $0, ($sp) .section .fini __invoke_fini_section: - add $sp, -4 + add $sp, -8 ldc $0, $lp sw $0, ($sp) |