intermezzo_psdev.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
  2.  * vim:expandtab:shiftwidth=8:tabstop=8:
  3.  */
  4. #ifndef __PRESTO_PSDEV_H
  5. #define __PRESTO_PSDEV_H
  6. #define MAX_CHANNEL 16
  7. #define PROCNAME_SIZE 32
  8. #include <linux/locks.h>
  9. #include <linux/smp_lock.h>
  10. #include <linux/version.h>
  11. /* represents state of an instance reached with /dev/intermezzo */
  12. /* communication pending & processing queues */
  13. struct upc_channel {
  14.         unsigned int         uc_seq;
  15.         wait_queue_head_t    uc_waitq;    /* Lento wait queue */
  16.         struct list_head     uc_pending;
  17.         struct list_head     uc_processing;
  18.         spinlock_t            uc_lock;
  19.         int                  uc_pid;      /* Lento's pid */
  20.         int                  uc_hard;     /* allows signals during upcalls */
  21.         int                  uc_no_filter;
  22.         int                  uc_no_journal;
  23.         int                  uc_no_upcall;
  24.         int                  uc_timeout;  /* . sec: signals will dequeue upc */
  25.         long                 uc_errorval; /* for testing I/O failures */
  26.         struct list_head     uc_cache_list;
  27.         int                  uc_minor;
  28. };
  29. #define ISLENTO(minor) (current->pid == izo_channels[minor].uc_pid 
  30.                 || current->p_pptr->pid == izo_channels[minor].uc_pid 
  31.                 || current->p_pptr->p_pptr->pid == izo_channels[minor].uc_pid)
  32. extern struct upc_channel izo_channels[MAX_CHANNEL];
  33. /* message types between presto filesystem in kernel */
  34. #define REQ_READ   1
  35. #define REQ_WRITE  2
  36. #define REQ_ASYNC  4
  37. #define REQ_DEAD   8
  38. struct upc_req {
  39.         struct list_head   rq_chain;
  40.         caddr_t            rq_data;
  41.         int                rq_flags;
  42.         int                rq_bufsize;
  43.         int                rq_rep_size;
  44.         int                rq_opcode;  /* copied from data to save lookup */
  45.         int                rq_unique;
  46.         wait_queue_head_t  rq_sleep;   /* process' wait queue */
  47.         unsigned long      rq_posttime;
  48. };
  49. #endif