C/Direct memory access
From Attie's Wiki
(Difference between revisions)
m |
m (Attie moved page Direct memory access to C/Direct memory access) |
Latest revision as of 17:07, 14 February 2013
This example shows how to access memory locations directly (in this case a 16-bit register)
unsigned short *p; unsigned short mask = 0x400; p = 0xFFFE3A02; if (*p & mask) { *p &= ~mask; } else { *p |= mask; }
From within the kernel, use ptr = ioremap(addr,len)
and iounmap(ptr)