Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ void process_launch(struct process *p)
list_push_tail(&ready_list, &p->node);
}

static void process_switch(int newstate)
static void process_switch( process_state_t newstate )
{
interrupt_block();

Expand Down
14 changes: 8 additions & 6 deletions kernel/process.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ See the file LICENSE for details.
#include "x86.h"
#include "fs.h"

#define PROCESS_STATE_CRADLE 0
#define PROCESS_STATE_READY 1
#define PROCESS_STATE_RUNNING 2
#define PROCESS_STATE_BLOCKED 3
#define PROCESS_STATE_GRAVE 4
typedef enum {
PROCESS_STATE_CRADLE,
PROCESS_STATE_READY,
PROCESS_STATE_RUNNING,
PROCESS_STATE_BLOCKED,
PROCESS_STATE_GRAVE,
} process_state_t;

#define PROCESS_MAX_OBJECTS 32
#define PROCESS_MAX_PID 1024
Expand All @@ -29,7 +31,7 @@ See the file LICENSE for details.

struct process {
struct list_node node;
int state;
process_state_t state;
int exitcode;
int exitreason;
struct pagetable *pagetable;
Expand Down