]> Zhao Yanbai Git Server - kernel.git/commitdiff
改善panic时的cpu满载情况
authoracevest <zhaoyanbai@126.com>
Sun, 21 May 2023 15:10:22 +0000 (23:10 +0800)
committeracevest <zhaoyanbai@126.com>
Sun, 21 May 2023 15:10:22 +0000 (23:10 +0800)
include/system.h

index 3e56a3eb780ed494c15c5f4565a540fed6f3c908..2721475c98e445664ec2c31665d9576a543d10cf 100644 (file)
@@ -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;