pcppi-keep-at-halt.patch -- NetBSD 11.0: keep pcppi0's timer at halt, so the "options BEEP_ONHALT" beep is a tone rather than 18 Hz silence. Needs sysbeep-keep-at-halt.patch as well. Apply in usr/src with: patch -p0 Author: Royce Williams License: the same terms as each NetBSD source file it modifies. --- sys/dev/isa/pcppi.c.orig +++ sys/dev/isa/pcppi.c @@ -63,9 +63,22 @@ void pcppi_childdet(device_t, device_t); int pcppi_rescan(device_t, const char *, const int *); +/* + * PCPPI_KEEP_AT_HALT -- NOT DVF_DETACH_SHUTDOWN. With that flag, + * config_detach_all() calls pcppi_detach() during an ordinary + * "shutdown -h". Its first act is pcppi_detach_speaker(), which sets + * sc_timer = NULL; it then fails at config_detach_children() because + * spkr0 declares no shutdown flag, so pcppi0 stays attached with its + * timer already gone. A later BEEP_ONHALT then skips + * attimer_set_pitch() and gates the speaker on over an unprogrammed + * PIT channel 2: measured at 18 Hz, which is silence on a real speaker. + * + * Companion to SYSBEEP_KEEP_AT_HALT in sys/arch/x86/isa/clock.c. + * Neither is sufficient alone. + */ CFATTACH_DECL3_NEW(pcppi, sizeof(struct pcppi_softc), pcppi_match, pcppi_isa_attach, pcppi_detach, NULL, pcppi_rescan, - pcppi_childdet, DVF_DETACH_SHUTDOWN); + pcppi_childdet, 0); static int pcppisearch(device_t, cfdata_t, const int *, void *); static void pcppi_bell_stop(struct pcppi_softc *);