lkml.org 
[lkml]   [2000]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: whats happening
On Sat, 23 Dec 2000, Sourav Sen wrote:

> In some parts of the kernel code I find expression like
>
> len = (len + ~PAGE_MASK) & PAGE_MASK ;
>
> Whats happening to len?

It's being aligned properly.

if you have a continuous array of objects that are each 8 bytes, you
create a mask that's FFFFFFF8, then if len=7, instead of doing an
operation on the last byte of the first thing and the first 7 bytes of the
second, the above expression will add 7, making len 14, then normalize it
to the last valid object address, 8. And if you start with a valid
address, you get that same address back.


justin
--
To summon a demon you must first know its name.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.051 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site