From owner-freebsd-current@FreeBSD.ORG Tue Jun 24 09:06:22 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0DFDA37B449; Tue, 24 Jun 2003 09:06:21 -0700 (PDT) Received: from storm.FreeBSD.org.uk (storm.FreeBSD.org.uk [194.242.157.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4703B43FBD; Tue, 24 Jun 2003 09:06:19 -0700 (PDT) (envelope-from mark@grondar.org) Received: from storm.FreeBSD.org.uk (Ugrondar@localhost [127.0.0.1]) by storm.FreeBSD.org.uk (8.12.9/8.12.9) with ESMTP id h5OG6H1f044275; Tue, 24 Jun 2003 17:06:17 +0100 (BST) (envelope-from mark@grondar.org) Received: (from Ugrondar@localhost)h5OG6HPf044274; Tue, 24 Jun 2003 17:06:17 +0100 (BST) X-Authentication-Warning: storm.FreeBSD.org.uk: Ugrondar set sender to mark@grondar.org using -f Received: from grondar.org (localhost [127.0.0.1])h5OG2PHh043393; Tue, 24 Jun 2003 17:02:25 +0100 (BST) (envelope-from mark@grondar.org) From: Mark Murray Message-Id: <200306241602.h5OG2PHh043393@grimreaper.grondar.org> To: jhb@freebsd.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <43354.1056470372.0@grondar.org> Date: Tue, 24 Jun 2003 17:02:25 +0100 Sender: mark@grondar.org X-Spam-Status: No, hits=1.7 required=5.0 tests=FROM_NO_LOWER,PATCH_UNIFIED_DIFF version=2.55 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: current@freebsd.org Subject: ACPI stuff to make Libretto 110CT work X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jun 2003 16:06:23 -0000 ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <43354.1056470372.1@grondar.org> Hi You (?) gave me these patches at least 6 months ago, and they've been working for my Libretto ever since then. Is it OK if I commit them? M -- Mark Murray iumop ap!sdn w,I idlaH ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <43354.1056470372.2@grondar.org> Content-Description: diff Index: dev/acpica/acpi.c =================================================================== RCS file: /home/ncvs/src/sys/dev/acpica/acpi.c,v retrieving revision 1.89 diff -u -d -r1.89 acpi.c --- dev/acpica/acpi.c 1 May 2003 18:51:43 -0000 1.89 +++ dev/acpica/acpi.c 2 May 2003 08:15:39 -0000 @@ -817,6 +817,10 @@ if (ACPI_SUCCESS(AcpiGetHandle(ACPI_ROOT_OBJECT, scopes[i], &parent))) AcpiWalkNamespace(ACPI_TYPE_ANY, parent, 100, acpi_probe_child, bus, NULL); + if (devclass_get_device(devclass_find("isa"), 0) == NULL) { + device_set_flags(BUS_ADD_CHILD(bus, 0, "isa", 0), 1); + } + /* * Scan all of the child devices we have created and let them probe/attach. */ Index: isa/isa_common.c =================================================================== RCS file: /home/ncvs/src/sys/isa/isa_common.c,v retrieving revision 1.35 diff -u -d -r1.35 isa_common.c --- isa/isa_common.c 11 Jun 2003 00:32:45 -0000 1.35 +++ isa/isa_common.c 11 Jun 2003 08:10:34 -0000 @@ -1108,6 +1108,60 @@ 1, /* no softc */ }; +static int +acpi_isa_probe(device_t dev) +{ + + if (device_get_flags(dev) == 0) { + return (ENXIO); + } + + return (isa_probe(dev)); +} + +static device_method_t acpi_isa_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, acpi_isa_probe), + DEVMETHOD(device_attach, isa_attach), + DEVMETHOD(device_detach, bus_generic_detach), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + + /* Bus interface */ + DEVMETHOD(bus_add_child, isa_add_child), + DEVMETHOD(bus_print_child, isa_print_child), + DEVMETHOD(bus_probe_nomatch, isa_probe_nomatch), + DEVMETHOD(bus_read_ivar, isa_read_ivar), + DEVMETHOD(bus_write_ivar, isa_write_ivar), + DEVMETHOD(bus_child_detached, isa_child_detached), + DEVMETHOD(bus_driver_added, isa_driver_added), + DEVMETHOD(bus_setup_intr, isa_setup_intr), + DEVMETHOD(bus_teardown_intr, isa_teardown_intr), + + DEVMETHOD(bus_get_resource_list,isa_get_resource_list), + DEVMETHOD(bus_alloc_resource, isa_alloc_resource), + DEVMETHOD(bus_release_resource, isa_release_resource), + DEVMETHOD(bus_set_resource, isa_set_resource), + DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), + DEVMETHOD(bus_delete_resource, bus_generic_rl_delete_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + + /* ISA interface */ + DEVMETHOD(isa_add_config, isa_add_config), + DEVMETHOD(isa_set_config_callback, isa_set_config_callback), + DEVMETHOD(isa_pnp_probe, isa_pnp_probe), + + { 0, 0 } +}; + +static driver_t acpi_isa_driver = { + "isa", + acpi_isa_methods, + 1, /* no softc */ +}; + /* * ISA can be attached to a PCI-ISA bridge or directly to the legacy device. */ @@ -1115,5 +1169,6 @@ DRIVER_MODULE(isa, eisab, isa_driver, isa_devclass, 0, 0); #if defined(__i386__) || defined(__amd64__) DRIVER_MODULE(isa, legacy, isa_driver, isa_devclass, 0, 0); +DRIVER_MODULE(isa, acpi, acpi_isa_driver, isa_devclass, 0, 0); #endif MODULE_VERSION(isa, 1); ------- =_aaaaaaaaaa0--