cleaning up print statements and unusded variables

master
Anton Lydike 3 years ago
parent cef79a92aa
commit 737a9a1cf3

@ -93,12 +93,6 @@ int ecall_handle_exit(int* args, ProcessControlBlock* pcb)
#pragma GCC diagnostic pop #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() { void trap_handle_ecall() {
mark_ecall_entry(); mark_ecall_entry();
ProcessControlBlock* pcb = get_current_process(); ProcessControlBlock* pcb = get_current_process();
@ -106,7 +100,6 @@ void trap_handle_ecall() {
int code = regs[REG_A0 + 7]; // code is inside a7 int code = regs[REG_A0 + 7]; // code is inside a7
dbgln("ecall:", 6); dbgln("ecall:", 6);
print_num(code);
// check if the code is too large/small or if the handler is zero // 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) { if (code < 0 || code > ECALL_TABLE_LEN || ecall_table[code] == 0) {

@ -9,29 +9,6 @@ extern void memset(int, void*, void*);
// this is the address where threads return to // this is the address where threads return to
extern int thread_finalizer; 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: // scheduling data:
ProcessControlBlock processes[PROCESS_COUNT]; ProcessControlBlock processes[PROCESS_COUNT];
ProcessControlBlock* current_process = NULL; ProcessControlBlock* current_process = NULL;
@ -64,7 +41,6 @@ void scheduler_try_return_to(ProcessControlBlock* pcb)
ProcessControlBlock* scheduler_select_free() ProcessControlBlock* scheduler_select_free()
{ {
unsigned long long int mtime; unsigned long long int mtime;
int i;
int timeout_available = false; // note if a timeout is available int timeout_available = false; // note if a timeout is available
if (current_process == NULL) if (current_process == NULL)
@ -72,7 +48,6 @@ ProcessControlBlock* scheduler_select_free()
while (true) { while (true) {
mtime = read_time(); mtime = read_time();
int i = 1;
ProcessControlBlock* pcb = current_process + 1; ProcessControlBlock* pcb = current_process + 1;
if (pcb > processes + PROCESS_COUNT) if (pcb > processes + PROCESS_COUNT)
pcb = processes; pcb = processes;

Loading…
Cancel
Save