From: acevest Date: Sun, 21 May 2023 15:10:22 +0000 (+0800) Subject: 改善panic时的cpu满载情况 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/static/gitweb.css?a=commitdiff_plain;h=3696149d8d1cfe5897ad0ae26ac3af893f683d61;p=kernel.git 改善panic时的cpu满载情况 --- diff --git a/include/system.h b/include/system.h index 3e56a3e..2721475 100644 --- a/include/system.h +++ b/include/system.h @@ -61,8 +61,9 @@ void kfree(void *addr); do { \ asm("cli;"); \ printk("PANIC:" msg " file:%s function:%s line:%d\n", ##__VA_ARGS__, __FILE__, __FUNCTION__, __LINE__); \ - while (1) \ - ; \ + while (1) { \ + asm("hlt"); \ + } \ } while (0); extern char etext, edata, end;