#include <kernel.h>
#include <semaphore.h>
Go to the source code of this file.
Data Structures | |
struct | pentry |
Defines | |
#define | NPROC 50 |
#define | STACKMAGIC 0x0A0AAAA9 |
#define | PRCURR 1 |
#define | PRFREE 2 |
#define | PRREADY 3 |
#define | PRRECV 4 |
#define | PRSLEEP 5 |
#define | PRSUSP 6 |
#define | PRWAIT 7 |
#define | PNMLEN 16 |
#define | NULLPROC 0 |
#define | BADPID (-1) |
#define | isbadpid(x) ((x)>=NPROC || PRFREE == proctab[(x)].state) |
#define | INITSTK 65536 |
#define | INITPRIO 20 |
#define | INITRET userret |
#define | MINSTK 4096 |
#define | NULLSTK MINSTK |
#define | BLOCK 1 |
#define | NOBLOCK 0 |
Typedefs | |
typedef struct pentry | pcb |
Functions | |
syscall | send (ushort pid, long msg, bool block) |
syscall | receive (bool block) |
Variables | |
struct pentry | proctab [] |
ushort | numproc |
ushort | currpid |
Definition in file proc.h.
#define INITPRIO 20 |
initial process priority
Definition at line 66 of file proc.h.
Referenced by main(), and nulluser().
#define INITRET userret |
#define INITSTK 65536 |
initial process stack size
Definition at line 65 of file proc.h.
Referenced by main(), nulluser(), test_bigargs(), test_deltaQueue(), test_procQueue(), test_recursion(), test_schedule(), test_semaphore(), test_semaphore2(), test_semaphore3(), test_semaphore4(), and testItem().
#define isbadpid | ( | x | ) | ((x)>=NPROC || PRFREE == proctab[(x)].state) |
#define MINSTK 4096 |
#define NULLPROC 0 |
id of the null process
Definition at line 38 of file proc.h.
Referenced by sysinit(), and xsh_kill().
#define PNMLEN 16 |
#define PRCURR 1 |
#define PRFREE 2 |
process slot is free
Definition at line 27 of file proc.h.
Referenced by kill(), newpid(), send(), sysinit(), test_semaphore(), test_semaphore2(), test_semaphore3(), test_semaphore4(), xsh_memstat(), and xsh_ps().
#define PRREADY 3 |
#define PRRECV 4 |
#define PRSLEEP 5 |
#define PRWAIT 7 |
process is on semaphore queue
Definition at line 32 of file proc.h.
Referenced by kill(), test_semaphore(), test_semaphore2(), test_semaphore3(), test_semaphore4(), and wait().
syscall receive | ( | bool | block | ) |
receive - request a message from mailbox
block | wait for message if BLOCK, return NULL if NOBLOCK and no message available |
Definition at line 19 of file receive.c.
References BLOCK, currpid, disable(), FALSE, pentry::hasmsg, pentry::msg, NULL, proctab, PRRECV, resched(), restore(), and pentry::state.
Referenced by shell().
send - pass a message to another process mailbox
pid | process id of recipient | |
msg | contents of message | |
block | reschedule if BLOCK, return to call function if NOBLOCK |
Definition at line 19 of file send.c.
References BLOCK, disable(), FALSE, pentry::hasmsg, isbadpid, pentry::msg, OK, PRFREE, proctab, PRRECV, ready(), resched(), RESCHED_NO, restore(), pentry::state, SYSERR, and TRUE.
Referenced by kill().
currently active processes
Definition at line 45 of file initialize.c.
Referenced by create(), kill(), nulluser(), and sysinit().
Definition at line 39 of file initialize.c.
Referenced by create(), kill(), newpid(), ready(), receive(), resched(), send(), sleep(), sysinit(), test_checkProcState(), wait(), xsh_memstat(), and xsh_ps().