summaryrefslogtreecommitdiff
path: root/sys/arch/i386/isa/fd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-30 08:25:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-12-30 08:25:43 +0000
commit4dc6705af38e4fdffea2a9c405a99940914c795b (patch)
tree45ccd731558dd74b8a5859073892528a82dc060a /sys/arch/i386/isa/fd.c
parent7ccaf50ce3e72cab9e52bbe28389f1add3d6ac88 (diff)
from perry:
fixed my own pr 1758 -- the floppy drive motor was not being turned off at halt time, especially if a floppy was mounted. Added a shutdown hook to turn off the motor. Per a request by mycroft, the cookie from the hook is saved in a new member I added to the fd_softc structure.
Diffstat (limited to 'sys/arch/i386/isa/fd.c')
-rw-r--r--sys/arch/i386/isa/fd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/arch/i386/isa/fd.c b/sys/arch/i386/isa/fd.c
index 6dc8d799112..a32d7ad0c47 100644
--- a/sys/arch/i386/isa/fd.c
+++ b/sys/arch/i386/isa/fd.c
@@ -167,6 +167,8 @@ struct fd_softc {
#define FD_MOTOR_WAIT 0x04 /* motor coming up */
int sc_cylin; /* where we think the head is */
+ void *sc_sdhook; /* saved shutdown hook for drive. */
+
TAILQ_ENTRY(fd_softc) sc_drivechain;
int sc_ops; /* I/O ops since last switch */
struct buf sc_q; /* head of buf chain */
@@ -408,6 +410,8 @@ fdattach(parent, self, aux)
/* XXX Need to do some more fiddling with sc_dk. */
dk_establish(&fd->sc_dk, &fd->sc_dev);
#endif
+ /* Needed to power off if the motor is on when we halt. */
+ fd->sc_sdhook = shutdownhook_establish(fd_motor_off, fd);
}
/*