Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 May 2006 19:07:26 -0700
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        william wallace <avalonwallace@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>, freebsd-arch@freebsd.org
Subject:   Re: misc questions about the device&driver arch
Message-ID:  <20060523020726.GP770@funkthat.com>
In-Reply-To: <87ab37ab0605221816y6cca5387sc43fa1e1116f55cc@mail.gmail.com>
References:  <87ab37ab0605210108w127a235bue281428f52bbc784@mail.gmail.com> <20060521.114807.74702188.imp@bsdimp.com> <87ab37ab0605212328ue7c70fcu49c5fec8921ae229@mail.gmail.com> <20060522.005010.104089663.imp@bsdimp.com> <87ab37ab0605221816y6cca5387sc43fa1e1116f55cc@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
william wallace wrote this message on Tue, May 23, 2006 at 09:16 +0800:
> In order to keep the API as consistent as possible between classic
> interrupt sources and MSI sources, I'd like to add a new bus method:
> 
> int
> bus_reserve_resource(device_t, int *start, int *end, int *count, int flags);
> 
> start, end, and count would be passed is as the desired range and would
> map to the per-function interrupt index in MSI.  On return, the range
> supported and negotiated by the OS, bus, and function would be filled
> into these values.  flags would be something like SYS_RES_MESSAGE.
> Internal failure of the function would be given in the return value.
> Whether failure to support MSI should be given as an error code return
> value can be debated.  This function will also program the MSI
> configuration registers on the device to use the correct message cookie
> and number of messages.

Why not create a wrapper, and start at the highest requested, and slowly
work your way down as the requests are rejected..  since the number of
messages must be a power of two, it isn't than many rounds..

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



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