From: Alan Cox Date: Wed, 17 Feb 2016 18:13:28 +0000 (+0000) Subject: doexit: tidy up types X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=79371af5de5c0aad5b39ff64fe0f9e691c9c4daf;p=FUZIX.git doexit: tidy up types --- diff --git a/Kernel/include/kernel.h b/Kernel/include/kernel.h index b9239b39..c5ad4ca3 100644 --- a/Kernel/include/kernel.h +++ b/Kernel/include/kernel.h @@ -786,7 +786,7 @@ extern void program_vectors(uint16_t *pageptr); extern void sgrpsig(uint16_t pgrp, uint8_t sig); extern void unix_syscall(void); extern void timer_interrupt(void); -extern void doexit (int16_t val, int16_t val2); +extern void doexit (uint16_t val); extern void panic(char *deathcry); extern void exec_or_die(void); #define need_resched() (nready != 1 && runticks >= udata.u_ptab->p_priority) diff --git a/Kernel/process.c b/Kernel/process.c index ee064afa..38eb74c5 100644 --- a/Kernel/process.c +++ b/Kernel/process.c @@ -477,7 +477,7 @@ void chksigs(void) #ifdef DEBUG kprintf("process terminated by signal %d\n", j); #endif - doexit(0, j); + doexit((uint16_t)j << 8); } else if (*svec != SIG_IGN) { /* Arrange to call the user routine at return */ udata.u_ptab->p_pending &= ~m; // unset the bit @@ -582,7 +582,7 @@ static int signal_parent(ptptr p) return 1; } -void doexit(int16_t val, int16_t val2) +void doexit(uint16_t val) { int16_t j; ptptr p; @@ -611,7 +611,7 @@ void doexit(int16_t val, int16_t val2) } - udata.u_ptab->p_exitval = (val << 8) | (val2 & 0xff); + udata.u_ptab->p_exitval = val; i_deref(udata.u_cwd); i_deref(udata.u_root); diff --git a/Kernel/syscall_proc.c b/Kernel/syscall_proc.c index 2d88b56a..8ea506c0 100644 --- a/Kernel/syscall_proc.c +++ b/Kernel/syscall_proc.c @@ -345,7 +345,8 @@ int16_t val; arg_t __exit(void) { - doexit(val, 0); + /* Deliberately chop to 8bits */ + doexit(val & 0xFF); return 0; // ... yeah. that might not happen. }