kern

diff src/proc.h @ 47:f65b348780e3

continuing with the process implementation. not done yet, panics.
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 28 Jul 2011 05:43:04 +0300
parents 5f6c5751ae05
children b1e8c8251884
line diff
     1.1 --- a/src/proc.h	Thu Jul 28 05:33:59 2011 +0300
     1.2 +++ b/src/proc.h	Thu Jul 28 05:43:04 2011 +0300
     1.3 @@ -7,17 +7,22 @@
     1.4  #define MAX_PROC	128
     1.5  
     1.6  struct context {
     1.7 -	struct registers regs;
     1.8 -	uint32_t instr_ptr;
     1.9 -	uint32_t stack_ptr;
    1.10 -	uint32_t flags;
    1.11 -	uint32_t pgtbl_paddr;
    1.12 +	struct registers regs;	/* saved general purpose registers */
    1.13 +	uint32_t instr_ptr;		/* saved eip */
    1.14 +	uint32_t stack_ptr;		/* saved esp */
    1.15 +	uint32_t flags;			/* saved eflags */
    1.16 +	uint32_t pgtbl_paddr;	/* physical address of the page table */
    1.17  	/* TODO add FPU state */
    1.18  };
    1.19  
    1.20  
    1.21  struct process {
    1.22 +	int parent;
    1.23  	struct context ctx;
    1.24  };
    1.25  
    1.26 +void init_proc(void);
    1.27 +
    1.28 +void context_switch(int pid);
    1.29 +
    1.30  #endif	/* PROC_H_ */