diff options
author | Matthew Dillon <dillon@FreeBSD.org> | 2001-08-30 18:50:57 +0000 |
---|---|---|
committer | Matthew Dillon <dillon@FreeBSD.org> | 2001-08-30 18:50:57 +0000 |
commit | 356861db03c330c7abfc710eb6ce342ca6c71557 (patch) | |
tree | 03a377cd1fcd2a2db481117b689dc177dcae6dd1 /sys/kern/subr_trap.c | |
parent | 21ed03d815df154a63d7c64cad5c2b6919aeabc2 (diff) | |
download | src-356861db03c330c7abfc710eb6ce342ca6c71557.tar.gz src-356861db03c330c7abfc710eb6ce342ca6c71557.zip |
Remove the MPSAFE keyword from the parser for syscalls.master.
Instead introduce the [M] prefix to existing keywords. e.g.
MSTD is the MP SAFE version of STD. This is prepatory for a
massive Giant lock pushdown. The old MPSAFE keyword made
syscalls.master too messy.
Begin comments MP-Safe procedures with the comment:
/*
* MPSAFE
*/
This comments means that the procedure may be called without
Giant held (The procedure itself may still need to obtain
Giant temporarily to do its thing).
sv_prepsyscall() is now MP SAFE and assumed to be MP SAFE
sv_transtrap() is now MP SAFE and assumed to be MP SAFE
ktrsyscall() and ktrsysret() are now MP SAFE (Giant Pushdown)
trapsignal() is now MP SAFE (Giant Pushdown)
Places which used to do the if (mtx_owned(&Giant)) mtx_unlock(&Giant)
test in syscall[2]() in */*/trap.c now do not. Instead they
explicitly unlock Giant if they previously obtained it, and then
assert that it is no longer held to catch broken system calls.
Rebuild syscall tables.
Notes
Notes:
svn path=/head/; revision=82585
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r-- | sys/kern/subr_trap.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index b9036601327f..727fe6963290 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -58,6 +58,8 @@ /* * Define the code needed before returning to user mode, for * trap and syscall. + * + * MPSAFE */ void userret(p, frame, oticks) @@ -71,8 +73,8 @@ userret(p, frame, oticks) PROC_LOCK(p); while ((sig = CURSIG(p)) != 0) postsig(sig); - mtx_unlock(&Giant); PROC_UNLOCK(p); + mtx_unlock(&Giant); mtx_lock_spin(&sched_lock); p->p_pri.pri_level = p->p_pri.pri_user; @@ -166,7 +168,6 @@ ast(framep) PCB_NPXTRAP); ucode = npxtrap(); if (ucode != -1) { - mtx_lock(&Giant); trapsignal(p, SIGFPE, ucode); } } @@ -178,8 +179,6 @@ ast(framep) } userret(p, framep, sticks); - if (mtx_owned(&Giant)) - mtx_unlock(&Giant); s = critical_enter(); } mtx_assert(&Giant, MA_NOTOWNED); |