applied uncrustify to ecall source

master
Anton Lydike 3 years ago
parent 74d22fb542
commit c5afa93bb3

@ -5,7 +5,7 @@
#include "io.h" #include "io.h"
// this type is only used here, therefore we don't need it in the ktypes header // this type is only used here, therefore we don't need it in the ktypes header
typedef optional_int (*ecall_handler)(int*,ProcessControlBlock*); typedef optional_int (*ecall_handler)(int*, ProcessControlBlock*);
ecall_handler ecall_table[ECALL_TABLE_LEN] = { 0 }; ecall_handler ecall_table[ECALL_TABLE_LEN] = { 0 };
@ -20,7 +20,7 @@ optional_int ecall_handle_spawn_thread(int* args_ptr, ProcessControlBlock* pcb)
void* args = (void*) args_ptr[1]; // a1 void* args = (void*) args_ptr[1]; // a1
//int flags = args_ptr[2]; // a2 //int flags = args_ptr[2]; // a2
optional_pcbptr pcb_or_err = create_new_thread(pcb, entry, args, 1<<14); optional_pcbptr pcb_or_err = create_new_thread(pcb, entry, args, 1 << 14);
if (has_error(pcb_or_err)) if (has_error(pcb_or_err))
return (optional_int) { .error = pcb_or_err.error }; return (optional_int) { .error = pcb_or_err.error };
@ -31,6 +31,7 @@ optional_int ecall_handle_spawn_thread(int* args_ptr, ProcessControlBlock* pcb)
optional_int ecall_handle_sleep(int* args, ProcessControlBlock* pcb) optional_int ecall_handle_sleep(int* args, ProcessControlBlock* pcb)
{ {
int len = args[0]; int len = args[0];
if (len < 0) { if (len < 0) {
return (optional_int) { .error = EINVAL }; return (optional_int) { .error = EINVAL };
} }
@ -59,10 +60,12 @@ optional_int ecall_handle_join(int* args, ProcessControlBlock* pcb)
pcb->waiting_for_process = target; pcb->waiting_for_process = target;
int timeout = args[1]; int timeout = args[1];
if (timeout <= 0) if (timeout <= 0)
return (optional_int) { .value = 0 }; return (optional_int) { .value = 0 };
unsigned int len = (unsigned int) timeout; unsigned int len = (unsigned int) timeout;
pcb->asleep_until = read_time() + len; pcb->asleep_until = read_time() + len;
return (optional_int) { .value = 0 }; return (optional_int) { .value = 0 };
@ -181,5 +184,5 @@ void init_ecall_table()
void handle_exception(int ecode, int mtval) void handle_exception(int ecode, int mtval)
{ {
dbgln("exception encountered!", 17); dbgln("exception encountered!", 17);
__asm__("ebreak"); __asm__ ("ebreak");
} }

Loading…
Cancel
Save