summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_ktr.c8
-rw-r--r--sys/kern/subr_prof.c7
2 files changed, 7 insertions, 8 deletions
diff --git a/sys/kern/kern_ktr.c b/sys/kern/kern_ktr.c
index 3f00c8d..1422a3e 100644
--- a/sys/kern/kern_ktr.c
+++ b/sys/kern/kern_ktr.c
@@ -117,7 +117,8 @@ ktr_tracepoint(u_int mask, const char *format, u_long arg1, u_long arg2,
#endif
{
struct ktr_entry *entry;
- int newindex, saveindex, saveintr;
+ int newindex, saveindex;
+ critical_t savecrit;
#ifdef KTR_EXTEND
va_list ap;
#endif
@@ -130,14 +131,13 @@ ktr_tracepoint(u_int mask, const char *format, u_long arg1, u_long arg2,
if (((1 << KTR_CPU) & ktr_cpumask) == 0)
return;
#endif
- saveintr = save_intr();
- disable_intr();
+ savecrit = critical_enter();
do {
saveindex = ktr_idx;
newindex = (saveindex + 1) & (KTR_ENTRIES - 1);
} while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) == 0);
entry = &ktr_buf[saveindex];
- restore_intr(saveintr);
+ critical_exit(savecrit);
if (ktr_mask & KTR_LOCK)
/*
* We can't use nanotime with KTR_LOCK, it would cause
diff --git a/sys/kern/subr_prof.c b/sys/kern/subr_prof.c
index 5277a58..ce71fb6 100644
--- a/sys/kern/subr_prof.c
+++ b/sys/kern/subr_prof.c
@@ -92,7 +92,7 @@ kmstartup(dummy)
int nullfunc_loop_overhead;
int nullfunc_loop_profiled_time;
uintfptr_t tmp_addr;
- int intrstate;
+ critical_t savecrit;
#endif
/*
@@ -135,8 +135,7 @@ kmstartup(dummy)
* Disable interrupts to avoid interference while we calibrate
* things.
*/
- intrstate = save_intr();
- disable_intr();
+ savecrit = critical_enter();
/*
* Determine overheads.
@@ -190,7 +189,7 @@ kmstartup(dummy)
p->state = GMON_PROF_OFF;
stopguprof(p);
- restore_intr(intrstate);
+ critical_exit(savecrit);
nullfunc_loop_profiled_time = 0;
for (tmp_addr = (uintfptr_t)nullfunc_loop_profiled;
OpenPOWER on IntegriCloud