Embedded Xinu Network Playground COSC3300Fall2012
Process Management API

Functions

syscall create (void *, ulong, ulong, char *, ulong,...)
syscall ready (long, bool)
syscall resched (void)
syscall sleep (int n)

Function Documentation

syscall create ( void *  procaddr,
ulong  ssize,
ulong  priority,
char *  name,
ulong  nargs,
  ... 
)

Create a process to start running a procedure.

Parameters:
procaddrprocedure address
ssizestack stack size in words
priorityprocess priority
namename of the process, used for debugging
nargsnumber of arguments that follow
Returns:
the new process' process id
syscall ready ( long  pid,
bool  resch 
)

Make a process eligible for CPU service.

Parameters:
pidprocess id of the process to move to the ready state
reschif TRUE, reschedule will be called
Returns:
OK if the process has been added to the ready list, else SYSERR
syscall resched ( void  )

Reschedule processor to next ready process.

Upon entry, currpid gives current process id. Proctab[currpid].pstate gives correct NEXT state for current process if other than PRREADY.

Returns:
OK when the process is context switched back
syscall sleep ( int  ms)

Delay the calling process n milliseconds.

Parameters:
msnumber of milliseconds to sleep
Returns:
OK if process is sleeping, SYSERR if no clock