diff options
| author | Jon Santmyer <jon@jonsantmyer.com> | 2026-09-26 17:11:50 -0400 |
|---|---|---|
| committer | Jon Santmyer <jon@jonsantmyer.com> | 2026-09-26 17:11:50 -0400 |
| commit | 5f813d49a08cf3c3f8cf6c422cfb6587df575f62 (patch) | |
| tree | bd8872ee24580614b3eb845e1de26d465b025a09 /arch/x86_64/sys/serial.c | |
| parent | b6765812f7da9feccc271e8e0b06f166e8054386 (diff) | |
| download | jove-kernel-5f813d49a08cf3c3f8cf6c422cfb6587df575f62.tar.gz jove-kernel-5f813d49a08cf3c3f8cf6c422cfb6587df575f62.tar.bz2 jove-kernel-5f813d49a08cf3c3f8cf6c422cfb6587df575f62.zip | |
add docs for syscalls. make syscall code kind-of cleaner
Diffstat (limited to 'arch/x86_64/sys/serial.c')
| -rw-r--r-- | arch/x86_64/sys/serial.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/arch/x86_64/sys/serial.c b/arch/x86_64/sys/serial.c deleted file mode 100644 index 12db6fd..0000000 --- a/arch/x86_64/sys/serial.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "jove.h" -#include "lib/printf.h" -#include "syscall.h" -#include "arch/x86_64/hal/serial_com.h" - -static int -s_syscall_serial_write( - jove_owned_obj_t *serial_com, - size_t payload_bytes, - void *payload_data) -{ - size_t bytes_needed = sizeof(struct syscall_generic_write); - CHECK_TOOSMALL(bytes_needed, payload_bytes, "Message is too small for this syscall!"); - - struct syscall_generic_write *payload = payload_data; - bytes_needed += payload->len * 2; - CHECK_TOOSMALL(bytes_needed, payload_bytes, "Message is too small for write buffer!"); - - return serial_com_write(serial_com, payload->data, payload->len); -} - -int -_syscall_handle_serial( - jove_owned_obj_t *pcb_obj, - jove_owned_obj_t *objdir, - jove_owned_obj_t *message_obj, - jove_owned_obj_t *target_obj, - struct syscall_header *header, - size_t bytes_left, - void *payload_data) -{ - switch(header->callid) { - case 0: - return s_syscall_serial_write(target_obj, bytes_left, payload_data); - default: - kprintf("syscall_serial: serial com object does not support syscall %i\n", header->callid); - return EOOB; - } -} |
