Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jul 2003 20:34:31 -0600 (MDT)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        nate@root.org
Cc:        current@freebsd.org
Subject:   Re: newbus questions
Message-ID:  <20030714.203431.85413817.imp@bsdimp.com>
In-Reply-To: <20030714173017.F18544@root.org>
References:  <20030714173017.F18544@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help

In message: <20030714173017.F18544@root.org>
            Nate Lawson <nate@root.org> writes:
: I'm working on ECDT support for ACPI and ran into a couple newbus-related
: questions.
: 
: 1. I'm using the identify entry as a way to get called early on in the
: boot process.  However, this does not happen before $PIR evaluation.  How
: should I hook in a routine for pre-$PIR execution?

You cannot with newbus.  discovery of $PIR happens as part of the BIOS
scans, of which pci bios is one.  why do you need to do this?  It
seems like a very odd question.

: 2. I need to call bus_alloc_resource() to get access to some io ports.
: However, calling BUS_READ_IVAR in the identify routine gets a bad pointer
: deref.  So how do I get a handle to use for allocating the IO ports
: (first arg of bus_alloc_resource)?

You need a device and a parent device.  If you do not have one, then
you must get one.

: 3. It appears bus_alloc_resource() takes a range of values.  If I know the
: exact value to use, I request it via "value, value" instead of "0, ~0".
: Is this correct?

Yes.  However, typically the parent bus identifies these resources,
and the child device swallows it.  The child device typically has no
say in the matter.  However, the foo_identify routines can set what it
thinks are the right addresses.

: The framework for this code is in ec_identify() and ec_attach() in
: sys/dev/acpica/acpi_ec.c.

This really isn't a identify routine.  You must hook into other things
if you want to get access early.

Let's take a step back.  What are you trying to do?

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030714.203431.85413817.imp>