Changeset 36e7ee98 in mainline for generic/src
- Timestamp:
- 2005-12-15T21:32:12Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cddc1639
- Parents:
- 49b6d32
- Location:
- generic/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
generic/src/console/console.c
r49b6d32 r36e7ee98 37 37 #include <func.h> 38 38 #include <print.h> 39 #include <arch/atomic.h> 39 40 40 41 /** Standard input character device. */ … … 53 54 ipl_t ipl; 54 55 55 if ( haltstate) {56 if (atomic_get(&haltstate)) { 56 57 /* If we are here, we are hopefully on the processor, that 57 58 * issued the 'halt' command, so proceed to read the character … … 61 62 return chardev->op->read(chardev); 62 63 /* no other way of interacting with user, halt */ 63 printf("cpu: halted - no kconsole\n"); 64 if (CPU) 65 printf("cpu%d: ", CPU->id); 66 else 67 printf("cpu: "); 68 printf("halted - no kconsole\n"); 64 69 cpu_halt(); 65 70 } -
generic/src/lib/func.c
r49b6d32 r36e7ee98 35 35 #include <console/kconsole.h> 36 36 37 __u32 volatile haltstate = 0; /**< Halt flag */37 atomic_t haltstate = {0}; /**< Halt flag */ 38 38 39 39 … … 43 43 * 44 44 */ 45 void halt( void)45 void halt() 46 46 { 47 haltstate = 1; 47 #ifdef CONFIG_DEBUG 48 bool rundebugger; 49 50 // TODO test_and_set not defined on all arches 51 // if (!test_and_set(&haltstate)) 52 if (!atomic_get(&haltstate)) { 53 atomic_set(&haltstate, 1); 54 rundebugger = true; 55 } 56 #else 57 atomic_set(haltstate, 1); 58 #endif 59 48 60 interrupts_disable(); 49 61 #ifdef CONFIG_DEBUG 50 printf("\n"); 51 kconsole("panic"); /* Run kconsole as a last resort to user */ 62 if (rundebugger) { 63 printf("\n"); 64 kconsole("panic"); /* Run kconsole as a last resort to user */ 65 } 52 66 #endif 53 54 67 if (CPU) 55 68 printf("cpu%d: halted\n", CPU->id); -
generic/src/proc/scheduler.c
r49b6d32 r36e7ee98 407 407 ipl = interrupts_disable(); 408 408 409 if ( haltstate)409 if (atomic_get(&haltstate)) 410 410 halt(); 411 411
Note:
See TracChangeset
for help on using the changeset viewer.