Kernel: Remove offset from OpenFileDescriptor

This is now handled on the libc side. There might be reasons to
have it in kernel side, but for simplicity's sake I'm moving it
to libc for now :)
This commit is contained in:
Bananymous
2023-05-09 20:31:22 +03:00
parent 0cc1fb53d5
commit ff2e2937a5
12 changed files with 90 additions and 142 deletions

View File

@@ -5,21 +5,20 @@
#define SYS_WRITE 3
#define SYS_TERMID 4
#define SYS_CLOSE 5
#define SYS_SEEK 6
#define SYS_OPEN 7
#define SYS_ALLOC 8
#define SYS_FREE 9
#define SYS_OPEN 6
#define SYS_ALLOC 7
#define SYS_FREE 8
#include <kernel/Attributes.h>
#include <stdint.h>
namespace Kernel
{
template<typename T1 = void*, typename T2 = void*, typename T3 = void*>
inline long syscall(int syscall, T1 arg1 = nullptr, T2 arg2 = nullptr, T3 arg3 = nullptr)
ALWAYS_INLINE long syscall(int syscall, uintptr_t arg1 = 0, uintptr_t arg2 = 0, uintptr_t arg3 = 0, uintptr_t arg4 = 0, uintptr_t arg5 = 0)
{
long ret;
asm volatile("int $0x80" : "=a"(ret) : "a"(syscall), "b"((uintptr_t)arg1), "c"((uintptr_t)arg2), "d"((uintptr_t)arg3) : "memory");
asm volatile("int $0x80" : "=a"(ret) : "a"(syscall), "b"((uintptr_t)arg1), "c"((uintptr_t)arg2), "d"((uintptr_t)arg3), "S"((uintptr_t)arg4), "D"((uintptr_t)arg5) : "memory");
return ret;
}