diff options
author | 2011-10-16 01:11:31 +0000 | |
---|---|---|
committer | 2011-10-16 01:11:31 +0000 | |
commit | 8223ead04cfebb570832257af3494772d75c0d6d (patch) | |
tree | 139ec20c563e8b67e3ab72fda290c8260fc5ef8c | |
parent | sync (diff) | |
download | wireguard-openbsd-8223ead04cfebb570832257af3494772d75c0d6d.tar.xz wireguard-openbsd-8223ead04cfebb570832257af3494772d75c0d6d.zip |
align the read to the PCI config space.
from drahn@, ok deraadt@
-rw-r--r-- | sys/dev/pci/agp_via.c | 7 | ||||
-rw-r--r-- | sys/dev/pci/agpreg.h | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/pci/agp_via.c b/sys/dev/pci/agp_via.c index d2a49ba6feb..33fab817af4 100644 --- a/sys/dev/pci/agp_via.c +++ b/sys/dev/pci/agp_via.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_via.c,v 1.16 2010/08/07 19:31:23 oga Exp $ */ +/* $OpenBSD: agp_via.c,v 1.17 2011/10/16 01:11:31 dhill Exp $ */ /* $NetBSD: agp_via.c,v 1.2 2001/09/15 00:25:00 thorpej Exp $ */ /*- @@ -133,8 +133,9 @@ agp_via_attach(struct device *parent, struct device *self, void *aux) } if (AGP_CAPID_GET_MAJOR(capval) >= 3) { - agpsel = pci_conf_read(pa->pa_pc, pa->pa_tag, AGP_VIA_AGPSEL); - if ((agpsel & (1 << 1)) == 0) { + agpsel = pci_conf_read(pa->pa_pc, pa->pa_tag, + AGP_VIA_AGPSEL_REG); + if ((agpsel & (1 << 9)) == 0) { vsc->regs = via_v3_regs; printf(": v3"); } else { diff --git a/sys/dev/pci/agpreg.h b/sys/dev/pci/agpreg.h index d57fb7c7121..9efe42b4ab4 100644 --- a/sys/dev/pci/agpreg.h +++ b/sys/dev/pci/agpreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: agpreg.h,v 1.13 2011/09/14 10:26:16 oga Exp $ */ +/* $OpenBSD: agpreg.h,v 1.14 2011/10/16 01:11:31 dhill Exp $ */ /* $NetBSD: agpreg.h,v 1.1 2001/09/10 10:01:02 fvdl Exp $ */ /*- @@ -101,6 +101,7 @@ #define AGP3_VIA_GARTCTRL 0x90 #define AGP3_VIA_APSIZE 0x94 #define AGP3_VIA_ATTBASE 0x98 +#define AGP_VIA_AGPSEL_REG 0xfc #define AGP_VIA_AGPSEL 0xfd /* |