This commit is contained in:
2026-09-16 04:37:37 +02:00
parent e71245c082
commit 3e9bdf72c9
74 changed files with 555 additions and 567 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_ARCHCTL_H
#define __ZINNIA_UAPI_ARCHCTL_H
+3 -3
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_EPOLL_H
#define __ZINNIA_UAPI_EPOLL_H
@@ -24,7 +24,7 @@
#define __EPOLL_CTL_DEL 2
#define __EPOLL_CTL_MOD 3
union epoll_data {
union __epoll_data {
void* ptr;
int fd;
uint32_t u32;
@@ -33,7 +33,7 @@ union epoll_data {
struct epoll_event {
uint32_t events;
union epoll_data data;
union __epoll_data data;
};
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_ERRNO_H
#define __ZINNIA_UAPI_ERRNO_H
+1 -1
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_FCNTL_H
#define __ZINNIA_UAPI_FCNTL_H
+7 -8
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_MMAN_H
#define __ZINNIA_UAPI_MMAN_H
@@ -7,13 +7,12 @@
#define __PROT_WRITE 0x02
#define __PROT_EXEC 0x04
#define __MAP_FAILED ((void*)-1)
#define __MAP_FILE 0x00
#define __MAP_SHARED 0x01
#define __MAP_PRIVATE 0x02
#define __MAP_FIXED 0x10
#define __MAP_ANON 0x20
#define __MAP_ANONYMOUS 0x20
#define __MAP_FAILED ((void*)-1)
#define __MAP_FILE 0x00
#define __MAP_SHARED 0x01
#define __MAP_PRIVATE 0x02
#define __MAP_FIXED 0x10
#define __MAP_ANON 0x20
#define __MS_ASYNC 0x1
#define __MS_INVALIDATE 0x2
+1 -1
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_MOUNT_H
#define __ZINNIA_UAPI_MOUNT_H
+3 -3
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_POLL_H
#define __ZINNIA_UAPI_POLL_H
@@ -16,9 +16,9 @@
#define __POLLWRNORM 0x200
#define __POLLWRBAND 0x400
typedef intptr_t nfds_t;
typedef intptr_t __nfds_t;
struct pollfd {
struct __pollfd {
int fd;
int16_t events;
int16_t revents;
+2 -2
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_STAT_H
#define __ZINNIA_UAPI_STAT_H
@@ -32,7 +32,7 @@
#define __S_IWRITE __S_IWUSR
#define __S_IEXEC __S_IXUSR
struct stat {
struct __stat {
dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
-151
View File
@@ -1,151 +0,0 @@
// SPDX-License-Identifier: GPL-2.0
#ifndef __ZINNIA_UAPI_SYSCALL_NUMBERS_H
#define __ZINNIA_UAPI_SYSCALL_NUMBERS_H
#define __SYS_exit 0
#define __SYS_syslog 1
#define __SYS_getuname 2
#define __SYS_setuname 3
#define __SYS_archctl 4
#define __SYS_reboot 5
#define __SYS_mmap 6
#define __SYS_munmap 7
#define __SYS_mprotect 8
#define __SYS_madvise 9
#define __SYS_sigprocmask 10
#define __SYS_sigsuspend 11
#define __SYS_sigpending 12
#define __SYS_sigaction 13
#define __SYS_sigtimedwait 14
#define __SYS_sigaltstack 15
#define __SYS_sigreturn 16
#define __SYS_sigqueue 17
#define __SYS_execve 18
#define __SYS_fexecve 19
#define __SYS_fork 20
#define __SYS_kill 21
#define __SYS_gettid 22
#define __SYS_getpid 23
#define __SYS_getppid 24
#define __SYS_waitid 25
#define __SYS_waitpid 26
#define __SYS_pread 27
#define __SYS_readv 28
#define __SYS_pwrite 29
#define __SYS_writev 30
#define __SYS_seek 31
#define __SYS_ioctl 32
#define __SYS_openat 33
#define __SYS_close 34
#define __SYS_fstat 35
#define __SYS_fstatat 36
#define __SYS_statvfs 37
#define __SYS_fstatvfs 38
#define __SYS_faccessat 39
#define __SYS_fcntl 40
#define __SYS_ftruncate 41
#define __SYS_truncate 42
#define __SYS_fallocate 43
#define __SYS_fadvise 44
#define __SYS_utimensat 45
#define __SYS_mknodat 46
#define __SYS_getcwd 47
#define __SYS_chdir 48
#define __SYS_fchdir 49
#define __SYS_mkdirat 50
#define __SYS_rmdirat 51
#define __SYS_getdents 52
#define __SYS_renameat 53
#define __SYS_fchmod 54
#define __SYS_fchmodat 55
#define __SYS_fchownat 56
#define __SYS_linkat 57
#define __SYS_symlinkat 58
#define __SYS_unlinkat 59
#define __SYS_readlinkat 60
#define __SYS_flock 61
#define __SYS_ppoll 62
#define __SYS_dup 63
#define __SYS_dup3 64
#define __SYS_sync 65
#define __SYS_fsync 66
#define __SYS_fdatasync 67
#define __SYS_getgroups 68
#define __SYS_setgroups 69
#define __SYS_getsid 70
#define __SYS_setsid 71
#define __SYS_setuid 72
#define __SYS_getuid 73
#define __SYS_setgid 74
#define __SYS_getgid 75
#define __SYS_geteuid 76
#define __SYS_seteuid 77
#define __SYS_getegid 78
#define __SYS_setegid 79
#define __SYS_getpgid 80
#define __SYS_setpgid 81
#define __SYS_getresuid 82
#define __SYS_setresuid 83
#define __SYS_getresgid 84
#define __SYS_setresgid 85
#define __SYS_setreuid 86
#define __SYS_setregid 87
#define __SYS_umask 88
#define __SYS_pipe 89
#define __SYS_futex_wait 90
#define __SYS_futex_wake 91
#define __SYS_thread_create 92
#define __SYS_thread_kill 93
#define __SYS_thread_exit 94
#define __SYS_thread_setname 95
#define __SYS_thread_getname 96
#define __SYS_timer_create 97
#define __SYS_timer_set 98
#define __SYS_timer_get 99
#define __SYS_timer_getoverrun 100
#define __SYS_timer_delete 101
#define __SYS_itimer_get 102
#define __SYS_itimer_set 103
#define __SYS_clock_get 104
#define __SYS_clock_getres 105
#define __SYS_clock_set 106
#define __SYS_sleep 107
#define __SYS_yield 108
#define __SYS_chroot 109
#define __SYS_mount 110
#define __SYS_umount 111
#define __SYS_socket 112
#define __SYS_socketpair 113
#define __SYS_shutdown 114
#define __SYS_bind 115
#define __SYS_connect 116
#define __SYS_accept 117
#define __SYS_listen 118
#define __SYS_getpeername 119
#define __SYS_getsockname 120
#define __SYS_getsockopt 121
#define __SYS_setsockopt 122
#define __SYS_sendmsg 123
#define __SYS_recvmsg 124
#define __SYS_getentropy 125
#define __SYS_getrusage 126
#define __SYS_getrlimit 127
#define __SYS_setrlimit 128
#define __SYS_getpriority 129
#define __SYS_setpriority 130
#define __SYS_sched_getparam 131
#define __SYS_sched_setparam 132
#define __SYS_module_insert 133
#define __SYS_module_remove 134
#define __SYS_epoll_create 135
#define __SYS_epoll_ctl 136
#define __SYS_epoll_pwait 137
#define __SYS_timerfd_create 138
#define __SYS_timerfd_gettime 139
#define __SYS_timerfd_settime 140
#define __SYS_signalfd_create 141
#define __SYS_eventfd_create 142
#define __SYS_msync 143
#define __SYS_sysconf 144
#endif
+1 -1
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_TIME_H
#define __ZINNIA_UAPI_TIME_H
+1 -1
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_TYPES_H
#define __ZINNIA_UAPI_TYPES_H
+1 -1
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_UIO_H
#define __ZINNIA_UAPI_UIO_H
+1 -1
View File
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: GPL-2.0
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ZINNIA_UAPI_UTSNAME_H
#define __ZINNIA_UAPI_UTSNAME_H
-3
View File
@@ -1,3 +0,0 @@
#pragma once
#include <uapi/archctl.h>
+7
View File
@@ -0,0 +1,7 @@
#pragma once
#include <zinnia/errno.h>
#include <stdint.h>
#include <uapi/archctl.h>
errno_t arch_archctl(uintptr_t op, uintptr_t value);
+1
View File
@@ -1,5 +1,6 @@
#pragma once
#include <bits/elf.h>
#include <stdint.h>
constexpr char ELF_MAG[4] = {0x7F, 'E', 'L', 'F'};
+4 -4
View File
@@ -1,9 +1,9 @@
#pragma once
#include <bits/irq.h>
#include <stdint.h>
#include <zinnia/compiler.h>
#include <zinnia/list.h>
#include <bits/irq.h>
#include <stdint.h>
enum irq_status : uint8_t {
IRQ_STATUS_HANDLED,
@@ -35,13 +35,13 @@ struct irq_line {
bool is_busy;
};
void irq_line_attach(struct irq_line* self, struct irq_handler* handler);
struct irq_percpu {
uint32_t level;
bool in_interrupt;
};
void irq_line_attach(struct irq_line* self, struct irq_handler* handler);
void irq_lock();
void irq_unlock();
bool irq_set_interrupted(bool is_interrupted);
+25
View File
@@ -0,0 +1,25 @@
#pragma once
#include <stdint.h>
#include <uapi/mman.h>
enum prot_flags : uint8_t {
PROT_NONE = __PROT_NONE,
PROT_READ = __PROT_READ,
PROT_WRITE = __PROT_WRITE,
PROT_EXEC = __PROT_EXEC,
};
enum map_flags : uint8_t {
MAP_FILE = __MAP_FILE,
MAP_SHARED = __MAP_SHARED,
MAP_PRIVATE = __MAP_PRIVATE,
MAP_FIXED = __MAP_FIXED,
MAP_ANON = __MAP_ANON,
};
enum ms_flags : uint8_t {
MS_ASYNC = __MS_ASYNC,
MS_INVALIDATE = __MS_INVALIDATE,
MS_SYNC = __MS_SYNC,
};
@@ -2,7 +2,7 @@
#include <zinnia/errno.h>
#include <zinnia/list.h>
#include <zinnia/mem/page.h>
#include <zinnia/page.h>
#include <zinnia/spin.h>
#include <stddef.h>
#include <stdint.h>
@@ -37,7 +37,7 @@ struct paged_vmo {
struct vmo object;
struct pager_ops source;
list_head(struct page_list*) cache;
struct spinlock lock;
spinlock_t lock;
};
errno_t vmo_new_paged(struct pager_ops ops, struct paged_vmo** out);
@@ -3,7 +3,7 @@
#include <stddef.h>
#include <stdint.h>
enum page_type : uint32_t {
enum page_type : uint8_t {
PAGE_PHYS = 0, // Regular physical memory.
};
@@ -1,7 +1,7 @@
#pragma once
#include <stdint.h>
#include <zinnia/errno.h>
#include <stdint.h>
struct pager {
errno_t (*try_get_page)(struct pager* pager, uintptr_t offset);
+2 -2
View File
@@ -1,11 +1,11 @@
#pragma once
#include <bits/percpu.h>
#include <stddef.h>
#include <zinnia/compiler.h>
#include <zinnia/irq.h>
#include <zinnia/sched.h>
#include <zinnia/usercopy.h>
#include <bits/percpu.h>
#include <stddef.h>
ASSERT_TYPE(struct arch_percpu);
@@ -1,12 +1,12 @@
#pragma once
#include <zinnia/alloc.h>
#include <zinnia/errno.h>
#include <zinnia/mem/alloc.h>
#include <zinnia/spin.h>
#include <zinnia/utils.h>
#include <bits/mmu.h>
enum pte_flags {
enum pte_flags : uint8_t {
PTE_READ = 1 << 0, // Can read from this page.
PTE_WRITE = 1 << 1, // Can write to this page.
PTE_EXEC = 1 << 2, // Can execute code on this page.
@@ -14,8 +14,8 @@ enum pte_flags {
PTE_DIR = 1 << 4, // Is a non-leaf page.
};
enum cache_mode {
CACHE_NONE, // None means "nothing explicit" here.
enum cache_mode : uint8_t {
CACHE_ANY,
CACHE_WRITE_COMBINE,
CACHE_WRITE_THROUGH,
CACHE_WRITE_BACK,
@@ -24,7 +24,7 @@ enum cache_mode {
struct pmap {
phys_t root;
struct spinlock lock;
spinlock_t lock;
bool is_user;
};
@@ -35,8 +35,6 @@ errno_t pmap_protect(struct pmap* pt, uintptr_t vaddr, enum pte_flags flags);
errno_t pmap_unmap(struct pmap* pt, uintptr_t vaddr);
void pmap_set(struct pmap* pt);
pte_t* pmap_pte_resolve(struct pmap* pt, virt_t virt);
void pte_clear(pte_t* pte);
pte_t pte_build(phys_t addr, enum pte_flags flags, enum cache_mode cache);
bool pte_is_present(pte_t* pte);
+1 -1
View File
@@ -4,6 +4,6 @@
#include <stdarg.h>
[[__format(printf, 1, 2)]]
void printf(const char* message, ...);
void kprintf(const char* message, ...);
void kvprintf(const char* message, va_list args);
+4
View File
@@ -0,0 +1,4 @@
#pragma once
void rcu_read_lock();
void rcu_read_unlock();
+2 -14
View File
@@ -7,17 +7,5 @@ struct refcount {
size_t count;
};
static inline void refcount_inc(struct refcount* rc) {
rc->count++;
}
struct foo {
int a;
struct refcount rc;
};
static void do_foo() {
struct foo f = {.a = 4, .rc = {0}};
refcount_inc(&f.rc);
}
void refcount_inc(struct refcount* rc);
void refcount_dec(struct refcount* rc);
+4 -4
View File
@@ -4,13 +4,13 @@
// Busy-waits in a loop until the lock is freed.
// Does not put the CPU to sleep.
struct spinlock {
typedef struct {
uint32_t owner;
uint32_t next;
};
} spinlock_t;
// Attempts to lock a spinlock. If it's already locked, waits until it's freed.
void spin_lock(struct spinlock* spin);
void spin_lock(spinlock_t* spin);
// Unlocks a spinlock.
void spin_unlock(struct spinlock* spin);
void spin_unlock(spinlock_t* spin);
+18 -4
View File
@@ -2,10 +2,24 @@
#include <zinnia/sched.h>
typedef void (*syscall_fn_t)(struct arch_context* ctx);
enum syscall_kind {
SYSKIND_CALL = 0, // Regular call, returns error and/or value.
SYSKIND_CONTEXT, // Consumes the entire register image.
SYSKIND_NORETURN, // Does not resume control to the calling process.
};
struct syscall {
void (*handler)(struct arch_context*);
enum syscall_kind kind;
};
struct syscall_return {
int errno;
uintptr_t value;
};
void syscall_dispatch(struct arch_context* ctx);
#define __SYSCALL_DEFINE(_idx, name) void syscall_##name(struct arch_context* ctx);
#include <uapi/syscall_numbers.h>
#undef __SYSCALL_DEFINE
#include <zinnia/syscall_list.h>
extern const struct syscall syscall_table[256];
+149
View File
@@ -0,0 +1,149 @@
#pragma once
#include <zinnia/sched.h>
extern void sys_exit(struct arch_context* ctx);
extern void sys_syslog(struct arch_context* ctx);
extern void sys_getuname(struct arch_context* ctx);
extern void sys_setuname(struct arch_context* ctx);
extern void sys_archctl(struct arch_context* ctx);
extern void sys_reboot(struct arch_context* ctx);
extern void sys_mmap(struct arch_context* ctx);
extern void sys_munmap(struct arch_context* ctx);
extern void sys_mprotect(struct arch_context* ctx);
extern void sys_madvise(struct arch_context* ctx);
extern void sys_sigprocmask(struct arch_context* ctx);
extern void sys_sigsuspend(struct arch_context* ctx);
extern void sys_sigpending(struct arch_context* ctx);
extern void sys_sigaction(struct arch_context* ctx);
extern void sys_sigtimedwait(struct arch_context* ctx);
extern void sys_sigaltstack(struct arch_context* ctx);
extern void sys_sigreturn(struct arch_context* ctx);
extern void sys_sigqueue(struct arch_context* ctx);
extern void sys_execve(struct arch_context* ctx);
extern void sys_fexecve(struct arch_context* ctx);
extern void sys_fork(struct arch_context* ctx);
extern void sys_kill(struct arch_context* ctx);
extern void sys_gettid(struct arch_context* ctx);
extern void sys_getpid(struct arch_context* ctx);
extern void sys_getppid(struct arch_context* ctx);
extern void sys_waitid(struct arch_context* ctx);
extern void sys_waitpid(struct arch_context* ctx);
extern void sys_pread(struct arch_context* ctx);
extern void sys_readv(struct arch_context* ctx);
extern void sys_pwrite(struct arch_context* ctx);
extern void sys_writev(struct arch_context* ctx);
extern void sys_seek(struct arch_context* ctx);
extern void sys_ioctl(struct arch_context* ctx);
extern void sys_openat(struct arch_context* ctx);
extern void sys_close(struct arch_context* ctx);
extern void sys_fstat(struct arch_context* ctx);
extern void sys_fstatat(struct arch_context* ctx);
extern void sys_statvfs(struct arch_context* ctx);
extern void sys_fstatvfs(struct arch_context* ctx);
extern void sys_faccessat(struct arch_context* ctx);
extern void sys_fcntl(struct arch_context* ctx);
extern void sys_ftruncate(struct arch_context* ctx);
extern void sys_truncate(struct arch_context* ctx);
extern void sys_fallocate(struct arch_context* ctx);
extern void sys_fadvise(struct arch_context* ctx);
extern void sys_utimensat(struct arch_context* ctx);
extern void sys_mknodat(struct arch_context* ctx);
extern void sys_getcwd(struct arch_context* ctx);
extern void sys_chdir(struct arch_context* ctx);
extern void sys_fchdir(struct arch_context* ctx);
extern void sys_mkdirat(struct arch_context* ctx);
extern void sys_rmdirat(struct arch_context* ctx);
extern void sys_getdents(struct arch_context* ctx);
extern void sys_renameat(struct arch_context* ctx);
extern void sys_fchmod(struct arch_context* ctx);
extern void sys_fchmodat(struct arch_context* ctx);
extern void sys_fchownat(struct arch_context* ctx);
extern void sys_linkat(struct arch_context* ctx);
extern void sys_symlinkat(struct arch_context* ctx);
extern void sys_unlinkat(struct arch_context* ctx);
extern void sys_readlinkat(struct arch_context* ctx);
extern void sys_flock(struct arch_context* ctx);
extern void sys_ppoll(struct arch_context* ctx);
extern void sys_dup(struct arch_context* ctx);
extern void sys_dup3(struct arch_context* ctx);
extern void sys_sync(struct arch_context* ctx);
extern void sys_fsync(struct arch_context* ctx);
extern void sys_fdatasync(struct arch_context* ctx);
extern void sys_getgroups(struct arch_context* ctx);
extern void sys_setgroups(struct arch_context* ctx);
extern void sys_getsid(struct arch_context* ctx);
extern void sys_setsid(struct arch_context* ctx);
extern void sys_setuid(struct arch_context* ctx);
extern void sys_getuid(struct arch_context* ctx);
extern void sys_setgid(struct arch_context* ctx);
extern void sys_getgid(struct arch_context* ctx);
extern void sys_geteuid(struct arch_context* ctx);
extern void sys_seteuid(struct arch_context* ctx);
extern void sys_getegid(struct arch_context* ctx);
extern void sys_setegid(struct arch_context* ctx);
extern void sys_getpgid(struct arch_context* ctx);
extern void sys_setpgid(struct arch_context* ctx);
extern void sys_getresuid(struct arch_context* ctx);
extern void sys_setresuid(struct arch_context* ctx);
extern void sys_getresgid(struct arch_context* ctx);
extern void sys_setresgid(struct arch_context* ctx);
extern void sys_setreuid(struct arch_context* ctx);
extern void sys_setregid(struct arch_context* ctx);
extern void sys_umask(struct arch_context* ctx);
extern void sys_pipe(struct arch_context* ctx);
extern void sys_futex_wait(struct arch_context* ctx);
extern void sys_futex_wake(struct arch_context* ctx);
extern void sys_thread_create(struct arch_context* ctx);
extern void sys_thread_kill(struct arch_context* ctx);
extern void sys_thread_exit(struct arch_context* ctx);
extern void sys_thread_setname(struct arch_context* ctx);
extern void sys_thread_getname(struct arch_context* ctx);
extern void sys_timer_create(struct arch_context* ctx);
extern void sys_timer_set(struct arch_context* ctx);
extern void sys_timer_get(struct arch_context* ctx);
extern void sys_timer_getoverrun(struct arch_context* ctx);
extern void sys_timer_delete(struct arch_context* ctx);
extern void sys_itimer_get(struct arch_context* ctx);
extern void sys_itimer_set(struct arch_context* ctx);
extern void sys_clock_get(struct arch_context* ctx);
extern void sys_clock_getres(struct arch_context* ctx);
extern void sys_clock_set(struct arch_context* ctx);
extern void sys_sleep(struct arch_context* ctx);
extern void sys_yield(struct arch_context* ctx);
extern void sys_chroot(struct arch_context* ctx);
extern void sys_mount(struct arch_context* ctx);
extern void sys_umount(struct arch_context* ctx);
extern void sys_socket(struct arch_context* ctx);
extern void sys_socketpair(struct arch_context* ctx);
extern void sys_shutdown(struct arch_context* ctx);
extern void sys_bind(struct arch_context* ctx);
extern void sys_connect(struct arch_context* ctx);
extern void sys_accept(struct arch_context* ctx);
extern void sys_listen(struct arch_context* ctx);
extern void sys_getpeername(struct arch_context* ctx);
extern void sys_getsockname(struct arch_context* ctx);
extern void sys_getsockopt(struct arch_context* ctx);
extern void sys_setsockopt(struct arch_context* ctx);
extern void sys_sendmsg(struct arch_context* ctx);
extern void sys_recvmsg(struct arch_context* ctx);
extern void sys_getentropy(struct arch_context* ctx);
extern void sys_getrusage(struct arch_context* ctx);
extern void sys_getrlimit(struct arch_context* ctx);
extern void sys_setrlimit(struct arch_context* ctx);
extern void sys_getpriority(struct arch_context* ctx);
extern void sys_setpriority(struct arch_context* ctx);
extern void sys_sched_getparam(struct arch_context* ctx);
extern void sys_sched_setparam(struct arch_context* ctx);
extern void sys_module_insert(struct arch_context* ctx);
extern void sys_module_remove(struct arch_context* ctx);
extern void sys_epoll_create(struct arch_context* ctx);
extern void sys_epoll_ctl(struct arch_context* ctx);
extern void sys_epoll_pwait(struct arch_context* ctx);
extern void sys_timerfd_create(struct arch_context* ctx);
extern void sys_timerfd_gettime(struct arch_context* ctx);
extern void sys_timerfd_settime(struct arch_context* ctx);
extern void sys_signalfd_create(struct arch_context* ctx);
extern void sys_eventfd_create(struct arch_context* ctx);
extern void sys_msync(struct arch_context* ctx);
extern void sys_sysconf(struct arch_context* ctx);
+3 -3
View File
@@ -1,10 +1,10 @@
#pragma once
#include <zinnia/alloc.h>
#include <zinnia/errno.h>
#include <zinnia/mem/alloc.h>
#include <zinnia/mem/object.h>
#include <zinnia/mem/pmap.h>
#include <zinnia/mutex.h>
#include <zinnia/object.h>
#include <zinnia/pmap.h>
// Virtual address space.
struct vas {
+5 -6
View File
@@ -1,12 +1,11 @@
#pragma once
#include <stddef.h>
#include <stdint.h>
#include <uapi/fcntl.h>
#include <zinnia/errno.h>
#include <zinnia/iovec.h>
#include <zinnia/refcount.h>
#include <zinnia/string.h>
#include <stddef.h>
#include <stdint.h>
#include <uapi/fcntl.h>
struct vfs_mount {
struct refcount rc;
@@ -25,7 +24,7 @@ struct vfs_node;
struct vfs_regular_ops {
errno_t (*read)(struct vfs_node* file, struct iovec_iter* buffer, uint64_t offset, ssize_t* out_read);
errno_t (*write)(struct vfs_node* file, struct iovec_iter* buffer, uint64_t offset, ssize_t* out_written);
errno_t (*devctl)(struct vfs_node* file, );
errno_t (*devctl)(struct vfs_node* file);
};
struct vfs_node {
@@ -33,7 +32,7 @@ struct vfs_node {
const struct vfs_regular_ops* ops;
struct vfs_vnode* vnode;
struct vfs_path path;
struct string abs_path;
const char* abs_path;
bool has_path;
};
+1 -1
View File
@@ -8,7 +8,7 @@ struct task;
// A queue of tasks waiting for an event.
struct wait_queue {
tailq_head(struct task) waiters;
struct spinlock lock;
spinlock_t lock;
};
void wait_queue_init(struct wait_queue* wq);