diff options
author | Anton Kling <anton@kling.gg> | 2024-06-26 21:24:22 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-06-26 21:24:22 +0200 |
commit | 2e2f89c7508dede2c970e6061c2f66d4536162ca (patch) | |
tree | 63b7e2aaad1ecd1ed99b814fe967954f0687acfa | |
parent | edf86881446717b633dbb2aaac7b25dbc4630c3f (diff) |
Kernel: Remove unused syscalls
-rw-r--r-- | kernel/Makefile | 2 | ||||
-rw-r--r-- | kernel/syscalls/install_irq.c | 23 | ||||
-rw-r--r-- | kernel/syscalls/map_frames.c | 6 | ||||
-rw-r--r-- | kernel/syscalls/port.c | 14 | ||||
-rw-r--r-- | kernel/syscalls/virtual_to_physical.c | 6 |
5 files changed, 1 insertions, 50 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index 701e43c..0bc1e6b 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -1,6 +1,6 @@ CC="i686-sb-gcc" AS="i686-sb-as" -OBJ = arch/i386/boot.o init/kernel.o cpu/gdt.o cpu/reload_gdt.o cpu/idt.o cpu/io.o libc/stdio/print.o drivers/keyboard.o log.o drivers/pit.o libc/string/memcpy.o libc/string/strlen.o libc/string/memcmp.o drivers/ata.o libc/string/memset.o cpu/syscall.o read_eip.o libc/exit/assert.o process.o libc/string/strcpy.o arch/i386/mmu.o kmalloc.o fs/ext2.o fs/vfs.o fs/devfs.o cpu/spinlock.o random.o libc/string/strcmp.o crypto/ChaCha20/chacha20.o crypto/SHA1/sha1.o fs/tmpfs.o libc/string/isequal.o drivers/pst.o syscalls/ppoll.o syscalls/ftruncate.o kubsan.o syscalls/mmap.o drivers/serial.o syscalls/accept.o syscalls/bind.o syscalls/socket.o socket.o poll.o fs/fifo.o hashmap/hashmap.o fs/shm.o syscalls/shm.o elf.o ksbrk.o sched/scheduler.o syscalls/fstat.o libc/string/copy.o drivers/mouse.o libc/string/strlcpy.o libc/string/strcat.o drivers/vbe.o syscalls/msleep.o syscalls/uptime.o syscalls/mkdir.o drivers/pci.o drivers/rtl8139.o network/ethernet.o network/arp.o network/bytes.o network/ipv4.o network/udp.o syscalls/recvfrom.o math.o syscalls/sendto.o signal.o syscalls/kill.o syscalls/sigaction.o network/tcp.o drivers/ahci.o crypto/xoshiro256plusplus/xoshiro256plusplus.o syscalls/chdir.o syscalls/getcwd.o syscalls/isatty.o syscalls/randomfill.o syscalls/open.o syscalls/write.o syscalls/pwrite.o syscalls/port.o syscalls/map_frames.o syscalls/virtual_to_physical.o syscalls/install_irq.o arch/i386/interrupts.o cpu/isr.o lib/stack.o lib/buffered_write.o lib/list.o cpu/arch_inst.o cpu/int_syscall.o syscalls/munmap.o syscalls/open_process.o syscalls/lseek.o lib/ringbuffer.o lib/relist.o +OBJ = arch/i386/boot.o init/kernel.o cpu/gdt.o cpu/reload_gdt.o cpu/idt.o cpu/io.o libc/stdio/print.o drivers/keyboard.o log.o drivers/pit.o libc/string/memcpy.o libc/string/strlen.o libc/string/memcmp.o drivers/ata.o libc/string/memset.o cpu/syscall.o read_eip.o libc/exit/assert.o process.o libc/string/strcpy.o arch/i386/mmu.o kmalloc.o fs/ext2.o fs/vfs.o fs/devfs.o cpu/spinlock.o random.o libc/string/strcmp.o crypto/ChaCha20/chacha20.o crypto/SHA1/sha1.o fs/tmpfs.o libc/string/isequal.o drivers/pst.o syscalls/ppoll.o syscalls/ftruncate.o kubsan.o syscalls/mmap.o drivers/serial.o syscalls/accept.o syscalls/bind.o syscalls/socket.o socket.o poll.o fs/fifo.o hashmap/hashmap.o fs/shm.o syscalls/shm.o elf.o ksbrk.o sched/scheduler.o syscalls/fstat.o libc/string/copy.o drivers/mouse.o libc/string/strlcpy.o libc/string/strcat.o drivers/vbe.o syscalls/msleep.o syscalls/uptime.o syscalls/mkdir.o drivers/pci.o drivers/rtl8139.o network/ethernet.o network/arp.o network/bytes.o network/ipv4.o network/udp.o syscalls/recvfrom.o math.o syscalls/sendto.o signal.o syscalls/kill.o syscalls/sigaction.o network/tcp.o drivers/ahci.o crypto/xoshiro256plusplus/xoshiro256plusplus.o syscalls/chdir.o syscalls/getcwd.o syscalls/isatty.o syscalls/randomfill.o syscalls/open.o syscalls/write.o syscalls/pwrite.o arch/i386/interrupts.o cpu/isr.o lib/stack.o lib/buffered_write.o lib/list.o cpu/arch_inst.o cpu/int_syscall.o syscalls/munmap.o syscalls/open_process.o syscalls/lseek.o lib/ringbuffer.o lib/relist.o CFLAGS = -std=c99 -O0 -fsanitize=vla-bound,shift-exponent,pointer-overflow,shift,signed-integer-overflow,bounds -ggdb -ffreestanding -Wall -Wextra -Wno-int-conversion -Wno-unused-parameter -Werror -mgeneral-regs-only -Wimplicit-fallthrough -I./libc/include/ -I. -Wno-pointer-sign -DKERNEL LDFLAGS= INCLUDE=-I./includes/ -I../include/ -I./libc/include/ diff --git a/kernel/syscalls/install_irq.c b/kernel/syscalls/install_irq.c deleted file mode 100644 index 5ad2ee6..0000000 --- a/kernel/syscalls/install_irq.c +++ /dev/null @@ -1,23 +0,0 @@ -#include <sched/scheduler.h> -#include <syscalls.h> - -process_t *tmp; -void *handler; - -void jump_signal_handler(void *func, u32 esp); - -void test_handler(reg_t *regs) { - tmp->interrupt_handler = handler; - signal_t sig; - sig.handler_ip = (uintptr_t)handler; - process_push_signal(tmp, sig); - return; -} - -int syscall_install_irq(void (*irq_handler)(), u8 irq) { - // TODO: This should be able to fail if the handler is already set - tmp = current_task; - handler = irq_handler; - install_handler(test_handler, INT_32_INTERRUPT_GATE(0x0), 0x20 + irq); - return 1; -} diff --git a/kernel/syscalls/map_frames.c b/kernel/syscalls/map_frames.c deleted file mode 100644 index 1b0d097..0000000 --- a/kernel/syscalls/map_frames.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <mmu.h> -#include <syscalls.h> - -u32 syscall_map_frames(u32 address, u32 size) { - return (u32)mmu_map_user_frames((void *)address, size); -} diff --git a/kernel/syscalls/port.c b/kernel/syscalls/port.c deleted file mode 100644 index 0a27a5e..0000000 --- a/kernel/syscalls/port.c +++ /dev/null @@ -1,14 +0,0 @@ -#include <syscalls.h> - -// FIXME: PERMISSION CHECKS -void syscall_outw(u16 port, u16 word) { - outw(port, word); -} - -void syscall_outl(u16 port, u32 l) { - outl(port, l); -} - -u32 syscall_inl(u16 port) { - return inl(port); -} diff --git a/kernel/syscalls/virtual_to_physical.c b/kernel/syscalls/virtual_to_physical.c deleted file mode 100644 index e5b3eba..0000000 --- a/kernel/syscalls/virtual_to_physical.c +++ /dev/null @@ -1,6 +0,0 @@ -#include <mmu.h> -#include <syscalls.h> - -u32 syscall_virtual_to_physical(u32 virtual) { - return (u32)virtual_to_physical((void *)virtual, NULL); -} |