diff options
Diffstat (limited to 'c/src/exec/score/cpu/sparc/rtems.s')
-rw-r--r-- | c/src/exec/score/cpu/sparc/rtems.s | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/c/src/exec/score/cpu/sparc/rtems.s b/c/src/exec/score/cpu/sparc/rtems.s index 2b9bd10454..75aa41f83b 100644 --- a/c/src/exec/score/cpu/sparc/rtems.s +++ b/c/src/exec/score/cpu/sparc/rtems.s @@ -22,12 +22,22 @@ * is used to look up the directive. * * void RTEMS() - * { - * } */ .align 4 PUBLIC(RTEMS) SYM(RTEMS): - ret + /* + * g2 was chosen because gcc uses it as a scratch register in + * similar code scenarios and the other locals, ins, and outs + * are off limits to this routine unless it does a "save" and + * copies its in registers to the outs which only works up until + * 6 parameters. Best to take the simple approach in this case. + */ + sethi SYM(_Entry_points), %g2 + or %g2, %lo(SYM(_Entry_points)), %g2 + sll %g1, 2, %g1 + add %g1, %g2, %g2 + jmp %g2 + nop |