summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2007-11-19 18:56:42 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2007-11-19 18:56:42 +0000
commitafc41379da6c7e81d4e3b91cf84047ff3ba39edd (patch)
treeae74e6283d061ba44ed96de66d75b86bf6aec8f6 /sys/dev/acpi
parentd1c708cba9eb3148adc463bcb383ab8f64638f8d (diff)
Initialize sc_facs earlier.
ok deraadt@, beck@, canacar@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpi.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 393c846266d..adaf9a27540 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.101 2007/11/16 16:16:04 deraadt Exp $ */
+/* $OpenBSD: acpi.c,v 1.102 2007/11/19 18:56:41 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -402,12 +402,12 @@ acpi_attach(struct device *parent, struct device *self, void *aux)
struct device *dev;
struct acpi_ac *ac;
struct acpi_bat *bat;
- paddr_t facspa;
#endif
+ paddr_t facspa;
+
sc->sc_iot = aaa->aaa_iot;
sc->sc_memt = aaa->aaa_memt;
-
if (acpi_map(aaa->aaa_pbase, sizeof(struct acpi_rsdp), &handle)) {
printf(": can't map memory\n");
return;
@@ -463,6 +463,19 @@ acpi_attach(struct device *parent, struct device *self, void *aux)
return;
}
+ /*
+ * Set up a pointer to the firmware control structure
+ */
+ if (sc->sc_fadt->hdr_revision < 3 || sc->sc_fadt->x_firmware_ctl == 0)
+ facspa = sc->sc_fadt->firmware_ctl;
+ else
+ facspa = sc->sc_fadt->x_firmware_ctl;
+
+ if (acpi_map(facspa, sizeof(struct acpi_facs), &handle))
+ printf(" !FACS");
+ else
+ sc->sc_facs = (struct acpi_facs *)handle.va;
+
/* Create opcode hashtable */
aml_hashopcodes();
@@ -508,19 +521,6 @@ acpi_attach(struct device *parent, struct device *self, void *aux)
/* Find available sleep/resume related methods. */
acpi_init_pm(sc);
- /*
- * Set up a pointer to the firmware control structure
- */
- if (sc->sc_fadt->hdr_revision < 3 || sc->sc_fadt->x_firmware_ctl == 0)
- facspa = sc->sc_fadt->firmware_ctl;
- else
- facspa = sc->sc_fadt->x_firmware_ctl;
-
- if (acpi_map(facspa, sizeof(struct acpi_facs), &handle))
- printf(" !FACS");
- else
- sc->sc_facs = (struct acpi_facs *)handle.va;
-
/* Map Power Management registers */
acpi_map_pmregs(sc);