How can I test if a physical address is already mapped or not.

Jeff Haran jharan at bytemobile.com
Tue Oct 18 16:47:44 EDT 2011


> -----Original Message-----
> From: kernelnewbies-bounces at kernelnewbies.org [mailto:kernelnewbies-
> bounces at kernelnewbies.org] On Behalf Of StephanT
> Sent: Tuesday, October 18, 2011 10:23 AM
> To: kernelnewbies
> Subject: Re: How can I test if a physical address is already mapped or not.
> 
> 
> >>When you say an access to physical address, how are you managing to
> >>access the physical address directly?
> 
> Like this:
> 
> unsigned long    * const pReg = (unsigned long*) 0XC0000000 ;
> 
> printk( KERN_INFO"** read (%p) %08lX.\n", pReg, *pReg) ;

On any virtual memory processor I am aware of, the above will cause pReg to contain a virtual address, not a physical address.

Jeff Haran






More information about the Kernelnewbies mailing list