Changeset 40043e8 in mainline for kernel/generic/src/main/shutdown.c
- Timestamp:
- 2019-07-18T08:25:42Z (6 years ago)
- Children:
- 0116f21
- Parents:
- 2cc569a3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/shutdown.c
r2cc569a3 r40043e8 1 1 /* 2 2 * Copyright (c) 2007 Martin Decky 3 * Copyright (c) 2001-2004 Jakub Jermar 3 4 * All rights reserved. 4 5 * … … 36 37 */ 37 38 39 #include <shutdown.h> 40 #include <log.h> 41 #include <cpu.h> 42 #include <arch/asm.h> 38 43 #include <arch.h> 44 #include <console/kconsole.h> 39 45 #include <proc/task.h> 40 #include <halt.h> 41 #include <log.h> 46 47 /** Halt flag */ 48 atomic_t haltstate = 0; 49 50 /** Halt wrapper 51 * 52 * Set halt flag and halt the CPU. 53 * 54 */ 55 void halt(void) 56 { 57 #if (defined(CONFIG_DEBUG)) && (defined(CONFIG_KCONSOLE)) 58 bool rundebugger = false; 59 60 if (!atomic_load(&haltstate)) { 61 atomic_store(&haltstate, 1); 62 rundebugger = true; 63 } 64 #else 65 atomic_store(&haltstate, 1); 66 #endif 67 68 interrupts_disable(); 69 70 #if (defined(CONFIG_DEBUG)) && (defined(CONFIG_KCONSOLE)) 71 if ((rundebugger) && (kconsole_check_poll())) 72 kconsole("panic", "\nLast resort kernel console ready.\n", false); 73 #endif 74 75 if (CPU) 76 log(LF_OTHER, LVL_NOTE, "cpu%u: halted", CPU->id); 77 else 78 log(LF_OTHER, LVL_NOTE, "cpu: halted"); 79 80 cpu_halt(); 81 } 42 82 43 83 void reboot(void)
Note:
See TracChangeset
for help on using the changeset viewer.