现在的位置: 首页 > 综合 > 正文

linux-3.6.38内核关于/proc挂载例子

2012年10月03日 ⁄ 综合 ⁄ 共 457字 ⁄ 字号 评论关闭

内核源代码位置:

linux-3.6.38/drivers/tty/serial/samsung.c

+1550

#if defined(RS485_PORT3) || defined(RS485_PORT2)
static struct proc_dir_entry *gpn12_inode = NULL;
static char msg[10];

static int write_gpn12(struct file *file, const char __user *buffer, unsigned long count, void *data)
{
    int status = 0;

    if (copy_from_user((void *)msg, (const void __user *)buffer, count))
        return -EFAULT;

    status = simple_strtoul(msg, NULL, 0);

    gpio_direction_output(S3C64XX_GPN(12), status);

    return count;
}
#endif

抱歉!评论已关闭.