diff options
author | Anton Kling <anton@kling.gg> | 2024-06-26 21:34:40 +0200 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-06-26 21:34:40 +0200 |
commit | e15065fe45f8004adcc8b69bbbe680ced0d530a1 (patch) | |
tree | 19dab20babd5169a8266faf133d41a4ebd61f1f6 /kernel/includes | |
parent | 2e2f89c7508dede2c970e6061c2f66d4536162ca (diff) |
Kernel: Move all syscalls into one file
Diffstat (limited to 'kernel/includes')
-rw-r--r-- | kernel/includes/syscalls.h | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/kernel/includes/syscalls.h b/kernel/includes/syscalls.h deleted file mode 100644 index a7ebfe0..0000000 --- a/kernel/includes/syscalls.h +++ /dev/null @@ -1,124 +0,0 @@ -#include <fs/vfs.h> -#include <signal.h> -#include <socket.h> -#include <stddef.h> -#include <sys/types.h> -#include <time.h> -#include <typedefs.h> -#include <types.h> - -void syscall_outw(u16 port, u16 word); -u32 syscall_inl(u16 port); -void syscall_outl(u16 port, u32 l); -int syscall_open_process(int pid); - -int syscall_ipc_register_endpoint(u32 endpoint); -int syscall_ipc_read(u8 *buffer, u32 length, u32 *sender_pid); -int syscall_ipc_write(int ipc_id, u8 *buffer, u32 length); -int syscall_ipc_write_to_process(int pid, u8 *buffer, u32 length); -u32 syscall_map_frames(u32 address, u32 size); -u32 syscall_virtual_to_physical(u32 virtual); -int syscall_install_irq(void (*irq_handler)(), u8 irq); - -typedef struct SYS_ACCEPT_PARAMS { - int socket; - struct sockaddr *address; - socklen_t *address_len; -} __attribute__((packed)) SYS_ACCEPT_PARAMS; - -int syscall_accept(SYS_ACCEPT_PARAMS *args); -int syscall_open(const char *file, int flags, mode_t mode); -int syscall_write(int fd, const char *buf, size_t count); -int syscall_pwrite(int fd, const char *buf, size_t count, size_t offset); - -void syscall_randomfill(void *buffer, u32 size); - -typedef struct SYS_BIND_PARAMS { - int sockfd; - const struct sockaddr *addr; - socklen_t addrlen; -} __attribute__((packed)) SYS_BIND_PARAMS; - -int syscall_bind(SYS_BIND_PARAMS *args); -int syscall_chdir(const char *path); - -typedef struct SYS_CLOCK_GETTIME_PARAMS { - clockid_t clk; - struct timespec *ts; -} __attribute__((packed)) SYS_CLOCK_GETTIME_PARAMS; - -int syscall_clock_gettime(SYS_CLOCK_GETTIME_PARAMS *args); -int syscall_ftruncate(int fd, size_t length); - -char *syscall_getcwd(char *buf, size_t size); -int syscall_kill(pid_t pid, int sig); -int syscall_mkdir(const char *path, int mode); - -typedef struct SYS_MMAP_PARAMS { - void *addr; - size_t length; - int prot; - int flags; - int fd; - size_t offset; -} __attribute__((packed)) SYS_MMAP_PARAMS; - -void *syscall_mmap(SYS_MMAP_PARAMS *args); -int syscall_munmap(void *addr, size_t length); -#ifndef MSLEEP_H -#define MSLEEP_H -void syscall_msleep(u32 ms); -#endif - -typedef struct SYS_POLL_PARAMS { - struct pollfd *fds; - size_t nfds; - int timeout; -} __attribute__((packed)) SYS_POLL_PARAMS; - -int syscall_poll(SYS_POLL_PARAMS *args); - -struct two_args { - u32 a; - u32 b; -}; - -size_t syscall_recvfrom( - int socket, void *buffer, size_t length, int flags, - struct two_args - *extra_args /*struct sockaddr *address, socklen_t *address_len*/); - -struct t_two_args { - u32 a; - u32 b; -}; -size_t syscall_sendto(int socket, const void *message, size_t length, - int flags, struct t_two_args *extra_args /* - const struct sockaddr *dest_addr, - socklen_t dest_len*/); -#ifndef SYS_SHM_H -#define SYS_SHM_H - -typedef struct SYS_SHM_OPEN_PARAMS { - const char *name; - int oflag; - mode_t mode; -} __attribute__((packed)) SYS_SHM_OPEN_PARAMS; - -int syscall_shm_open(SYS_SHM_OPEN_PARAMS *args); -#endif -int syscall_sigaction(int sig, const struct sigaction *restrict act, - struct sigaction *restrict oact); - -typedef struct SYS_SOCKET_PARAMS { - int domain; - int type; - int protocol; -} __attribute__((packed)) SYS_SOCKET_PARAMS; - -int syscall_socket(SYS_SOCKET_PARAMS *args); - -int syscall_fstat(int fd, struct stat *buf); -u32 syscall_uptime(void); -int syscall_isatty(int fd); -int syscall_lseek(int fd, int offset, int whence); |