diff --git a/kernel/include/sys/Syscall.h b/kernel/include/sys/Syscall.h index 84ffeb7d..23a9cb4f 100644 --- a/kernel/include/sys/Syscall.h +++ b/kernel/include/sys/Syscall.h @@ -7,30 +7,29 @@ #define SYS_yield 1 #define SYS_sleep 2 #define SYS_write 3 -#define SYS_paint 4 -#define SYS_getprocid 5 -#define SYS_mmap 6 -#define SYS_munmap 7 -#define SYS_open 8 -#define SYS_read 9 -#define SYS_close 10 -#define SYS_seek 11 -#define SYS_execv 12 -#define SYS_fcntl 13 -#define SYS_mprotect 14 -#define SYS_clock_gettime 15 -#define SYS_mkdir 16 -#define SYS_fork 17 -#define SYS_waitpid 18 -#define SYS_access 19 -#define SYS_fstat 20 -#define SYS_pstat 21 -#define SYS_getdents 22 -#define SYS_stat 23 -#define SYS_dup2 24 -#define SYS_setuid 25 -#define SYS_setgid 26 -#define SYS_umask 27 +#define SYS_getprocid 4 +#define SYS_mmap 5 +#define SYS_munmap 6 +#define SYS_open 7 +#define SYS_read 8 +#define SYS_close 9 +#define SYS_seek 10 +#define SYS_execv 11 +#define SYS_fcntl 12 +#define SYS_mprotect 13 +#define SYS_clock_gettime 14 +#define SYS_mkdir 15 +#define SYS_fork 16 +#define SYS_waitpid 17 +#define SYS_access 18 +#define SYS_fstat 19 +#define SYS_pstat 20 +#define SYS_getdents 21 +#define SYS_stat 22 +#define SYS_dup2 23 +#define SYS_setuid 24 +#define SYS_setgid 25 +#define SYS_umask 26 struct stat; struct pstat; @@ -46,7 +45,6 @@ void sys_exit(Context* context, int status); void sys_yield(Context* context); void sys_sleep(Context* context, uint64_t ms); void sys_write(Context* context, int fd, size_t size, const char* addr); -void sys_paint(Context* context, uint64_t x, uint64_t y, uint64_t w, uint64_t h, uint64_t col); void sys_getprocid(Context* context, int field); void sys_mmap(Context* context, void* address, size_t size, int prot, int fd, off_t offset); void sys_munmap(Context* context, void* address, size_t size); diff --git a/kernel/src/sys/Syscall.cpp b/kernel/src/sys/Syscall.cpp index 60068b68..3b5118b8 100644 --- a/kernel/src/sys/Syscall.cpp +++ b/kernel/src/sys/Syscall.cpp @@ -15,7 +15,6 @@ void Syscall::entry(Context* context) case SYS_yield: sys_yield(context); break; case SYS_sleep: sys_sleep(context, context->rdi); break; case SYS_write: sys_write(context, (int)context->rdi, context->rsi, (const char*)context->rdx); break; - case SYS_paint: sys_paint(context, context->rdi, context->rsi, context->rdx, context->r10, context->r8); break; case SYS_getprocid: sys_getprocid(context, (int)context->rdi); break; case SYS_mmap: sys_mmap(context, (void*)context->rdi, context->rsi, (int)context->rdx, (int)context->r10, (off_t)context->r8); break; case SYS_munmap: sys_munmap(context, (void*)context->rdi, context->rsi); break; diff --git a/kernel/src/sys/paint.cpp b/kernel/src/sys/paint.cpp deleted file mode 100644 index 18e462c1..00000000 --- a/kernel/src/sys/paint.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "bootboot.h" -#include "interrupts/Context.h" -#include "render/Framebuffer.h" -#include "std/errno.h" -#include - -extern BOOTBOOT bootboot; - -void sys_paint(Context* context, uint64_t x, uint64_t y, uint64_t w, uint64_t h, uint64_t c) -{ - if ((x + w) > bootboot.fb_width) - { - context->rax = -EINVAL; - return; - } - if ((y + h) > bootboot.fb_height) - { - context->rax = -EINVAL; - return; - } - - uint32_t color = (uint32_t)c; - - framebuffer0.paint_rect((uint32_t)x, (uint32_t)y, (uint32_t)w, (uint32_t)h, Color::from_integer(color)); - - context->rax = 0; -} \ No newline at end of file diff --git a/libs/libc/include/sys/syscall.h b/libs/libc/include/sys/syscall.h index f4699257..c50ea703 100644 --- a/libs/libc/include/sys/syscall.h +++ b/libs/libc/include/sys/syscall.h @@ -5,29 +5,28 @@ #define SYS_yield 1 #define SYS_sleep 2 #define SYS_write 3 -#define SYS_paint 4 -#define SYS_getprocid 5 -#define SYS_mmap 6 -#define SYS_munmap 7 -#define SYS_open 8 -#define SYS_read 9 -#define SYS_close 10 -#define SYS_seek 11 -#define SYS_execv 12 -#define SYS_fcntl 13 -#define SYS_mprotect 14 -#define SYS_clock_gettime 15 -#define SYS_mkdir 16 -#define SYS_fork 17 -#define SYS_waitpid 18 -#define SYS_access 19 -#define SYS_fstat 20 -#define SYS_pstat 21 -#define SYS_getdents 22 -#define SYS_stat 23 -#define SYS_dup2 24 -#define SYS_setuid 25 -#define SYS_setgid 26 -#define SYS_umask 27 +#define SYS_getprocid 4 +#define SYS_mmap 5 +#define SYS_munmap 6 +#define SYS_open 7 +#define SYS_read 8 +#define SYS_close 9 +#define SYS_seek 10 +#define SYS_execv 11 +#define SYS_fcntl 12 +#define SYS_mprotect 13 +#define SYS_clock_gettime 14 +#define SYS_mkdir 15 +#define SYS_fork 16 +#define SYS_waitpid 17 +#define SYS_access 18 +#define SYS_fstat 19 +#define SYS_pstat 20 +#define SYS_getdents 21 +#define SYS_stat 22 +#define SYS_dup2 23 +#define SYS_setuid 24 +#define SYS_setgid 25 +#define SYS_umask 26 #endif \ No newline at end of file diff --git a/libs/libc/src/syscall.cpp b/libs/libc/src/syscall.cpp index f774cc4f..82a55e31 100644 --- a/libs/libc/src/syscall.cpp +++ b/libs/libc/src/syscall.cpp @@ -49,8 +49,7 @@ extern "C" long syscall(long number, ...) result = __luna_syscall3(number, arg0, arg1, arg2); break; } - case SYS_mmap: - case SYS_paint: { + case SYS_mmap: { arg arg0 = va_arg(ap, arg); arg arg1 = va_arg(ap, arg); arg arg2 = va_arg(ap, arg);