Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi jmcneill@: do not touch the bus_space(9) handle.
details: https://anonhg.NetBSD.org/src/rev/5214be140f9d
branches: trunk
changeset: 756972:5214be140f9d
user: jruoho <jruoho%NetBSD.org@localhost>
date: Sun Aug 08 18:47:54 2010 +0000
description:
jmcneill@: do not touch the bus_space(9) handle.
diffstat:
sys/dev/acpi/acpi_cpu.c | 11 ++++++-----
sys/dev/acpi/acpi_cpu.h | 3 ++-
2 files changed, 8 insertions(+), 6 deletions(-)
diffs (63 lines):
diff -r c0f023f0a208 -r 5214be140f9d sys/dev/acpi/acpi_cpu.c
--- a/sys/dev/acpi/acpi_cpu.c Sun Aug 08 18:44:15 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu.c Sun Aug 08 18:47:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.c,v 1.12 2010/08/08 16:58:42 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.c,v 1.13 2010/08/08 18:47:54 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
* SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.12 2010/08/08 16:58:42 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu.c,v 1.13 2010/08/08 18:47:54 jruoho Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -116,6 +116,7 @@
sc->sc_dev = self;
sc->sc_cold = false;
+ sc->sc_mapped = false;
sc->sc_iot = aa->aa_iot;
sc->sc_node = aa->aa_node;
sc->sc_cpuid = acpicpu_id(sc->sc_object.ao_procid);
@@ -150,8 +151,8 @@
rv = bus_space_map(sc->sc_iot, sc->sc_object.ao_pblkaddr,
sc->sc_object.ao_pblklen, 0, &sc->sc_ioh);
- if (rv != 0)
- sc->sc_ioh = 0;
+ if (rv == 0)
+ sc->sc_mapped = true;
}
acpicpu_cstate_attach(self);
@@ -194,7 +195,7 @@
if (rv != 0)
return rv;
- if (sc->sc_ioh != 0)
+ if (sc->sc_mapped != false)
bus_space_unmap(sc->sc_iot, sc->sc_ioh, addr);
mutex_destroy(&sc->sc_mtx);
diff -r c0f023f0a208 -r 5214be140f9d sys/dev/acpi/acpi_cpu.h
--- a/sys/dev/acpi/acpi_cpu.h Sun Aug 08 18:44:15 2010 +0000
+++ b/sys/dev/acpi/acpi_cpu.h Sun Aug 08 18:47:54 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu.h,v 1.9 2010/08/08 16:58:42 jruoho Exp $ */
+/* $NetBSD: acpi_cpu.h,v 1.10 2010/08/08 18:47:54 jruoho Exp $ */
/*-
* Copyright (c) 2010 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -168,6 +168,7 @@
uint32_t sc_flags;
cpuid_t sc_cpuid;
bool sc_cold;
+ bool sc_mapped;
};
void acpicpu_cstate_attach(device_t);
Home |
Main Index |
Thread Index |
Old Index