diff options
| author | joda <joda@NetBSD.org> | 2000-01-17 12:57:26 +0000 |
|---|---|---|
| committer | joda <joda@NetBSD.org> | 2000-01-17 12:57:26 +0000 |
| commit | 2367ad5f3dc07a63ed4f07cd5f4be1948519f8ef (patch) | |
| tree | 92f7ad2c767b6150bd317489e7fef77654670cf5 /sys/dev | |
| parent | 6ed33701a8cb5bd869a748b5a6498d28a74d6180 (diff) | |
add shutdown hook
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pci/pccbb.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index ab609a33d24..930f32507ee 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -1,4 +1,4 @@ -/* $NetBSD: pccbb.c,v 1.13 2000/01/13 09:05:41 joda Exp $ */ +/* $NetBSD: pccbb.c,v 1.14 2000/01/17 12:57:27 joda Exp $ */ /* * Copyright (c) 1998 and 1999 HAYAKAWA Koichi. All rights reserved. @@ -380,7 +380,22 @@ cb_chipset(pci_id, namep, flagp) +static void +pccbb_shutdown(void *arg) +{ + struct pccbb_softc *sc = arg; + pcireg_t command; + DPRINTF(("%s: shutdown\n", sc->sc_dev.dv_xname)); + bus_space_write_4(sc->sc_base_memt, sc->sc_base_memh, CB_SOCKET_MASK, 0); + + command = pci_conf_read(sc->sc_pc, sc->sc_tag, PCI_COMMAND_STATUS_REG); + + command &= ~(PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE | + PCI_COMMAND_MASTER_ENABLE); + pci_conf_write(sc->sc_pc, sc->sc_tag, PCI_COMMAND_STATUS_REG, command); + +} void pccbbattach(parent, self, aux) @@ -492,6 +507,8 @@ pccbbattach(parent, self, aux) /* bus bridge initialisation */ pccbb_chipinit(sc); + shutdownhook_establish(pccbb_shutdown, sc); + #if __NetBSD_Version__ > 103060000 config_defer(self, pccbb_pci_callback); #else |
