免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 807 | 回复: 0
打印 上一主题 下一主题

2_3_3___pipe.h [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-05-08 21:02 |只看该作者 |倒序浏览

                2_3_3___pipe.h
#ifndef __PIPE_H__
#define __PIPE_H__
#ifdef PIPE_DEBUG
#define DPRINTK(fmt, args...)     { printk(KERN_DEBUG "%s(%d): " fmt, __FUNCTION__ , __LINE__, ## args);  }
#else
#define DPRINTK(fmt, args...)
#endif
#define PIPE_NR_DEVS            2
#define DATA_BUFF_SIZE          4000
struct data_buff{
        
        spinlock_t              lock;   /* lock to use this struct */
        
        wait_queue_head_t       inQ;    /* write queue */
        u8                      inF;    /* write flag */
        
        wait_queue_head_t       outQ;   /* read queue */
        u8                      outF;   /* read flag */
        
        size_t                  in;     /* total size for write */
        size_t                  out;    /* total size for read */
        
        char                    data[ DATA_BUFF_SIZE ]; /* data buff */
};
struct pipe_chrdev{
        int                     index;  /* minor id */
        spinlock_t              olock;  /* lock for open() */
        int                     ocnt;   /* open count */
        struct data_buff        buff;   /* data buff */
        struct data_buff        *rb;    /* pointer to read buff */
        struct data_buff        *wb;    /* pointer to write buff */
        struct cdev             *cdev;  /* pointer to char device */
};
#endif
               
               
返回目录


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/68424/showart_681420.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP