From c0ac7f68e9930cff510f1ecd65026fa51bca279e Mon Sep 17 00:00:00 2001 From: pumnflqv2 Date: Tue, 5 Jul 2022 05:17:38 +0800 Subject: [PATCH] ADD file via upload --- cur/linux/kernel/panic.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 cur/linux/kernel/panic.c diff --git a/cur/linux/kernel/panic.c b/cur/linux/kernel/panic.c new file mode 100644 index 0000000..7d8a06b --- /dev/null +++ b/cur/linux/kernel/panic.c @@ -0,0 +1,24 @@ +/* + * linux/kernel/panic.c + * + * (C) 1991 Linus Torvalds + */ + +/* + * This function is used through-out the kernel (includeinh mm and fs) + * to indicate a major problem. + */ +#include +#include + +void sys_sync(void); /* it's really int */ + +volatile void panic(const char * s) +{ + printk("Kernel panic: %s\n\r",s); + if (current == task[0]) + printk("In swapper task - not syncing\n\r"); + else + sys_sync(); + for(;;); +}