commit 70a9af5006aabb7af04f9d68c40b978331b42dba
parent e1773e8bd9716a04d941981e555c7612e099a3d9
Author: Roberto E. Vargas Caballero <roberto.vargas@midokura.com>
Date: Thu, 17 Nov 2022 07:47:59 +0100
os9: Make ictx() void
ictx cannot fail in any way.
Diffstat:
4 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/include/os9/os9.h b/include/os9/os9.h
@@ -273,7 +273,7 @@ extern noreturn void fault(const char *msg, Context *ctx);
extern noreturn void swtch(Context *ctx);
extern noreturn void trap(Context *ctx);
extern Ptable *initptable(Task *);
-extern int ictx(Task *, void *);
+extern void ictx(Task *, void *);
extern int savectx(Task *);
extern char *getconf(char *);
extern void idle(void);
diff --git a/src/os9/arch/arm64/ctx.c b/src/os9/arch/arm64/ctx.c
@@ -107,7 +107,7 @@ panic(const char *msg)
fault(msg, NULL);
}
-int
+void
ictx(Task *tp, void *fn)
{
uint64_t *rp;
@@ -119,6 +119,4 @@ ictx(Task *tp, void *fn)
rp[SP_EL1] = (uint64_t) tp->kstack;
rp[SPSR] = sysrd(SPSR_EL1);
rp[ELR] = (uint64_t) fn;
-
- return 0;
}
diff --git a/src/os9/hosted/ctx.c b/src/os9/hosted/ctx.c
@@ -9,7 +9,7 @@ savectx(Task *tp)
return 1;
}
-int
+void
ictx(Task *tp, void *fn)
{
tp->ctx.stack = (void *) tp->stack.va;
diff --git a/src/os9/proc.c b/src/os9/proc.c
@@ -496,12 +496,10 @@ kproc(void *fn)
tp->deadtime = 0;
tp->flags = 0;
-
- if (ictx(tp, fn) < 0)
- goto err;
-
tp->state = TREADY;
+ ictx(tp, fn);
+
return tp;
err: