From 0766263be1a49c33855c38c43135ecc50021e4bc Mon Sep 17 00:00:00 2001 From: dfr Date: Sun, 19 Nov 2000 12:28:42 +0000 Subject: [PATCH] Convert various calls to splhigh() to disable_intr() since splhigh() is now a no-op. --- sys/alpha/alpha/clock.c | 27 ++++++++++++++++----------- sys/alpha/alpha/db_interface.c | 5 +++-- sys/alpha/alpha/interrupt.c | 10 ++++++---- sys/alpha/alpha/mp_machdep.c | 5 +++-- sys/alpha/alpha/prom.c | 12 ++++++------ sys/alpha/alpha/vm_machdep.c | 1 - sys/powerpc/aim/vm_machdep.c | 1 - sys/powerpc/powerpc/vm_machdep.c | 1 - 8 files changed, 34 insertions(+), 28 deletions(-) diff --git a/sys/alpha/alpha/clock.c b/sys/alpha/alpha/clock.c index ef7cb65adb19..b74dc5bb77cd 100644 --- a/sys/alpha/alpha/clock.c +++ b/sys/alpha/alpha/clock.c @@ -269,7 +269,8 @@ getit(void) int high, low; int s; - s = splhigh(); + s = save_intr(); + disable_intr(); /* Select timer0 and latch counter value. */ outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); @@ -277,7 +278,7 @@ getit(void) low = inb(TIMER_CNTR0); high = inb(TIMER_CNTR0); - splx(s); + restore_intr(s); return ((high << 8) | low); } @@ -370,7 +371,8 @@ set_timer_freq(u_int freq, int intr_freq) int new_timer0_max_count; int s; - s = splhigh(); + s = save_intr(); + disable_intr(); timer_freq = freq; new_timer0_max_count = TIMER_DIV(intr_freq); if (new_timer0_max_count != timer0_max_count) { @@ -379,14 +381,15 @@ set_timer_freq(u_int freq, int intr_freq) outb(TIMER_CNTR0, timer0_max_count & 0xff); outb(TIMER_CNTR0, timer0_max_count >> 8); } - splx(s); + restore_intr(s); } static void handleclock(void* arg) { if (timecounter->tc_get_timecount == i8254_get_timecount) { - int s = splhigh(); + int s = save_intr(); + disable_intr(); if (i8254_ticked) i8254_ticked = 0; else { @@ -394,7 +397,7 @@ handleclock(void* arg) i8254_lastcount = 0; } clkintr_pending = 0; - splx(s); + restore_intr(s); } hardclock(arg); @@ -566,7 +569,8 @@ i8254_get_timecount(struct timecounter *tc) u_int high, low; int s; - s = splhigh(); + s = save_intr(); + disable_intr(); /* Select timer0 and latch counter value. */ outb(TIMER_MODE, TIMER_SEL0 | TIMER_LATCH); @@ -584,7 +588,7 @@ i8254_get_timecount(struct timecounter *tc) i8254_lastcount = count; count += i8254_offset; - splx(s); + restore_intr(s); return (count); } @@ -636,12 +640,13 @@ sysbeepstop(void *chan) int sysbeep(int pitch, int period) { - int x = splhigh(); + int s = save_intr(); + disable_intr(); if (acquire_timer2(TIMER_SQWAVE|TIMER_16BIT)) if (!beeping) { /* Something else owns it. */ - splx(x); + restore_intr(s); return (-1); /* XXX Should be EBUSY, but nobody cares anyway. */ } @@ -655,7 +660,7 @@ sysbeep(int pitch, int period) beeping = period; timeout(sysbeepstop, (void *)NULL, period); } - splx(x); + restore_intr(s); return (0); } diff --git a/sys/alpha/alpha/db_interface.c b/sys/alpha/alpha/db_interface.c index aaa80b161ffe..4ed58ca7f48b 100644 --- a/sys/alpha/alpha/db_interface.c +++ b/sys/alpha/alpha/db_interface.c @@ -191,7 +191,8 @@ kdb_trap(a0, a1, a2, entry, regs) ddb_regs = *regs; - s = splhigh(); + s = save_intr(); + disable_intr(); #if 0 db_printf("stopping %x\n", PCPU_GET(other_cpus)); @@ -214,7 +215,7 @@ kdb_trap(a0, a1, a2, entry, regs) restart_cpus(stopped_cpus); #endif - splx(s); + restore_intr(s); *regs = ddb_regs; diff --git a/sys/alpha/alpha/interrupt.c b/sys/alpha/alpha/interrupt.c index 4d3ddc948c62..76321a1e0986 100644 --- a/sys/alpha/alpha/interrupt.c +++ b/sys/alpha/alpha/interrupt.c @@ -352,9 +352,10 @@ alpha_setup_intr(const char *name, int vector, driver_intr_t *handler, i->disable = disable; i->enable = enable; - s = splhigh(); + s = save_intr(); + disable_intr(); LIST_INSERT_HEAD(&alpha_intr_hash[h], i, list); - splx(s); + restore_intr(s); } /* Second, create the interrupt thread if needed. */ @@ -484,9 +485,10 @@ alpha_teardown_intr(void *cookie) /* XXX - if the ithd has no handlers left, we should remove it */ #if 0 - s = splhigh(); + s = save_intr(); + disable_intr(); LIST_REMOVE(i, list); - splx(s); + restore_intr(s); free(i, M_DEVBUF); #endif diff --git a/sys/alpha/alpha/mp_machdep.c b/sys/alpha/alpha/mp_machdep.c index 6514229ece3c..393802da1651 100644 --- a/sys/alpha/alpha/mp_machdep.c +++ b/sys/alpha/alpha/mp_machdep.c @@ -914,7 +914,8 @@ smp_rendezvous(void (* setup_func)(void *), int s; /* disable interrupts on this CPU, save interrupt status */ - s = splhigh(); + s = save_intr(); + disable_intr(); /* obtain rendezvous lock */ s_lock(&smp_rv_lock); /* XXX sleep here? NOWAIT flag? */ @@ -937,7 +938,7 @@ smp_rendezvous(void (* setup_func)(void *), s_unlock(&smp_rv_lock); /* restore interrupt flag */ - splx(s); + restore_intr(s); } /* diff --git a/sys/alpha/alpha/prom.c b/sys/alpha/alpha/prom.c index f299d0ccce93..1958d7994388 100644 --- a/sys/alpha/alpha/prom.c +++ b/sys/alpha/alpha/prom.c @@ -134,14 +134,14 @@ promcnputc(dev, c) unsigned char *to = (unsigned char *)0x20000000; int s; - s = enter_prom(); /* splhigh() and map prom */ + s = enter_prom(); /* disable_intr() and map prom */ *to = c; do { ret.bits = prom_putstr(alpha_console, to, 1); } while ((ret.u.retval & 1) == 0); - leave_prom(s); /* unmap prom and splx(s) */ + leave_prom(s); /* unmap prom and restore_intr(s) */ } /* @@ -189,9 +189,9 @@ promcncheckc(dev) static int enter_prom() { - int s = splhigh(); - pt_entry_t *lev1map; + int s = save_intr(); + disable_intr(); if (!prom_mapped) { #ifdef SIMOS @@ -230,7 +230,7 @@ leave_prom __P((s)) lev1map[0] = saved_pte[0]; /* XXX */ prom_cache_sync(); /* XXX */ } - splx(s); + restore_intr(s); } static void @@ -270,7 +270,7 @@ prom_halt(halt) /* * Turn off interrupts, for sanity. */ - (void) splhigh(); + disable_intr(); /* * Set "boot request" part of the CPU state depending on what diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c index 0aff5a9b0b1b..1f1a7f24cddd 100644 --- a/sys/alpha/alpha/vm_machdep.c +++ b/sys/alpha/alpha/vm_machdep.c @@ -253,7 +253,6 @@ cpu_exit(p) { alpha_fpstate_drop(p); - (void) splhigh(); mtx_enter(&sched_lock, MTX_SPIN); mtx_exit(&Giant, MTX_DEF | MTX_NOSWITCH); mtx_assert(&Giant, MA_NOTOWNED); diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c index 0aff5a9b0b1b..1f1a7f24cddd 100644 --- a/sys/powerpc/aim/vm_machdep.c +++ b/sys/powerpc/aim/vm_machdep.c @@ -253,7 +253,6 @@ cpu_exit(p) { alpha_fpstate_drop(p); - (void) splhigh(); mtx_enter(&sched_lock, MTX_SPIN); mtx_exit(&Giant, MTX_DEF | MTX_NOSWITCH); mtx_assert(&Giant, MA_NOTOWNED); diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c index 0aff5a9b0b1b..1f1a7f24cddd 100644 --- a/sys/powerpc/powerpc/vm_machdep.c +++ b/sys/powerpc/powerpc/vm_machdep.c @@ -253,7 +253,6 @@ cpu_exit(p) { alpha_fpstate_drop(p); - (void) splhigh(); mtx_enter(&sched_lock, MTX_SPIN); mtx_exit(&Giant, MTX_DEF | MTX_NOSWITCH); mtx_assert(&Giant, MA_NOTOWNED);