summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_prof.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-12-18 00:27:18 +0000
committerjhb <jhb@FreeBSD.org>2001-12-18 00:27:18 +0000
commita3b98398cbfb4b809f8577b6a95aabb2c30a1aeb (patch)
treebd1f842c61588e8478e798dece6dff8b2be41310 /sys/kern/subr_prof.c
parent090c933e94e7345e9c9e9a9fbe29ea6c8397a662 (diff)
downloadFreeBSD-src-a3b98398cbfb4b809f8577b6a95aabb2c30a1aeb.zip
FreeBSD-src-a3b98398cbfb4b809f8577b6a95aabb2c30a1aeb.tar.gz
Modify the critical section API as follows:
- The MD functions critical_enter/exit are renamed to start with a cpu_ prefix. - MI wrapper functions critical_enter/exit maintain a per-thread nesting count and a per-thread critical section saved state set when entering a critical section while at nesting level 0 and restored when exiting to nesting level 0. This moves the saved state out of spin mutexes so that interlocking spin mutexes works properly. - Most low-level MD code that used critical_enter/exit now use cpu_critical_enter/exit. MI code such as device drivers and spin mutexes use the MI wrappers. Note that since the MI wrappers store the state in the current thread, they do not have any return values or arguments. - mtx_intr_enable() is replaced with a constant CRITICAL_FORK which is assigned to curthread->td_savecrit during fork_exit(). Tested on: i386, alpha
Diffstat (limited to 'sys/kern/subr_prof.c')
-rw-r--r--sys/kern/subr_prof.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c
index 67629d4..8808651 100644
--- a/sys/kern/subr_prof.c
+++ b/sys/kern/subr_prof.c
@@ -90,7 +90,6 @@ kmupetext(uintfptr_t nhighpc)
struct gmonparam np; /* slightly large */
struct gmonparam *p = &_gmonparam;
char *cp;
- critical_t savecrit;
GIANT_REQUIRED;
bcopy(p, &np, sizeof(*p));
@@ -127,7 +126,7 @@ kmupetext(uintfptr_t nhighpc)
np.mcount_count = &KCOUNT(&np, PC_TO_I(&np, mcount));
np.mexitcount_count = &KCOUNT(&np, PC_TO_I(&np, mexitcount));
#endif
- savecrit = critical_enter();
+ critical_enter();
bcopy(p->tos, np.tos, p->tossize);
bzero((char *)np.tos + p->tossize, np.tossize - p->tossize);
bcopy(p->kcount, np.kcount, p->kcountsize);
@@ -137,7 +136,7 @@ kmupetext(uintfptr_t nhighpc)
bzero((char *)np.froms + p->fromssize, np.fromssize - p->fromssize);
cp = (char *)p->tos;
bcopy(&np, p, sizeof(*p));
- critical_exit(savecrit);
+ critical_exit();
free(cp, M_GPROF);
}
@@ -156,7 +155,6 @@ kmstartup(dummy)
int nullfunc_loop_overhead;
int nullfunc_loop_profiled_time;
uintfptr_t tmp_addr;
- critical_t savecrit;
#endif
/*
@@ -195,7 +193,7 @@ kmstartup(dummy)
* Disable interrupts to avoid interference while we calibrate
* things.
*/
- savecrit = critical_enter();
+ critical_enter();
/*
* Determine overheads.
@@ -249,7 +247,7 @@ kmstartup(dummy)
p->state = GMON_PROF_OFF;
stopguprof(p);
- critical_exit(savecrit);
+ critical_exit();
nullfunc_loop_profiled_time = 0;
for (tmp_addr = (uintfptr_t)nullfunc_loop_profiled;
OpenPOWER on IntegriCloud