From f209dc3a24987419c3f7ad9fbe3fe2b4dfb16427 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Fri, 25 Aug 2017 10:26:21 +0200 Subject: implements pio.h functions and makefile update to optimize size - remove syscall.h, unused and not implemented - bug fix for memcmp() in string.c other changes are still partially unfinished and might not work --- sw/z80/kernel/include/process.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'sw/z80/kernel/include/process.h') diff --git a/sw/z80/kernel/include/process.h b/sw/z80/kernel/include/process.h index d7aa7fd..3b0c843 100644 --- a/sw/z80/kernel/include/process.h +++ b/sw/z80/kernel/include/process.h @@ -9,6 +9,12 @@ */ #define PROC_COUNT 2 +/* the pid is defined with a single byte (pid_t is uint8_t), because of that + * there cannot be more than 255 processes open at the same time. this is a + * limitation but for our purposes is more than enough + */ +#define PID_COUNT_MAX 255 + struct executable { void *text; @@ -19,19 +25,12 @@ struct executable struct process { - uint blocked :1; // process is waiting for hardware or locked - uint running :1; // pid is used - struct page pages[4]; // pages used by the process - // TODO: implement quick callback? + uint blocked :1; // process is waiting for hardware or locked + uint running :1; // pid is used + uint pages; // number of pages used by the process + struct page page[4]; // pages used by the process }; -/* the pid is defined with a single byte (pid_t is uint8_t), because of that - * there cannot be more than 255 processes open at the same time. this is a - * limitation but for our purposes is more than enough - */ -extern struct process proc_table[255]; -extern struct process *current_proc; - pid_t newpid(void); int fork(void); -- cgit v1.2.1