File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ void process_launch(struct process *p)
242242 list_push_tail (& ready_list , & p -> node );
243243}
244244
245- static void process_switch (int newstate )
245+ static void process_switch ( process_state_t newstate )
246246{
247247 interrupt_block ();
248248
Original file line number Diff line number Diff line change @@ -15,11 +15,13 @@ See the file LICENSE for details.
1515#include "x86.h"
1616#include "fs.h"
1717
18- #define PROCESS_STATE_CRADLE 0
19- #define PROCESS_STATE_READY 1
20- #define PROCESS_STATE_RUNNING 2
21- #define PROCESS_STATE_BLOCKED 3
22- #define PROCESS_STATE_GRAVE 4
18+ typedef enum {
19+ PROCESS_STATE_CRADLE ,
20+ PROCESS_STATE_READY ,
21+ PROCESS_STATE_RUNNING ,
22+ PROCESS_STATE_BLOCKED ,
23+ PROCESS_STATE_GRAVE ,
24+ } process_state_t ;
2325
2426#define PROCESS_MAX_OBJECTS 32
2527#define PROCESS_MAX_PID 1024
@@ -29,7 +31,7 @@ See the file LICENSE for details.
2931
3032struct process {
3133 struct list_node node ;
32- int state ;
34+ process_state_t state ;
3335 int exitcode ;
3436 int exitreason ;
3537 struct pagetable * pagetable ;
You can’t perform that action at this time.
0 commit comments