speaker(4): drop NEEDGIANT
When the frequency configuration logic was moved to clock.c in 2008, a mutex lock was added there (timer_spkr_setfreq) to serialize accesses to the I/O register. Since then, no more calls to disable/enable_intr were needed in spkr.c than they were needed in the other callers to the same timer_spkr functions in syscons / kern_cons, that is, not at all. This is because there are no other accesses remaining in the kernel to the i8254 timers after boot than through clock.c. For context, see commitse465985885and93f5134aaf. Signed-off-by: Raphael Poss <knz@thaumogen.net> Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1922
This commit is contained in:
committed by
Warner Losh
parent
03a515e989
commit
43b7cf42d4
@@ -24,7 +24,7 @@ static d_ioctl_t spkrioctl;
|
||||
|
||||
static struct cdevsw spkr_cdevsw = {
|
||||
.d_version = D_VERSION,
|
||||
.d_flags = D_NEEDGIANT,
|
||||
.d_flags = 0,
|
||||
.d_open = spkropen,
|
||||
.d_close = spkrclose,
|
||||
.d_write = spkrwrite,
|
||||
@@ -78,10 +78,8 @@ tone(unsigned int thz, unsigned int centisecs)
|
||||
if (timer_spkr_acquire()) {
|
||||
return;
|
||||
}
|
||||
disable_intr();
|
||||
/* Configure the speaker with the tone frequency. */
|
||||
timer_spkr_setfreq(thz);
|
||||
enable_intr();
|
||||
|
||||
/*
|
||||
* Make the current thread sleep while the tone is being
|
||||
|
||||
Reference in New Issue
Block a user