Re: Improving bus/resource API
From: John Baldwin (jhb_at_FreeBSD.org)
Date: 09/20/05
- Previous message: Poul-Henning Kamp: "Improving bus/resource API"
- In reply to: Poul-Henning Kamp: "Improving bus/resource API"
- Next in thread: Doug Rabson: "Re: Improving bus/resource API"
- Reply: Doug Rabson: "Re: Improving bus/resource API"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: freebsd-arch@freebsd.org Date: Tue, 20 Sep 2005 10:45:58 -0400
On Tuesday 20 September 2005 07:20 am, Poul-Henning Kamp wrote:
> The patch below improves the bus/resource API such that between 10
> and 20 lines of code can be eliminated from the attach/detach
> functions of the average device driver.
>
> Therefore the best place to start is to read what the patch does
> to if_sis.c, which is a very typical case.
>
> The patch is backwards compatible in binary and source form so
> it is a potential candidate for RELENG_6 at some point.
>
> Compile tested on i386/amd64 and sparc64. My alpha will be chewing
> on it for the forseeable future.
>
>
> For sanity in the ensuing bikeshed, let's take three topics in
> this order:
>
> 1. "what this does to the device driver sources."
>
> 2. "what this does to the rman/bus internals"
>
> 3. "suggestions for different function names"
I'll only comment on 3)
Maybe bus_read_{1,2,4}() rather than bsr_? (Same with s/bsw_/bus_write_/). I
do like having the accessors take just a resource rather than a tag, handle
pair. Many drivers already hide this in wrapper macros already though.
For the dwiw (dwim? :-P) maybe since it takes an array, just make the
'resource' part plural, thus 'bus_alloc_resources()' and
'bus_release_resources()'?
-- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org _______________________________________________ freebsd-arch@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-arch To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"
- Previous message: Poul-Henning Kamp: "Improving bus/resource API"
- In reply to: Poul-Henning Kamp: "Improving bus/resource API"
- Next in thread: Doug Rabson: "Re: Improving bus/resource API"
- Reply: Doug Rabson: "Re: Improving bus/resource API"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|