Chinaunix首页 | 论坛 | 博客
  • 博客访问: 686716
  • 博文数量: 152
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1793
  • 用 户 组: 普通用户
  • 注册时间: 2013-09-12 12:26
个人简介

相信自己,只有不想做的,没有做不到的。

文章分类

全部博文(152)

文章存档

2021年(1)

2015年(2)

2014年(74)

2013年(75)

发布时间:2013-12-12 13:01:21

poll//8 poll的使用/定义.poll = globalfifo_poll,//结构体/*globalfifo设备结构体*/struct globalfifo_dev                               &nbs.........【阅读全文】

阅读(653) | 评论(0) | 转发(0)

发布时间:2013-12-12 13:00:34

//7简单睡眠机制//1.定义wait_queue_head_t readq;//初始化init_waitqueue_head(&readq);//等队列待被唤醒wait_event_interruptible(readq, flags != 0);//唤醒等待的队列wake_up_interruptible(&readq);......【阅读全文】

阅读(393) | 评论(0) | 转发(0)

发布时间:2013-12-12 12:59:36

//异步信号//1,定义struct fasync_struct *hello_fasync_struct;//2初始化.fasync = hello_fasync,//初始化信号处理static int hello_fasync (int fd, struct file *file, int on){ return fasync_helper(fd, file, on, &hello_fasync_struct);;}//3判断是否有信号被定义, 有这读操作被唤醒,KILL——FA.........【阅读全文】

阅读(331) | 评论(0) | 转发(0)

发布时间:2013-12-12 12:58:57

一,下半部机制task//不能有睡眠,可以响应中断,不接受调度,不能太长1,定义  struct tasklet_struct tlet;2,中断内初始化tasklet_schedule(&dev->tlet);3中断与执行函数想关联/* register the tasklet */ tasklet_init(&globalfifo_devp->tlet, jit_tasklet_fn, (unsigned long)globalfifo_de.........【阅读全文】

阅读(420) | 评论(0) | 转发(0)

发布时间:2013-12-12 12:57:34

//信号量1,定义struct semaphore sem;2,初始化sema_init(&sem,1);3,获得信号量,释放信号量static int hello_open (struct inode *inode, struct file *file){  if(down_trylock(&sem))  return -EBUSY; return 0;}static int hello_release (struct inode *inode, struct fi.........【阅读全文】

阅读(392) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册