21 #define PROCESS_CONTEXT_SIZE (32) //4*32 22 #define PROCESS_STACK_SIZE (6000) //bytes 23 #define PCB_QUEUE_MAX_SIZE (128) 24 #define PROCESS_MAX_NAME_LENGTH (20) 26 #define PROCESS_LOWEST_PRIORITY 0 27 #define PROCESS_HIGHEST_PRIORITY 9 e_PCB_ERROR_CODE_t prevPCBError
void pcbTest(void)
pcbTest a simple test case function to show pcb queue functionality
e_PROCESS_SUSPENSION_STATE_t
typedef of linked list node (see s_ll_node).
void printPCBFunc(void *pcb)
printPCBFunc prints the status of a process
const char * errorToString(e_PCB_ERROR_CODE_t error)
errorToString creates a string form of the error passed in
programPtr_t * programStart
processStack_t * stackTop
#define PROCESS_MAX_NAME_LENGTH
int pcbSearchFunc(void *pcb, void *nameToFind)
pcbSearchFunc pcb search function for linked list. All pcb linkedLists use this function for searchin...
void initPCBQueues(void)
initPCBQueues initlize the queues for each process queue. This function calls the list init function ...
pcb_t * currentOperatingProcess
e_PROCESS_STATE_t processState
The s_processContext struct defines the context that each process stores .
const char * classToString(e_PROCESS_CLASS_t processClass)
classToString creates a string form of the class passed in
processStack_t * stackBase
pcb_t * findPCB(const char *processName)
findPCB will search all queues for the PCB with the input name
typedef of linked list (see s_ll).
e_PROCESS_SUSPENSION_STATE_t processSuspensionState
int priorityInsertFunc(void *pcb1, void *pcb2)
priorityInsertFunc function that inserts pcbs into new pcb queues ordered by the pcbs' priority...
e_PCB_ERROR_CODE_t changeProcessPriority(const char *procName, processPriority_t newPriority)
changeProcessPriority
#define PROCESS_STACK_SIZE
linkedList_t blockedQueue
node_t * representingNode
void insertPCB(pcb_t *pcbToInsert)
insertPCB insert the PCB into the queue represented by the process state, following each queue's rule...
e_PCB_ERROR_CODE_t freePCB(pcb_t *pcbToFree)
freePCB free all associated memory with the PCB, including the stack and other pointers ...
defines the properties of a process control block
pcb_t * allocatePCB(void)
allocatePCB allocate new memory for a pcb_t
typedef for pcbQueue_t struct
uint32_t programDataPtr_t
programDataPtr_t a pointer to a process's data
processStack_t stack[PROCESS_STACK_SIZE]
uint8_t processStack_t
processStack_t a pointer to someplace in a process's stack
e_PCB_ERROR_CODE_t removePCB(pcb_t *pcbToRemove)
removePCB remove the input PCB from its associated queue
linkedList_t suspendedBlockedQueue
const char * stateToString(e_PROCESS_STATE_t state)
stateToString creates a string form of the state passed in
e_PROCESS_CLASS_t processClass
e_PROCESS_STATE_t
The PROCESS_STATE_t enum defines the possible operating states of a process.
size_t PID_t
PID_t a type that defines a process operating ID.
e_PROCESS_CLASS_t stringToClass(const char *stringifiedClass)
stringToClass returns the enum representation of a string
programDataPtr_t * dataStart
pcb_t * setupPCB(const char *processName, e_PROCESS_CLASS_t processClass, processPriority_t processPriority)
setupPCB calls allocatePCB, initializes the PCB with the arguments and sets it state to ready ...
e_PCB_ERROR_CODE_t changeProcessSuspensionState(const char *processName, e_PROCESS_SUSPENSION_STATE_t suspensionState)
changeProcessSuspensionState
e_PCB_ERROR_CODE_t
The e_PCB_ERROR_CODE_t enum defines the return status of functions working with PCBs.
e_PROCESS_STATE_t getState(const char *name)
getState gets the current state of the process
e_PCB_ERROR_CODE_t changeProcessState(const char *processName, e_PROCESS_STATE_t state)
changeProcessState changes the state of the process being called
linkedList_t suspendedReadyQueue
int fifoInsertFunc(void *pcb1, void *pcb2)
priorityInsertFunc function that inserts pcbs into new pcb queues ordered by the sequence of arrival...
char name[PROCESS_MAX_NAME_LENGTH]
processContext_t * context
e_PROCESS_CLASS_t
The PROCESS_CLASS_t enum defines the operating class of the process.
uint8_t programPtr_t
programPtr_t a pointer to a process's code
size_t processPriority_t
processPriority_t defines a process priority to the system