(* Copyright (C) 1989, Digital Equipment Corporation *) (* All rights reserved. *) (* See the file COPYRIGHT for a full description. *) (* Last modified on Tue Jun 26 00:26:24 1990 by muller *) (* modified on Wed Apr 12 08:48:03 1989 by kalsow *) INTERFACE ThreadSup; IMPORT Thread; (* The variables below are local to each thread. More precisely, there is one location corresponding for each of these variable, but they are modified whenever switching occurs. handlers is used by the runtime system to store the head of the list of active handlers. stackLimit is used by the runtime to store the top of the stack and thus check stack overflow. These are not declared because we need declarations extern char * _ThreadAs__stackLimit; extern HANDLER * _ThreadAs__handlers; in most of the modules (via M3RuntimeDecls.h). But this declaration would conflict with the declaration produced by the compiler for modules which import ThreadSup. And the only client today is Thread.m3 that does not need explicit access to these variables. So we do not declare them in the Modula world. *) VAR self: Thread.T; (* stackLimit: ADDRESS; *) (* handlers: ADDRESS; *) VAR inCritical: INTEGER; <*EXTERNAL*> VAR contextSize: INTEGER; <*EXTERNAL*> PROCEDURE InitTopContext (t: Thread.T; context: ADDRESS); <*EXTERNAL*> PROCEDURE InitContext (t: Thread.T; context, stack: ADDRESS; size: INTEGER); <*EXTERNAL*> PROCEDURE Transfer (context: ADDRESS); <*EXTERNAL*> PROCEDURE Tos (context: ADDRESS; VAR start, stop: ADDRESS); <*EXTERNAL*> PROCEDURE SelfTos (VAR start, stop: ADDRESS); <*EXTERNAL*> PROCEDURE UserMain (self: Thread.Closure): REFANY; END ThreadSup.