9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 4fb757020d858b0826a8a23e2191ed90da5d72fd
parent 238c5c1f53f81a6b2e757d0f3069365ee8328bca
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 25 Oct 2020 22:15:14 +0100

os9/proc: Add newslot()

Change-Id: Ic93614a305d21f5c61a37e823870314738b4a8a6

Diffstat:
Msrc/os9/proc.c | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/os9/proc.c b/src/os9/proc.c @@ -69,3 +69,16 @@ newtid(void) return (tid != id) ? tid : -1; } + +static Task * +newslot(void) +{ + Task *tp; + + for (tp = tasktab; tp < &tasktab[NR_TASKS]; ++tp) { + if (tp->mode == PDISABLED) + break; + } + + return (tp != &tasktab[NR_TASKS]) ? tp : NULL; +}