[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Addresses in ARM kernel head.S
Hi,
In kernel 2.6.14, head.S for ARM, there is:
__INIT
.type stext, %function
ENTRY(stext)
...
ldr r13, __switch_data
...
such that, __switch_data is a structure defined right below
ENTRY(stext) and it has the address of the first function to be ran
after MMU is enabled:
.type __switch_data, %object
__switch_data:
.long __mmap_switched
...
.type __mmap_switched, %function
__mmap_switched:
...
Eventually the MMU is enabled and right after, __mmap_switched is
called. My questions are:
(a) How come ENTRY(stext) is position independent, but __mmap_switched
which is defined right below it is *not*.
(b) How come first field of __switch_data stores the *virtual* address
of __mmap_switched and it works just fine to jump to it after mmu is
enabled? Maybe __mmap_switched is just mapped to its physical address?
Finally, is it irrelevant to ask arch-specific questions like this in
kernelnewbies?
Thanks,
Bahadir
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/