PAGE_MASK ?

Ravi Wijayaratne (ravi@jumprun.tamu.edu)
Mon, 28 Sep 1998 23:46:07 -0500 (CDT)


Hi,

What does the PAGE_MASK macro do in the kernel ?

The PAGE_MASK macro is defined as

/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 12
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))

in /linux/include/asm-i386/page.h

and the macro usage is like

pos=filp->f_pos;
ppos=pos&PAGE_MASK

Can some one please tell me the purpose of PAGE_MASK in this piece of
code.

Thank you

Ravi

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