Desktop/xinu_mips-1.0.2.tar/xinu_mips-1.0.2/system/queue.c File Reference

#include <proc.h>
#include <queue.h>

Include dependency graph for queue.c:

Go to the source code of this file.

Functions

short enqueue (short pid, queue q)
short remove (short pid)
short dequeue (queue q)
queue newqueue (void)

Variables

struct qentry queuetab [NQENT]
static int nextqueue = NPROC


Detailed Description

enqueue, remove, dequeue, getfirst, newqueue

Id
queue.c 240 2007-07-13 21:43:45Z brylow

Definition in file queue.c.


Function Documentation

short dequeue ( queue  q  ) 

Remove and return the first process on a list

Parameters:
q queue from which process should be removed
Returns:
process id of removed process, or EMPTY

Definition at line 57 of file queue.c.

References EMPTY, isbadqueue, qentry::next, NPROC, qentry::prev, queuehead, queuetab, and SYSERR.

Referenced by freesem(), resched(), signal(), signaln(), test_deltaQueue(), test_procQueue(), and wakeup().

short enqueue ( short  pid,
queue  q 
)

Insert a process at the tail of a queue

Parameters:
pid process ID to enqueue
q queue to which the process should be added
Returns:
process id of enqueued process

Definition at line 21 of file queue.c.

References isbadpid, isbadqueue, qentry::next, qentry::prev, queuetab, queuetail, and SYSERR.

Referenced by wait().

queue newqueue ( void   ) 

Initialize a new queue in the global process queue table

Returns:
newly allocated

Definition at line 79 of file queue.c.

References EMPTY, qentry::next, nextqueue, qentry::prev, and queuetab.

Referenced by sysinit().

short remove ( short  pid  ) 

Remove a process from anywhere in a queue

Parameters:
pid process ID to remove
Returns:
process id of removed process

Definition at line 43 of file queue.c.

References isbadpid, qentry::next, qentry::prev, queuetab, and SYSERR.


Variable Documentation

int nextqueue = NPROC [static]

queuetab[0..NPROC-1] are processes

Definition at line 13 of file queue.c.

Referenced by newqueue().

struct qentry queuetab[NQENT]

global queue table

Definition at line 12 of file queue.c.

Referenced by dequeue(), enqueue(), insert(), insertd(), newqueue(), and remove().


Generated on Thu Oct 9 22:35:09 2008 for xinu by  doxygen 1.5.5