hi, In the example 1 << PAGE_SHIFT, left shift gives me the address of page number 1 i.e. the address of second page in memory (page no. 0 is the first page). now, address of page number 1 (second page) - address of page number 0 (first page) == size of one page == PAGE_SIZE
so the left shift :) cheers, Nikhil On Tue, Apr 22, 2008 at 2:08 AM, Nikhil Talpallikar < [EMAIL PROTECTED]> wrote: > > > On Tue, Apr 22, 2008 at 1:54 AM, Mrunal Gawade <[EMAIL PROTECTED]> > wrote: > > > Right. But It should be always a right shift right? Why your example has > > a left shift 1 << PAGE_SHIFT? > > > > use right shift ( of 32 bit address ) to get page number from the 32 bit > address > use left shift ( of page number ) to get the 32 bit address of the first > byte of that page > > > cheers, > Nikhil > > >
