In message <[EMAIL PROTECTED]> Doug 
Rabson writes:
: I'm uneasy about using the flags for this since I'm vaguely reserving the
: upper 16 bits of flags for bus-specific purposes (although I haven't
: formalised this).
: 
: For allocating aligned regions with pnp, I simply looped in the caller
: trying each specific range until one was free (see isa_find_port() in
: isa_common.c). This is ugly but it does work.
: 
: In the long run, I think we need either an extra parameter to
: rman_reserve_resource() or a new api rman_reserve_resource_aligned().
: This also implies changing the method BUS_ALLOC_RESOURCE() or adding
: BUS_ALLOC_RESOURCE_ALIGNED().

Well, with just 6 bits one could handle any alignment requirement up
to 2^(2^6).

We have 6 bits left.  If this were the alignment requirement, a value
of 0 would mean 2^0 or 1, which is the current behavior.  More
restrictive alignment requirements could be encoded easily.  No ABI or
API change needed.

#define RF_ALIGNMENT_MASK       0xfc00
#define RF_ALIGNMENT_SHIFT      10
#define RF_ALIGNMENT_LOG2(x)    (x << RF_ALIGNMENT_SHIFT)

Warner


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to