perm filename PROCES.DEF[CMU,AIL] blob sn#030566 filedate 1974-10-01 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	DEFAULT VARIABLES FOR SPROUT OPTIONS
C00008 ENDMK
C⊗;
COMMENT DEFAULT VARIABLES FOR SPROUT OPTIONS;
EXTERNAL INTEGER DEFSSS, COMMENT STRING STACK;
	DEFPSS,		COMMENT SYSTEM STACK;
	DEFPRI,		COMMENT PRIORITY;
	DEFQNT;		COMMENT QUANTUM;

COMMENT OPTIONS FOR SPROUT;
DEFINE QUANTUM(X)= "(X LSH 18)",
	STRINGSTACK(X)="(X LSH 14)",
	PSTACK(X)="(X LSH 8)",
	PRIORITY(X)="(X LSH 4)",
	SUSPHIM="'10",
	SUSPME="'2",
	RUNME="'1";

COMMENT OPTIONS FOR CAUSE;
DEFINE DONTSAVE="1",
   	TELLALL="2",
	RESCHEDULE="4";

COMMENT OPTIONS FOR INTERROGATE;
DEFINE RETAIN ="1",
	WAIT="2",
	SAY_WHICH="'10";
COMMENT RESULT CODES WHICH USER EVENT PROCEDURES MAY LIKE;
DEFINE	NOJOY='400000,
	MULTIN='200000;

DEFINE EVENT_TYPE="EVTYPI";

COMMENT PIECES OF AN EVENT TYPE DATUM;
DEFINE 	NOTCQ(ET)="MEMORY[DATUM(ET,INTEGER),LIST]",
 	WAITQ(ET)="MEMORY[DATUM(ET,INTEGER)+1,LIST]",
 	USER1(ET)="MEMORY[DATUM(ET,INTEGER)+4]",
 	USER2(ET)="MEMORY[DATUM(ET,INTEGER)+5]";


COMMENT OPTIONS FOR RESUME;
DEFINE	NOTNOW=1,
	READYME='4,
	KILLME='10,
	IRUN='14;

COMMENT STATUS CODES;
DEFINE RUNNING=-1,
	READY=1,
	SUSPENDED=0,
	TERMINATED=2;

COMMENT USEFUL MACROS FOR INTERRUPTS;

DEFINE INTSWW_INX=0,
	INTSWD_INX=1,
	INTSHW_INX=2,
	INTSHD_INX=3,
	INTTTY_INX=4,
	INTPTO_INX=5,
	INTMAIL_INX=6,
	INTPTI_INX=8,
	INTPAR_INX=9,
	INTCLK_INX=10,
	INTINR_INX=11,
	INTINS_INX=12,
	INTIMS_INX=13,
	INTINP_INX=14,
	INTTTI_INX=15,
	INTPOV_INX=19,
	INTILM_INX=22,
	INTNXM_INX=23,
	INTFOV_INX=29,
	INTOV_INX=32;



DEFINE AUTO_POLL(X)="REQUIRE X POLLING_INTERVAL";
DEFINE NO_AUTO_POLLING="AUTO_POLL(0)";
EXTERNAL INTEGER NOPOLL;
DEFINE POLLON="NOPOLL←0";
DEFINE POLLOFF="NOPOLL←1";

DEFINE SCHEDULE_ON_CLOCK_INTERRUPTS=
	"BEGIN
	INTMAP(INTCLK_INX,CLKMOD,0);
	ENABLE(INTCLK_INX);
	END";

DEFINE DEFERRED_CAUSE_ON_INTERRUPT(INX,TYP,NOT,OPT)=
	"INTMAP(INX,DFRINT,DFCPKT(0,TYP,NOT,OPT))";
COMMENT NOTE THAT THIS DOES NOT DO AN ENABLE;


COMMENT NOTE ALSO THAT YOU SHOULD DO AN INTSET(INT_PROCESS_ITEM,OPTS)
	BEFORE TRYING TO USE DEFERRED CAUSES;