Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi 'struct acpi_resources' will have references to...
details: https://anonhg.NetBSD.org/src/rev/bfda355cda49
branches: trunk
changeset: 550651:bfda355cda49
user: kochi <kochi%NetBSD.org@localhost>
date: Fri Aug 15 17:22:23 2003 +0000
description:
'struct acpi_resources' will have references to malloc'ed memory.
So it's better to not to allocate on stack.
diffstat:
sys/dev/acpi/fdc_acpi.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diffs (79 lines):
diff -r e43cfae39f5f -r bfda355cda49 sys/dev/acpi/fdc_acpi.c
--- a/sys/dev/acpi/fdc_acpi.c Fri Aug 15 17:14:31 2003 +0000
+++ b/sys/dev/acpi/fdc_acpi.c Fri Aug 15 17:22:23 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fdc_acpi.c,v 1.9 2003/06/18 08:58:34 drochner Exp $ */
+/* $NetBSD: fdc_acpi.c,v 1.10 2003/08/15 17:22:23 kochi Exp $ */
/*
* Copyright (c) 2002 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fdc_acpi.c,v 1.9 2003/06/18 08:58:34 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdc_acpi.c,v 1.10 2003/08/15 17:22:23 kochi Exp $");
#include "rnd.h"
@@ -69,6 +69,7 @@
struct fdc_softc sc_fdc;
bus_space_handle_t sc_baseioh;
struct acpi_devnode *sc_node; /* ACPI devnode */
+ struct acpi_resources res;
};
static int fdc_acpi_enumerate(struct fdc_acpi_softc *);
@@ -122,7 +123,6 @@
struct fdc_acpi_softc *asc = (struct fdc_acpi_softc *)self;
struct fdc_softc *sc = &asc->sc_fdc;
struct acpi_attach_args *aa = aux;
- struct acpi_resources res;
struct acpi_io *io, *ctlio;
struct acpi_irq *irq;
struct acpi_drq *drq;
@@ -134,7 +134,7 @@
asc->sc_node = aa->aa_node;
/* parse resources */
- rv = acpi_resource_parse(&sc->sc_dev, aa->aa_node, &res,
+ rv = acpi_resource_parse(&sc->sc_dev, aa->aa_node, &asc->res,
&acpi_resource_parse_ops_default);
if (rv != AE_OK) {
printf("%s: unable to parse resources\n", sc->sc_dev.dv_xname);
@@ -142,7 +142,7 @@
}
/* find our i/o registers */
- io = acpi_res_io(&res, 0);
+ io = acpi_res_io(&asc->res, 0);
if (io == NULL) {
printf("%s: unable to find i/o register resource\n",
sc->sc_dev.dv_xname);
@@ -150,7 +150,7 @@
}
/* find our IRQ */
- irq = acpi_res_irq(&res, 0);
+ irq = acpi_res_irq(&asc->res, 0);
if (irq == NULL) {
printf("%s: unable to find irq resource\n",
sc->sc_dev.dv_xname);
@@ -158,7 +158,7 @@
}
/* find our DRQ */
- drq = acpi_res_drq(&res, 0);
+ drq = acpi_res_drq(&asc->res, 0);
if (drq == NULL) {
printf("%s: unable to find drq resource\n",
sc->sc_dev.dv_xname);
@@ -195,7 +195,7 @@
* omitting the controller I/O port. (One has to exist for there to
* be a working fdc). Just try and force the mapping in.
*/
- ctlio = acpi_res_io(&res, 1);
+ ctlio = acpi_res_io(&asc->res, 1);
if (ctlio == NULL) {
if (bus_space_map(sc->sc_iot, io->ar_base + io->ar_length + 1,
1, 0, &sc->sc_fdctlioh)) {
Home |
Main Index |
Thread Index |
Old Index