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/init/init.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/cmd/init/init.c') diff --git a/src/cmd/init/init.c b/src/cmd/init/init.c index 0a64054..9caa283 100644 --- a/src/cmd/init/init.c +++ b/src/cmd/init/init.c @@ -68,9 +68,10 @@ void redirect(const char *exe, const char *out, const char *in) { } } -void shutdown(void) { - printf("[init] intr\n"); - _sys_intr(NULL, 0); +void shutdown(struct intr_data *data) { + const char *msg = "impending shutdown"; + printf("[init] shutdown with message: %s\n", data->msg); + _sys_intr(msg, strlen(msg)); _sys_sleep(1000); printf("[init] filicide\n"); _sys_filicide(); -- cgit v1.2.3