kern

annotate 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
rev   line source
nuclear@29 1 #ifndef PROC_H_
nuclear@29 2 #define PROC_H_
nuclear@29 3
nuclear@43 4 #include <inttypes.h>
nuclear@42 5 #include "asmops.h"
nuclear@42 6
nuclear@42 7 #define MAX_PROC 128
nuclear@42 8
nuclear@42 9 struct context {
nuclear@47 10 struct registers regs; /* saved general purpose registers */
nuclear@47 11 uint32_t instr_ptr; /* saved eip */
nuclear@47 12 uint32_t stack_ptr; /* saved esp */
nuclear@47 13 uint32_t flags; /* saved eflags */
nuclear@47 14 uint32_t pgtbl_paddr; /* physical address of the page table */
nuclear@42 15 /* TODO add FPU state */
nuclear@42 16 };
nuclear@42 17
nuclear@29 18
nuclear@29 19 struct process {
nuclear@47 20 int parent;
nuclear@42 21 struct context ctx;
nuclear@29 22 };
nuclear@29 23
nuclear@47 24 void init_proc(void);
nuclear@47 25
nuclear@47 26 void context_switch(int pid);
nuclear@47 27
nuclear@29 28 #endif /* PROC_H_ */