forked from M-Labs/artiq
1
0
Fork 0

soc/runtime: cleanup/simplify exception_longjmp

This commit is contained in:
Sebastien Bourdeauducq 2014-09-24 00:00:10 +08:00
parent 4d3d15ad99
commit 1b81fc8a8f
3 changed files with 7 additions and 11 deletions

View File

@ -1,5 +1,5 @@
.global exception_setjmp .global exception_setjmp
.type exception_setjmp,@function .type exception_setjmp, @function
exception_setjmp: exception_setjmp:
l.sw 0(r3), r1 l.sw 0(r3), r1
l.sw 4(r3), r2 l.sw 4(r3), r2
@ -15,16 +15,12 @@ exception_setjmp:
l.sw 44(r3), r28 l.sw 44(r3), r28
l.sw 48(r3), r30 l.sw 48(r3), r30
l.jr r9 l.jr r9
l.ori r11,r0,0 l.ori r11, r0, 0
.global exception_longjmp .global exception_longjmp
.type exception_longjmp,@function .type exception_longjmp, @function
exception_longjmp: exception_longjmp:
l.sfeqi r4, 0 l.lwz r1, 0(r3)
l.bnf 1f
l.addi r11, r4, 0
l.ori r11, r0, 1
1: l.lwz r1, 0(r3)
l.lwz r2, 4(r3) l.lwz r2, 4(r3)
l.lwz r9, 8(r3) l.lwz r9, 8(r3)
l.lwz r10, 12(r3) l.lwz r10, 12(r3)
@ -38,4 +34,4 @@ exception_longjmp:
l.lwz r28, 44(r3) l.lwz r28, 44(r3)
l.lwz r30, 48(r3) l.lwz r30, 48(r3)
l.jr r9 l.jr r9
l.nop l.ori r11, r0, 1

View File

@ -30,5 +30,5 @@ int exception_getid(void)
void exception_raise(int id) void exception_raise(int id)
{ {
exception_longjmp(exception_contexts[--ec_top].jb, 1); exception_longjmp(exception_contexts[--ec_top].jb);
} }

View File

@ -6,7 +6,7 @@ enum {
}; };
int exception_setjmp(void *jb) __attribute__((returns_twice)); int exception_setjmp(void *jb) __attribute__((returns_twice));
void exception_longjmp(void *jb, int val) __attribute__((noreturn)); void exception_longjmp(void *jb) __attribute__((noreturn));
void *exception_push(void); void *exception_push(void);
void exception_pop(int levels); void exception_pop(int levels);