home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / evsyscall.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  8.9 KB  |  311 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_EVSYSCALL_H
  11. #define _SYS_EVSYSCALL_H
  12.  
  13. #ident    "@(#)/usr/include/sys/evsyscall.h.sl 1.1 4.0 12/08/90 3486 AT&T-USL"
  14. /*            File Contents
  15. **            =============
  16. **
  17. **    This file contains the data concerned with the evsys system
  18. **    call.  This system call is the interface between user mode and
  19. **    the kernel.  The only other events system call is evtrapret for
  20. **    returning from event trap handlers.  Of course, since events
  21. **    are implemented as a VFS, lots of other system calls (open,
  22. **    close, etc.) also work on event queues.  Users are not expected
  23. **    to do invoked the evsys system call directly but rather to
  24. **    invoke the library routines such as evpost, evpoll, etc. which,
  25. **    in turn, do the system call.  For this reason, this header file
  26. **    is not intended to be included in user's programs.
  27. */
  28.  
  29.  
  30. /*            Required Header Files
  31. **            =====================
  32. **
  33. **    The following header files must be includes before including
  34. **    this file.
  35. **
  36. **        REQUIRES    sys/types.h
  37. **        REQUIRES    sys/signal.h
  38. **        REQUIRES    sys/evecb.h
  39. **        REQUIRES    sys/hrtcntl.h
  40. **        REQUIRES    sys/priocntl.h
  41. **        REQUIRES    sys/procset.h
  42. **        REQUIRES    sys/events.h
  43. */
  44.  
  45. /*            The evsys System Call
  46. **            =====================
  47. **
  48. **    The evsys system call is used to obtain a direct entry into
  49. **    the events code without going through the VFS interface.  This
  50. **    is necessary in some cases because no file descriptor is
  51. **    required with certain events function calls (e.g., evcntl).
  52. **    Without a file descriptor referring to an event queue (file),
  53. **    it is impossible to go through the VFS mechanism.  We always
  54. **    use evsys rather than an existing system call such as ioctl
  55. **    so that we always get into the events code, even for errors.
  56. **    This enables us to give more specific error messages for some
  57. **    cases.  In addition, extension of events to work over RFS will
  58. **    require that the ioctl interface not be used.
  59. **    The following is the list of functions which are implemented
  60. **    through the evsys interface.  The comment with each command
  61. **    indicates the value of the variable third argument to the
  62. **    function.  This argument appears in the evsa_arg member of the
  63. **    evsys_args_t structure defined at the end of this file.
  64. */
  65.  
  66. typedef enum evscmds {
  67.  
  68.     EVS_EVPOST,    /* An evpost function.            */
  69.             /* evsa_arg = (evsys_post_t *).        */
  70.     EVS_EVPOLL,    /* An evpoll function.            */
  71.             /* evsa_arg = (evsys_poll_t *).        */
  72.     EVS_EVPOLLMORE,    /* An evpollmore function.        */
  73.             /* evsa_arg = (evsys_pollmore_t *).    */
  74.     EVS_EVTRAP,    /* An evtrap function.            */
  75.             /* evsa_arg = (evsys_trap_t *).        */
  76.     EVS_EVTRAPCAN,    /* An evtrapcancel function.        */
  77.             /* evsa_arg = (evsys_trapcancel_t *).    */
  78.     EVS_EVCNTL,    /* An evcntl function.            */
  79.             /* evsa_arg = (evsys_cntl_t *).        */
  80.     EVS_EVQCNTL,    /* An evqcntl function.            */
  81.             /* evsa_arg = (evsys_qcntl_t *).    */
  82.     EVS_EVEXIT,    /* An evexit with eqid = EQ_NOQUEUE.    */
  83.             /* evsa_arg = (evsys_exit_t *).        */
  84.     EVS_EVSIG    /* An evsig with eqid = EQ_NOQUEUE.    */
  85.             /* evsa_arg = (evsys_sig_t *).        */
  86. } evscmds_t;
  87.  
  88. /*            The evsys System Call (Continued)
  89. **            =================================
  90. **
  91. **    The following structure describes the arguments to the evsys
  92. **    system call.
  93. **
  94. **    The field evsa_ver below should really be type evver_t.
  95. **    However, this type is a short and the following structure
  96. **    describes arguments to a system call which, like all function
  97. **    arguments, are passed as int's.
  98. */
  99.  
  100. typedef struct evsys_args {
  101.     evscmds_t    evsa_cmd;    /* One of the EVS_XXXX    */
  102.                     /* commands listed    */
  103.                     /* above.        */
  104.     int        evsa_ver;    /* A version number    */
  105.                     /* like EV_VERSION.    */
  106.     _VOID        *evsa_arg;    /* The actual argument.    */
  107.                     /* A pointer to one of    */
  108.                     /* the structures    */
  109.                     /* defined below.    */
  110. } evsys_args_t;
  111.  
  112. /*            The evpost Interface
  113. **            ====================
  114. **
  115. **    The following structure is pointed to by "arg" on the evsys
  116. **    system call for an evpost function.
  117. */
  118.  
  119. typedef struct evsys_post {
  120.     event_t    *evs_post_elp;        /* Pointer to array of    */
  121.                     /* event structures to    */
  122.                     /* post.        */
  123.     int    evs_post_els;        /* Nbr of structures in    */
  124.                     /* list.        */
  125.     int    evs_post_flags;        /* Flags passed with    */
  126.                     /* evpost.        */
  127. } evsys_post_t;
  128.  
  129. /*            The evpoll Interface
  130. **            ====================
  131. **
  132. **    The following structure is pointed to by "arg" on the evsys
  133. **    system call for an evpoll function.
  134. */
  135.  
  136. typedef struct evsys_poll {
  137.     evpollcmds_t    evs_poll_cmd;    /* The poll cmd.  One    */
  138.                     /* of the EC_XXXX     */
  139.                     /* commands defined in    */
  140.                     /* events.h.        */
  141.     event_t        *evs_poll_elp;    /* Ptr to array of    */
  142.                     /* events to poll for.    */
  143.     int        evs_poll_els;    /* Nbr of events in the    */
  144.                     /* array.        */
  145.  
  146.     hrtime_t    *evs_poll_top;    /* Ptr to the hrtime_t    */
  147.                     /* structure giving the    */
  148.                     /* timeout for the poll    */
  149.                     /* or NULL (immediate    */
  150.                     /* return) or -1 (wait    */
  151.                     /* forever).        */
  152. } evsys_poll_t;
  153.  
  154. /*            The evpollmore Interface
  155. **            ========================
  156. **
  157. **    The following structure is pointed to by "arg" on the evsys
  158. **    system call for the evpollmore function.
  159. */
  160.  
  161. typedef struct evsys_pollmore {
  162.     event_t        *evs_pollmore_elp;
  163.                     /* Ptr to array of    */
  164.                     /* events to poll for.    */
  165.  
  166.     int        evs_pollmore_els;
  167.                     /* Nbr of events in the    */
  168.                     /* array.        */
  169. } evsys_pollmore_t;
  170.  
  171. /*            The evtrap Interface
  172. **            ====================
  173. **
  174. **    The following structure is pointed to by "arg" on the evsys
  175. **    system call for the evtrap function.
  176. */
  177.  
  178. typedef struct evsys_trap {
  179.     evpollcmds_t    evs_trap_cmd;    /* The trap cmd.  One    */
  180.                     /* of the EC_XXX     */
  181.                     /* commands defined in    */
  182.                     /* events.h        */
  183.     event_t        *evs_trap_elp;    /* Ptr to array of    */
  184.                     /* events to trap for.    */
  185.     int        evs_trap_els;    /* Nbr of events in the    */
  186.                     /* array.        */
  187.     long        evs_trap_tid;    /* The trap identifier.    */
  188.  
  189.     void        (*evs_trap_lfunc)();
  190.                     /* The library routine    */
  191.                     /* to call a user's     */
  192.                     /* trap handler.    */
  193.  
  194.     void        (*evs_trap_ufunc)();
  195.                     /* The user's trap    */
  196.                     /* handler to call.    */
  197.  
  198.     evta_t    *evs_trap_tap;    /* The optional trap    */
  199.                     /* argument.        */
  200. } evsys_trap_t;
  201.  
  202. /*            The evtrapcancel Interface
  203. **            ==========================
  204. **
  205. **    The following structure is pointed to by "arg" on the evsys
  206. **    system call for the evtrapcancel function.
  207. */
  208.  
  209. typedef struct evsys_trapcan {
  210.     long        *evs_trapcan_tidp;
  211.                     /* Ptr to the array of    */
  212.                     /* trap identifiers    */
  213.                     /* which are to be    */
  214.                     /* cancelled.        */
  215.     int        evs_trapcan_tids;
  216.                     /* Size of the array    */
  217.                     /* evs_trapcan_tidp.    */
  218. } evsys_trapcan_t;
  219.  
  220. /*            The evcntl Interface
  221. **            ====================
  222. **
  223. **    The following structure is pointed to by "arg" on the evsys
  224. **    system call for the evcntl function.
  225. */
  226.  
  227. typedef struct evsys_cntl {
  228.     evcntlcmds_t    evs_cntl_cmd;    /* The command argument.*/
  229.     long        evs_cntl_arg1;    /* First argument.    */
  230.     long        evs_cntl_arg2;    /* Second argument.    */
  231. } evsys_cntl_t;
  232.  
  233.  
  234.  
  235.  
  236.  
  237. /*            The evqcntl Interface
  238. **            =====================
  239. **
  240. **    The following structure is pointed to by "arg" on the evsys
  241. **    system call for the evqcntl function.
  242. */
  243.  
  244. typedef struct evsys_qcntl {
  245.     int        evs_qcntl_eqd;    /* The event queue    */
  246.                     /* descriptor (file    */
  247.                     /* descriptor) for the    */
  248.                     /* queue to access.    */
  249.     evqcntlcmds_t    evs_qcntl_cmd;    /* The value of "cmd"    */
  250.                     /* from the evqcntl    */
  251.                     /* call.  Will be one    */
  252.                     /* of EC_XXXX from    */
  253.                     /* events.h.        */
  254.     long        evs_qcntl_arg;    /* The value of "arg"    */
  255.                     /* from the evqcntl    */
  256.                     /* call.        */
  257. } evsys_qcntl_t;
  258.  
  259. /*            The evexit Interface
  260. **            ====================
  261. **
  262. **    The following structure is pointed to by "arg" on the evsys
  263. **    system call for the evexit function.
  264. */
  265.  
  266. typedef struct evsys_exit {
  267.     procset_t    *evs_exit_psp;    /* Ptr to the process    */
  268.                     /* set structure which    */
  269.                     /* defines the set of    */
  270.                     /* processes which are    */
  271.                     /* to be operated on.    */
  272.     hostid_t    evs_exit_hostid;/* The id of the host    */
  273.                     /* system to which the    */
  274.                     /* process set applies.    */
  275.  
  276.     ecb_t    *evs_exit_ecbp;    /* Ptr to the ecb for    */
  277.                     /* the event to be    */
  278.                     /* posted.        */
  279. } evsys_exit_t;
  280.  
  281.  
  282.  
  283.  
  284.  
  285. /*            The evsig Interface
  286. **            ===================
  287. **
  288. **    The following structure is pointed to by "arg" on the evsys
  289. **    system call for the evsig function.
  290. */
  291.  
  292. typedef struct evsys_sig {
  293.     sigset_t    *evs_sig_setp;    /* Ptr to the set of    */
  294.                     /* signals to which     */
  295.                     /* this call applies.    */
  296.  
  297.     ecb_t    *evs_sig_ecbp;        /* Ptr to the ecb for    */
  298.                     /* the event to be     */
  299.                     /* posted.        */
  300.     evsiginfo_t    *evs_sig_silp;    /* Ptr to list of    */
  301.                     /* structures to use     */
  302.                     /* for returning the    */
  303.                     /* old status of the    */
  304.                     /* signals.        */
  305.     int        evs_sig_sils;    /* Nbr of elements in    */
  306.                     /* the evs_sig_silp    */
  307.                     /* list.        */
  308. } evsys_sig_t;
  309.  
  310. #endif    /* _SYS_EVSYSCALL_H */
  311.