[RFC PATCH 2/3] ARM: mm: add l2x0 physical address parameter to init

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Sep 26 10:51:04 EDT 2011


On Mon, Sep 26, 2011 at 03:32:40PM +0100, Lorenzo Pieralisi wrote:
> This patch redefines the l2x0_init function, and it adds a
> parameter defining the L2 physical base address in preparation
> for L2 resume support. The device tree init code retrieves the
> physical address from the "reg" array and converts it to a
> physical address pointer.

I've no idea why many people have a really dire time understanding the
following basic fact.  I keep seeing the same things: virtual addresses
as integers and physical addresses as pointers.

Virtual addresses are pointers.
Physical addresses are NOT pointers but integers.

Why?  You CAN'T dereference a physical address when running in the virtual
address space (which is the space which the kernel runs in.)

Stop doing it.



More information about the linux-arm-kernel mailing list