Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jan 2004 00:34:40 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        nate@root.org
Cc:        msmith@freebsd.org
Subject:   Re: newbus ioport usage
Message-ID:  <20040128.003440.73380546.imp@bsdimp.com>
In-Reply-To: <20040127225912.A77804@root.org>
References:  <20040127141708.O75272@root.org> <20040127.153120.67922084.imp@bsdimp.com> <20040127225912.A77804@root.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20040127225912.A77804@root.org>
            Nate Lawson <nate@root.org> writes:
: Now acpi0 owns the resources.  In acpi_alloc_resource, I
: call resource_list_alloc().  If it returns NULL, then loop through all
: rids, calling resource_list_find() on each.  For each that it finds, check
: if rl->start + rl->count overlaps the requested address.  If so, free this
: resource via resource_list_free(), call BUS_ALLOC_RESOURCE() for the
: caller's resource, then generate a new resource_list_alloc() for the
: truncated range.  This would be unnecessary if we had a way to free a
: partial range of a resource, but it appears this is the only way.
: 
: Thoughts?

I'd be tempted to create your own resource manager, and use the rman
code to deal.  Once you allocate the resources from the upstream
manager (using BUS_ALLOC_RESOURCE), you can then search the resource
manager to dole out the resources.  Since these resources aren't
associated in a 1-1 manner with how the devices will use it, unlike
pci or pc card busses, this may be the easiest way to cope.  The
resource manager does the stuff that you talk about.  The resource
manager is how you deal with partial ranges.

Be aware that jhb believes that there might be some bugs in the dark
corners of rman that would account for some weird behavior that we've
seen from time to time, but I'm less sure.  You'd need to rman_init()
things, and then rman_manage_region the appropriate regions.  The code
would look a lot like what is in nexus.

Warner



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