summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>2008-01-15 00:24:47 +0000
committerdrochner <drochner@NetBSD.org>2008-01-15 00:24:47 +0000
commit98da2f9c504d7f8e2ea3836f9b697b40ea271f9d (patch)
tree61bf630a04aa6c877d745f26ac8a0849ca1de217 /sys
parent488b0bc13ea5670943c1c7fab97d5577a6f53f85 (diff)
fix some unaligned PCI config space accesses in suspend/resume functions
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/x86/pci/ichlpcib.c22
-rw-r--r--sys/dev/pci/piixide.c8
2 files changed, 9 insertions, 21 deletions
diff --git a/sys/arch/x86/pci/ichlpcib.c b/sys/arch/x86/pci/ichlpcib.c
index bb53f18cab9..48b4c497d4a 100644
--- a/sys/arch/x86/pci/ichlpcib.c
+++ b/sys/arch/x86/pci/ichlpcib.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ichlpcib.c,v 1.6 2007/12/09 20:27:49 jmcneill Exp $ */
+/* $NetBSD: ichlpcib.c,v 1.7 2008/01/15 00:24:47 drochner Exp $ */
/*-
* Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.6 2007/12/09 20:27:49 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichlpcib.c,v 1.7 2008/01/15 00:24:47 drochner Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -96,7 +96,7 @@ struct lpcib_softc {
#endif
/* Power management */
- pcireg_t sc_pirq[8];
+ pcireg_t sc_pirq[2];
pcireg_t sc_pmcon;
pcireg_t sc_fwhsel2;
};
@@ -268,13 +268,7 @@ lpcib_suspend(device_t dv)
/* capture PIRQ routing control registers */
sc->sc_pirq[0] = pci_conf_read(pc, tag, LPCIB_PCI_PIRQA_ROUT);
- sc->sc_pirq[1] = pci_conf_read(pc, tag, LPCIB_PCI_PIRQB_ROUT);
- sc->sc_pirq[2] = pci_conf_read(pc, tag, LPCIB_PCI_PIRQC_ROUT);
- sc->sc_pirq[3] = pci_conf_read(pc, tag, LPCIB_PCI_PIRQD_ROUT);
- sc->sc_pirq[4] = pci_conf_read(pc, tag, LPCIB_PCI_PIRQE_ROUT);
- sc->sc_pirq[5] = pci_conf_read(pc, tag, LPCIB_PCI_PIRQF_ROUT);
- sc->sc_pirq[6] = pci_conf_read(pc, tag, LPCIB_PCI_PIRQG_ROUT);
- sc->sc_pirq[7] = pci_conf_read(pc, tag, LPCIB_PCI_PIRQH_ROUT);
+ sc->sc_pirq[1] = pci_conf_read(pc, tag, LPCIB_PCI_PIRQE_ROUT);
sc->sc_pmcon = pci_conf_read(pc, tag, LPCIB_PCI_GEN_PMCON_1);
sc->sc_fwhsel2 = pci_conf_read(pc, tag, LPCIB_PCI_GEN_STA);
@@ -303,13 +297,7 @@ lpcib_resume(device_t dv)
/* restore PIRQ routing control registers */
pci_conf_write(pc, tag, LPCIB_PCI_PIRQA_ROUT, sc->sc_pirq[0]);
- pci_conf_write(pc, tag, LPCIB_PCI_PIRQB_ROUT, sc->sc_pirq[1]);
- pci_conf_write(pc, tag, LPCIB_PCI_PIRQC_ROUT, sc->sc_pirq[2]);
- pci_conf_write(pc, tag, LPCIB_PCI_PIRQD_ROUT, sc->sc_pirq[3]);
- pci_conf_write(pc, tag, LPCIB_PCI_PIRQE_ROUT, sc->sc_pirq[4]);
- pci_conf_write(pc, tag, LPCIB_PCI_PIRQF_ROUT, sc->sc_pirq[5]);
- pci_conf_write(pc, tag, LPCIB_PCI_PIRQG_ROUT, sc->sc_pirq[6]);
- pci_conf_write(pc, tag, LPCIB_PCI_PIRQH_ROUT, sc->sc_pirq[7]);
+ pci_conf_write(pc, tag, LPCIB_PCI_PIRQE_ROUT, sc->sc_pirq[1]);
pci_conf_write(pc, tag, LPCIB_PCI_GEN_PMCON_1, sc->sc_pmcon);
pci_conf_write(pc, tag, LPCIB_PCI_GEN_STA, sc->sc_fwhsel2);
diff --git a/sys/dev/pci/piixide.c b/sys/dev/pci/piixide.c
index 4e04ddb7ae6..d8a6c2449c4 100644
--- a/sys/dev/pci/piixide.c
+++ b/sys/dev/pci/piixide.c
@@ -1,4 +1,4 @@
-/* $NetBSD: piixide.c,v 1.43 2008/01/04 00:27:27 joerg Exp $ */
+/* $NetBSD: piixide.c,v 1.44 2008/01/15 00:24:47 drochner Exp $ */
/*
* Copyright (c) 1999, 2000, 2001 Manuel Bouyer.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: piixide.c,v 1.43 2008/01/04 00:27:27 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: piixide.c,v 1.44 2008/01/15 00:24:47 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -289,7 +289,7 @@ piixide_resume(device_t dv)
pci_conf_write(sc->sc_pc, sc->sc_tag, PIIX_IDETIM,
sc->sc_pm_reg[0]);
- pci_conf_write(sc->sc_pc, sc->sc_tag, PIIX_UDMATIM,
+ pci_conf_write(sc->sc_pc, sc->sc_tag, PIIX_UDMAREG,
sc->sc_pm_reg[1]);
return true;
@@ -303,7 +303,7 @@ piixide_suspend(device_t dv)
sc->sc_pm_reg[0] = pci_conf_read(sc->sc_pc, sc->sc_tag,
PIIX_IDETIM);
sc->sc_pm_reg[1] = pci_conf_read(sc->sc_pc, sc->sc_tag,
- PIIX_UDMATIM);
+ PIIX_UDMAREG);
return true;
}