summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/ofw/rtas.c
diff options
context:
space:
mode:
authornwhitehorn <nwhitehorn@FreeBSD.org>2013-09-09 12:45:41 +0000
committernwhitehorn <nwhitehorn@FreeBSD.org>2013-09-09 12:45:41 +0000
commit9c7a32d39919735caaff636fa621ee0306559f4b (patch)
tree89c01a2fae45fdaf8b8fc05577d2e02e12ee66fd /sys/powerpc/ofw/rtas.c
parentedb58d082bda05cc6e61498cf95a019950886aa1 (diff)
downloadFreeBSD-src-9c7a32d39919735caaff636fa621ee0306559f4b.zip
FreeBSD-src-9c7a32d39919735caaff636fa621ee0306559f4b.tar.gz
Use a spin lock instead of a mutex to gate RTAS. This is required if RTAS
calls are involved in interrupt handling. Approved by: re (kib)
Diffstat (limited to 'sys/powerpc/ofw/rtas.c')
-rw-r--r--sys/powerpc/ofw/rtas.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/powerpc/ofw/rtas.c b/sys/powerpc/ofw/rtas.c
index c6d8969..34b7acf 100644
--- a/sys/powerpc/ofw/rtas.c
+++ b/sys/powerpc/ofw/rtas.c
@@ -93,7 +93,7 @@ rtas_setup(void *junk)
return;
}
- mtx_init(&rtas_mtx, "RTAS", MTX_DEF, 0);
+ mtx_init(&rtas_mtx, "RTAS", NULL, MTX_SPIN);
/* RTAS must be called with everything turned off in MSR */
rtasmsr = mfmsr();
@@ -208,7 +208,7 @@ rtas_call_method(cell_t token, int nargs, int nreturns, ...)
args.token = token;
va_start(ap, nreturns);
- mtx_lock(&rtas_mtx);
+ mtx_lock_spin(&rtas_mtx);
rtas_bounce_offset = 0;
args.nargs = nargs;
@@ -232,7 +232,7 @@ rtas_call_method(cell_t token, int nargs, int nreturns, ...)
__asm __volatile ("sync");
rtas_real_unmap(argsptr, &args, sizeof(args));
- mtx_unlock(&rtas_mtx);
+ mtx_unlock_spin(&rtas_mtx);
if (result < 0)
return (result);
OpenPOWER on IntegriCloud