cleaned up ecall code, moved debug statements into a debug check, removed trailing spaces

master
Anton Lydike 3 years ago
parent f2e83a61ac
commit b5893aacab

@ -78,14 +78,16 @@ optional_int ecall_handle_exit(int* args, ProcessControlBlock* pcb)
pcb->status = PROC_DEAD;
pcb->exit_code = *args;
if (DEBUGGING) {
dbgln("exit", 4);
char msg[34] = "process exited with code ";
itoa(pcb->pid, &msg[8], 10);
itoa(*args % 10, &msg[28], 10);
itoa(*args, &msg[28], 10);
dbgln(msg, 34);
}
// recursively kill all child processes
kill_child_processes(pcb);
@ -95,7 +97,8 @@ optional_int ecall_handle_exit(int* args, ProcessControlBlock* pcb)
#pragma GCC diagnostic pop
void trap_handle_ecall() {
void trap_handle_ecall()
{
mark_ecall_entry();
ProcessControlBlock* pcb = get_current_process();
int *regs = pcb->regs;

@ -3,9 +3,8 @@
#include "sched.h"
/* ecall codes are defined here
*
*
/*
* Maps ecall names to numbers
*/
enum ecall_codes {
ECALL_SPAWN = 1,

Loading…
Cancel
Save