Putc(c: CHAR);
Putx(x: Word.T);
Putc puts a character on the screen.
Putx puts a hexadecimal representation of the
value x on the screen.
System(<*AS CTEXT*>command : TEXT) : ErrorCode;
SpaceSelf() : Space.T
ThreadSelf() : Strand.T
SpaceDestroy(s : Space.T)
StrandDestroy(s : Strand.T)
Close(xref : Word.T) : ErrorCode
DomainLookup(<*AS CTEXT*>name : TEXT;): Domain.T;
DomainCreate(<*AS CTEXT*>name : TEXT): Domain.T;
DomainRegister(<*AS CTEXT*>name : TEXT; d: Domain.T): ErrorCode;
DomainLoad (d : Domain.T;
<*AS VAR %s : INTEGER! void *%s *> object: Word.T;
size : INTEGER): ErrorCode;
DomainLink(domain, extern: Domain.T): ErrorCode;
DomainInitialize(domain: Domain.T): ErrorCode;
DomainDestroy(domain: Domain.T): ErrorCode;
<*AS CTEXT*> are directives
to Sieg.
Rendezvous(<*AS CTEXT*>simpleName: TEXT;
key: REFANY; (* Protect the rendezvous, NIL if any *)
VAR reply: REFANY): ErrorCode;
Brand string defined in the extension.
(ex. "Dlib" in case of Dlib extension).USyscall.Rendezvous. The handler typically
installs the system call handler for the caller.USyscall_DomainLookup("Dlib").
This calls the name server, and since
dlib isn't loaded, nanny is called to
load dlib.
USyscall.Rendezvous event.
USyscall_Rendezvous("Dlib")
Dlib.Rendezvous is called in response to
USyscall.Rendezvous event.
This procedure installs a handler for the
MachineTrap.Syscall event. As a
authorizer key, the triple
USyscall_ prepended to the original service name.
The parameter types obey the sieg rule.
Below are examples of user side procedures.
See USyscallUser.s also.
void USyscall_Putc(char x); long USyscall_System(char *command); long USyscall_Rendezvous(char *simpleName, long key, long *reply);The most interesting use of USyscall is loading a systemcall extension on demand. Here's the example user bootstrap code.
#define SPIN_NIL_REF (unsigned long)(0x7fffffffffffffff)
__Dlib_BootPrintString(char *s)
{
while (*s) {
USyscall_Putc(*s);
s++;
}
}
__Dlib_Boot()
{
unsigned long reply;
int fd = USyscall_DomainLookup("Dlib");
if (USyscall_DomainLookup("Dlib") == SPIN_NIL_REF) {
__Dlib_BootPrintString("Dlib : could not find\n");
return 0;
} else {
USyscall_Close(fd);
}
__Dlib_BootPrintString("Rendezvous w/Dlib\n");
if (USyscall_Rendezvous(name, SPIN_NIL_REF, &reply) == SPIN_FAILURE) {
__Dlib_BootPrintString("Could not rendezvous\n");
return 0;
}
return 1;
}
yasushi@cs.washington.edu