newbus questions

M. Warner Losh imp at bsdimp.com
Mon Jul 14 19:34:36 PDT 2003


In message: <20030714173017.F18544 at root.org>
            Nate Lawson <nate at 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


More information about the freebsd-current mailing list