diff options
author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2016-01-10 16:42:14 +0000 |
---|---|---|
committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2016-01-10 16:42:14 +0000 |
commit | a18c313e4a629099f2a747656e6307b6065616d5 (patch) | |
tree | 27594a95bb41f2c889fd13be830d29451361e818 /sys/powerpc/powermac | |
parent | cf45f1240d75a92edf739e6e60bdd0ea6bba7a32 (diff) | |
download | src-a18c313e4a629099f2a747656e6307b6065616d5.tar.gz src-a18c313e4a629099f2a747656e6307b6065616d5.zip |
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.
Notes
Notes:
svn path=/head/; revision=293636
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 b4a8a3b5e035..95d59a1ca744 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; |