From f004c1ade8d617a82cea2fe249434cccb47a2358 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Tue, 19 Mar 2024 13:03:52 -0400 Subject: rename abi to sys. better memory allocation --- abi/syscall.h | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 abi/syscall.h (limited to 'abi/syscall.h') diff --git a/abi/syscall.h b/abi/syscall.h deleted file mode 100644 index e336fe6..0000000 --- a/abi/syscall.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef JOVE_ABI_SYSCALL_H -#define JOVE_ABI_SYSCALL_H 1 - -#include - -typedef struct syscall { - int id; -} syscall_t; - -struct syscall_log { - syscall_t syscall; - const char *message; -}; - -struct syscall_mem_takefree { - syscall_t syscall; - uintptr_t npages; -}; - -enum -{ - SYSCALL_LOG = 0, - SYSCALL_TID, - - SYSCALL_MEM_TAKEFREE, - - SYSCALL_COUNT -}; - -#define _SYSCALL(data) \ - intmax_t ax; \ - __asm__ volatile("movq %0, %%rdi\nsyscall": "=a"(ax): "r"(data): "memory"); \ - return ax - -int _syscall_log(const char *message) { - struct syscall_log syscall_data = { - .syscall = (syscall_t){ .id = SYSCALL_LOG }, - .message = message - }; - _SYSCALL(&syscall_data); -} - -intmax_t _syscall_tid(void) { - syscall_t syscall_data = { SYSCALL_TID }; - _SYSCALL(&syscall_data); -} - -#endif -- cgit v1.2.1