管理提醒: 本帖被 arm9home 从 Linux技术交流专区 移动到本区(2010-09-09)
有段程序请教各位大侠:
希望能详细的解说一下
static int sbc2440_leds_ioctl(
struct inode*inode,
struct file*file,
unsigned int cmd,
unsigned long arg)
{
switch(cmd)
{
unsigned tmp;
case 0:
case 1:
if(arg>4)
{
return-EINVAL;
}
tmp=readl(S3C64XX_GPKDAT);
什么意思? tmp&=~(1<<(4+arg));
什么意思? tmp|=((!cmd)<<(4+arg));
什么意思? writel(tmp,S3C64XX_GPKDAT);
什么意思? //printk(DEVICE_NAME":%d%d\n",arg,cmd);
return 0;
default:
return-EINVAL;
}
}
不胜感激
[ 此帖被besthgt在2010-08-27 10:25重新编辑 ]