DEFINITION MODULE SYSCALL;
(* V0.9     6/1/87 Copyright 1987 fred brooks LogicTek *)

FROM    ATOMIC  IMPORT  SIGNAL,sysvariable;
FROM    SYSTEM  IMPORT  ADDRESS;

CONST   (* SYSTEM ERRORS *)

        ENOERR           =       0;     (* no error *)
        ENOENT           =       2;     (* no file or directory *)
        ENORCH           =       3;     (* no such process *)
        ENOMEM           =       12;    (* out of memory *)
        EBADRQC          =       54;    (* bad request *)

(* Read the program command line and pass it to kernel to execute *)
PROCEDURE   SysCmd;

(* Pass command line to kernal to execute *)
PROCEDURE   SysReq(VAR command: ARRAY OF CHAR);

(* Get the processdescriptor for the currentprocess *)
PROCEDURE  SysDes(VAR currentprocess : SIGNAL);

(* Get the systemvariables *)
PROCEDURE  SysVar(VAR sysvar : sysvariable);

(* Put procedure to sleep *)
PROCEDURE        Sleep;

(* Wakeup sleeping procedure *)
PROCEDURE        WakeUp(pid: INTEGER);

(* check to see if special interrupt has happened , execute if triggered *)
PROCEDURE CheckSpint;

(*  Setup spint linkage to spintid *)
PROCEDURE EnableSpint(spintid: CARDINAL; routine: PROC; data: ADDRESS): BOOLEAN;

(*  request spint data and active info  return TRUE if active bit set *)
(*  data will be set to NIL if the spint is disabled           *)
PROCEDURE SpintInfo(spintid: CARDINAL; VAR data: ADDRESS): BOOLEAN;

(*  remove spint linkage to spintid *)
PROCEDURE DisableSpint(spintid: CARDINAL);

(*  send spint to routine  *)
PROCEDURE Trigger(spintid: CARDINAL): BOOLEAN;

(*  Hold program interrupts *)
PROCEDURE HoldSpint(spintid: CARDINAL);

(*  Release program interrupts *)
PROCEDURE ReleaseSpint(spintid: CARDINAL);

(*  Wait a specified period of time for a program interrupt ticks are
    in 200 hz clocks. If tick is -1 then wait forever for interrupt  *)
PROCEDURE IntDelay(tick: LONGINT): INTEGER;

END               SYSCALL.
