misc questions about the device&driver arch
gurney_j at resnet.uoregon.edu
Mon May 22 19:07:32 PDT 2006
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:
> 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."
More information about the freebsd-hackers