Changeset 02a99d2 in mainline
- Timestamp:
- 2005-05-11T19:51:55Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 69515260
- Parents:
- 45671f48
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/debug/panic.s
r45671f48 r02a99d2 28 28 29 29 .text 30 .global panic 30 .global panic_printf 31 31 32 panic :32 panic_printf: 33 33 movl $halt,(%esp) # fake stack to make printf return to halt 34 34 jmp printf -
arch/ia32/src/interrupt.c
r45671f48 r02a99d2 29 29 #include <arch/interrupt.h> 30 30 #include <print.h> 31 #include <debug.h> 31 32 #include <panic.h> 32 33 #include <arch/i8259.h> … … 49 50 iroutine trap_register(__u8 n, iroutine f) 50 51 { 52 ASSERT(n < IVT_ITEMS); 53 51 54 iroutine old; 52 55 53 56 old = ivt[n]; 54 57 ivt[n] = f; 55 56 58 59 return old; 57 60 } 58 61 … … 63 66 void trap_dispatcher(__u8 n, __u32 stack[]) 64 67 { 65 ivt[n](n,stack); 68 ASSERT(n < IVT_ITEMS); 69 70 ivt[n](n, stack); 66 71 } 67 72 … … 113 118 enable_irqs_function(irqmask); 114 119 else 115 panic( PANIC"no enable_irqs_function\n");120 panic("no enable_irqs_function\n"); 116 121 } 117 122 … … 121 126 disable_irqs_function(irqmask); 122 127 else 123 panic( PANIC"no disable_irqs_function\n");128 panic("no disable_irqs_function\n"); 124 129 } 125 130 … … 129 134 eoi_function(); 130 135 else 131 panic( PANIC"no eoi_function\n");136 panic("no eoi_function\n"); 132 137 133 138 } -
arch/ia32/src/pm.c
r45671f48 r02a99d2 144 144 tss_p = (struct tss *) malloc(sizeof(struct tss)); 145 145 if (!tss_p) 146 panic( PANIC"could not allocate TSS\n");146 panic("could not allocate TSS\n"); 147 147 } 148 148 -
arch/ia32/src/smp/mps.c
r45671f48 r02a99d2 470 470 */ 471 471 if (!(gdt_new = (struct descriptor *) malloc(GDT_ITEMS*sizeof(struct descriptor)))) 472 panic( PANIC"couldn't allocate memory for GDT\n");472 panic("couldn't allocate memory for GDT\n"); 473 473 474 474 memcopy(gdt, gdt_new, GDT_ITEMS*sizeof(struct descriptor)); -
arch/ia64/src/fake.s
r45671f48 r02a99d2 48 48 .global map_page_to_frame 49 49 .global memsetb 50 .global panic 50 .global panic_printf 51 51 52 52 before_thread_runs_arch: … … 69 69 map_page_to_frame: 70 70 memsetb: 71 panic :71 panic_printf: 72 72 br.ret.sptk.many b0 73 73 -
arch/mips/src/cache.c
r45671f48 r02a99d2 32 32 void cache_error(void) 33 33 { 34 panic( PANIC"cache_error exception\n");34 panic("cache_error exception\n"); 35 35 } -
arch/mips/src/exception.c
r45671f48 r02a99d2 52 52 case EXC_TLBL: 53 53 case EXC_TLBS: tlb_invalid(); break; 54 default: panic( PANIC"unhandled exception %d\n", excno); break;54 default: panic("unhandled exception %d\n", excno); break; 55 55 } 56 56 -
arch/mips/src/interrupt.c
r45671f48 r02a99d2 76 76 case 0x4: 77 77 case 0x5: 78 case 0x6: panic( PANIC"unhandled interrupt %d\n", i); break;78 case 0x6: panic("unhandled interrupt %d\n", i); break; 79 79 case 0x7: 80 80 /* clear timer interrupt */ -
arch/mips/src/mm/tlb.c
r45671f48 r02a99d2 42 42 } 43 43 44 panic( PANIC"tlb_refill exception\n");44 panic("tlb_refill exception\n"); 45 45 } 46 46 47 47 void tlb_invalid(void) 48 48 { 49 panic( PANIC"%X: TLB exception at %X", cp0_badvaddr_read(), THREAD ? THREAD->saved_epc : 0);49 panic("%X: TLB exception at %X", cp0_badvaddr_read(), THREAD ? THREAD->saved_epc : 0); 50 50 } 51 51 -
arch/mips/src/panic.s
r45671f48 r02a99d2 33 33 .set nomacro 34 34 35 .global panic 35 .global panic_printf 36 36 37 panic :37 panic_printf: 38 38 jal printf 39 39 nop -
include/list.h
r45671f48 r02a99d2 69 69 } 70 70 71 #define list_empty(head) (((head)->next == (head))? 1:0)71 #define list_empty(head) (((head)->next == (head))?true:false) 72 72 73 73 #define list_get_instance(link,type,member) (type *)(((__u8*)(link))-((__u8*)&(((type *)NULL)->member))) -
include/panic.h
r45671f48 r02a99d2 30 30 #define __PANIC_H__ 31 31 32 #define PANIC "KERNEL PANIC: " 32 #ifndef NDEBUG 33 # define panic(format, ...) panic_printf("Kernel panic in %s() at %s on line %d: " format, __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__); 34 #else 35 # define panic(format, ...) panic_printf("Kernel panic: " format, ##__VA_ARGS__); 36 #endif 33 37 34 extern void panic (char *fmt, ...);38 extern void panic_printf(char *fmt, ...); 35 39 36 40 #endif -
include/print.h
r45671f48 r02a99d2 38 38 static void print_str(const char *str); 39 39 static void print_fixed_hex(const __native num, const int width); 40 static void print_number(const __native num, const int base);40 static void print_number(const __native num, const unsigned int base); 41 41 42 42 extern void putchar(const char c); -
include/typedefs.h
r45671f48 r02a99d2 35 35 typedef short bool; 36 36 37 typedef unsigned int size_t; 38 37 39 typedef struct config config_t; 38 40 typedef struct cpu_private_data cpu_private_data_t; -
src/debug/print.c
r45671f48 r02a99d2 47 47 void print_str(const char *str) 48 48 { 49 49 int i = 0; 50 50 char c; 51 51 52 52 while (c = str[i++]) 53 53 putchar(c); 54 54 } 55 55 … … 85 85 * 86 86 */ 87 void print_number(const __native num, const int base)87 void print_number(const __native num, const unsigned int base) 88 88 { 89 89 int val = num; 90 90 char d[sizeof(__native)*8+1]; /* this is good enough even for base == 2 */ 91 92 91 int i = sizeof(__native)*8-1; 92 93 93 do { 94 94 d[i--] = digits[val % base]; -
src/main/kinit.c
r45671f48 r02a99d2 120 120 */ 121 121 m = vm_create(); 122 if (!m) panic( PANIC"vm_create");122 if (!m) panic("vm_create"); 123 123 u = task_create(m); 124 if (!u) panic( PANIC"task_create");124 if (!u) panic("task_create"); 125 125 t = thread_create(uinit, NULL, u, THREAD_USER_STACK); 126 if (!t) panic( PANIC"thread_create");126 if (!t) panic("thread_create"); 127 127 128 128 /* … … 130 130 */ 131 131 a = vm_area_create(m, VMA_TEXT, 1, UTEXT_ADDRESS); 132 if (!a) panic( PANIC"vm_area_create: vm_text");132 if (!a) panic("vm_area_create: vm_text"); 133 133 memcopy((__address) utext, PA2KA(a->mapping[0]), utext_size < PAGE_SIZE ? utext_size : PAGE_SIZE); 134 134 … … 137 137 */ 138 138 a = vm_area_create(m, VMA_STACK, 1, USTACK_ADDRESS); 139 if (!a) panic( PANIC"vm_area_create: vm_stack");139 if (!a) panic("vm_area_create: vm_stack"); 140 140 141 141 thread_ready(t); -
src/main/main.c
r45671f48 r02a99d2 30 30 #include <arch/context.h> 31 31 #include <print.h> 32 #include <panic.h> 32 33 #include <config.h> 33 34 #include <time/clock.h> -
src/mm/frame.c
r45671f48 r02a99d2 72 72 frame_bitmap = (__u8 *) malloc(frame_bitmap_octets); 73 73 if (!frame_bitmap) 74 panic( PANIC"malloc/frame_bitmap\n");74 panic("malloc/frame_bitmap\n"); 75 75 76 76 /* … … 145 145 } 146 146 } 147 panic( PANIC"frames_free inconsistent (%d)\n", frames_free);147 panic("frames_free inconsistent (%d)\n", frames_free); 148 148 } 149 149 spinlock_unlock(&framelock); … … 151 151 152 152 if (flags & FRAME_PANIC) 153 panic( PANIC"unable to allocate frame\n");153 panic("unable to allocate frame\n"); 154 154 155 155 /* TODO: implement sleeping logic here */ 156 panic( PANIC"sleep not supported\n");156 panic("sleep not supported\n"); 157 157 158 158 goto loop; … … 196 196 } 197 197 } 198 else panic( PANIC"frame_free: frame already free\n");199 } 200 else panic( PANIC"frame_free: frame number too big\n");198 else panic("frame_free: frame already free\n"); 199 } 200 else panic("frame_free: frame number too big\n"); 201 201 202 202 spinlock_unlock(&framelock); -
src/mm/heap.c
r45671f48 r02a99d2 31 31 #include <func.h> 32 32 #include <memstr.h> 33 #include <panic.h> 33 34 #include <arch/types.h> 34 35 -
src/mm/vm.c
r45671f48 r02a99d2 63 63 64 64 if (addr % PAGE_SIZE) 65 panic( PANIC"addr not aligned to a page boundary");65 panic("addr not aligned to a page boundary"); 66 66 67 67 pri = cpu_priority_high(); … … 125 125 break; 126 126 default: 127 panic( PANIC"unexpected vm_type_t %d", a->type);127 panic("unexpected vm_type_t %d", a->type); 128 128 } 129 129 -
src/proc/scheduler.c
r45671f48 r02a99d2 38 38 #include <arch/asm.h> 39 39 #include <list.h> 40 #include <panic.h> 40 41 #include <typedefs.h> 41 42 #include <mm/page.h> -
src/synch/rwlock.c
r45671f48 r02a99d2 185 185 break; 186 186 case ESYNCH_OK_ATOMIC: 187 panic( PANIC"_mutex_lock_timeout()==ESYNCH_OK_ATOMIC");187 panic("_mutex_lock_timeout()==ESYNCH_OK_ATOMIC"); 188 188 break; 189 189 dafault: 190 panic( PANIC"invalid ESYNCH");190 panic("invalid ESYNCH"); 191 191 break; 192 192 } -
src/time/timeout.c
r45671f48 r02a99d2 31 31 #include <arch/types.h> 32 32 #include <config.h> 33 #include <panic.h> 33 34 #include <synch/spinlock.h> 34 35 #include <func.h>
Note:
See TracChangeset
for help on using the changeset viewer.