From 737a9a1cf3af37b83479e5b9f18c23680d152190 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Sun, 22 Aug 2021 11:12:34 +0200 Subject: [PATCH] cleaning up print statements and unusded variables --- kinclude/ecall.c | 7 ------- kinclude/sched.c | 25 ------------------------- 2 files changed, 32 deletions(-) diff --git a/kinclude/ecall.c b/kinclude/ecall.c index 4c1b91d..b2df8d3 100644 --- a/kinclude/ecall.c +++ b/kinclude/ecall.c @@ -93,12 +93,6 @@ int ecall_handle_exit(int* args, ProcessControlBlock* pcb) #pragma GCC diagnostic pop -static void print_num(int num) { - char buff[16]; - char* end = itoa(num, buff, 10); - dbgln(buff, (int)(end - buff)); -} - void trap_handle_ecall() { mark_ecall_entry(); ProcessControlBlock* pcb = get_current_process(); @@ -106,7 +100,6 @@ void trap_handle_ecall() { int code = regs[REG_A0 + 7]; // code is inside a7 dbgln("ecall:", 6); - print_num(code); // check if the code is too large/small or if the handler is zero if (code < 0 || code > ECALL_TABLE_LEN || ecall_table[code] == 0) { diff --git a/kinclude/sched.c b/kinclude/sched.c index bf22623..0f58842 100644 --- a/kinclude/sched.c +++ b/kinclude/sched.c @@ -9,29 +9,6 @@ extern void memset(int, void*, void*); // this is the address where threads return to extern int thread_finalizer; -static void print_num(int num) { - char buff[16]; - char* end = itoa(num, buff, 10); - dbgln(buff, (int)(end - buff)); -} - -static void print_processes() { - char line[12] = "============"; - char alive[5] = "alive"; - char dead[4] = "dead"; - for (int i = 0; i < PROCESS_COUNT; i++) { - ProcessControlBlock* pcb = processes + i; - print_num(pcb->pid); - if (pcb->status == PROC_DEAD) { - dbgln(dead, 4); - } else { - dbgln(alive, 5); - } - print_num(i); - dbgln(line, 12); - } -} - // scheduling data: ProcessControlBlock processes[PROCESS_COUNT]; ProcessControlBlock* current_process = NULL; @@ -64,7 +41,6 @@ void scheduler_try_return_to(ProcessControlBlock* pcb) ProcessControlBlock* scheduler_select_free() { unsigned long long int mtime; - int i; int timeout_available = false; // note if a timeout is available if (current_process == NULL) @@ -72,7 +48,6 @@ ProcessControlBlock* scheduler_select_free() while (true) { mtime = read_time(); - int i = 1; ProcessControlBlock* pcb = current_process + 1; if (pcb > processes + PROCESS_COUNT) pcb = processes;