home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / class.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  4.3 KB  |  129 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.  
  11.  
  12. #ifndef _SYS_CLASS_H
  13. #define _SYS_CLASS_H
  14.  
  15. #ident    "@(#)/usr/include/sys/class.h.sl 1.1 4.0 12/08/90 54718 AT&T-USL"
  16.  
  17.  
  18. /*
  19.  * NOTE: Developers making use of the scheduler class switch mechanism
  20.  * to develop scheduling class modules should be aware that the
  21.  * architecture is not frozen and the kernel interface for scheduling
  22.  * class modules may change in future releases of System V.  Support
  23.  * for the current interface is not guaranteed and class modules
  24.  * developed to this interface may require changes in order to work
  25.  * with future releases of the system.
  26.  */
  27.  
  28.  
  29. extern int    nclass;        /* number of configured scheduling classes */
  30. extern char    *initclass;    /* class of init process */
  31.  
  32. typedef struct class {
  33.     char    *cl_name;    /* class name */
  34.     void    (*cl_init)();    /* class specific initialization function */
  35.     struct classfuncs *cl_funcs;    /* pointer to classfuncs structure */
  36. } class_t;
  37.  
  38. extern struct class    class[];    /* the class table */
  39.  
  40. typedef struct classfuncs {
  41.     int        (*cl_admin)();
  42.     int        (*cl_enterclass)();
  43.     void        (*cl_exitclass)();
  44.     int        (*cl_fork)();
  45.     void        (*cl_forkret)();
  46.     int        (*cl_getclinfo)();
  47.     void        (*cl_getglobpri)();
  48.     void        (*cl_parmsget)();
  49.     int        (*cl_parmsin)();
  50.     int        (*cl_parmsout)();
  51.     int        (*cl_parmsset)();
  52.     void        (*cl_preempt)();
  53.     int        (*cl_proccmp)();
  54.     void        (*cl_setrun)();
  55.     void        (*cl_sleep)();
  56.     void        (*cl_stop)();
  57.     void        (*cl_swapin)();
  58.     void         (*cl_swapout)();
  59.     void        (*cl_tick)();
  60.     void        (*cl_trapret)();    /* Don't move without changing */
  61.                         /*  .set in ml/ttrap.s */
  62.     void        (*cl_wakeup)();
  63.     int        (*cl_filler[11])();
  64. } classfuncs_t;
  65.  
  66.  
  67. #define    CL_ADMIN(clp, uaddr, reqpcid, reqpcredp) \
  68. (*(clp)->cl_funcs->cl_admin)(uaddr, reqpcid, reqpcredp)
  69.  
  70. #define    CL_ENTERCLASS(clp, clparmsp, pp, pstatp, pprip, pflagp, pcredpp, clprocpp, reqpcid, reqpcredp) \
  71. (*(clp)->cl_funcs->cl_enterclass)\
  72.   (clparmsp, pp, pstatp, pprip, pflagp, pcredpp, clprocpp, reqpcid, reqpcredp)
  73.  
  74. #define    CL_EXITCLASS(pp, clprocp) (*(pp)->p_clfuncs->cl_exitclass)(clprocp)
  75.  
  76. #define CL_FORK(pp, pclprocp, cprocp, cpstatp, cpprip, cpflagp, cpcredpp, clprocpp) \
  77. (*(pp)->p_clfuncs->cl_fork)\
  78.   (pclprocp, cprocp, cpstatp, cpprip, cpflagp, cpcredpp, clprocpp)
  79.  
  80. #define    CL_FORKRET(cp, cclprocp, pclprocp) \
  81. (*(cp)->p_clfuncs->cl_forkret)(cclprocp, pclprocp)
  82.  
  83. #define    CL_GETCLINFO(clp, clinfop, reqpcid, reqpcredp) \
  84. (*(clp)->cl_funcs->cl_getclinfo)(clinfop, reqpcid, reqpcredp)
  85.  
  86. #define CL_GETGLOBPRI(clp, clparmsp, globprip) \
  87. (*(clp)->cl_funcs->cl_getglobpri)(clparmsp, globprip)
  88.  
  89. #define    CL_PARMSGET(pp, clprocp, clparmsp) \
  90.     (*(pp)->p_clfuncs->cl_parmsget)(clprocp, clparmsp)
  91.  
  92. #define CL_PARMSIN(clp, clparmsp, rqpcid, rqpcredp, tgpcid, tgpcredp, tgpclpp) \
  93. (*(clp)->cl_funcs->cl_parmsin)\
  94. (clparmsp, rqpcid, rqpcredp, tgpcid, tgpcredp, tgpclpp)
  95.  
  96. #define CL_PARMSOUT(clp, clparmsp, reqpcid, reqpcredp, targpcredp) \
  97. (*(clp)->cl_funcs->cl_parmsout)(clparmsp, reqpcid, reqpcredp, targpcredp)
  98.  
  99. #define    CL_PARMSSET(pp, clparmsp, clprocp, reqpcid, reqpcredp) \
  100.     (*(pp)->p_clfuncs->cl_parmsset)(clparmsp, clprocp, reqpcid, reqpcredp)
  101.  
  102. #define CL_PREEMPT(pp, clprocp) (*(pp)->p_clfuncs->cl_preempt)(clprocp)
  103.  
  104. #define CL_PROCCMP(pp, clproc1p, clproc2p) \
  105.     (*(pp)->p_clfuncs->cl_proccmp)(clproc1p, clproc2p)
  106.  
  107. #define CL_SETRUN(pp, clprocp) (*(pp)->p_clfuncs->cl_setrun)(clprocp)
  108.  
  109. #define CL_SLEEP(pp, clprocp, chan, disp) \
  110.     (*(pp)->p_clfuncs->cl_sleep)(clprocp, chan, disp)
  111.  
  112. #define CL_STOP(pp, clprocp, why, what) \
  113.     (*(pp)->p_clfuncs->cl_stop)(clprocp, why, what)
  114.  
  115. #define CL_SWAPIN(clp, fmem, procpp, runflagp) \
  116.     (*(clp)->cl_funcs->cl_swapin)(fmem, procpp, runflagp)
  117.  
  118. #define CL_SWAPOUT(clp, fmem, justloaded, procpp, unloadokp) \
  119.     (*(clp)->cl_funcs->cl_swapout)(freemem, justloaded, procpp, unloadokp)
  120.  
  121. #define CL_TICK(pp, clprocp) (*(pp)->p_clfuncs->cl_tick)(clprocp)
  122.  
  123. #define CL_TRAPRET(pp, clprocp) (*(pp)->p_clfuncs->cl_trapret)(clprocp)
  124.  
  125. #define CL_WAKEUP(pp, clprocp, preemptflg) \
  126.     (*(pp)->p_clfuncs->cl_wakeup) (clprocp, preemptflg)
  127.  
  128. #endif    /* _SYS_CLASS_H */
  129.