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/ofw/rtas.c | |
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/ofw/rtas.c')
-rw-r--r-- | sys/powerpc/ofw/rtas.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/powerpc/ofw/rtas.c b/sys/powerpc/ofw/rtas.c index 15cb58e..5dff8ef 100644 --- a/sys/powerpc/ofw/rtas.c +++ b/sys/powerpc/ofw/rtas.c @@ -62,8 +62,6 @@ int rtascall(vm_offset_t callbuffer, uintptr_t rtas_privdat); extern uintptr_t rtas_entry; extern register_t rtasmsr; -int setfault(faultbuf); /* defined in locore.S */ - /* * After the VM is up, allocate RTAS memory and instantiate it */ @@ -203,7 +201,7 @@ int rtas_call_method(cell_t token, int nargs, int nreturns, ...) { vm_offset_t argsptr; - faultbuf env, *oldfaultbuf; + jmp_buf env, *oldfaultbuf; va_list ap; struct { cell_t token; @@ -233,7 +231,8 @@ rtas_call_method(cell_t token, int nargs, int nreturns, ...) /* Get rid of any stale machine checks that have been waiting. */ __asm __volatile ("sync; isync"); oldfaultbuf = curthread->td_pcb->pcb_onfault; - if (!setfault(env)) { + curthread->td_pcb->pcb_onfault = &env; + if (!setjmp(env)) { __asm __volatile ("sync"); result = rtascall(argsptr, rtas_private_data); __asm __volatile ("sync; isync"); |