Re: [RFC] I/O Access Abstractions

David Howells
2001-07-03T08:04:38Z

> Case 1:
> You pass a single cookie to the readb code
> Odd platforms decode it

As opposed to passing a cookie (struct resource) and an offset, and letting
the compiler do the addition it'd do anyway or eliminate the cookie directly
on platforms where this is suitable.

> Case 2:
> You carry around bus number information all throughout
> each driver

Eh? Who said anything about bus number info? Just the information in the
resource structure.

> You keep putting it on/off the stack

Why should I want to do that? You've got to keep the base address of your
resource space somewhere anyway, so you could just replace it with a pointer
to the resource struct (which you've already got). Plus, I can pass this in a
register to any behind the scenes function.

In my example code, in the really simple cases (most of them), there were no
pushes and pops.

> You keep it in structures

Doesn't everyone? Apart from those that use global variables, I suppose, but
surely they're limited in reusability.

> You do complex generic locking for hotplug 'just in case'

Eh? No I wasn't, but under some circumstances one might have to do that
anyway, and so the out-of-line functions may be the best place to do that.

David