[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tracking adresses of write and read



On Wed, May 16, 2001 at 02:49:36PM +0200, Fabrice Gautier wrote:
> I'm writing a driver for some special hardware. It's a PCI device.
> First I have a kernel module which ioremap the hardware registers. Then
> I have a user space program which mmap the device to user space. And
> then i read/write the devices registers throught this mmap-ed region.
> 
> I would like to be abble to see which physical adress i'm
> writing/reading to when I write/read in the mmap-ed memory.
> 
> Who could i do this? 

My guess:

  unsigned long phys_addr;

  phys_addr = virt_to_phys(virtual_address);
  printk(KERN_INFO "%s: phys_addr = 0x%08x\n", __FUNCTION__, phys_addr);


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
-
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.kernelnewbies.org/