【发布时间】:2010-01-25 16:13:56
【问题描述】:
在用户空间中是否可以有这样一段代码? 我的意思是可以在 Netbsd / Linux 的用户空间中读/写协处理器寄存器吗?
XYZ]# cat pmc.c
static inline int
arm11_pmc_ctrl_read(void)
{
unsigned int val;
__asm volatile ("mrc p15, 0, %0, c15, c12, 0" : "=r" (val));
return val;
}
int main(){
unsigned int ctrl;
ctrl = arm11_pmc_ctrl_read();
}
【问题讨论】:
标签: c assembly linux-kernel arm