From user space access, use mmap.
Regards,
Muhammad Sarwar
Mangrove Systems Inc.
-----Original Message-----
From: John Zhou [mailto:zjzhou@newrocktech.com]
Sent: Sunday, January 11, 2004 9:20 PM
To: linuxppc-dev@lists.linuxppc.org
Subject: how to read/write registers of CPU or Device from user space
Hi, all,
when debugging kernel or driver, we need to read/write registers of CPU and devices. I wanna use /dev/mem to do, is it possible? if need to do others things? is it better to write a driver for read/write CPU/device's registers by myself?
Do you have any good advice?
Thanks in advance!
John
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
On Jan 12, 2004, at 7:48 AM, Muhammad Sarwar wrote:
From user space access, use mmap.
To elaborate a *little* more, you can mmap /dev/mem to get a view onto
the physical address space. (Note that it won't work for RAM, but
that's not what you're trying to do anyways.)
This won't help you to read the CPU's registers, but what are you
looking for there?
-----Original Message-----
From: John Zhou [mailto:zjzhou@newrocktech.com]
Sent: Sunday, January 11, 2004 9:20 PM
To: linuxppc-dev@lists.linuxppc.org
Subject: how to read/write registers of CPU or Device from user space
Hi, all,
when debugging kernel or driver, we need to read/write registers of
CPU and devices. I wanna use /dev/mem to do, is it possible? if need
to do others things? is it better to write a driver for read/write
CPU/device's registers by myself?
Do you have any good advice?
Thanks in advance!
John
--
Hollis Blanchard
IBM Linux Technology Center
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
On Jan 12, 2004, at 9:31 AM, Hollis Blanchard wrote:
On Jan 12, 2004, at 7:48 AM, Muhammad Sarwar wrote:
quoted
From user space access, use mmap.
(Note that it won't work for RAM, but that's not what you're trying to
do anyways.)
I misunderstood something here; you can in fact remap RAM via /dev/mem.
This mapping will be done with the VM_RESERVED flag set, which was not
acceptable in the context I heard it discussed, but I guess is ok
generally speaking.
--
Hollis Blanchard
IBM Linux Technology Center
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/