int sm_ioctl(struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg)
{
int ret;
switch(cmd)
{
case SM_IOC_SHAREMEM:
{
printk("<1>buf address is %d\n", (unsigned char *)arg);
sm_test_kiobuf(arg);
ret = SUCCESS;
}
break;
default:
ret = SUCCESS;
break;
}
return ret;
}
void sm_test_kiobuf(unsigned long userbuf)
{
//KernelBuff is a global viriable defined as
//unsigned char KernelBuff[12];
memcpy((unsigned char *)userbuf, KernelBuff, 12);
}
///////////////////////////////////////////////////////////////////////////////
The module and the application work fine. That means I can manipulate user space buffer
directory in my module's ioctl interface. And then why use KIOBUF interfaces?
What is wrong with my concepts?
Please give me advices.
Thanks
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/