Changeset 7e752b2 in mainline for kernel/generic
- Timestamp:
- 2010-11-26T01:33:20Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bf61d3a
- Parents:
- 202f57b
- Location:
- kernel/generic
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/synch/spinlock.h
r202f57b r7e752b2 146 146 if ((pname)++ > (value)) { \ 147 147 (pname) = 0; \ 148 printf("Deadlock probe %s: exceeded threshold %u\n" ,\148 printf("Deadlock probe %s: exceeded threshold %u\n" \ 149 149 "cpu%u: function=%s, line=%u\n", \ 150 150 #pname, (value), CPU->id, __func__, __LINE__); \ -
kernel/generic/src/cpu/cpu.c
r202f57b r7e752b2 107 107 void cpu_list(void) 108 108 { 109 size_t i;109 unsigned int i; 110 110 111 111 for (i = 0; i < config.cpu_count; i++) { -
kernel/generic/src/debug/debug.c
r202f57b r7e752b2 52 52 if (symtab_name_lookup((uintptr_t) call_site, &call_site_sym, 53 53 &call_site_off) == EOK) 54 printf("%s +%" PRIp "->%s\n", call_site_sym, call_site_off,55 fn_sym);54 printf("%s()+%p->%s()\n", call_site_sym, 55 (void *) call_site_off, fn_sym); 56 56 else 57 printf("->%s \n", fn_sym);57 printf("->%s()\n", fn_sym); 58 58 } 59 59 … … 67 67 if (symtab_name_lookup((uintptr_t) call_site, &call_site_sym, 68 68 &call_site_off) == EOK) 69 printf("%s +%" PRIp "<-%s\n", call_site_sym, call_site_off,70 fn_sym);69 printf("%s()+%p<-%s()\n", call_site_sym, 70 (void *) call_site_off, fn_sym); 71 71 else 72 printf("<-%s \n", fn_sym);72 printf("<-%s()\n", fn_sym); 73 73 } 74 74 -
kernel/generic/src/debug/panic.c
r202f57b r7e752b2 42 42 #include <interrupt.h> 43 43 44 #define BANNER_LEFT "######>" 45 #define BANNER_RIGHT "<######" 46 44 47 void panic_common(panic_category_t cat, istate_t *istate, int access, 45 48 uintptr_t address, const char *fmt, ...) 46 49 { 47 50 va_list args; 48 51 49 52 silent = false; 50 51 printf("\n KERNEL PANIC ");53 54 printf("\n%s Kernel panic ", BANNER_LEFT); 52 55 if (CPU) 53 printf(" ON cpu%d", CPU->id);54 printf(" DUE TO");55 56 printf("on cpu%u ", CPU->id); 57 printf("due to "); 58 56 59 va_start(args, fmt); 57 60 if (cat == PANIC_ASSERT) { 58 printf(" A FAILED ASSERTION:\n");61 printf("a failed assertion: %s\n", BANNER_RIGHT); 59 62 vprintf(fmt, args); 60 63 printf("\n"); 61 64 } else if (cat == PANIC_BADTRAP) { 62 printf("BAD TRAP %ld.\n", address); 65 printf("bad trap %" PRIun ". %s\n", address, 66 BANNER_RIGHT); 63 67 if (fmt) { 64 68 vprintf(fmt, args); … … 66 70 } 67 71 } else if (cat == PANIC_MEMTRAP) { 68 printf(" A BAD MEMORY ACCESS WHILE");72 printf("a bad memory access while "); 69 73 if (access == PF_ACCESS_READ) 70 printf(" LOADING FROM");74 printf("loading from"); 71 75 else if (access == PF_ACCESS_WRITE) 72 printf(" STORING TO");76 printf("storing to"); 73 77 else if (access == PF_ACCESS_EXEC) 74 printf(" BRANCHING TO");78 printf("branching to"); 75 79 else 76 printf("REFERENCING"); 77 printf(" ADDRESS %p.\n", address); 80 printf("referencing"); 81 printf(" address %p. %s\n", (void *) address, 82 BANNER_RIGHT); 78 83 if (fmt) { 79 84 vprintf(fmt, args); … … 81 86 } 82 87 } else { 83 printf("THE FOLLOWING REASON:\n"); 88 printf("the following reason: %s\n", 89 BANNER_RIGHT); 84 90 vprintf(fmt, args); 85 91 printf("\n"); 86 92 } 87 93 va_end(args); 88 94 89 95 printf("\n"); 90 96 91 97 if (istate) { 92 98 istate_decode(istate); 93 99 printf("\n"); 94 100 } 95 101 96 102 stack_trace(); 97 103 halt(); -
kernel/generic/src/debug/stacktrace.c
r202f57b r7e752b2 41 41 #define STACK_FRAMES_MAX 20 42 42 43 void 44 stack_trace_ctx(stack_trace_ops_t *ops, stack_trace_context_t *ctx) 43 void stack_trace_ctx(stack_trace_ops_t *ops, stack_trace_context_t *ctx) 45 44 { 46 45 int cnt = 0; … … 54 53 if (ops->symbol_resolve && 55 54 ops->symbol_resolve(ctx->pc, &symbol, &offset)) { 56 57 printf("%p: %s +%" PRIp "()\n",58 ctx->fp, symbol,offset);55 if (offset) 56 printf("%p: %s()+%p\n", (void *) ctx->fp, 57 symbol, (void *) offset); 59 58 else 60 printf("%p: %s()\n", 61 ctx->fp, symbol); 62 } else { 63 printf("%p: %p()\n", ctx->fp, ctx->pc); 64 } 59 printf("%p: %s()\n", (void *) ctx->fp, symbol); 60 } else 61 printf("%p: %p()\n", (void *) ctx->fp, (void *) ctx->pc); 62 65 63 if (!ops->return_address_get(ctx, &pc)) 66 64 break; 65 67 66 if (!ops->frame_pointer_prev(ctx, &fp)) 68 67 break; 68 69 69 ctx->fp = fp; 70 70 ctx->pc = pc; -
kernel/generic/src/debug/symtab.c
r202f57b r7e752b2 192 192 uintptr_t addr = uint64_t_le2host(symbol_table[pos].address_le); 193 193 char *realname = symbol_table[pos].symbol_name; 194 printf("%p: %s\n", addr, realname);194 printf("%p: %s\n", (void *) addr, realname); 195 195 pos++; 196 196 } -
kernel/generic/src/interrupt/interrupt.c
r202f57b r7e752b2 176 176 printf("Task %s (%" PRIu64 ") killed due to an exception at " 177 177 "program counter %p.\n", TASK->name, TASK->taskid, 178 istate_get_pc(istate));178 (void *) istate_get_pc(istate)); 179 179 180 180 stack_trace_istate(istate); -
kernel/generic/src/ipc/ipc.c
r202f57b r7e752b2 702 702 for (i = 0; i < IPC_MAX_PHONES; i++) { 703 703 if (SYNCH_FAILED(mutex_trylock(&task->phones[i].lock))) { 704 printf("% d: mutex busy\n", i);704 printf("%zu: mutex busy\n", i); 705 705 continue; 706 706 } 707 707 708 708 if (task->phones[i].state != IPC_PHONE_FREE) { 709 printf("% " PRIs ": ", i);709 printf("%zu: ", i); 710 710 711 711 switch (task->phones[i].state) { -
kernel/generic/src/main/kinit.c
r202f57b r7e752b2 129 129 * For each CPU, create its load balancing thread. 130 130 */ 131 size_t i;131 unsigned int i; 132 132 133 133 for (i = 0; i < config.cpu_count; i++) { … … 139 139 thread_ready(thread); 140 140 } else 141 printf("Unable to create kcpulb thread for cpu " PRIs "\n", i);141 printf("Unable to create kcpulb thread for cpu%u\n", i); 142 142 } 143 143 } … … 179 179 for (i = 0; i < init.cnt; i++) { 180 180 if (init.tasks[i].addr % FRAME_SIZE) { 181 printf("init[% " PRIs "].addr is not frame aligned\n", i);181 printf("init[%zu].addr is not frame aligned\n", i); 182 182 programs[i].task = NULL; 183 183 continue; … … 219 219 220 220 if (rd != RE_OK) 221 printf("Init binary % " PRIs "not used (error %d)\n", i, rd);221 printf("Init binary %zu not used (error %d)\n", i, rd); 222 222 } 223 223 } -
kernel/generic/src/main/main.c
r202f57b r7e752b2 183 183 version_print(); 184 184 185 LOG("\nconfig.base=%p config.kernel_size=% " PRIs186 "\nconfig.stack_base=%p config.stack_size=% " PRIs,185 LOG("\nconfig.base=%p config.kernel_size=%zu" 186 "\nconfig.stack_base=%p config.stack_size=%zu", 187 187 config.base, config.kernel_size, config.stack_base, 188 188 config.stack_size); … … 225 225 slab_enable_cpucache(); 226 226 227 printf("Detected % " PRIs " CPU(s), %" PRIu64" MiB free memory\n",227 printf("Detected %u CPU(s), %" PRIu64 " MiB free memory\n", 228 228 config.cpu_count, SIZE2MB(zones_total_size())); 229 229 … … 241 241 size_t i; 242 242 for (i = 0; i < init.cnt; i++) 243 LOG("init[%" PRIs "].addr=%p, init[%" PRIs 244 "].size=%" PRIs, i, init.tasks[i].addr, i, 245 init.tasks[i].size); 243 LOG("init[%zu].addr=%p, init[%zu].size=%zu", 244 i, init.tasks[i].addr, i, init.tasks[i].size); 246 245 } else 247 246 printf("No init binaries found.\n"); -
kernel/generic/src/mm/as.c
r202f57b r7e752b2 1811 1811 } 1812 1812 1813 panic("Inconsistency detected while adding % " PRIs "pages of used "1814 "space at %p.", count, page);1813 panic("Inconsistency detected while adding %zu pages of used " 1814 "space at %p.", count, (void *) page); 1815 1815 } 1816 1816 … … 1991 1991 1992 1992 error: 1993 panic("Inconsistency detected while removing % " PRIs "pages of used "1994 "space from %p.", count, page);1993 panic("Inconsistency detected while removing %zu pages of used " 1994 "space from %p.", count, (void *) page); 1995 1995 } 1996 1996 … … 2105 2105 2106 2106 mutex_lock(&area->lock); 2107 printf("as_area: %p, base=%p, pages=%" PRIs 2108 " (%p - %p)\n", area, area->base, area->pages, 2109 area->base, area->base + FRAMES2SIZE(area->pages)); 2107 printf("as_area: %p, base=%p, pages=%zu" 2108 " (%p - %p)\n", area, (void *) area->base, 2109 area->pages, (void *) area->base, 2110 (void *) (area->base + FRAMES2SIZE(area->pages))); 2110 2111 mutex_unlock(&area->lock); 2111 2112 } -
kernel/generic/src/mm/frame.c
r202f57b r7e752b2 145 145 (!iswithin(zones.info[i].base, zones.info[i].count, 146 146 base, count))) { 147 printf("Zone (%p, %p) overlaps with previous zone (%p, %p)!\n", 148 PFN2ADDR(base), PFN2ADDR(count), 149 PFN2ADDR(zones.info[i].base), 150 PFN2ADDR(zones.info[i].count)); 147 printf("Zone (%p, %p) overlaps " 148 "with previous zone (%p %p)!\n", 149 (void *) PFN2ADDR(base), (void *) PFN2ADDR(count), 150 (void *) PFN2ADDR(zones.info[i].base), 151 (void *) PFN2ADDR(zones.info[i].count)); 151 152 } 152 153 … … 1049 1050 1050 1051 #ifdef CONFIG_DEBUG 1051 printf("Thread %" PRIu64 " waiting for % " PRIs "frames, "1052 "% " PRIs "available.\n", THREAD->tid, size, avail);1052 printf("Thread %" PRIu64 " waiting for %zu frames, " 1053 "%zu available.\n", THREAD->tid, size, avail); 1053 1054 #endif 1054 1055 … … 1297 1298 bool available = zone_flags_available(flags); 1298 1299 1299 printf("%-4 " PRIs, i);1300 printf("%-4zu", i); 1300 1301 1301 1302 #ifdef __32_BITS__ 1302 printf(" % 10p",base);1303 printf(" %p", (void *) base); 1303 1304 #endif 1304 1305 1305 1306 #ifdef __64_BITS__ 1306 printf(" % 18p",base);1307 printf(" %p", (void *) base); 1307 1308 #endif 1308 1309 1309 printf(" %12 " PRIs "%c%c%c ", count,1310 printf(" %12zu %c%c%c ", count, 1310 1311 available ? 'A' : ' ', 1311 1312 (flags & ZONE_RESERVED) ? 'R' : ' ', … … 1313 1314 1314 1315 if (available) 1315 printf("%14 " PRIs " %14" PRIs,1316 printf("%14zu %14zu", 1316 1317 free_count, busy_count); 1317 1318 … … 1354 1355 bool available = zone_flags_available(flags); 1355 1356 1356 printf("Zone number: % " PRIs "\n", znum);1357 printf("Zone base address: %p\n", base);1358 printf("Zone size: % " PRIs " frames (%" PRIs "KiB)\n", count,1357 printf("Zone number: %zu\n", znum); 1358 printf("Zone base address: %p\n", (void *) base); 1359 printf("Zone size: %zu frames (%zu KiB)\n", count, 1359 1360 SIZE2KB(FRAMES2SIZE(count))); 1360 1361 printf("Zone flags: %c%c%c\n", … … 1364 1365 1365 1366 if (available) { 1366 printf("Allocated space: % " PRIs " frames (%" PRIs "KiB)\n",1367 printf("Allocated space: %zu frames (%zu KiB)\n", 1367 1368 busy_count, SIZE2KB(FRAMES2SIZE(busy_count))); 1368 printf("Available space: % " PRIs " frames (%" PRIs "KiB)\n",1369 printf("Available space: %zu frames (%zu KiB)\n", 1369 1370 free_count, SIZE2KB(FRAMES2SIZE(free_count))); 1370 1371 } -
kernel/generic/src/mm/slab.c
r202f57b r7e752b2 890 890 irq_spinlock_unlock(&slab_cache_lock, true); 891 891 892 printf("%-18s %8 " PRIs " %8u %8" PRIs "%8ld %8ld %8ld %-5s\n",892 printf("%-18s %8zu %8u %8zu %8ld %8ld %8ld %-5s\n", 893 893 name, size, (1 << order), objects, allocated_slabs, 894 894 cached_objs, allocated_objs, -
kernel/generic/src/proc/program.c
r202f57b r7e752b2 145 145 146 146 program_loader = image_addr; 147 LOG("Registered program loader at 0x%" PRIp,148 image_addr);147 LOG("Registered program loader at %p", 148 (void *) image_addr); 149 149 150 150 return EOK; -
kernel/generic/src/proc/scheduler.c
r202f57b r7e752b2 727 727 irq_spinlock_lock(&cpus[cpu].lock, true); 728 728 729 printf("cpu%u: address=%p, nrdy=% ld, needs_relink=%" PRIs "\n",729 printf("cpu%u: address=%p, nrdy=%" PRIua ", needs_relink=%zu\n", 730 730 cpus[cpu].id, &cpus[cpu], atomic_get(&cpus[cpu].nrdy), 731 731 cpus[cpu].needs_relink); -
kernel/generic/src/proc/task.c
r202f57b r7e752b2 478 478 #ifdef __32_BITS__ 479 479 if (*additional) 480 printf("%-8" PRIu64 " %9 lu %7lu", task->taskid,480 printf("%-8" PRIu64 " %9" PRIua " %7" PRIua, task->taskid, 481 481 atomic_get(&task->refcount), atomic_get(&task->active_calls)); 482 482 else … … 489 489 #ifdef __64_BITS__ 490 490 if (*additional) 491 printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c %9lu %7lu", 491 printf("%-8" PRIu64 " %9" PRIu64 "%c %9" PRIu64 "%c " 492 "%9" PRIua " %7" PRIua, 492 493 task->taskid, ucycles, usuffix, kcycles, ksuffix, 493 494 atomic_get(&task->refcount), atomic_get(&task->active_calls)); … … 501 502 for (i = 0; i < IPC_MAX_PHONES; i++) { 502 503 if (task->phones[i].callee) 503 printf(" % " PRIs ":%p", i, task->phones[i].callee);504 printf(" %zu:%p", i, task->phones[i].callee); 504 505 } 505 506 printf("\n"); -
kernel/generic/src/synch/spinlock.c
r202f57b r7e752b2 102 102 103 103 if (i++ > DEADLOCK_THRESHOLD) { 104 printf("cpu%u: looping on spinlock % " PRIp ":%s, "105 "caller=% " PRIp "(%s)\n", CPU->id, lock, lock->name,106 CALLER, symtab_fmt_name_lookup(CALLER));104 printf("cpu%u: looping on spinlock %p:%s, " 105 "caller=%p (%s)\n", CPU->id, lock, lock->name, 106 (void *) CALLER, symtab_fmt_name_lookup(CALLER)); 107 107 108 108 i = 0; -
kernel/generic/src/sysinfo/sysinfo.c
r202f57b r7e752b2 494 494 break; 495 495 case SYSINFO_VAL_DATA: 496 printf("+ %s (% " PRIs"bytes)\n", cur->name,496 printf("+ %s (%zu bytes)\n", cur->name, 497 497 cur->val.data.size); 498 498 break; … … 505 505 /* N.B.: No data was actually returned (only a dry run) */ 506 506 (void) cur->val.fn_data(cur, &size, true); 507 printf("+ %s (% " PRIs"bytes) [generated]\n", cur->name,507 printf("+ %s (%zu bytes) [generated]\n", cur->name, 508 508 size); 509 509 break;
Note:
See TracChangeset
for help on using the changeset viewer.