kern

diff src/proc.h @ 72:3941e82b07f2

- implemented syscalls: exit, waitpid, getppid - moved sys_whatever functions out of syscall.c into more reasonable files - putting all the definitions that must be synced with userland to include/kdef.h
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 15 Oct 2011 07:45:56 +0300
parents 0a205396e1a0
children 7ff2b4971216
line diff
     1.1 --- a/src/proc.h	Thu Oct 13 05:22:35 2011 +0300
     1.2 +++ b/src/proc.h	Sat Oct 15 07:45:56 2011 +0300
     1.3 @@ -27,6 +27,8 @@
     1.4  	int id, parent;
     1.5  	enum proc_state state;
     1.6  
     1.7 +	int exit_status;
     1.8 +
     1.9  	/* when blocked it's waiting for a wakeup on this address */
    1.10  	void *wait_addr;
    1.11  
    1.12 @@ -44,12 +46,17 @@
    1.13  
    1.14  	struct context ctx;
    1.15  
    1.16 +	struct process *child_list;
    1.17 +
    1.18  	struct process *next, *prev;	/* for the scheduler queues */
    1.19 +	struct process *sib_next;		/* for the sibling list */
    1.20  };
    1.21  
    1.22  void init_proc(void);
    1.23  
    1.24 -int fork(void);
    1.25 +int sys_fork(void);
    1.26 +int sys_exit(int status);
    1.27 +int sys_waitpid(int pid, int *status, int opt);
    1.28  
    1.29  void context_switch(int pid);
    1.30  
    1.31 @@ -58,6 +65,9 @@
    1.32  struct process *get_current_proc(void);
    1.33  struct process *get_process(int pid);
    1.34  
    1.35 +int sys_getpid(void);
    1.36 +int sys_getppid(void);
    1.37 +
    1.38  /* defined in proc-asm.S */
    1.39  uint32_t get_instr_ptr(void);
    1.40  uint32_t get_caller_instr_ptr(void);