Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/acpi/acpica/Osd Fix 16bit-wide access to PCI configu...



details:   https://anonhg.NetBSD.org/src/rev/700001d9997c
branches:  trunk
changeset: 565129:700001d9997c
user:      kochi <kochi%NetBSD.org@localhost>
date:      Tue Mar 30 11:12:32 2004 +0000

description:
Fix 16bit-wide access to PCI configuration space.

diffstat:

 sys/dev/acpi/acpica/Osd/OsdHardware.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r ab0b4070eef2 -r 700001d9997c sys/dev/acpi/acpica/Osd/OsdHardware.c
--- a/sys/dev/acpi/acpica/Osd/OsdHardware.c     Tue Mar 30 10:12:33 2004 +0000
+++ b/sys/dev/acpi/acpica/Osd/OsdHardware.c     Tue Mar 30 11:12:32 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: OsdHardware.c,v 1.7 2004/03/23 19:00:03 drochner Exp $ */
+/*     $NetBSD: OsdHardware.c,v 1.8 2004/03/30 11:12:32 kochi Exp $    */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: OsdHardware.c,v 1.7 2004/03/23 19:00:03 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: OsdHardware.c,v 1.8 2004/03/30 11:12:32 kochi Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -216,7 +216,7 @@
                break;
 
        case 16:
-               *(uint16_t *) Value = (tmp >> ((Register & 1) * 8)) & 0xffff;
+               *(uint16_t *) Value = (tmp >> ((Register & 3) * 8)) & 0xffff;
                break;
 
        case 32:
@@ -255,9 +255,9 @@
                break;
 
        case 16:
-               tmp = pci_conf_read(acpi_softc->sc_pc, tag, Register & ~1);
-               tmp &= ~(0xffff << ((Register & 1) * 8));
-               tmp |= (Value << ((Register & 1) * 8));
+               tmp = pci_conf_read(acpi_softc->sc_pc, tag, Register & ~3);
+               tmp &= ~(0xffff << ((Register & 3) * 8));
+               tmp |= (Value << ((Register & 3) * 8));
                break;
 
        case 32:



Home | Main Index | Thread Index | Old Index