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/cmd/shell/shell.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/cmd/shell/shell.c') diff --git a/src/cmd/shell/shell.c b/src/cmd/shell/shell.c index 9afdb5c..15cb6ed 100644 --- a/src/cmd/shell/shell.c +++ b/src/cmd/shell/shell.c @@ -139,10 +139,14 @@ static void run(char *cmd) { } } +static void intr(struct intr_data *intr) { + fprintf(stderr, "%s: got interrupt: %s\n", getprogname(), intr->msg); +} + int main(int argc, char **argv) { static char buf[256]; FILE *f = stdin; - intr_set(NULL); + intr_set(intr); if (argc > 1) { f = fopen(argv[1], "r"); -- cgit v1.2.3