changed EABORT to ETIMEOUT for marking timeouts
This commit is contained in:
parent
b429c460a1
commit
8fdff36c65
@ -13,7 +13,7 @@ enum error_code {
|
||||
ENOMEM = 3, // not enough memory
|
||||
ENOBUFS = 4, // no space left in buffer
|
||||
ESRCH = 5, // no such process
|
||||
EABORT = 6
|
||||
ETIMEOUT= 6 // timeout while waiting
|
||||
};
|
||||
|
||||
/*
|
||||
@ -33,16 +33,18 @@ struct loaded_binary;
|
||||
|
||||
struct process_control_block {
|
||||
int pid;
|
||||
// state information
|
||||
int pc;
|
||||
int regs[31];
|
||||
int exit_code;
|
||||
// scheduling information
|
||||
enum process_status status;
|
||||
struct process_control_block* waiting_for_process;
|
||||
struct loaded_binary* binary;
|
||||
unsigned long long int asleep_until;
|
||||
// parent
|
||||
// hierarchical information
|
||||
struct loaded_binary* binary;
|
||||
struct process_control_block* parent;
|
||||
// memory management information
|
||||
void* stack_top;
|
||||
};
|
||||
|
||||
|
@ -103,7 +103,7 @@ struct process_control_block* scheduler_select_free()
|
||||
if (pcb->asleep_until != 0) {
|
||||
if (pcb->asleep_until < mtime) {
|
||||
// if the timeout ran out, set an error code
|
||||
pcb->regs[REG_A0 + 1] = EABORT;
|
||||
pcb->regs[REG_A0 + 1] = ETIMEOUT;
|
||||
pcb->status = PROC_RDY;
|
||||
return pcb;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user