|
Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
|
Go to the source code of this file.
Data Structures | |
| struct | iovec |
Macros | |
| #define | SYSCALL_READ 0X0 |
| #define | SYSCALL_WRITE 0X1 |
| #define | SYSCALL_OPEN 0X2 |
| #define | SYSCALL_CLOSE 0x3 |
| #define | SYSCALL_FSTAT 0X4 |
| #define | SYSCALL_ALLOC 0x8 |
| #define | SYSCALL_ARCH_PRCTL 158 |
| #define | SYSCALL_API 0X9F |
| #define | SYSCALL_SET_TID 0xDA |
| #define | SYSCALL_EXIT 0x3C |
| #define | SYSCALL_IOCTL 0x10 |
| #define | SYSCALL_WRITEV 0x14 |
| #define | SYSCALL_EXIT_GROUP 0xE7 |
| #define | SYSCALL_BRK 0x0C |
| #define | SYSCALL_MMAP 0x9 |
| #define | SYSCALL_MPORTECT 0x0A |
| #define | PROT_NONE 0 |
| #define | PROT_READ 1 |
| #define | PROT_WRITE 2 |
| #define | PROT_EXEC 4 |
| #define | PROT_GROWSDOWN 0x01000000 |
| #define | PROT_GROWSUP 0x02000000 |
Functions | |
| void | syscall_init (void) |
| int | syscall_read (int fd, void *buf, long count) |
| int | syscall_write (int fd, void *buf, long count) |
| int | syscall_open (const char *path, int flags, int mode) |
| int | syscall_arch_prctl (int code, unsigned long addr) |
| pid_t | syscall_set_tid (uint32_t tid) |
| int | syscall_ioctl (int fd, uint32_t req, void *arg) |
| intptr_t | syscall_brk (void *addr) |
| void * | syscall_mmap (void *addr, size_t len, int prot, int flags, int fd, long off) |
| int | syscall_mprotect (void *addr, size_t len, int prot) |
| long | syscall_writev (int fd, const struct iovec *iov, int iovcnt) |
| void | syscall_exit_group (int status) |
| #define PROT_EXEC 4 |
Definition at line 28 of file syscall.h.
Referenced by mmap_prot_to_flags(), and syscall_mprotect().
| #define PROT_NONE 0 |
Definition at line 25 of file syscall.h.
Referenced by mmap_prot_to_flags().
| #define PROT_READ 1 |
Definition at line 26 of file syscall.h.
Referenced by mmap_prot_to_flags(), and syscall_mprotect().
| #define PROT_WRITE 2 |
Definition at line 27 of file syscall.h.
Referenced by mmap_prot_to_flags(), and syscall_mprotect().
| #define SYSCALL_ARCH_PRCTL 158 |
Definition at line 14 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_BRK 0x0C |
Definition at line 21 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_CLOSE 0x3 |
Definition at line 11 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_EXIT 0x3C |
Definition at line 17 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_EXIT_GROUP 0xE7 |
Definition at line 20 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_IOCTL 0x10 |
Definition at line 18 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_MMAP 0x9 |
Definition at line 22 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_MPORTECT 0x0A |
Definition at line 23 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_OPEN 0X2 |
Definition at line 10 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_READ 0X0 |
Definition at line 8 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_SET_TID 0xDA |
Definition at line 16 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_WRITE 0X1 |
Definition at line 9 of file syscall.h.
Referenced by syscall_dispatch().
| #define SYSCALL_WRITEV 0x14 |
Definition at line 19 of file syscall.h.
Referenced by syscall_dispatch().
| int syscall_arch_prctl | ( | int | code, |
| unsigned long | addr ) |
Definition at line 14 of file arch_prctl.c.
References addr, ARCH_GET_FS, ARCH_GET_GS, ARCH_SET_FS, ARCH_SET_GS, code, get_current_core_data(), msrSetFSBase(), msrSetKernelGSBase(), and serial2_printf().
Referenced by syscall_dispatch().
| intptr_t syscall_brk | ( | void * | addr | ) |
Definition at line 8 of file brk.c.
References addr, ALIGN_UP, get_current_core_data(), heap_start, PAGE_PRESENT, PAGE_SIZE, PAGE_USER, PAGE_WRITABLE, phys_base_alloc(), serial2_printf(), spin_acquire(), spin_release(), and vxMmap().
Referenced by syscall_dispatch().
| void syscall_exit_group | ( | int | status | ) |
Definition at line 5 of file exit_group.c.
References get_current_core_data(), serial2_printf(), and status.
Referenced by syscall_dispatch().
| void syscall_init | ( | void | ) |
| int syscall_ioctl | ( | int | fd, |
| uint32_t | req, | ||
| void * | arg ) |
Definition at line 8 of file ioctl.c.
References EBADF, ENOTTY, fdt, get_current_core_data(), LOG2_ERROR, and ops.
Referenced by syscall_dispatch().
| void * syscall_mmap | ( | void * | addr, |
| size_t | len, | ||
| int | prot, | ||
| int | flags, | ||
| int | fd, | ||
| long | off ) |
Definition at line 100 of file mmap.c.
References addr, ALIGN_UP, EINVAL, ENOENT, ENOSPC, flags, get_current_core_data(), len, MAP_ANONYMOUS, MAP_PRIVATE, mmap_handle_anonymous(), mmap_prot_to_flags(), serial2_printf(), and serial_trace.
Referenced by syscall_dispatch().
| int syscall_mprotect | ( | void * | addr, |
| size_t | len, | ||
| int | prot ) |
Definition at line 9 of file mprotect.c.
References addr, ALIGN_DOWN, ALIGN_UP, get_current_core_data(), len, PAGE_NO_EXECUTE, PAGE_PRESENT, PAGE_USER, PAGE_WRITABLE, PROT_EXEC, PROT_READ, PROT_WRITE, serial2_printf(), vma_find(), and vxMultipleMmap().
Referenced by syscall_dispatch().
| int syscall_open | ( | const char * | path, |
| int | flags, | ||
| int | mode ) |
| int syscall_read | ( | int | fd, |
| void * | buf, | ||
| long | count ) |
Definition at line 9 of file read.c.
References count, EBADF, ENOTTY, fdt, get_current_core_data(), LOG2_ERROR, and ops.
Referenced by syscall_dispatch().
Definition at line 5 of file set_tid.c.
References get_current_core_data().
Referenced by syscall_dispatch().
| int syscall_write | ( | int | fd, |
| void * | buf, | ||
| long | count ) |
Definition at line 8 of file write.c.
References count, EBADF, ENOTTY, fdt, get_current_core_data(), LOG2_ERROR, and ops.
Referenced by syscall_dispatch().
| long syscall_writev | ( | int | fd, |
| const struct iovec * | iov, | ||
| int | iovcnt ) |
Definition at line 9 of file writev.c.
References EBADF, EINVAL, ENOTTY, fdt, get_current_core_data(), iovec::iov_base, iovec::iov_len, kalloc(), LOG2_ERROR, memcopy(), ops, and serial2_printf().
Referenced by syscall_dispatch().