kern

diff src/proc.h @ 51:b1e8c8251884

lalalala
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 01 Aug 2011 06:45:29 +0300
parents f65b348780e3
children fa65b4f45366
line diff
     1.1 --- a/src/proc.h	Sat Jul 30 07:35:53 2011 +0300
     1.2 +++ b/src/proc.h	Mon Aug 01 06:45:29 2011 +0300
     1.3 @@ -15,14 +15,29 @@
     1.4  	/* TODO add FPU state */
     1.5  };
     1.6  
     1.7 +enum proc_state {
     1.8 +	STATE_RUNNING,
     1.9 +	STATE_BLOCKED,
    1.10 +	STATE_ZOMBIE
    1.11 +};
    1.12 +
    1.13  
    1.14  struct process {
    1.15 -	int parent;
    1.16 +	int id, parent;
    1.17 +	enum proc_state state;
    1.18 +
    1.19 +	int ticks_left;
    1.20  	struct context ctx;
    1.21 +
    1.22 +	struct process *next, *prev;	/* for the scheduler queues */
    1.23  };
    1.24  
    1.25  void init_proc(void);
    1.26  
    1.27  void context_switch(int pid);
    1.28  
    1.29 +int get_current_pid(void);
    1.30 +struct process *get_current_proc(void);
    1.31 +struct process *get_process(int pid);
    1.32 +
    1.33  #endif	/* PROC_H_ */