# ifndef NO_WHAT
/*
 *      SCCS file type - Emulator Include File
 *
 *      What identification string:
 */
static char *_S_Kercalls = "@(#)EM_KERcalls.h	3.4";
# endif

/*
COPYRIGHT:  1979, by Ford Aerospace and Communications Corp.
ADDRESS:    Ford Aerospace and Communications Corp.
            Western Development Laboratories
            3939 Fabian Way
            Palo Alto, California 94303
            Attention: Software Technology Dept.
            Mail Stop: V02 

CPCI:   Emulator

TAG:    EKL
MODULE NAME:  

		Kernel Interface Linkage Include file.

REFERENCES-
  A Specs:  ???
  B5 Specs:  ???

HISTORY:
  AUTHOR: Dan Ladermann, modified from Modula version by L.C.Dion, R.B.Neely.
  VERSION:  3.4 of 12/12/82
  MODULE TYPE: M4 include file with C types.

PRIVILEGES:  None
SPECIAL NOTES:  None

*/


/*
 *      CONSTANTS
 */

translate( msg_limit, 11)          /* top index for bytes in a message     */

translate(FALSE, 0)             /* boolean values */
translate(TRUE, -1)             /* 0377 as used in Kernel */


/* bits for discretionary access  */

	translate( ownerRead,     0400)
	translate( ownerWrite,    0200)
	translate( ownerExecute,  0100)
	translate( groupRead,      040)
	translate( groupWrite,     020)
	translate( groupExecute,   010)
	translate( allRead,         04)
	translate( allWrite,        02)
	translate( allExecute,      01)

/* bits for discretionary access  for acc modes */

	translate( ACC_mode_Read,     0400)
	translate( ACC_mode_Write,    0200)
	translate( ACC_mode_Execute,  0100)


/* K_remap status selectors */

	translate( remap_inLoc,     01)
	translate( remap_inAcc,     02)
	translate( remap_outSize,   04)

/* K_set_segment_status selectors */

	translate(segset_mem_lock,      01)
	translate(segset_mem_advise,    02)
	translate(segset_swap_lock,     04)
	translate(segset_sharable,     010)
	translate(segset_stat_acc,     020)
	translate(segset_stat_loc,     040)

/* K_(set)(get)_process_status selectors */

	translate( pstat_family,    01)            /* privileged to set    */
	translate( pstat_owner,     02)            /* privileged to set    */
	translate( pstat_group,     04)            /* privileged to set    */
	translate( pstat_aprio,    010)            /* owner to set         */
	translate( pstat_pseint,   020)            /* owner to set         */
	translate( pstat_ps,       040)            /* self only to set     */
	translate( pstat_alarm,   0100)            /* owner to set         */
	translate( pstat_tt,      0200)            /* owner to set         */
	translate( pstat_clock,   0400)            /* set time_of_day_clock*/

/* K_set_object_level selectors */

	translate( setol_acclev,    01)            /* set access_level     */
	translate( setol_owner,     02)            /* set effective owner  */
	translate( setol_group,     04)            /* set effective group  */
	translate( setol_da,       010)            /* set discr_access     */
	translate( setol_priv,     020)            /* set privileges       */


/*
 *      TYPES
 *
 *
 *      Each type declaration has two comments associated with it.
 *
 *      1. a short description as to what the type is used for
 *
 *      2. the size of the type ( in bytes of data space )
 *
 *      3. where m4 translates have been used for typedefs there is also
 *         and addition comment -typedef-
 */


translate(bits32,long)     /* typedef */ /* 32-bit bits */
				      /* 4 bytes */

translate(cardinal32,long) /* typedef */ /* 32-bit cardinal */
				      /* 4 bytes */

translate(cardinal,unsigned int) /* typedef */ /* 32-bit cardinal */
				      /* 2 bytes */

translate(selector,int)    /* typedef */ /* status selector */
				      /* 2 bytes */

translate(boolean,char)    /* typedef */ /* TRUE or FALSE */
				      /* 1 byte */

translate(Boolean,char)    /* typedef */ /* TRUE or FALSE */
				      /* 1 byte */




/*
 *      nsp_type  - name space partition
 */

	translate(nsp_type,char)	/* 1 byte */


	/*
	 *      The file_nsp has been removed. If cardinal( seid.nsp )
	 *              is greater than 127, then the namespace signifies
	 *              the file namespace (by definition).
	 */


	translate( null_nsp,      0)   /* null                 */
	translate( extent_nsp,   01)   /* EXTENTS              */
	translate( terminal_nsp, 02)   /* TERMINALS            */
	translate( device_nsp,   03)   /* DEVICES              */
	translate( process_nsp,  04)   /* PROCESSES            */
	translate( segment_nsp,  05)   /* SEGMENTS             */
	translate( subtype_nsp,  06)   /* SUBTYPES             */
	translate( kernel_nsp,   07)   /* Kernel gen. messages */
	translate( same_nsp,   0200)   /* UNIX directories     */
	translate( root_nsp,   0201)   /* ROOT directory nsp   */
	translate( low_file_nsp, 0201)  /* mounted file systme  */
	translate( hign_file_nsp,0377)  /* mounted file system  */

/*
 *       seid   -     SEID
 */

	translate(seid,long)	/* 4 bytes */
	translate(SEID,long)	/* 4 bytes */

	struct  {
		nsp_type  nsp;          /* name space   */
		char      uniq_id0;     /* unique ID    */
		int       uniq_id1;     /* unique ID    */
	};

	/*
	 *      Seids can be move, compared for
	 *      equality and passed as longs. But
	 *      should be accessed using the
	 *      above structure and the following
	 *      macro(s).
	 */

	/* usage namespace(seid)- returns the name space portion of the seid */
	/* where seid is a long.                                             */

	define( namespace, ((int)($1.nsp) & 0377) )

translate(asyncId,int)  /* ID for asynchronous I/O */
			/* 2 bytes */

/*
 *      acc_mode        Access Modes
 */

	translate(acc_mode,int) /* access mode bit mask */
				/* 2 bytes */


/*
 *      compartments
 */
	translate( SYSTEM,                01L)
	translate( compart_1,             02L)
	translate( compart_2,             04L)
	translate( compart_3,            010L)
	translate( compart_4,            020L)
	translate( compart_5,            040L)
	translate( compart_6,           0100L)
	translate( compart_7,           0200L)
	translate( compart_8,           0400L)
	translate( compart_9,          01000L)
	translate( compart_10,         02000L)
	translate( compart_11,         04000L)
	translate( compart_12,        010000L)
	translate( compart_13,        020000L)
	translate( compart_14,        040000L)
	translate( compart_15,       0100000L)
	translate( compart_16,       0200000L)
	translate( compart_17,       0400000L)
	translate( compart_18,      01000000L)
	translate( compart_19,      02000000L)
	translate( compart_20,      04000000L)
	translate( compart_21,     010000000L)
	translate( compart_22,     020000000L)
	translate( compart_23,     040000000L)
	translate( compart_24,    0100000000L)
	translate( compart_25,    0200000000L)
	translate( compart_26,    0400000000L)
	translate( compart_27,   01000000000L)
	translate( compart_28,   02000000000L)
	translate( compart_29,   04000000000L)
	translate( compart_30,  010000000000L)
	translate( compart_31,  020000000000L)

	translate( compart_set, bits32)   /* typedef */
				       /* 4 bytes */

/*
 *      direction       = (up,down)     (* segment growth direction     *)
 */
	translate( direction, boolean) /* typedef */
				       /* 1 byte   */
	translate( up, FALSE)
	translate( down, TRUE)

/*
 *      discr_access - Discretionary access
 */

	translate( discr_access, int)  /* typedef */
				    /* 2 bytes */

/*
 *      domain_type  -  domains
 */

	translate( domain_type, char)      /* typedef */
					/* 1 byte */

	translate( null_domain,            0)       /* domains */
	translate( kernel_domain,         01)
	translate( supervisor_domain,     02)
	translate( user_domain,           03)

translate( fBlockNumber, long)   /* typedef */   /* block number in files */
			/* 4 bytes */

/*
 *       file_stat_block = RECORD               file status
 */                       /* 14 bytes */

	translate( file_stat_block,fStatBl)
	translate( time_last_mod,TLstMod)
	translate( open_at_crash,OpenACr)

	typedef struct  {
			cardinal32    f_size;           /* file size    */
			seid          subtype;          /* file subtype */
			cardinal32    time_last_mod;    /* time of last mod */
			boolean       open_at_crash;    /* if open at crash */
		} file_stat_block;

/*
 *      integrity categories
 */

	translate( integrity_cat_type,char)  /*typedef */
					  /* 1 byte */

	translate( integrity_cat_0,             00)
	translate( integrity_cat_1,             01)
	translate( integrity_cat_2,             02)
	translate( integrity_cat_3,             03)
	translate( integrity_cat_4,             04)
	translate( integrity_cat_5,             05)
	translate( integrity_cat_6,             06)
	translate( integrity_cat_7,             07)
	translate( integrity_cat_8,            010)
	translate( integrity_cat_9,            011)
	translate( integrity_cat_10,           012)
	translate( integrity_cat_11,           013)
	translate( integrity_cat_12,           014)
	translate( integrity_cat_13,           015)
	translate( integrity_cat_14,           016)
	translate( integrity_cat_15,           017)

/*
 *      ioFunction - device functions
 */

	translate( ioFunction, char)  /* typedef */
				   /* 1 byte */
	translate( READ,               00)
	translate( WRITE,              01)
	translate( SETEOMCHARS,        02)
	translate( REWIND,             03)
	translate( UNLOAD,             04)
	translate( WRITEMARK,          05)
	translate( SETDENSITY,         06)
	translate( SETTERMMODES1,      07)
	translate( SETTERMMODES2,     010)
	translate( GETTERMMODES,      011)
	translate( SETFILESIZE,       012)
	translate( ERASEFILE,         013)
	translate( VOLUMEVALID,       014)
	translate( VOLUMEINVALID,     015)
	translate( INPUTWAIT,         016)
	translate( SETPATH,           017)

/*
 *      definitions for devices.
 */

	translate( break_on_all_characters,             01 )
	translate( suppress_echo,                       02 )
	translate( suppress_echo_of_break_character,    04 )


/*
 *      msg_struct       = message portion of IPC
 */
	translate( msg_struct, msgStr)

	typedef char    msg_struct[msg_limit + 1];     /* message */
				/* 12 bytes */

/*
 *      ipc_block       = RECORD    -  IPC message
 */

	translate(ipc_block,ipcBlk)
	translate(ipc_seid,ipcSeid)

	typedef struct  {       /* 16 bytes */
			seid            ipc_seid;       /* SEID of sender */
			msg_struct      ipc_msg;        /* message data   */
		}ipc_block;

/*
 *      K_err_num -        Kernel error values
 */

	translate( K_err_num, int )        /* typedef */
					/* 2 byte */
	translate(tempx,0)   /* temp variable used for filling out err_nums */
	define(incv,`define(`$1',incr($1))' `$1')
	translate( XOK,                    tempx)
	translate( XfcaBadBlockNo,         incv(`tempx'))
	translate( XfcaBadDa,              incv(`tempx'))
	translate( XfcaBadDa1,             incv(`tempx'))
	translate( XfcaBadDa2,             incv(`tempx'))
	translate( XfcaBadDevice,          incv(`tempx'))
	translate( XfcaBadNsp,             incv(`tempx'))
	translate( XfcaBadOd,              incv(`tempx'))
	translate( XfcaBadPriv,            incv(`tempx'))
	translate( XfcaBadRefCount,        incv(`tempx'))
	translate( XfcaBadRequest,         incv(`tempx'))
	translate( XfcaBadSize,            incv(`tempx'))
	translate( XfcaBadStCap,           incv(`tempx'))
	translate( XfcaBadSubtype,         incv(`tempx'))
	translate( XfcaBadSubtypeMatch,    incv(`tempx'))
	translate( XfcaBadType,            incv(`tempx'))
	translate( XfcaBadpriv,            incv(`tempx'))
	translate( XfcaChangeLink,         incv(`tempx'))
	translate( XfcaCritExcl,           incv(`tempx'))
	translate( XfcaDapViol,            incv(`tempx'))
	translate( XfcaDevNotWritable,     incv(`tempx'))
	translate( XfcaDevOpen,            incv(`tempx'))
	translate( XfcaEndOfFile,          incv(`tempx'))
	translate( XfcaFileOpen,           incv(`tempx'))
	translate( XfcaInUse,              incv(`tempx'))
	translate( XfcaNoDev,              incv(`tempx'))
	translate( XfcaNoDevice,           incv(`tempx'))
	translate( XfcaNoExclDA,           incv(`tempx'))
	translate( XfcaNoExtent,           incv(`tempx'))
	translate( XfcaNoFile,             incv(`tempx'))
	translate( XfcaNoFile1,            incv(`tempx'))
	translate( XfcaNoFile2,            incv(`tempx'))
	translate( XfcaNoLeaf,             incv(`tempx'))
	translate( XfcaNoOwner,            incv(`tempx'))
	translate( XfcaNoPriv,             incv(`tempx'))
	translate( XfcaNoStCap,            incv(`tempx'))
	translate( XfcaNoWriteDa,          incv(`tempx'))
	translate( XfcaNotFile,            incv(`tempx'))
	translate( XfcaNotReadable,        incv(`tempx'))
	translate( XfcaNotTerminal,        incv(`tempx'))
	translate( XfcaNotThere,           incv(`tempx'))
	translate( XfcaNotWritable,        incv(`tempx'))
	translate( XfcaOdSpace,            incv(`tempx'))
	translate( XfcaOpenFiles,          incv(`tempx'))
	translate( XfcaOverflow,           incv(`tempx'))
	translate( XfcaReadOnly,           incv(`tempx'))
	translate( XfcaSTNotWritable,      incv(`tempx'))
	translate( XfcaTermLocked,         incv(`tempx'))
	translate( XfmiExclusiveFile,      incv(`tempx'))
	translate( XlevFilEx,              incv(`tempx'))
	translate( XlevSegEx,              incv(`tempx'))
	translate( XnoSeg,                 incv(`tempx'))
	translate( XproBadSlot,            incv(`tempx'))
	translate( XproIpcOverflow,        incv(`tempx'))
	translate( XproNoAccess,           incv(`tempx'))
	translate( XproNoPriv,             incv(`tempx'))
	translate( XproNoProcess,          incv(`tempx'))
	translate( XproNoReceiver,         incv(`tempx'))
	translate( XproNoRelease,          incv(`tempx'))
	translate( XproTooManyProcesses,   incv(`tempx'))
	translate( XproUninterruptable,    incv(`tempx'))
	translate( XpvmArgNotWritable,     incv(`tempx'))
	translate( XpvmArgOverflow,        incv(`tempx'))
	translate( XpvmArgSharable,        incv(`tempx'))
	translate( XpvmBadDa,              incv(`tempx'))
	translate( XpvmBadGrowth,          incv(`tempx'))
	translate( XpvmBadSeg,             incv(`tempx'))
	translate( XpvmDupSeg,             incv(`tempx'))
	translate( XpvmExecute,            incv(`tempx'))
	translate( XpvmImmOverflow,        incv(`tempx'))
	translate( XpvmNoArg,              incv(`tempx'))
	translate( XpvmNoDa,               incv(`tempx'))
	translate( XpvmNoDes,              incv(`tempx'))
	translate( XpvmNoHole,             incv(`tempx'))
	translate( XpvmNoSeg,              incv(`tempx'))
	translate( XpvmNoStick,            incv(`tempx'))
	translate( XpvmNoSuchSeg,          incv(`tempx'))
	translate( XpvmNoSwap,             incv(`tempx'))
	translate( XpvmNotReadable,        incv(`tempx'))
	translate( XpvmNotWritable,        incv(`tempx'))
	translate( XpvmRemap1,             incv(`tempx'))
	translate( XpvmRemap2,             incv(`tempx'))
	translate( XpvmSharable,           incv(`tempx'))
	translate( XpvmSpace,              incv(`tempx'))
	translate( XpvmVecTooLong,         incv(`tempx'))
	translate( XpvmWriteOnly,          incv(`tempx'))
	translate( XsegBadMode,            incv(`tempx'))
	translate( XsegBadName,            incv(`tempx'))
	translate( XsegBadSize,            incv(`tempx'))
	translate( XsegNotHeld,            incv(`tempx'))
	translate( XsegNotNull,            incv(`tempx'))
	translate( XsegSticky,             incv(`tempx'))
	translate( XsegSwappable,          incv(`tempx'))
	translate( XsylTooHigh,            incv(`tempx'))
	translate( XtiiNoObj,              incv(`tempx'))
	translate( XtiiNoSetPriv,          incv(`tempx'))

/*
 *      ioStatus - I/O status of operation
 */

	translate( ioStatus, long)    /* typedef */
				   /* 4 bytes */
	translate(devIndep,devIdep)
	struct  {                     /* structure for accessing ioStatus */
		K_err_num       devIndep;     /* independent part */
		int             devDep  ;     /* dependent part   */
	};

/*
 *      ioc_block - struct of I/O completion message
 */

	typedef struct {
		seid            ioc_seid;
		char            ioc_type;
		char            ioc_x1;
		ioStatus        ioc_stat;
		unsigned int    ioc_bytes;
		asyncId         ioc_async;
		char            ioc_x2[2];
	} ioc_block;

/*
 *      mem_type - memory space divisions
 */

	translate( mem_type,char)  /* typedef */   /* memory space divisions */
				/* 1 byte  */
	translate(null_space, 0)
	translate(d_space,    1)
	translate(i_space,    2)

translate( openDescriptor, int)      /* typedef */  /* open file handle */
				  /* 2 bytes */
/*
 *     KopenModes - open modes
 */

	/* open modes as used by Kernel
	 *      openModes = RECORD
	 *                (* 4 bytes *)
	 *                        read            : boolean;
	 *                        write           : boolean;
	 *                        exclusive_read  : boolean;
	 *                        exclusive_write : boolean
	 *                  END;
	 */
	translate(KopenModes, long)         /* typedef */

	/* structure for geting at  KopenModes */
	struct {
		char    KomRead;
		char    KomWrite;
		char    KomEread;
		char    KomEwrite;
	};


	/* open  modes used by the emulator - packed in char  */

	translate(open_mode, char)         /* typedef */

	translate( om_read,   01)      /* bit masks for open Modes */
	translate( om_write,  02)
	translate( om_exclusive_read, 04)
	translate( om_exclusive_write, 010)

	/*
	 * m4 macro used for converting packed character of open modes
	 * into two arguments of kernel open mode type.  Used in Kernel calls
	 */

	define( unpack_om,  ($1&om_read)|(($1&om_write)<<7)  `,'
		 (($1&om_exclusive_read)>>2)|(($1&om_exclusive_write)<<5)
	       )
/*
 * virt_addr, virt_loc - virtual address and location
 */

	translate( virt_addr,int)  /* virtual address */
				/* 2 bytes */

	translate( virt_loc,long)  /* virtual location */
				/* 4 bytes */

	/* structure definition used for accessing virt_loc */
	struct  {
		domain_type     domain;         /* char */
		mem_type        space;          /* char */
		virt_addr       address;        /* int  */
	};

	/* macros for getting domain and space from long that handles sign extention*/
	define(get_domain, ((int)($1.domain) & 0377) )
	define(get_space,  ((int)($1.space)  & 0377) )

/*
 *      p_block - parameter block
 */


	typedef struct {        /* parameter block */
				/* 6 bytes */
			virt_loc        location;       /* block address   */
			int             b_size  ;       /* block size      */
		}  p_block;

/*
 *      priv_names - privileges
 */

	translate( priv_struct, bits32)  /* typedef */     /* set of privileges */
				      /* 4 bytes */

	translate( privFileUpdateStatus,               01L)   /* names of privileges */
	translate( privLink,                           02L)
	translate( privLockSeg,                        04L)
	translate( privModifyPriv,                    010L)
	translate( privMount,                         020L)
	translate( privSetLevel,                      040L)
	translate( privStickySeg,                    0100L)
	translate( privSetPath,                      0200L)
	translate( privViolSimpSecurity,             0400L)
	translate( privViolStarSecurity,            01000L)
	translate( privViolSimpIntegrity,           02000L)
	translate( privViolStarIntegrity,           04000L)
	translate( privViolDiscrAccess,            010000L)
	translate( privRealizeExecPermission,      020000L)
	translate( privSignal,                     040000L)
	translate( privWalkPTable,                0100000L)
	translate( privHalt,                      0200000L)
	translate( privKernelCall,                0400000L)
	translate( privViolCompartments,         01000000L)
	translate( privSetComm,                  02000000L)
	translate( privImmigrate,                04000000L)

/*
 *      proc_stat_block - process status block
 */

	translate( proc_stat_block,PstatBl)

	typedef struct  {                       /* process status block     */
					/* 32 bytes */
			seid            own;    /* own seid -- read-only    */
			seid            parent; /* parent seid -- read-only */
			int             family; /* process family name      */

			int             owner;  /* real owner id --read-only*/
			int             group;  /* real group id --read-only*/

			int             aprio;  /* advisory priority        */
			int             pseint; /* pseudo-interrupt level   */
			int             ps;     /* processor status         */

			int             alarm;  /* real-time timer alarm    */
			cardinal32      clock;  /* time of day clock        */
			boolean         tt;     /* timer toggle enable      */

			int             stiming;/* supv timings - read-only */
			int             utiming;/* user timings - read-only */
		} proc_stat_block;

/*
 *      pseudo_int_levels  - pseudo interrupt levels
 */

	translate(PI_ADDRESS, 32)  /* starting address of pseduo int vectors */

	translate( pseudo_int_levels,int)   /* typedef */
					  /* 2 byte */
	translate(base_lev,    0)   /* emulator */
	translate(ipc_lev,     1)   /* IPC      */
	translate(time_lev,    2)   /* timer    */
	translate(sig_lev,     3)   /* K_signal */
	translate(io_lev,      4)   /* I/O      */
	translate(hard_lev,    5)   /* hardware */

/*
 *      pseudo_int_vector    -- pseudo-interrupt vector
 */
	translate(pseudo_int_vector,PIvec)
	translate(interrupted_pc,intPc)
	translate(interrupted_ps,intPs)
	translate(interrupted_p_level,intPlev)

	typedef struct  {
				/* 26 bytes */
			int             interrupted_pc;
			int             interrupted_ps;
			int             interrupted_p_level;
			ipc_block       int_msg;
			int             new_pc;
			int             new_ps;
		} pseudo_int_vector;


	translate(pseudo_int_vectors,PIvecs)

	typedef pseudo_int_vector pseudo_int_vectors[hard_lev + 1] ;


/*
 *      security_cat_type - security categories
 */

	translate( security_cat_type,char)  /*typedef */
					  /* 1 byte */

	translate( security_cat_0,             00)
	translate( security_cat_1,             01)
	translate( security_cat_2,             02)
	translate( security_cat_3,             03)
	translate( security_cat_4,             04)
	translate( security_cat_5,             05)
	translate( security_cat_6,             06)
	translate( security_cat_7,             07)
	translate( security_cat_8,            010)
	translate( security_cat_9,            011)
	translate( security_cat_10,           012)
	translate( security_cat_11,           013)
	translate( security_cat_12,           014)
	translate( security_cat_13,           015)
	translate( security_cat_14,           016)
	translate( security_cat_15,           017)

translate( seg_des,int)    /* typedef */           /* open segment handle */
			/* 2 bytes */

translate( seg_size,int)   /* typedef */           /* size of segments */
			/* 2 bytes */

/*
 *      seg_stat_block  -- segment status block
 */

	translate(seg_stat_block,segStBl)
	translate(mem_lock,memLock)
	translate(mem_advise,memAdv)
	translate(swap_lock,swapLk)
	translate(executable,execabl)
	translate(sharable,sharabl)
	translate(stat_size,statSiz)
	translate(stat_seid,statSed)
	translate(stat_des,statDes)
	translate(stat_mapped,statMap)
	translate(stat_acc,statAcc)
	translate(stat_loc,statLoc)

	/* entries marked K_build only can be set by K_build  */

	typedef struct {
				/* 22 bytes */
			boolean            mem_lock;       /* in mem       */
			boolean            mem_advise;     /* I/O          */
			boolean            swap_lock;      /* sticky       */
			boolean            sharable;       /* sharable     */
			direction          growth;         /* K_build only */
			seg_size           stat_size;      /* K_build only */
			seid               stat_seid;      /* read only    */
			seg_des            stat_des;       /* read only    */
			boolean            stat_mapped;    /* read only    */
			acc_mode           stat_acc;       /* K_build only */
			virt_loc           stat_loc;       /* K_build only */
		} seg_stat_block;


/*
 *      access_level_type
 */

	translate(access_level_type,accLevT)
	translate(security_category,secCat)
	translate(integrity_category,intgCat)
	translate(security_compart,secComp)

	typedef struct  {
					/* 6 bytes */
			security_cat_type              security_category;
			integrity_cat_type             integrity_category;
			compart_set                    security_compart;
		} access_level_type;

/*
 *      tii_struct
 */

	translate(tii_struct,tiiStru)
	translate(access_level,accLev)
	translate(tii_priv,tiiPriv)
	translate(tii_owner,tiiOwn)
	translate(tii_group,tiiGrp)

	typedef struct  {
				/* 16 bytes */
			access_level_type       access_level;
			int                     tii_owner;
			int                     tii_group;
			discr_access            da;
			priv_struct             tii_priv;
		} tii_struct;



/* CONST   Typed constants */

translate( null_open_descriptor, -1)

translate( null_seg_des, -1)

translate( null_seid, 0L)                  /* all zero's */

translate( null_acc_mode, 0L)              /* all false  */

translate( null_priv_struct, 0L)              /* all zero's */

translate( null_virt_loc, 0L)              /* null_domain, null_space, 0 */

/* null structures (from Modula) - no C mapping  */
/*
 *      null_p_block         = p_block( virt_loc( null_domain,
 *                                                null_space, 0 ), 0 );
 *
 *      null_tii_struct       = tii_struct(
 *                                  access_level_type(
 *                                      security_cat_0,
 *                                      integrity_cat_0,
 *                                      bits32( [], [] )
 *                                  ),
 *                                  0,0,[],bits32([],[])
 *                              );
 *      null_file_stat_block  = file_stat_block(
 *                                  cardinal32( 0, 0 ),
 *                                  seid( null_nsp, 0C, 0 ),
 *                                  cardinal32( 0, 0 ),
 *                                  false
 *                              );
 *      null_proc_stat_block  = proc_stat_block(
 *                                  seid( null_nsp, 0C, 0 ),
 *                                  seid( null_nsp, 0C, 0 ),
 *                                  0,0,0,0,0,0,
 *                                  0,cardinal32( 0, 0 ),false,
 *                                  0,0
 *                              );
 *      null_seg_stat_block   = seg_stat_block(
 *                                  false,false,false,false,up,
 *                                  0,
 *                                  acc_mode( false, false, false ),
 *                                  virt_loc( null_domain, null_space, 0 )
 *                              );
 */

/* long to short name mapping for Kernel calls */

translate( K_build_segment,          Kbldseg	)
translate( K_close,                  Kclose	)
translate( K_create,                 Kcreate	)
translate( K_device_function,        Kdevfun	)
translate( K_fork,                   Kfork	)
translate( K_get_file_status,        Kgetfs	)
translate( K_get_object_level,       Kgetol	)
translate( K_get_process_status,     Kgetps	)
translate( K_get_segment_status,     Kgetss	)
translate( K_halt,                   Khalt      )
translate( K_interrupt_return,       Kintret	)
translate( K_invoke,                 Kinvoke	)
translate( K_link,                   Klink	)
translate( K_mount,                  Kmount	)
translate( K_nap,                    Knap	)
translate( K_open,                   Kopen	)
translate( K_post,                   Kpost	)
translate( K_read_block,             Kread	)
translate( K_receive,                Kreceive	)
translate( K_release_process,        Krelproc	)
translate( K_release_segment,        Krelseg	)
translate( K_remap,                  Kremap	)
translate( K_rendezvous_segment,     Krndzvs	)
translate( K_secure_terminal_lock,   Ktrmlock	)
translate( K_set_file_status,        Ksetfs	)
translate( K_set_object_level,       Ksetol	)
translate( K_set_process_status,     Ksetps	)
translate( K_set_segment_status,     Ksetss	)
translate( K_signal,                 Ksignal	)
translate( K_spawn,                  Kspawn	)
translate( K_unlink,                 Kunlink	)
translate( K_unmount,                Kumount	)
translate( K_walk_process_table,     Kwkpctab	)
translate( K_write_block,            Kwrite	)
translate( K_set_pil,                Ksetpil    )
translate( K_set_da,                 Ksetda     )
translate( K_set_priv,               Ksetpriv   )
translate( K_set_real_id,            Ksetrid    )
/* K_boot not implemented in emulator interface */
translate( K_boot,                   Kboot      )
translate( K_lock,                   Klock      )
translate( K_unlock,                 Kunlock    )
