2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
* libc/machine/nds32/setjmp.S: Keep jmp_buff sync with GDB.
This commit is contained in:
parent
488d885bf3
commit
c18decccef
@ -1,3 +1,7 @@
|
|||||||
|
2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
|
||||||
|
|
||||||
|
* libc/machine/nds32/setjmp.S: Keep jmp_buff sync with GDB.
|
||||||
|
|
||||||
2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
|
2014-03-21 Sabrina Ni <sabrinanitw@gmail.com>
|
||||||
|
|
||||||
* libc/machine/nds32/setjmp.S: Optimize.
|
* libc/machine/nds32/setjmp.S: Optimize.
|
||||||
|
@ -40,7 +40,9 @@ The usage of thirty-two 32-bit General Purpose Registers (GPR):
|
|||||||
reserved for assembler : $r15
|
reserved for assembler : $r15
|
||||||
reserved for other use : $r24, $r25, $r26, $r27
|
reserved for other use : $r24, $r25, $r26, $r27
|
||||||
|
|
||||||
Save all callee-save registers and $fp, $gp, $lp and $sp.
|
Save all callee-save registers and $fp, $gp, $lp and $sp is enough in theory.
|
||||||
|
For debugging issue, the layout of jum_buf in here should be in sync with GDB.
|
||||||
|
The $r16 ~ $r19 are used to store D0/D1, keep them for backward-compatible.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* int setjmp(jmp_buf env); */
|
/* int setjmp(jmp_buf env); */
|
||||||
@ -50,13 +52,12 @@ Save all callee-save registers and $fp, $gp, $lp and $sp.
|
|||||||
.type setjmp, @function
|
.type setjmp, @function
|
||||||
setjmp:
|
setjmp:
|
||||||
#ifdef __NDS32_REDUCED_REGS__
|
#ifdef __NDS32_REDUCED_REGS__
|
||||||
/* This case, save 10 words. */
|
smw.bim $r6, [$r0], $r10, #0b0000
|
||||||
smw.bim $r6, [$r0], $r10, 0x0
|
addi $r0, $r0, #32 /* Leave room to keep jum_buf all the same. */
|
||||||
smw.bim $r31, [$r0], $r31, 0xf
|
smw.bim $r31, [$r0], $r31, #0b1111
|
||||||
#else
|
#else
|
||||||
/* This case, save 17 words. */
|
smw.bim $r6, [$r0], $r14, #0b0000
|
||||||
smw.bim $r6, [$r0], $r14, 0x0
|
smw.bim $r16, [$r0], $r19, #0b1111
|
||||||
smw.bim $r16, [$r0], $r19, 0xf
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Set return value to zero. */
|
/* Set return value to zero. */
|
||||||
@ -72,11 +73,12 @@ setjmp:
|
|||||||
.type longjmp, @function
|
.type longjmp, @function
|
||||||
longjmp:
|
longjmp:
|
||||||
#ifdef __NDS32_REDUCED_REGS__
|
#ifdef __NDS32_REDUCED_REGS__
|
||||||
lmw.bim $r6, [$r0], $r10, 0x0
|
lmw.bim $r6, [$r0], $r10, #0b0000
|
||||||
lmw.bim $r31, [$r0], $r31, 0xf
|
addi $r0, $r0, #32
|
||||||
|
lmw.bim $r31, [$r0], $r31, #0b1111
|
||||||
#else
|
#else
|
||||||
lmw.bim $r6, [$r0], $r14, 0x0
|
lmw.bim $r6, [$r0], $r14, #0b0000
|
||||||
lmw.bim $r16, [$r0], $r19, 0xf
|
lmw.bim $r16, [$r0], $r19, #0b1111
|
||||||
#endif
|
#endif
|
||||||
/* Set val as return value. If the value val is 0, 1 will be returned
|
/* Set val as return value. If the value val is 0, 1 will be returned
|
||||||
instead. */
|
instead. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user