On Fri, 28 Jan 2000, YAMAMOTO Shigeru wrote:
>
> >>>>> "Warner" == Warner Losh <Warner> writes:
> Warner> In a cardbus system, one would force the alignment in the card bus
> Warner> bridge. It would reject those things that aren't aligned in a sane
> Warner> manner for cardbus. It would try again to get a different range, if
> Warner> possible, or would reject the attempt.
>
> I think it is no good to try again to get a different range.
> Because, a different system has a different free address range and a device
> dirver can not know where is a free address range.
>
> So I change rman_reserve_resource() in @src/sys/kern/subr_rman.c for we can
> allocate an aligned address.
>
> My idea is using high bits of flags.
> RF_ALIGN_XXX in aflags specifies an alignment request and an alignment
> size.
> Bad point of my idea is that we need to use a different bit for each an
> alignment size.
>
> This is a patch for @src/sys/kern/subr_rman.c (rev. 1.10) and
> @src/sys/sys/rman.h (rev. 1.5)
>
> Is my idea good or not?
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().
--
Doug Rabson Mail: [EMAIL PROTECTED]
Nonlinear Systems Ltd. Phone: +44 181 442 9037
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message