Subject: Re: Add a MAP_ALIGNED flag for mmap(2).
To: Andrew Brown <atatat@atatdot.net>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 03/02/2003 21:33:09
At 08:22 PM 3/2/2003, Andrew Brown wrote:
> >+ if (flags & MAP_FIXED) {
> >+ if ((*addr & (align-1)) != 0)
> >+ return(EINVAL);
> >+ align = 0;
>
>at some point today, something clicked in my head that said "this
>should not be arbitrarily disallowed.
It isn't disallowed. It's just make sure that the bits you want
to be zero, are zero.
>right now, if you specify MAP_FIXED, all you have to do is make sure
>that specify a hint that's page aligned. in the case of MAP_ALIGN,
>all you should have to do it make sure specify a hint that's aligned
>to the alignment you want.
Uh. And why do you think the above code doesn't do that?
>0x60010000 should be fine as an aligned, fixed address, as long as
>don't specify an alignment that's greater than 64k.
Correct. And that's what the above enfornces.
--
Matt Thomas Internet: matt@3am-software.com
3am Software Foundry WWW URL: http://www.3am-software.com/bio/matt/
Cupertino, CA Disclaimer: I avow all knowledge of this message