From 69fd0dd9fda47aa52cccdbef6ca388cea38e693b Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 25 Jul 2024 22:17:27 +0200 Subject: kernel: pass more information to user on interrupt This is meant to facilitate a syscall for returning from interrupts, which will actually work in the general case as opposed to the current hack, which only works if the interrupt occured during a syscall (which is correct... for now). --- src/kernel/proc.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/kernel/proc.h') diff --git a/src/kernel/proc.h b/src/kernel/proc.h index 99eac94..96cd8ba 100644 --- a/src/kernel/proc.h +++ b/src/kernel/proc.h @@ -88,6 +88,7 @@ struct Proc { /* interrupt handler */ void __user *intr_fn; + Intr *queuedintr; struct { void *buf; @@ -99,6 +100,12 @@ struct Proc { uint64_t basetime; }; +/* an interrupt queued for delivery */ +struct Intr { + size_t len; + char buf[]; +}; + extern Proc *proc_cur; /** Creates the root process. */ @@ -116,9 +123,6 @@ void proc_kill(Proc *proc, int ret); /** Tries to reap a dead process / free a tombstone. */ void proc_tryreap(Proc *dead); -/** Try to interrupt whatever the process is doing instead of PS_RUNNING. */ -void proc_tryintr(Proc *p); - /** Send an interupt to a process. */ void proc_intr(Proc *p, const char *buf, size_t len); -- cgit v1.2.3