Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2711 → Rev 2712

/trunk/kernel/generic/include/macros.h
62,6 → 62,7
 
return (s1 < e2) && (s2 < e1);
}
 
/* Compute overlapping of physical addresses */
#define PA_overlaps(x, szx, y, szy) overlaps(KA2PA(x), szx, KA2PA(y), szy)
 
/trunk/kernel/generic/src/interrupt/interrupt.c
103,19 → 103,33
/** kconsole cmd - print all exceptions */
static int exc_print_cmd(cmd_arg_t *argv)
{
int i;
unsigned int i;
char *symbol;
 
spinlock_lock(&exctbl_lock);
printf("Exc Description Handler\n");
for (i=0; i < IVT_ITEMS; i++) {
symbol = get_symtab_entry((unative_t)exc_table[i].f);
if (sizeof(void *) == 4) {
printf("Exc Description Handler Symbol\n");
printf("--- ------------ ---------- --------\n");
} else {
printf("Exc Description Handler Symbol\n");
printf("--- ------------ ------------------ --------\n");
}
for (i = 0; i < IVT_ITEMS; i++) {
symbol = get_symtab_entry((unative_t) exc_table[i].f);
if (!symbol)
symbol = "not found";
printf("%d %s %.*p(%s)\n", i + IVT_FIRST, exc_table[i].name,
sizeof(uintptr_t) * 2, exc_table[i].f,symbol);
if (!((i+1) % 20)) {
printf("Press any key to continue.");
if (sizeof(void *) == 4)
printf("%-3u %-12s %#10zx %s\n", i + IVT_FIRST, exc_table[i].name,
exc_table[i].f, symbol);
else
printf("%-3u %-12s %#18zx %s\n", i + IVT_FIRST, exc_table[i].name,
exc_table[i].f, symbol);
if (((i + 1) % 20) == 0) {
printf(" -- Press any key to continue -- ");
spinlock_unlock(&exctbl_lock);
getc(stdin);
spinlock_lock(&exctbl_lock);
122,6 → 136,7
printf("\n");
}
}
spinlock_unlock(&exctbl_lock);
return 1;
/trunk/kernel/generic/src/printf/printf_core.c
458,7 → 458,7
*
* - u Print unsigned decimal number.
*
* - X, x Print hexadecimal number with upper- or lower-case. Prefix isi
* - X, x Print hexadecimal number with upper- or lower-case. Prefix is
* not printed by default.
*
* All other characters from fmt except the formatting directives are printed in
/trunk/kernel/generic/src/proc/task.c
420,10 → 420,15
uint64_t cycles;
char suffix;
order(task_get_accounting(t), &cycles, &suffix);
printf("%-6llu %-10s %-3ld %#10zx %#10zx %9llu%c %7zd %6zd",
t->taskid, t->name, t->context, t, t->as, cycles, suffix,
t->refcount, atomic_get(&t->active_calls));
if (sizeof(void *) == 4)
printf("%-6llu %-10s %-3ld %#10zx %#10zx %9llu%c %7zd %6zd",
t->taskid, t->name, t->context, t, t->as, cycles, suffix,
t->refcount, atomic_get(&t->active_calls));
else
printf("%-6llu %-10s %-3ld %#18zx %#18zx %9llu%c %7zd %6zd",
t->taskid, t->name, t->context, t, t->as, cycles, suffix,
t->refcount, atomic_get(&t->active_calls));
for (j = 0; j < IPC_MAX_PHONES; j++) {
if (t->phones[j].callee)
printf(" %zd:%#zx", j, t->phones[j].callee);
443,10 → 448,17
ipl = interrupts_disable();
spinlock_lock(&tasks_lock);
printf("taskid name ctx address as cycles threads "
"calls callee\n");
printf("------ ---------- --- ---------- ---------- ---------- ------- "
"------ ------>\n");
if (sizeof(void *) == 4) {
printf("taskid name ctx address as "
"cycles threads calls callee\n");
printf("------ ---------- --- ---------- ---------- "
"---------- ------- ------ ------>\n");
} else {
printf("taskid name ctx address as "
"cycles threads calls callee\n");
printf("------ ---------- --- ------------------ ------------------ "
"---------- ------- ------ ------>\n");
}
 
avltree_walk(&tasks_tree, task_print_walker, NULL);
 
/trunk/kernel/generic/src/proc/thread.c
586,18 → 586,27
uint64_t cycles;
char suffix;
order(t->cycles, &cycles, &suffix);
if (sizeof(void *) == 4)
printf("%-6llu %-10s %#10zx %-8s %#10zx %-3ld %#10zx %#10zx %9llu%c ",
t->tid, t->name, t, thread_states[t->state], t->task,
t->task->context, t->thread_code, t->kstack, cycles, suffix);
else
printf("%-6llu %-10s %#18zx %-8s %#18zx %-3ld %#18zx %#18zx %9llu%c ",
t->tid, t->name, t, thread_states[t->state], t->task,
t->task->context, t->thread_code, t->kstack, cycles, suffix);
printf("%-6llu %-10s %#10zx %-8s %#10zx %-3ld %#10zx %#10zx %9llu%c ",
t->tid, t->name, t, thread_states[t->state], t->task,
t->task->context, t->thread_code, t->kstack, cycles, suffix);
if (t->cpu)
printf("%-4zd", t->cpu->id);
else
printf("none");
if (t->state == Sleeping)
printf(" %#10zx", t->sleep_queue);
if (t->state == Sleeping) {
if (sizeof(uintptr_t) == 4)
printf(" %#10zx", t->sleep_queue);
else
printf(" %#18zx", t->sleep_queue);
}
printf("\n");
 
613,10 → 622,21
ipl = interrupts_disable();
spinlock_lock(&threads_lock);
printf("tid name address state task ctx code "
" stack cycles cpu waitqueue\n");
printf("------ ---------- ---------- -------- ---------- --- --------"
"-- ---------- ---------- ---- ---------\n");
if (sizeof(uintptr_t) == 4) {
printf("tid name address state task "
"ctx code stack cycles cpu "
"waitqueue\n");
printf("------ ---------- ---------- -------- ---------- "
"--- ---------- ---------- ---------- ---- "
"----------\n");
} else {
printf("tid name address state task "
"ctx code stack cycles cpu "
"waitqueue\n");
printf("------ ---------- ------------------ -------- ------------------ "
"--- ------------------ ------------------ ---------- ---- "
"------------------\n");
}
 
avltree_walk(&threads_tree, thread_walker, NULL);
 
/trunk/kernel/generic/src/mm/frame.c
1120,15 → 1120,29
 
ipl = interrupts_disable();
spinlock_lock(&zones.lock);
printf("# base address free frames busy frames\n");
printf("-- ------------ ------------ ------------\n");
if (sizeof(void *) == 4) {
printf("# base address free frames busy frames\n");
printf("-- ------------ ------------ ------------\n");
} else {
printf("# base address free frames busy frames\n");
printf("-- -------------------- ------------ ------------\n");
}
for (i = 0; i < zones.count; i++) {
zone = zones.info[i];
spinlock_lock(&zone->lock);
printf("%-2d %12p %12zd %12zd\n", i, PFN2ADDR(zone->base),
zone->free_count, zone->busy_count);
if (sizeof(void *) == 4)
printf("%-2d %#10zx %12zd %12zd\n", i, PFN2ADDR(zone->base),
zone->free_count, zone->busy_count);
else
printf("%-2d %#18zx %12zd %12zd\n", i, PFN2ADDR(zone->base),
zone->free_count, zone->busy_count);
spinlock_unlock(&zone->lock);
}
spinlock_unlock(&zones.lock);
interrupts_restore(ipl);
}
/trunk/kernel/arch/amd64/src/debugger.c
104,17 → 104,27
/** Print table of active breakpoints */
int cmd_print_breakpoints(cmd_arg_t *argv __attribute__((unused)))
{
int i;
unsigned int i;
char *symbol;
 
printf("Breakpoint table.\n");
for (i=0; i < BKPOINTS_MAX; i++)
if (sizeof(void *) == 4) {
printf("# Count Address In symbol\n");
printf("-- ----- ---------- ---------\n");
} else {
printf("# Count Address In symbol\n");
printf("-- ----- ------------------ ---------\n");
}
for (i = 0; i < BKPOINTS_MAX; i++)
if (breakpoints[i].address) {
symbol = get_symtab_entry(breakpoints[i].address);
printf("%d. %lx in %s\n", i,
breakpoints[i].address, symbol);
printf(" Count(%d) ", breakpoints[i].counter);
printf("\n");
if (sizeof(void *) == 4)
printf("%-2u %-5d %#10zx %s\n", i, breakpoints[i].counter,
breakpoints[i].address, symbol);
else
printf("%-2u %-5d %#18zx %s\n", i, breakpoints[i].counter,
breakpoints[i].address, symbol);
}
return 1;
}
/trunk/kernel/arch/ia32/src/mm/frame.c
96,17 → 96,20
 
static int cmd_e820mem(cmd_arg_t *argv)
{
int i;
unsigned int i;
char *name;
 
printf("Base Size Name\n");
printf("------------------ ------------------ ---------\n");
for (i = 0; i < e820counter; i++) {
if (e820table[i].type <= MEMMAP_MEMORY_UNUSABLE)
name = e820names[e820table[i].type];
else
name = "invalid";
printf("%.*p %#.16llXB %s\n", sizeof(unative_t) * 2,
(unative_t) e820table[i].base_address,
(uint64_t) e820table[i].size, name);
printf("%#18llx %#18llx %s\n", e820table[i].base_address,
e820table[i].size, name);
}
return 0;
}