Beispiel #1
0
static void
acpi_stop_beep(void *arg)
{

	if (acpi_resume_beep != 0)
		timer_spkr_release();
}
Beispiel #2
0
int
sc_tone(int herz)
{

	if (herz) {
		if (timer_spkr_acquire())
			return (EBUSY);
		timer_spkr_setfreq(herz);
	} else
		timer_spkr_release();

	return (0);
}
int
sc_tone(int herz)
{

	if (herz) {
		if (timer_spkr_acquire())
			return EBUSY;
		timer_spkr_setfreq(herz);
	} else {
		timer_spkr_release();
	}
	return 0;
}
Beispiel #4
0
int
sc_tone(int herz)
{

#if defined(HAS_TIMER_SPKR)
    if (herz) {
        if (timer_spkr_acquire())
            return (EBUSY);
        timer_spkr_setfreq(herz);
    } else
        timer_spkr_release();
#endif

    return (0);
}
Beispiel #5
0
/* 
 * Emit tone of frequency thz for given number of centisecs 
 */
static void
tone(unsigned int thz, unsigned int centisecs)
{
	int sps, timo;

	if (thz <= 0)
		return;

#ifdef DEBUG
	(void) printf("tone: thz=%d centisecs=%d\n", thz, centisecs);
#endif /* DEBUG */

	/* set timer to generate clicks at given frequency in Hertz */
	sps = splclock();

	if (timer_spkr_acquire()) {
		/* enter list of waiting procs ??? */
		splx(sps);
		return;
	}
	splx(sps);
	disable_intr();
	timer_spkr_setfreq(thz);
	enable_intr();

	/*
	 * Set timeout to endtone function, then give up the timeslice.
	 * This is so other processes can execute while the tone is being
	 * emitted.
	 */
	timo = centisecs * hz / 100;
	if (timo > 0)
		tsleep(&endtone, SPKRPRI | PCATCH, "spkrtn", timo);
	sps = splclock();
	timer_spkr_release();
	splx(sps);
}