Module Name:    src
Committed By:   jruoho
Date:           Wed Jun 15 04:52:52 UTC 2011

Modified Files:
        src/sys/arch/x86/pci: amdpcib_hpet.c
        src/sys/dev/acpi: hpet_acpi.c

Log Message:
Use defined constants.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/pci/amdpcib_hpet.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/acpi/hpet_acpi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/pci/amdpcib_hpet.c
diff -u src/sys/arch/x86/pci/amdpcib_hpet.c:1.5 src/sys/arch/x86/pci/amdpcib_hpet.c:1.6
--- src/sys/arch/x86/pci/amdpcib_hpet.c:1.5	Wed Jun 15 04:20:47 2011
+++ src/sys/arch/x86/pci/amdpcib_hpet.c	Wed Jun 15 04:52:52 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: amdpcib_hpet.c,v 1.5 2011/06/15 04:20:47 jruoho Exp $ */
+/* $NetBSD: amdpcib_hpet.c,v 1.6 2011/06/15 04:52:52 jruoho Exp $ */
 
 /*
  * Copyright (c) 2006 Nicolas Joly
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdpcib_hpet.c,v 1.5 2011/06/15 04:20:47 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdpcib_hpet.c,v 1.6 2011/06/15 04:52:52 jruoho Exp $");
 
 #include <sys/systm.h>
 #include <sys/device.h>
@@ -43,6 +43,7 @@
 #include <dev/pci/pcireg.h>
 #include <dev/pci/pcidevs.h>
 
+#include <dev/ic/hpetreg.h>
 #include <dev/ic/hpetvar.h>
 
 static int	amdpcib_hpet_match(device_t , cfdata_t , void *);
@@ -76,8 +77,8 @@
 		return;
 	}
 
-	sc->sc_mems = 1024;
 	sc->sc_memt = pa->pa_memt;
+	sc->sc_mems = HPET_WINDOW_SIZE;
 
 	addr = conf & 0xfffffc00;
 

Index: src/sys/dev/acpi/hpet_acpi.c
diff -u src/sys/dev/acpi/hpet_acpi.c:1.8 src/sys/dev/acpi/hpet_acpi.c:1.9
--- src/sys/dev/acpi/hpet_acpi.c:1.8	Wed Jun 15 04:20:47 2011
+++ src/sys/dev/acpi/hpet_acpi.c	Wed Jun 15 04:52:52 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: hpet_acpi.c,v 1.8 2011/06/15 04:20:47 jruoho Exp $ */
+/* $NetBSD: hpet_acpi.c,v 1.9 2011/06/15 04:52:52 jruoho Exp $ */
 
 /*
  * Copyright (c) 2006, 2011 Nicolas Joly
@@ -28,7 +28,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hpet_acpi.c,v 1.8 2011/06/15 04:20:47 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpet_acpi.c,v 1.9 2011/06/15 04:52:52 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -36,13 +36,13 @@
 #include <sys/timetc.h>
 
 #include <dev/acpi/acpivar.h>
+
+#include <dev/ic/hpetreg.h>
 #include <dev/ic/hpetvar.h>
 
 #define _COMPONENT	ACPI_RESOURCE_COMPONENT
 ACPI_MODULE_NAME	("acpi_hpet")
 
-#define HPET_MEM_WIDTH	0x3ff   /* Expected memory region size. */
-
 static int		hpet_acpi_dev_match(device_t, cfdata_t, void *);
 static void		hpet_acpi_dev_attach(device_t, device_t, void *);
 static int		hpet_acpi_tab_match(device_t, cfdata_t, void *);
@@ -96,7 +96,7 @@
 		return;
 
 	sc->sc_memt = aa->aa_memt;
-	sc->sc_mems = HPET_MEM_WIDTH;
+	sc->sc_mems = HPET_WINDOW_SIZE;
 
 	if (hpet->Address.Address == 0xfed0000000000000UL) /* A quirk. */
 		hpet->Address.Address >>= 32;
@@ -111,7 +111,7 @@
 
 	aprint_naive("\n");
 	aprint_normal(": mem 0x%"PRIx64"-0x%"PRIx64"\n",
-	    hpet->Address.Address, hpet->Address.Address + HPET_MEM_WIDTH);
+	    hpet->Address.Address, hpet->Address.Address + sc->sc_mems);
 
 	hpet_attach_subr(self);
 }
@@ -151,7 +151,7 @@
 		goto out;
 	}
 
-	if (mem->ar_length < HPET_MEM_WIDTH) {
+	if (mem->ar_length < HPET_WINDOW_SIZE) {
 		aprint_error(": invalid memory region size\n");
 		goto out;
 	}
@@ -166,7 +166,6 @@
 	}
 
 	sc->sc_mapped = true;
-
 	hpet_attach_subr(self);
 
 out:

Reply via email to