From owner-acpi-jp@jp.FreeBSD.org Tue Jan 29 22:21:53 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id g0TDLrR86128;
	Tue, 29 Jan 2002 22:21:53 +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.68.253])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id g0TDLr686123
	for <acpi-jp@jp.freebsd.org>; Tue, 29 Jan 2002 22:21:53 +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 WAA16180
	for <acpi-jp@jp.freebsd.org>; Tue, 29 Jan 2002 22:20:09 +0900 (JST)
	(envelope-from takawata@shidahara1.planet.sci.kobe-u.ac.jp)
Message-Id: <200201291320.WAA16180@shidahara1.planet.sci.kobe-u.ac.jp>
To: acpi-jp@jp.FreeBSD.org
Date: Tue, 29 Jan 2002 22:20:09 +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+011218
X-Sequence: acpi-jp 1566
Subject: [acpi-jp 1566] What this code means?
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


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)?

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 






