Module Name: src Committed By: kiyohara Date: Mon Jul 13 12:57:04 UTC 2009
Modified Files: src/sys/dev/acpi: com_acpi.c Log Message: c...@acpi supports memory space. It tested on HP zx6000(ia64). To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/dev/acpi/com_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/dev/acpi/com_acpi.c diff -u src/sys/dev/acpi/com_acpi.c:1.28 src/sys/dev/acpi/com_acpi.c:1.29 --- src/sys/dev/acpi/com_acpi.c:1.28 Tue Feb 17 12:46:01 2009 +++ src/sys/dev/acpi/com_acpi.c Mon Jul 13 12:57:04 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: com_acpi.c,v 1.28 2009/02/17 12:46:01 jmcneill Exp $ */ +/* $NetBSD: com_acpi.c,v 1.29 2009/07/13 12:57:04 kiyohara Exp $ */ /* * Copyright (c) 2002 Jared D. McNeill <jmcne...@invisible.ca> @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.28 2009/02/17 12:46:01 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.29 2009/07/13 12:57:04 kiyohara Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -100,8 +100,12 @@ struct acpi_attach_args *aa = aux; struct acpi_resources res; struct acpi_io *io; + struct acpi_mem *mem; struct acpi_irq *irq; + bus_space_tag_t iot; bus_space_handle_t ioh; + bus_addr_t base; + bus_size_t size; ACPI_STATUS rv; sc->sc_dev = self; @@ -114,10 +118,21 @@ /* find our i/o registers */ io = acpi_res_io(&res, 0); - if (io == NULL) { - aprint_error_dev(self, - "unable to find i/o register resource\n"); - goto out; + if (io != NULL) { + iot = aa->aa_iot; + base = io->ar_base; + size = io->ar_length; + } else { + mem = acpi_res_mem(&res, 0); + if (mem != NULL) { + iot = aa->aa_memt; + base = mem->ar_base; + size = mem->ar_length; + } else { + aprint_error_dev(self, + "unable to find i/o register and memory resource\n"); + goto out; + } } /* find our IRQ */ @@ -127,14 +142,12 @@ goto out; } - if (!com_is_console(aa->aa_iot, io->ar_base, &ioh)) { - if (bus_space_map(sc->sc_regs.cr_iot, io->ar_base, io->ar_length, - 0, &ioh)) { + if (!com_is_console(iot, base, &ioh)) + if (bus_space_map(iot, base, size, 0, &ioh)) { aprint_error_dev(self, "can't map i/o space\n"); goto out; } - } - COM_INIT_REGS(sc->sc_regs, aa->aa_iot, ioh, io->ar_base); + COM_INIT_REGS(sc->sc_regs, iot, ioh, base); aprint_normal("%s", device_xname(self));