diff options
Diffstat (limited to 'sys/pc98/cbus/clock.c')
-rw-r--r-- | sys/pc98/cbus/clock.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index 08af871..96b7e10 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -232,7 +232,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 { @@ -240,7 +240,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) { @@ -257,14 +257,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; @@ -272,7 +272,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; @@ -280,7 +280,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; @@ -465,7 +465,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); @@ -473,7 +473,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); } @@ -610,10 +610,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); @@ -861,7 +861,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) { @@ -870,7 +870,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); } /* @@ -885,11 +885,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); } /* @@ -1540,7 +1540,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); @@ -1564,7 +1564,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); } |