- Timestamp:
- Jul 20, 2017, 10:29:05 AM (7 years ago)
- Location:
- trunk/hal/x86_64/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_exception.c
r234 r242 69 69 } 70 70 71 x86_lock(); 71 72 x86_printf("\n****** EXCEPTION OCCURRED ******\n"); 72 73 x86_printf("%s\n", (char *)buf); … … 77 78 x86_printf("-> va = %Z\n", rcr2()); 78 79 x86_printf("****** EXCEPTION OCCURRED ******\n\n"); 80 x86_unlock(); 79 81 80 82 while (1); -
trunk/hal/x86_64/core/hal_internal.h
r236 r242 79 79 80 80 /* x86_printf.c */ 81 void x86_lock(); 82 void x86_unlock(); 83 81 84 void x86_panic(char *msg); 82 85 void x86_putc(char c); -
trunk/hal/x86_64/core/x86_printf.c
r234 r242 42 42 size_t cons_ptr __in_kdata = 0; 43 43 44 /* -------------------------------------------------------------------------- */ 45 46 static uint32_t x86_lock_val __in_kdata = 0; 47 48 void x86_lock() 49 { 50 while (!hal_atomic_cas(&x86_lock_val, 0, 1)) { 51 /* wait */ 52 } 53 } 54 55 void x86_unlock() 56 { 57 while (!hal_atomic_cas(&x86_lock_val, 1, 0)) { 58 /* wait */ 59 } 60 } 61 62 /* -------------------------------------------------------------------------- */ 63 44 64 void x86_panic(char *msg) 45 65 { 66 x86_lock(); 46 67 x86_printf("!!!!! PANIC !!!!!\n"); 47 68 x86_printf("-> %s\n", msg); 48 69 x86_printf("!!!!!!!!!!!!!!!!!\n"); 70 x86_unlock(); 49 71 while (1); 50 72 }
Note: See TracChangeset
for help on using the changeset viewer.