From 78853170f8304ca7af29e7383f5efccedaf21454 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Wed, 17 Feb 2021 18:38:54 -0500 Subject: fixing waits output in alt+pause --- src/kernel/dump.c | 10 +++++----- src/kernel/task.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/kernel/dump.c b/src/kernel/dump.c index d0c02e6..f8d7385 100644 --- a/src/kernel/dump.c +++ b/src/kernel/dump.c @@ -53,7 +53,7 @@ static void write_mem_page(uint32_t page) { #include "kbd.h" -#define WAIT_TASK tasks[i].waits[t].task - tasks + 1, tasks[i].waits[t].task->name +#define WAIT_TASK tasks[t].waits[i].task->name, tasks[t].waits[i].task - tasks + 1 void dump(enum kbd_isr_result kind, const uint32_t edi, const uint32_t esi, const uint32_t ebx, const uint32_t edx, const uint32_t ecx, const uint32_t eax, const uint32_t eip, const uint32_t cs, const uint32_t eflags, const uint32_t esp, const uint32_t ss) { uint32_t cr3; @@ -99,23 +99,23 @@ void dump(enum kbd_isr_result kind, const uint32_t edi, const uint32_t esi, cons if (tasks[t].waiting) { logf(LOG_DUMP, " Waits:"); for (uint8_t i = 0; i < MAX_WAITS; ++i) - switch (tasks[i].waits[t].mode) { + switch (tasks[t].waits[i].mode) { case NONE: continue; case PROCESS_END: - logf(LOG_DUMP, " Waiting for task 0x%hb (%s) to end", WAIT_TASK); + logf(LOG_DUMP, " Waiting for task %s (0x%hb) to end", WAIT_TASK); continue; case WINDOW_ACTION: logf(LOG_DUMP, " Waiting for window action"); continue; case IPC_SENT: - logf(LOG_DUMP, " Waiting for IPC to be sent by 0x%hb (%s)", WAIT_TASK); + logf(LOG_DUMP, " Waiting for IPC to be sent by %s (0x%hb)", WAIT_TASK); continue; case IPC_SENT_ANY: logf(LOG_DUMP, " Waiting for IPC to be sent by anyone"); continue; case IPC_READ: - logf(LOG_DUMP, " Waiting for IPC to be read by 0x%hb (%s)", WAIT_TASK); + logf(LOG_DUMP, " Waiting for IPC to be read by %s (0x%hb)", WAIT_TASK); continue; default: logf(LOG_DUMP, " Other (corrupted?)"); diff --git a/src/kernel/task.c b/src/kernel/task.c index 8d8de86..93310bc 100644 --- a/src/kernel/task.c +++ b/src/kernel/task.c @@ -296,7 +296,7 @@ void unwait(struct task_state *task, struct wait wait) { default: PANIC("Unwait matched with unrecognized wait mode."); } - for (uint8_t i = 0; i < MAX_WAITS; ++i) + for (i = 0; i < MAX_WAITS; ++i) task->waits[i].mode = NONE; task->waiting = false; return; -- cgit v1.2.3