[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $var-__PAGE_OFFSET
I found the following information on the Internet a while back:
---
The intel "invlpg" semantics are extremely strange. The * chip will add
the segment base to the memory address, even though * no segment checking is
done. We correct for this by using an - * offset of 0x40000000 that will wrap
around the kernel segment base - * of 0xC0000000 to get the correct address (it
will always be outside + * offset of -__PAGE_OFFSET that will wrap around the
kernel segment base + * of __PAGE_OFFSET to get the correct address (it will
always be outside * the kernel segment, but we're only interested in the final
linear * address.
---
But it's still not very clear to me, especially since $var-__PAGE_OFFSET
was not used in kernel 2.2.
- Why is it used now in 2.4?
- Why is it used only in some places?
Thanks
Werner
On Sun, 14 Jan 2001, [iso-8859-1] Augusto César Radtke wrote:
> w.us@verizon.net wrote:
>
> >
> > Hi,
> >
> > Does someone know why we subtract addresses by __PAGE_OFFSET
> > in arch/i386/kernel/head.s on 2.4?
> >
> > E.g.:
> > movl $pg0-__PAGE_OFFSET,%edi
> > cmp $empty_zero_page-__PAGE_OFFSET,%edi
> > movl $swapper_pg_dir-__PAGE_OFFSET,%eax
> > etc.
>
> Generally to align the data on the memory.
>
> Augusto
>
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.surriel.com/kernelnewbies.shtml