summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/clock.c32
-rw-r--r--sys/i386/isa/if_el.c4
-rw-r--r--sys/i386/isa/intr_machdep.c4
-rw-r--r--sys/i386/isa/ithread.c14
-rw-r--r--sys/i386/isa/nmi.c4
-rw-r--r--sys/i386/isa/npx.c4
6 files changed, 31 insertions, 31 deletions
diff --git a/sys/i386/isa/clock.c b/sys/i386/isa/clock.c
index d7a1ff0..bbd066b 100644
--- a/sys/i386/isa/clock.c
+++ b/sys/i386/isa/clock.c
@@ -207,7 +207,7 @@ clkintr(struct clockframe frame)
{
if (timecounter->tc_get_timecount == i8254_get_timecount) {
- mtx_enter(&clock_lock, MTX_SPIN);
+ mtx_lock_spin(&clock_lock);
if (i8254_ticked)
i8254_ticked = 0;
else {
@@ -215,7 +215,7 @@ clkintr(struct clockframe frame)
i8254_lastcount = 0;
}
clkintr_pending = 0;
- mtx_exit(&clock_lock, MTX_SPIN);
+ mtx_unlock_spin(&clock_lock);
}
timer_func(&frame);
switch (timer0_state) {
@@ -232,14 +232,14 @@ clkintr(struct clockframe frame)
break;
case ACQUIRE_PENDING:
- mtx_enter(&clock_lock, MTX_SPIN);
+ mtx_lock_spin(&clock_lock);
i8254_offset = i8254_get_timecount(NULL);
i8254_lastcount = 0;
timer0_max_count = TIMER_DIV(new_rate);
outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
outb(TIMER_CNTR0, timer0_max_count & 0xff);
outb(TIMER_CNTR0, timer0_max_count >> 8);
- mtx_exit(&clock_lock, MTX_SPIN);
+ mtx_unlock_spin(&clock_lock);
timer_func = new_function;
timer0_state = ACQUIRED;
break;
@@ -247,7 +247,7 @@ clkintr(struct clockframe frame)
case RELEASE_PENDING:
if ((timer0_prescaler_count += timer0_max_count)
>= hardclock_max_count) {
- mtx_enter(&clock_lock, MTX_SPIN);
+ mtx_lock_spin(&clock_lock);
i8254_offset = i8254_get_timecount(NULL);
i8254_lastcount = 0;
timer0_max_count = hardclock_max_count;
@@ -255,7 +255,7 @@ clkintr(struct clockframe frame)
TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
outb(TIMER_CNTR0, timer0_max_count & 0xff);
outb(TIMER_CNTR0, timer0_max_count >> 8);
- mtx_exit(&clock_lock, MTX_SPIN);
+ mtx_unlock_spin(&clock_lock);
timer0_prescaler_count = 0;
timer_func = hardclock;
timer0_state = RELEASED;
@@ -403,7 +403,7 @@ getit(void)
{
int high, low;
- mtx_enter(&clock_lock, MTX_SPIN);
+ mtx_lock_spin(&clock_lock);
/* Select timer0 and latch counter value. */
outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH);
@@ -411,7 +411,7 @@ getit(void)
low = inb(TIMER_CNTR0);
high = inb(TIMER_CNTR0);
- mtx_exit(&clock_lock, MTX_SPIN);
+ mtx_unlock_spin(&clock_lock);
return ((high << 8) | low);
}
@@ -525,10 +525,10 @@ sysbeep(int pitch, int period)
splx(x);
return (-1); /* XXX Should be EBUSY, but nobody cares anyway. */
}
- mtx_enter(&clock_lock, MTX_SPIN);
+ mtx_lock_spin(&clock_lock);
outb(TIMER_CNTR2, pitch);
outb(TIMER_CNTR2, (pitch>>8));
- mtx_exit(&clock_lock, MTX_SPIN);
+ mtx_unlock_spin(&clock_lock);
if (!beeping) {
/* enable counter2 output to speaker */
outb(IO_PPI, inb(IO_PPI) | 3);
@@ -679,7 +679,7 @@ set_timer_freq(u_int freq, int intr_freq)
{
int new_timer0_max_count;
- mtx_enter(&clock_lock, MTX_SPIN);
+ mtx_lock_spin(&clock_lock);
timer_freq = freq;
new_timer0_max_count = hardclock_max_count = TIMER_DIV(intr_freq);
if (new_timer0_max_count != timer0_max_count) {
@@ -688,7 +688,7 @@ set_timer_freq(u_int freq, int intr_freq)
outb(TIMER_CNTR0, timer0_max_count & 0xff);
outb(TIMER_CNTR0, timer0_max_count >> 8);
}
- mtx_exit(&clock_lock, MTX_SPIN);
+ mtx_unlock_spin(&clock_lock);
}
/*
@@ -703,11 +703,11 @@ void
i8254_restore(void)
{
- mtx_enter(&clock_lock, MTX_SPIN);
+ mtx_lock_spin(&clock_lock);
outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT);
outb(TIMER_CNTR0, timer0_max_count & 0xff);
outb(TIMER_CNTR0, timer0_max_count >> 8);
- mtx_exit(&clock_lock, MTX_SPIN);
+ mtx_unlock_spin(&clock_lock);
}
/*
@@ -1194,7 +1194,7 @@ i8254_get_timecount(struct timecounter *tc)
u_int eflags;
eflags = read_eflags();
- mtx_enter(&clock_lock, MTX_SPIN);
+ mtx_lock_spin(&clock_lock);
/* Select timer0 and latch counter value. */
outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH);
@@ -1218,7 +1218,7 @@ i8254_get_timecount(struct timecounter *tc)
}
i8254_lastcount = count;
count += i8254_offset;
- mtx_exit(&clock_lock, MTX_SPIN);
+ mtx_unlock_spin(&clock_lock);
return (count);
}
diff --git a/sys/i386/isa/if_el.c b/sys/i386/isa/if_el.c
index ed53636..0e980c5 100644
--- a/sys/i386/isa/if_el.c
+++ b/sys/i386/isa/if_el.c
@@ -110,8 +110,8 @@ DRIVER_MODULE(if_el, isa, el_driver, el_devclass, 0, 0);
#define CSR_READ_1(sc, reg) \
bus_space_read_1(sc->el_btag, sc->el_bhandle, reg)
-#define EL_LOCK(_sc) mtx_enter(&(_sc)->el_mtx, MTX_DEF)
-#define EL_UNLOCK(_sc) mtx_exit(&(_sc)->el_mtx, MTX_DEF)
+#define EL_LOCK(_sc) mtx_lock(&(_sc)->el_mtx)
+#define EL_UNLOCK(_sc) mtx_unlock(&(_sc)->el_mtx)
/* Probe routine. See if the card is there and at the right place. */
static int
diff --git a/sys/i386/isa/intr_machdep.c b/sys/i386/isa/intr_machdep.c
index d44a672..70b9378 100644
--- a/sys/i386/isa/intr_machdep.c
+++ b/sys/i386/isa/intr_machdep.c
@@ -701,7 +701,7 @@ inthand_remove(struct intrhand *idesc)
ithds[ithd->irq] = NULL;
if ((idesc->ih_flags & INTR_FAST) == 0) {
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
if (ithd->it_proc->p_stat == SWAIT) {
ithd->it_proc->p_intr_nesting_level = 0;
ithd->it_proc->p_stat = SRUN;
@@ -713,7 +713,7 @@ inthand_remove(struct intrhand *idesc)
* XXX: should we lower the threads priority?
*/
}
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
}
}
free(idesc->ih_name, M_DEVBUF);
diff --git a/sys/i386/isa/ithread.c b/sys/i386/isa/ithread.c
index 5f64861..99a1abf 100644
--- a/sys/i386/isa/ithread.c
+++ b/sys/i386/isa/ithread.c
@@ -114,7 +114,7 @@ sched_ithd(void *cookie)
* is higher priority than their current thread, it gets run now.
*/
ir->it_need = 1;
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
if (ir->it_proc->p_stat == SWAIT) { /* not on run queue */
CTR1(KTR_INTR, "sched_ithd: setrunqueue %d",
ir->it_proc->p_pid);
@@ -134,7 +134,7 @@ sched_ithd(void *cookie)
ir->it_proc->p_stat );
need_resched();
}
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
}
/*
@@ -163,7 +163,7 @@ ithd_loop(void *dummy)
me->it_proc->p_pid, me->it_proc->p_comm);
curproc->p_ithd = NULL;
free(me, M_DEVBUF);
- mtx_enter(&Giant, MTX_DEF);
+ mtx_lock(&Giant);
kthread_exit(0);
}
@@ -188,10 +188,10 @@ ithd_loop(void *dummy)
ih->ih_flags);
if ((ih->ih_flags & INTR_MPSAFE) == 0)
- mtx_enter(&Giant, MTX_DEF);
+ mtx_lock(&Giant);
ih->ih_handler(ih->ih_argument);
if ((ih->ih_flags & INTR_MPSAFE) == 0)
- mtx_exit(&Giant, MTX_DEF);
+ mtx_unlock(&Giant);
}
}
@@ -201,7 +201,7 @@ ithd_loop(void *dummy)
* set again, so we have to check it again.
*/
mtx_assert(&Giant, MA_NOTOWNED);
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
if (!me->it_need) {
INTREN (1 << me->irq); /* reset the mask bit */
@@ -217,6 +217,6 @@ ithd_loop(void *dummy)
CTR1(KTR_INTR, "ithd_loop pid %d: resumed",
me->it_proc->p_pid);
}
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
}
}
diff --git a/sys/i386/isa/nmi.c b/sys/i386/isa/nmi.c
index d44a672..70b9378 100644
--- a/sys/i386/isa/nmi.c
+++ b/sys/i386/isa/nmi.c
@@ -701,7 +701,7 @@ inthand_remove(struct intrhand *idesc)
ithds[ithd->irq] = NULL;
if ((idesc->ih_flags & INTR_FAST) == 0) {
- mtx_enter(&sched_lock, MTX_SPIN);
+ mtx_lock_spin(&sched_lock);
if (ithd->it_proc->p_stat == SWAIT) {
ithd->it_proc->p_intr_nesting_level = 0;
ithd->it_proc->p_stat = SRUN;
@@ -713,7 +713,7 @@ inthand_remove(struct intrhand *idesc)
* XXX: should we lower the threads priority?
*/
}
- mtx_exit(&sched_lock, MTX_SPIN);
+ mtx_unlock_spin(&sched_lock);
}
}
free(idesc->ih_name, M_DEVBUF);
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index a729e0f..0dab6ae 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -724,7 +724,7 @@ npx_intr(dummy)
u_short control;
struct intrframe *frame;
- mtx_enter(&Giant, MTX_DEF);
+ mtx_lock(&Giant);
if (PCPU_GET(npxproc) == NULL || !npx_exists) {
printf("npxintr: npxproc = %p, curproc = %p, npx_exists = %d\n",
PCPU_GET(npxproc), curproc, npx_exists);
@@ -783,7 +783,7 @@ npx_intr(dummy)
*/
psignal(curproc, SIGFPE);
}
- mtx_exit(&Giant, MTX_DEF);
+ mtx_unlock(&Giant);
}
/*
OpenPOWER on IntegriCloud