The GNU Modula-2 front end to GCC

gm2-libs-iso/RTco

DEFINITION MODULE RTco ;

FROM SYSTEM IMPORT ADDRESS ;


(* init initializes the module and allows the application to lazily invoke threads.  *)


PROCEDURE init () : INTEGER ;


PROCEDURE initThread (p: PROC; stackSize: CARDINAL; interruptLevel: CARDINAL) : INTEGER ;


PROCEDURE initSemaphore (value: CARDINAL) : INTEGER ;


PROCEDURE wait (semaphore: INTEGER) ;


PROCEDURE signal (semaphore: INTEGER) ;


PROCEDURE transfer (VAR p1: INTEGER; p2: INTEGER) ;


PROCEDURE waitThread (tid: INTEGER) ;


PROCEDURE signalThread (tid: INTEGER) ;


PROCEDURE currentThread () : INTEGER ;


(* currentInterruptLevel returns the interrupt level of the current thread.  *)


PROCEDURE currentInterruptLevel () : CARDINAL ;


(* turninterrupts returns the old interrupt level and assigns the interrupt level
   to newLevel.  *)


PROCEDURE turnInterrupts (newLevel: CARDINAL) : CARDINAL ;


(*
   select access to the select system call which will be thread safe.
   This is typically called from the idle process to wait for an interrupt.
*)


PROCEDURE select (p1: INTEGER;
                  p2: ADDRESS;
                  p3: ADDRESS;
                  p4: ADDRESS;
                  p5: ADDRESS) : INTEGER ;


END RTco.