Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Use defined constants.
details: https://anonhg.NetBSD.org/src/rev/6688610f58c1
branches: trunk
changeset: 766079:6688610f58c1
user: jruoho <jruoho%NetBSD.org@localhost>
date: Wed Jun 15 04:52:52 2011 +0000
description:
Use defined constants.
diffstat:
sys/arch/x86/pci/amdpcib_hpet.c | 7 ++++---
sys/dev/acpi/hpet_acpi.c | 15 +++++++--------
2 files changed, 11 insertions(+), 11 deletions(-)
diffs (105 lines):
diff -r 182c34fcdfa0 -r 6688610f58c1 sys/arch/x86/pci/amdpcib_hpet.c
--- a/sys/arch/x86/pci/amdpcib_hpet.c Wed Jun 15 04:20:47 2011 +0000
+++ b/sys/arch/x86/pci/amdpcib_hpet.c Wed Jun 15 04:52:52 2011 +0000
@@ -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;
diff -r 182c34fcdfa0 -r 6688610f58c1 sys/dev/acpi/hpet_acpi.c
--- a/sys/dev/acpi/hpet_acpi.c Wed Jun 15 04:20:47 2011 +0000
+++ b/sys/dev/acpi/hpet_acpi.c Wed Jun 15 04:52:52 2011 +0000
@@ -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:
Home |
Main Index |
Thread Index |
Old Index