diff options
author | nwhitehorn <nwhitehorn@FreeBSD.org> | 2016-01-10 16:42:14 +0000 |
---|---|---|
committer | nwhitehorn <nwhitehorn@FreeBSD.org> | 2016-01-10 16:42:14 +0000 |
commit | f5d714b876f969adce2affd720c9237b29047693 (patch) | |
tree | 27594a95bb41f2c889fd13be830d29451361e818 /sys/powerpc/powermac | |
parent | d42a26ab2089d53213cf28c22508023ea16e7efb (diff) | |
download | FreeBSD-src-f5d714b876f969adce2affd720c9237b29047693.zip FreeBSD-src-f5d714b876f969adce2affd720c9237b29047693.tar.gz |
Use setjmp() instead of the identical-except-for-having-a-wrong-prototype
setfault() when testing for faults. This should also help the compiler
do the right thing with this complicated-to-optimize function.
Diffstat (limited to 'sys/powerpc/powermac')
-rw-r--r-- | sys/powerpc/powermac/grackle.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/powerpc/powermac/grackle.c b/sys/powerpc/powermac/grackle.c index b4a8a3b..95d59a1 100644 --- a/sys/powerpc/powermac/grackle.c +++ b/sys/powerpc/powermac/grackle.c @@ -82,8 +82,6 @@ static int grackle_enable_config(struct grackle_softc *, u_int, static void grackle_disable_config(struct grackle_softc *); static int badaddr(void *, size_t); -int setfault(faultbuf); /* defined in locore.S */ - /* * Driver methods. */ @@ -244,7 +242,7 @@ static int badaddr(void *addr, size_t size) { struct thread *td; - faultbuf env, *oldfaultbuf; + jmp_buf env, *oldfaultbuf; int x; /* Get rid of any stale machine checks that have been waiting. */ @@ -253,7 +251,8 @@ badaddr(void *addr, size_t size) td = curthread; oldfaultbuf = td->td_pcb->pcb_onfault; - if (setfault(env)) { + td->td_pcb->pcb_onfault = &env; + if (setjmp(env)) { td->td_pcb->pcb_onfault = oldfaultbuf; __asm __volatile ("sync"); return 1; |