From owner-acpi-jp@jp.FreeBSD.org Wed Jan 30 02:32:07 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id g0THW7541752;
	Wed, 30 Jan 2002 02:32:07 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from rover.village.org (warner@[204.144.255.66])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id g0THW4641746
	for <acpi-jp@jp.FreeBSD.org>; Wed, 30 Jan 2002 02:32:04 +0900 (JST)
	(envelope-from imp@village.org)
Received: from harmony.village.org (harmony.village.org [10.0.0.6])
	by rover.village.org (8.11.3/8.11.3) with ESMTP id g0THUeo24875
	for <acpi-jp@jp.FreeBSD.org>; Tue, 29 Jan 2002 10:30:40 -0700 (MST)
	(envelope-from imp@village.org)
Received: from localhost (warner@rover2.village.org [10.0.0.1])
	by harmony.village.org (8.11.6/8.11.6) with ESMTP id g0THUcx18621
	for <acpi-jp@jp.FreeBSD.org>; Tue, 29 Jan 2002 10:30:39 -0700 (MST)
	(envelope-from imp@village.org)
Date: Tue, 29 Jan 2002 10:30:05 -0700 (MST)
Message-Id: <20020129.103005.85735280.imp@village.org>
To: acpi-jp@jp.FreeBSD.org
From: "M. Warner Losh" <imp@village.org>
In-Reply-To: <200201291320.WAA16180@shidahara1.planet.sci.kobe-u.ac.jp>
References: <200201291320.WAA16180@shidahara1.planet.sci.kobe-u.ac.jp>
X-Mailer: Mew version 2.1 on Emacs 21.1 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+011218
X-Sequence: acpi-jp 1567
Subject: [acpi-jp 1567] Re: What this code means?
Errors-To: owner-acpi-jp@jp.FreeBSD.org
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: imp@village.org

In message: <200201291320.WAA16180@shidahara1.planet.sci.kobe-u.ac.jp>
            Takanori Watanabe <takawata@shidahara1.planet.sci.kobe-u.ac.jp> writes:
: 
: I have a question about following code in acpi_pcib_route interrupt.
: 
:     /* find the bridge softc */
:     if (devclass_get_devices(acpi_pcib_devclass, &devlist, &devcount))
:         goto out;
:     BUS_READ_IVAR(pcib, pcib, PCIB_IVAR_BUS, &up);
:     bus = up;
:     sc = NULL;
:     for (i = 0; i < devcount; i++) {
:         sc = device_get_softc(*(devlist + i));
:         if (sc->ap_bus == bus)
:             break;
:         sc = NULL;
:     }
:     if (sc == NULL)                     /* not one of ours */
:         goto out;
:     prtp = sc->ap_prt.Pointer;
: 
: Are there any problem with simply device_get_softc(pcib)?

It looks like it is trying to find the softc of the parent of pcib.

Warner
