diff options
author | Marvin Borner | 2019-11-30 21:07:22 +0100 |
---|---|---|
committer | Marvin Borner | 2019-11-30 21:07:22 +0100 |
commit | 50f949d994c33ab23d63bdb9e8a438560ab0b4c4 (patch) | |
tree | 35089087979bd8cee4693c71264b1c537336e4dd /src/kernel/syscall/syscall.h | |
parent | ac947d45c288f62e927895afe7cd6a722ffdd8f8 (diff) |
Working userspace!
Diffstat (limited to 'src/kernel/syscall/syscall.h')
-rw-r--r-- | src/kernel/syscall/syscall.h | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/src/kernel/syscall/syscall.h b/src/kernel/syscall/syscall.h index 78a1ab5..7fe7862 100644 --- a/src/kernel/syscall/syscall.h +++ b/src/kernel/syscall/syscall.h @@ -1,40 +1,9 @@ #ifndef MELVIX_SYSCALL_H #define MELVIX_SYSCALL_H -#include <kernel/interrupts/interrupts.h> - +extern void idt_syscall(); void syscalls_install(); -void syscall_handler(struct regs *r); - -#define DECL_SYSCALL0(fn) int syscall_##fn(); -#define DECL_SYSCALL1(fn, p1) int syscall_##fn(p1); -#define DECL_SYSCALL2(fn, p1, p2) int syscall_##fn(p1,p2); -#define DECL_SYSCALL3(fn, p1, p2, p3) int syscall_##fn(p1,p2,p3); -#define DECL_SYSCALL4(fn, p1, p2, p3, p4) int syscall_##fn(p1,p2,p3,p4); -#define DECL_SYSCALL5(fn, p1, p2, p3, p4, p5) int syscall_##fn(p1,p2,p3,p4,p5); - -#define DEFN_SYSCALL0(fn, num) \ -int syscall_##fn() { \ - int a; \ - asm volatile("int $0x80" : "=a" (a) : "0" (num)); \ - return a; \ -} - -#define DEFN_SYSCALL1(fn, num, P1) \ -int syscall_##fn(P1 p1) { \ - int a; \ - asm volatile("int $0x80" : "=a" (a) : "0" (num), "b" ((int)p1)); \ - return a; \ -} - -#define DEFN_SYSCALL2(fn, num, P1, P2) \ -int syscall_##fn(P1 p1, P2 p2) { \ - int a; \ - asm volatile("int $0x80" : "=a" (a) : "0" (num), "b" ((int)p1), "c" ((int)p2)); \ - return a; \ -} - -DECL_SYSCALL1(serial_write, const char *) +uint32_t sys_write(char *buf, uint32_t count); #endif |