diff options
| author | Benno Rice <benno@FreeBSD.org> | 2002-05-12 13:43:21 +0000 |
|---|---|---|
| committer | Benno Rice <benno@FreeBSD.org> | 2002-05-12 13:43:21 +0000 |
| commit | 608cd3ca29d244f52b0aac31cfd024d189a36b7b (patch) | |
| tree | eeb9745f58e991a3ccc1cc1ee393187ae60334f3 | |
| parent | 163c384f66ecdfc24ef3ddd85029a021035c4b60 (diff) | |
Notes
| -rw-r--r-- | sys/powerpc/aim/trap.c | 16 | ||||
| -rw-r--r-- | sys/powerpc/powerpc/trap.c | 16 |
2 files changed, 26 insertions, 6 deletions
diff --git a/sys/powerpc/aim/trap.c b/sys/powerpc/aim/trap.c index 1aa2272f6f83..13f8646b2f74 100644 --- a/sys/powerpc/aim/trap.c +++ b/sys/powerpc/aim/trap.c @@ -265,8 +265,6 @@ trap(frame) int n; register_t args[10]; - PROC_LOCK(p); - #if 0 uvmexp.syscalls++; #endif @@ -309,6 +307,13 @@ trap(frame) params = args; } + /* + * Try to run the syscall without Giant if the syscall + * is MP safe. + */ + if ((callp->sy_narg & SYF_MPSAFE) == 0) + mtx_lock(&Giant); + #ifdef KTRACE if (KTRPOINT(p, KTR_SYSCALL)) ktrsyscall(p, code, argsize, params); @@ -344,12 +349,17 @@ syscall_bad: break; } + /* + * Release Giant if we had to get it. Don't use + * mtx_owned(), we want to catch broken syscalls. + */ + if ((callp->sy_narg & SYF_MPSAFE) == 0) + mtx_unlock(&Giant); #ifdef KTRACE if (KTRPOINT(p, KTR_SYSRET)) ktrsysret(p, code, error, rval[0]); #endif } - PROC_UNLOCK(p); break; case EXC_FPU|EXC_USER: diff --git a/sys/powerpc/powerpc/trap.c b/sys/powerpc/powerpc/trap.c index 1aa2272f6f83..13f8646b2f74 100644 --- a/sys/powerpc/powerpc/trap.c +++ b/sys/powerpc/powerpc/trap.c @@ -265,8 +265,6 @@ trap(frame) int n; register_t args[10]; - PROC_LOCK(p); - #if 0 uvmexp.syscalls++; #endif @@ -309,6 +307,13 @@ trap(frame) params = args; } + /* + * Try to run the syscall without Giant if the syscall + * is MP safe. + */ + if ((callp->sy_narg & SYF_MPSAFE) == 0) + mtx_lock(&Giant); + #ifdef KTRACE if (KTRPOINT(p, KTR_SYSCALL)) ktrsyscall(p, code, argsize, params); @@ -344,12 +349,17 @@ syscall_bad: break; } + /* + * Release Giant if we had to get it. Don't use + * mtx_owned(), we want to catch broken syscalls. + */ + if ((callp->sy_narg & SYF_MPSAFE) == 0) + mtx_unlock(&Giant); #ifdef KTRACE if (KTRPOINT(p, KTR_SYSRET)) ktrsysret(p, code, error, rval[0]); #endif } - PROC_UNLOCK(p); break; case EXC_FPU|EXC_USER: |
