Skip to content

Commit b9652d2

Browse files
committed
Use the intr_ as prefix for interrupt API, intr_[disable|enable|...]
Discussed with Patrick, we both agree this makes more sense than using a suffix. Also use intr_get_state() and intr_set_state() instead of state() and restore().
1 parent dc8eb42 commit b9652d2

File tree

14 files changed

+36
-36
lines changed

14 files changed

+36
-36
lines changed

sys/arch/amd64/amd64/amd64_mem.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,12 @@ mrt2mtrr(u_int64_t flags)
275275
void
276276
mrstore(struct mem_range_softc *sc)
277277
{
278-
disable_intr(); /* disable interrupts */
278+
intr_disable(); /* disable interrupts */
279279
#ifdef MULTIPROCESSOR
280280
x86_broadcast_ipi(X86_IPI_MTRR);
281281
#endif
282282
mrstoreone(sc);
283-
enable_intr();
283+
intr_enable();
284284
}
285285

286286
/*
@@ -617,7 +617,7 @@ mrinit_cpu(struct mem_range_softc *sc)
617617
void
618618
mrreload_cpu(struct mem_range_softc *sc)
619619
{
620-
disable_intr();
620+
intr_disable();
621621
mrstoreone(sc); /* set MTRRs to match BSP */
622-
enable_intr();
622+
intr_enable();
623623
}

sys/arch/amd64/amd64/hibernate_machdep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,13 +411,13 @@ hibernate_inflate_skip(union hibernate_info *hib_info, paddr_t dest)
411411
void
412412
hibernate_enable_intr_machdep(void)
413413
{
414-
enable_intr();
414+
intr_enable();
415415
}
416416

417417
void
418418
hibernate_disable_intr_machdep(void)
419419
{
420-
disable_intr();
420+
intr_disable();
421421
}
422422

423423
#ifdef MULTIPROCESSOR

sys/arch/amd64/amd64/i8259.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ i8259_hwunmask(struct pic *pic, int pin)
168168
unsigned port;
169169
u_int8_t byte;
170170

171-
disable_intr(); /* XXX */
171+
intr_disable(); /* XXX */
172172
i8259_imen &= ~(1 << pin);
173173
#ifdef PIC_MASKDELAY
174174
delay(10);
@@ -181,7 +181,7 @@ i8259_hwunmask(struct pic *pic, int pin)
181181
byte = i8259_imen & 0xff;
182182
}
183183
outb(port, byte);
184-
enable_intr();
184+
intr_enable();
185185
}
186186

187187
static void

sys/arch/amd64/amd64/ioapic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ ioapic_lock(struct ioapic_softc *sc)
116116
u_long flags;
117117

118118
flags = read_psl();
119-
disable_intr();
119+
intr_disable();
120120
#ifdef MULTIPROCESSOR
121121
mtx_enter(&sc->sc_pic.pic_mutex);
122122
#endif

sys/arch/amd64/amd64/ipifuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ x86_64_ipi_halt(struct cpu_info *ci)
100100
KASSERT(!__mp_lock_held(&kernel_lock));
101101

102102
fpusave_cpu(ci, 1);
103-
disable_intr();
103+
intr_disable();
104104
lapic_disable();
105105
wbinvd();
106106
ci->ci_flags &= ~CPUF_RUNNING;

sys/arch/amd64/amd64/lapic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ lapic_map(paddr_t lapic_base)
9797
pt_entry_t *pte;
9898
vaddr_t va = (vaddr_t)&local_apic;
9999

100-
disable_intr();
100+
intr_disable();
101101
s = lapic_tpr;
102102

103103
/*
@@ -114,7 +114,7 @@ lapic_map(paddr_t lapic_base)
114114
invlpg(va);
115115

116116
lapic_tpr = s;
117-
enable_intr();
117+
intr_enable();
118118
}
119119

120120
/*
@@ -358,7 +358,7 @@ lapic_calibrate_timer(struct cpu_info *ci)
358358
i82489_writereg(LAPIC_DCR_TIMER, LAPIC_DCRT_DIV1);
359359
i82489_writereg(LAPIC_ICR_TIMER, 0x80000000);
360360

361-
disable_intr();
361+
intr_disable();
362362

363363
/* wait for current cycle to finish */
364364
wait_next_cycle();

sys/arch/amd64/amd64/lock_machdep.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ __mp_lock(struct __mp_lock *mpl)
8080
long rf = read_rflags();
8181
struct __mp_lock_cpu *cpu = &mpl->mpl_cpus[cpu_number()];
8282

83-
disable_intr();
83+
intr_disable();
8484
if (cpu->mplc_depth++ == 0)
8585
cpu->mplc_ticket = fetch_and_add(&mpl->mpl_users, 1);
8686
write_rflags(rf);
@@ -101,7 +101,7 @@ __mp_unlock(struct __mp_lock *mpl)
101101
}
102102
#endif
103103

104-
disable_intr();
104+
intr_disable();
105105
if (--cpu->mplc_depth == 0)
106106
mpl->mpl_ticket++;
107107
write_rflags(rf);
@@ -114,7 +114,7 @@ __mp_release_all(struct __mp_lock *mpl)
114114
int rv = cpu->mplc_depth;
115115
long rf = read_rflags();
116116

117-
disable_intr();
117+
intr_disable();
118118
cpu->mplc_depth = 0;
119119
mpl->mpl_ticket++;
120120
write_rflags(rf);

sys/arch/amd64/amd64/machdep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ init_x86_64(paddr_t first_avail)
15851585
fpuinit(&cpu_info_primary);
15861586

15871587
crit_enter(); /* XXX need to think this through */
1588-
enable_intr();
1588+
intr_enable();
15891589

15901590
#ifdef DDB
15911591
db_machine_init();
@@ -1620,7 +1620,7 @@ void
16201620
cpu_reset(void)
16211621
{
16221622

1623-
disable_intr();
1623+
intr_disable();
16241624

16251625
if (cpuresetfn)
16261626
(*cpuresetfn)();

sys/arch/amd64/include/cpufunc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ void setidt(int idx, /*XXX*/caddr_t func, int typ, int dpl);
193193
typedef u_long intr_state_t;
194194

195195
static __inline void
196-
disable_intr(void)
196+
intr_disable(void)
197197
{
198198
__asm volatile("cli");
199199
}
200200

201201
static __inline void
202-
enable_intr(void)
202+
intr_enable(void)
203203
{
204204
__asm volatile("sti");
205205
}
@@ -219,8 +219,8 @@ write_rflags(u_long ef)
219219
__asm volatile("pushq %0; popfq" : : "r" (ef));
220220
}
221221

222-
#define state_intr read_rflags
223-
#define restore_intr write_rflags
222+
#define intr_get_state read_rflags
223+
#define intr_set_state write_rflags
224224

225225
static __inline u_int64_t
226226
rdmsr(u_int msr)

sys/arch/amd64/isa/clock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ gettick(void)
217217
/* Don't want someone screwing with the counter while we're here. */
218218
mtx_enter(&timer_mutex);
219219
ef = read_rflags();
220-
disable_intr();
220+
intr_disable();
221221
/* Select counter 0 and latch it. */
222222
outb(IO_TIMER1+TIMER_MODE, TIMER_SEL0 | TIMER_LATCH);
223223
lo = inb(IO_TIMER1+TIMER_CNTR0);
@@ -662,7 +662,7 @@ i8254_get_timecount(struct timecounter *tc)
662662
u_long ef;
663663

664664
ef = read_rflags();
665-
disable_intr();
665+
intr_disable();
666666

667667
outb(IO_TIMER1+TIMER_MODE, TIMER_SEL0 | TIMER_LATCH);
668668
lo = inb(IO_TIMER1+TIMER_CNTR0);

0 commit comments

Comments
 (0)