From 8dd9e664d7fb48338eccde753d0b694676d44931 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 14 Dec 2017 15:22:58 +0000 Subject: [PATCH] 65c816: add hints for process.c and also fix up the waitpid loop Without this fix we can end up stalling in weird corner cases --- Kernel/process.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/Kernel/process.c b/Kernel/process.c index 29e78b09..97d3da20 100644 --- a/Kernel/process.c +++ b/Kernel/process.c @@ -59,7 +59,7 @@ void psleep(void *event) void wakeup(void *event) { - ptptr p; + regptr ptptr p; irqflags_t irq; #ifdef DEBUGHARDER @@ -154,7 +154,7 @@ ptptr getproc(void) ptptr getproc(void) { - ptptr p = udata.u_ptab; + regptr ptptr p = udata.u_ptab; #ifdef DEBUGREALLYHARD kputs("getproc("); @@ -193,7 +193,7 @@ ptptr getproc(void) * Call in the processes context! * This process MUST be run immediately (since it sets status P_RUNNING) */ -void newproc(ptptr p) +void newproc(regptr ptptr p) { /* Passed New process table entry */ uint8_t *j; irqflags_t irq; @@ -249,7 +249,8 @@ void newproc(ptptr p) uint16_t nextpid = 0; ptptr ptab_alloc(void) { - ptptr p, newp; + regptr ptptr p; + regptr ptptr newp; irqflags_t irq; newp = NULL; @@ -298,7 +299,7 @@ ptptr ptab_alloc(void) void load_average(void) { - struct runload *r; + regptr struct runload *r; static uint8_t utick; uint8_t i; uint16_t nr; @@ -432,7 +433,7 @@ void unix_syscall(void) void sgrpsig(uint16_t pgrp, uint8_t sig) { - ptptr p; + regptr ptptr p; if (pgrp) { for (p = ptab; p < ptab_end; ++p) if (p->p_pgrp == pgrp) @@ -462,15 +463,13 @@ static uint8_t dump_core(uint8_t sig) #define SIGBIT(x) (1 << (x & 15)) -static const uint16_t stopper = { - SIGBIT(SIGSTOP) | SIGBIT(SIGTTIN) | SIGBIT(SIGTTOU) | SIGBIT(SIGTSTP) -}; +static const uint16_t stopper = + SIGBIT(SIGSTOP) | SIGBIT(SIGTTIN) | SIGBIT(SIGTTOU) | SIGBIT(SIGTSTP); -static const uint16_t clear = { +static const uint16_t clear = SIGBIT(SIGSTOP) | SIGBIT(SIGTTIN) | SIGBIT(SIGTTOU) | SIGBIT(SIGTSTP) | SIGBIT(SIGCHLD) | SIGBIT(SIGURG) | SIGBIT(SIGWINCH) | SIGBIT(SIGIO) | - SIGBIT(SIGCONT) -}; + SIGBIT(SIGCONT); /* Process a block of 16 signals so we can avoid using longs */ -- 2.34.1