/* <cshdef.h>
 *
 *	Class scheduler definitions.
 */
#ifndef _CSHDEF_H
#define _CSHDEF_H

/* $SCHED function codes */
#define CSH$_READ_ALL	23	/* read data on all processes */
#define CSH$_READ_NEW	24	/* read data on new processes */
#define CSH$_SET_CLASS	25	/* place process(es) into class(es) */
#define CSH$_RES1	26
#define CSH$_RES2	27
#define CSH$_RES3	28
#define CSH$_RES4	29
#define CSH$_SET_NEW	30	/* define this process as "new" */
#define CSH$_SET_TIMEOUT 31	/* set deadman timer */
#define CSH$_RES5	32
#define CSH$_RES6	33
#define CSH$_RES7	34
#define CSH$_RES8	35
#define CSH$_READ_QUANT 36	/* read per-class quanta remaining */
#define CSH$_SET_QUANT	37	/* define per-class quanta */
#define CSH$_RES9	38
#define CSH$_RESA	39
#define CSH$_RESB	40
#define CSH$_RESC	41
#define CSH$_SET_ATTN_AST 42	/* establish attention AST */
#define CSH$_RSED	43
#define CSH$_RESE	44
#define CSH$_RESF	45
#define CSH$_RES0	46
#define CSH$_CLEAR_ATTN_AST 47	/* clear attention AST */
#define CSH$_MAX_SCHED_FUNC 48

/* AST reason mask */
#define CSH$V_NEW_PROC	1	/* possible new process */
#define CSH$M_NEW_PROC	(1<<CSH$V_NEW_PROC)	/* 0x02 */

/* CSHC -- Class ScHeduler Class block */
/* Used to communicate from user to system, defining process/class mapping */
#define CSHC$K_LENGTH	8
#define CSHC$C_LENGTH	8
struct cshcdef {
    unsigned long cshc$l_epid;		/* EPID of target process */
    short cshc$w_class;			/* class number, 0-N, %X'FFFF' means */
					/* `take out of class scheduling' */
    unsigned short cshc$w_windfall;	/* windfall ticks to grant */
};

/* CSHP -- Class ScHeduler data block for Processes */
/* Used to communicate from system to user, showing various characteristics
   of processes. */
#define CSHP$K_LENGTH	24
#define CSHP$C_LENGTH	24
struct cshpdef {
    unsigned long cshp$l_status;	/* copy of PCB$L_STS */
    unsigned short cshp$w_pix;		/* process index slot */
    char cshp$b_pri;			/* current priority (internal) */
    char cshp$b_prib;			/* current base priority (internal) */
    unsigned long cshp$l_epid;		/* the official PID */
    char cshp$t_account[8];		/* account string from PCB */
    unsigned long cshp$l_cputim;	/* CPU time charged */
};

#endif	/*_CSHDEF_H*/
