From owner-acpi-jp@jp.freebsd.org  Thu Oct 19 10:37:23 2000
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id KAA04381;
	Thu, 19 Oct 2000 10:37:23 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from shidahara1.planet.sci.kobe-u.ac.jp (shidahara1.planet.sci.kobe-u.ac.jp [133.30.50.200])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id KAA04374
	for <acpi-jp@jp.freebsd.org>; Thu, 19 Oct 2000 10:37:22 +0900 (JST)
	(envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp)
Received: from shidahara1.planet.sci.kobe-u.ac.jp (localhost [127.0.0.1])
	by shidahara1.planet.sci.kobe-u.ac.jp (8.9.3/8.9.3) with ESMTP id KAA22804
	for <acpi-jp@jp.freebsd.org>; Thu, 19 Oct 2000 10:36:07 +0900 (JST)
	(envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp)
Message-Id: <200010190136.KAA22804@shidahara1.planet.sci.kobe-u.ac.jp>
To: acpi-jp@jp.freebsd.org
In-reply-to: Your message of "Thu, 12 Oct 2000 22:15:14 JST."
             <200010121315.WAA84890@shidahara1.planet.sci.kobe-u.ac.jp>
Date: Thu, 19 Oct 2000 10:36:07 +0900
From: Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp>
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+000315
X-Sequence: acpi-jp 883
Subject: [acpi-jp 883] Re: Latest ACPI megapatch update 
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: takawata@shidahara1.planet.sci.kobe-u.ac.jp

In message <200010121315.WAA84890@shidahara1.planet.sci.kobe-u.ac.jp>, Takanori
 Watanabe $B$5$s$$$o$/(B:
>
>And I try to call acpi_parse_resources() directly from acpi_probe_child
>but end up with page fault in resource_list_find();

I found the bug. This is my (commented out) bus_set_resource code origin.
Sorry:-(.

Takanori Watanabe
<a href="http://www.planet.sci.kobe-u.ac.jp/~takawata/key.html">
Public Key</a>
Key fingerprint =  2C 51 E2 78 2C E1 C5 2D  0F F1 20 A3 11 3A 62 2A 


diff -ru /home/takawata/acpica/dev/acpica/acpi.c ./acpi.c
--- /home/takawata/acpica/dev/acpica/acpi.c	Sun Oct  8 20:15:28 2000
+++ ./acpi.c	Thu Oct 19 10:34:51 2000
@@ -503,7 +503,7 @@
     /*
      * This method should be called when resource setting is changed.
      */
-    struct acpi_device		*ad = device_get_ivars(dev);
+    struct acpi_device		*ad = device_get_ivars(child);
     struct resource_list	*rl = &ad->ad_rl;
        
     resource_list_add(rl, type, rid, start, start + count -1, count);
@@ -610,7 +610,7 @@
 {
     ACPI_OBJECT_TYPE	type;
     device_t		child, bus = (device_t)context;
-
+    struct acpi_device  *ad;
     if (AcpiGetType(handle, &type) == AE_OK) {
 	switch(type) {
 	case ACPI_TYPE_DEVICE:
@@ -622,7 +622,12 @@
 	     * so that the probe/attach passes will run breadth-first.
 	     */
 	    child = BUS_ADD_CHILD(bus, level * 10, NULL, -1);
+	    printf("acpi_probe_child:%s %d\n",acpi_name(handle),level);
 	    acpi_set_handle(child, handle);
+	    acpi_parse_resources(child, handle,
+				 &acpi_res_parse_set);
+	    ad = device_get_ivars(child);
+	    ad->ad_rvalid = 1;
 	}
     }
     return(AE_OK);


