Skip to content

Commit

Permalink
soc/runtime: cleanup/simplify exception_longjmp
Browse files Browse the repository at this point in the history
sbourdeauducq committed Sep 23, 2014
1 parent 4d3d15a commit 1b81fc8
Showing 3 changed files with 7 additions and 11 deletions.
14 changes: 5 additions & 9 deletions soc/runtime/exception_jmp.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.global exception_setjmp
.type exception_setjmp,@function
.type exception_setjmp, @function
exception_setjmp:
l.sw 0(r3), r1
l.sw 4(r3), r2
@@ -15,16 +15,12 @@ exception_setjmp:
l.sw 44(r3), r28
l.sw 48(r3), r30
l.jr r9
l.ori r11,r0,0
l.ori r11, r0, 0

.global exception_longjmp
.type exception_longjmp,@function
.type exception_longjmp, @function
exception_longjmp:
l.sfeqi r4, 0
l.bnf 1f
l.addi r11, r4, 0
l.ori r11, r0, 1
1: l.lwz r1, 0(r3)
l.lwz r1, 0(r3)
l.lwz r2, 4(r3)
l.lwz r9, 8(r3)
l.lwz r10, 12(r3)
@@ -38,4 +34,4 @@ exception_longjmp:
l.lwz r28, 44(r3)
l.lwz r30, 48(r3)
l.jr r9
l.nop
l.ori r11, r0, 1
2 changes: 1 addition & 1 deletion soc/runtime/exceptions.c
Original file line number Diff line number Diff line change
@@ -30,5 +30,5 @@ int exception_getid(void)

void exception_raise(int id)
{
exception_longjmp(exception_contexts[--ec_top].jb, 1);
exception_longjmp(exception_contexts[--ec_top].jb);
}
2 changes: 1 addition & 1 deletion soc/runtime/exceptions.h
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ enum {
};

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_pop(int levels);

0 comments on commit 1b81fc8

Please sign in to comment.