From a2f9ae9d4ab678fa66a2ec5d1072ea22a36a18a1 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Thu, 19 Jan 2023 23:36:11 +0100 Subject: kernel: user interrupts --- src/user/lib/unistd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/user/lib/unistd.c') diff --git a/src/user/lib/unistd.c b/src/user/lib/unistd.c index 01aa94f..cb862f8 100644 --- a/src/user/lib/unistd.c +++ b/src/user/lib/unistd.c @@ -161,3 +161,14 @@ size_t absolutepath(char *out, const char *in, size_t size) { void __setinitialcwd(const char *s) { __initialcwd = s; } + +static void intr_null(void) { } + +extern void (*volatile _intr)(void); +void intr_set(void (*fn)(void)) { + _intr = fn ? fn : intr_null; +} + +void intr_default(void) { + exit(-1); +} -- cgit v1.2.3