Subject: Re: Add a MAP_ALIGNED flag for mmap(2).
To: Matt Thomas <>
From: Andrew Brown <>
List: tech-kern
Date: 03/03/2003 00:42:32
>> >+              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?

no, i now see that it does.  i just recalled something from another
discussion on a similar subject from somewhere else and confused them.

>>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.

yup.  sorry.

|-----< "CODE WARRIOR" >-----|             * "ah!  i see you have the internet (Andrew Brown)                that goes *ping*!"       * "information is power -- share the wealth."