Accessing PCI Memory Mapped Registers in Linux Kernel
mulyadi.santosa at gmail.com
Tue Dec 21 12:59:42 EST 2010
On Tue, Dec 21, 2010 at 16:04, YOUNGWHAN SONG <breadncup at gmail.com> wrote:
> test_foo = (struct foo*)regsva;
I was thinking differently, could it be that casting...as shown
above...introduce this behaviour? what if you just point to the
address...directly without any "container" such as struct foo?
> printk(KERN_DBG "value TEST1: 0x%lx\n", readl(test_foo->TEST1));
> printk(KERN_DBG "value 0: 0x%x\n", readw(&test_foo->a1);
> printk(KERN_DBG "value 1: 0x%x\n", readw(&test_foo->a1);
in the above statement, it means "take the address of a1[0 and read
some bytes from that address", right?
Freelance Linux trainer and consultant
More information about the Kernelnewbies