MCPcopy Create free account
hub / github.com/F-Stack/f-stack / timer_spkr_acquire

Function timer_spkr_acquire

freebsd/x86/isa/clock.c:156–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156int
157timer_spkr_acquire(void)
158{
159 int mode;
160
161 mode = TIMER_SEL2 | TIMER_SQWAVE | TIMER_16BIT;
162
163 if (timer2_state != RELEASED)
164 return (-1);
165 timer2_state = ACQUIRED;
166
167 /*
168 * This access to the timer registers is as atomic as possible
169 * because it is a single instruction. We could do better if we
170 * knew the rate. Use of splclock() limits glitches to 10-100us,
171 * and this is probably good enough for timer2, so we aren't as
172 * careful with it as with timer0.
173 */
174 outb(TIMER_MODE, TIMER_SEL2 | (mode & 0x3f));
175
176 ppi_spkr_on(); /* enable counter2 output to speaker */
177 return (0);
178}
179
180int
181timer_spkr_release(void)

Callers 2

sysbeepFunction · 0.85
acpi_sleep_machdepFunction · 0.85

Calls 1

outbFunction · 0.50

Tested by

no test coverage detected