Merge orbis-kernel submodule

This commit is contained in:
Ivan Chikish 2023-07-03 14:10:16 +03:00
parent 91f48cdf77
commit 1ee6b7c970
97 changed files with 8134 additions and 1 deletions

View file

@ -0,0 +1,4 @@
#include "sys/sysproto.hpp"
#include "error.hpp"
orbis::SysResult orbis::sys_acct(Thread *thread, ptr<char> path) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,11 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_audit(Thread *thread, ptr<const void> record, uint length) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_auditon(Thread *thread, sint cmd, ptr<void> data, uint length) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getauid(Thread *thread, ptr<uid_t> auid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setauid(Thread *thread, ptr<uid_t> auid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getaudit(Thread *thread, ptr<struct auditinfo> auditinfo) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setaudit(Thread *thread, ptr<struct auditinfo> auditinfo) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getaudit_addr(Thread *thread, ptr<struct auditinfo_addr> auditinfo_addr, uint length) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setaudit_addr(Thread *thread, ptr<struct auditinfo_addr> auditinfo_addr, uint length) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_auditctl(Thread *thread, ptr<char> path) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,6 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_cap_enter(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_cap_getmode(Thread *thread, ptr<uint> modep) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_cap_new(Thread *thread, sint fd, uint64_t rights) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_cap_getrights(Thread *thread, sint fd, ptr<uint64_t> rights) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,5 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_getcontext(Thread *thread, ptr<struct ucontext> ucp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setcontext(Thread *thread, ptr<struct ucontext> ucp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_swapcontext(Thread *thread, ptr<struct ucontext> oucp, ptr<struct ucontext> ucp) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,7 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_cpuset(Thread *thread, ptr<cpusetid_t> setid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_cpuset_setid(Thread *thread, cpuwhich_t which, id_t id, cpusetid_t setid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_cpuset_getid(Thread *thread, cpulevel_t level, cpuwhich_t which, id_t id, ptr<cpusetid_t> setid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_cpuset_getaffinity(Thread *thread, cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, ptr<cpuset> mask) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_cpuset_setaffinity(Thread *thread, cpulevel_t level, cpuwhich_t which, id_t id, size_t cpusetsize, ptr<const cpuset> mask) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,18 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_getdtablesize(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_dup2(Thread *thread, uint from, uint to) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_dup(Thread *thread, uint fd) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fcntl(Thread *thread, sint fd, sint cmd, slong arg) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_close(Thread *thread, sint fd) {
if (auto close = thread->tproc->ops->close) {
return close(thread, fd);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_closefrom(Thread *thread, sint lowfd) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fstat(Thread *thread, sint fd, ptr<struct stat> ub) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_nfstat(Thread *thread, sint fd, ptr<struct nstat> sb) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fpathconf(Thread *thread, sint fd, sint name) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_flock(Thread *thread, sint fd, sint how) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_kenv(Thread *thread, sint what, ptr<const char> name, ptr<char> value, sint len) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,9 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_kqueue(Thread *thread) {
return {};
}
orbis::SysResult orbis::sys_kevent(Thread *thread, sint fd, ptr<struct kevent> changelist, sint nchanges, ptr<struct kevent> eventlist, sint nevents, ptr<const struct timespec> timeout) {
return {};
}

View file

@ -0,0 +1,5 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_execve(Thread *thread, ptr<char> fname, ptr<ptr<char>> argv, ptr<ptr<char>> envv) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fexecve(Thread *thread, sint fd, ptr<ptr<char>> argv, ptr<ptr<char>> envv) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___mac_execve(Thread *thread, ptr<char> fname, ptr<ptr<char>> argv, ptr<ptr<char>> envv, ptr<struct mac> mac_p) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,13 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_exit(Thread *thread, sint status) {
if (auto exit = thread->tproc->ops->exit) {
return exit(thread, status);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_abort2(Thread *thread, ptr<const char> why, sint narg, ptr<ptr<void>> args) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_wait4(Thread *thread, sint pid, ptr<sint> status, sint options, ptr<struct rusage> rusage) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,6 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_fork(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_pdfork(Thread *thread, ptr<sint> fdp, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_vfork(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_rfork(Thread *thread, sint flags) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,75 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_read(Thread *thread, sint fd, ptr<void> buf, size_t nbyte) {
if (auto read = thread->tproc->ops->read) {
return read(thread, fd, buf, nbyte);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_pread(Thread *thread, sint fd, ptr<void> buf, size_t nbyte, off_t offset) {
if (auto pread = thread->tproc->ops->pread) {
return pread(thread, fd, buf, nbyte, offset);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_freebsd6_pread(Thread *thread, sint fd, ptr<void> buf, size_t nbyte, sint, off_t offset) {
return sys_pread(thread, fd, buf, nbyte, offset);
}
orbis::SysResult orbis::sys_readv(Thread *thread, sint fd, ptr<struct iovec> iovp, uint iovcnt) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_preadv(Thread *thread, sint fd, ptr<struct iovec> iovp, uint iovcnt, off_t offset) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_write(Thread *thread, sint fd, ptr<const void> buf, size_t nbyte) {
if (auto write = thread->tproc->ops->write) {
return write(thread, fd, buf, nbyte);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_pwrite(Thread *thread, sint fd, ptr<const void> buf, size_t nbyte, off_t offset) {
if (auto pwrite = thread->tproc->ops->pwrite) {
return pwrite(thread, fd, buf, nbyte, offset);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_freebsd6_pwrite(Thread *thread, sint fd, ptr<const void> buf, size_t nbyte, sint, off_t offset) {
return sys_pwrite(thread, fd, buf, nbyte, offset);
}
orbis::SysResult orbis::sys_writev(Thread *thread, sint fd, ptr<struct iovec> iovp, uint iovcnt) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_pwritev(Thread *thread, sint fd, ptr<struct iovec> iovp, uint iovcnt, off_t offset) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ftruncate(Thread *thread, sint fd, off_t length) {
if (auto ftruncate = thread->tproc->ops->ftruncate) {
return ftruncate(thread, fd, length);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_freebsd6_ftruncate(Thread *thread, sint fd, sint, off_t length) {
return sys_ftruncate(thread, fd, length);
}
orbis::SysResult orbis::sys_ioctl(Thread *thread, sint fd, ulong com, caddr_t data) {
if (auto ioctl = thread->tproc->ops->ioctl) {
return ioctl(thread, fd, com, data);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_pselect(Thread *thread, sint nd, ptr<fd_set> in, ptr<fd_set> ou, ptr<fd_set> ex, ptr<const struct timespec> ts, ptr<const sigset_t> sm) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_select(Thread *thread, sint nd, ptr<struct fd_set_t> in, ptr<struct fd_set_t> out, ptr<struct fd_set_t> ex, ptr<struct timeval> tv) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_poll(Thread *thread, ptr<struct pollfd> fds, uint nfds, sint timeout) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_openbsd_poll(Thread *thread, ptr<struct pollfd> fds, uint nfds, sint timeout) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_nlm_syscall(Thread *thread, sint debug_level, sint grace_period, sint addr_count, ptr<ptr<char>> addrs) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_nfssvc(Thread *thread, sint flag, caddr_t argp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sysarch(Thread *thread, sint op, ptr<char> parms) {
if (op == 129) {
auto fs = uread((ptr<uint64_t>)parms);
std::printf("sys_sysarch: set FS to 0x%zx\n", (std::size_t)fs);
thread->fsBase = fs;
return {};
}
std::printf("sys_sysarch(op = %d, parms = %p): unknown op\n", op, parms);
return {};
}
orbis::SysResult orbis::sys_nnpfs_syscall(Thread *thread, sint operation, ptr<char> a_pathP, sint opcode, ptr<void> a_paramsP, sint a_followSymlinks) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_afs3_syscall(Thread *thread, slong syscall, slong param1, slong param2, slong param3, slong param4, slong param5, slong param6) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_gssd_syscall(Thread *thread, ptr<char> path) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,7 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_jail(Thread *thread, ptr<struct jail> jail) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_jail_set(Thread *thread, ptr<struct iovec> iovp, uint iovcnt, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_jail_get(Thread *thread, ptr<struct iovec> iovp, uint iovcnt, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_jail_remove(Thread *thread, sint jid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_jail_attach(Thread *thread, sint jid) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,4 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_ktrace(Thread *thread, ptr<const char> fname, sint ops, sint facs, sint pit) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_utrace(Thread *thread, ptr<const void> addr, size_t len) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,10 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_kldload(Thread *thread, ptr<const char> file) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kldunload(Thread *thread, sint fileid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kldunloadf(Thread *thread, slong fileid, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kldfind(Thread *thread, ptr<const char> name) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kldnext(Thread *thread, sint fileid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kldstat(Thread *thread, sint fileid, ptr<struct kld_file_stat> stat) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kldfirstmod(Thread *thread, sint fileid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kldsym(Thread *thread, sint fileid, sint cmd, ptr<void> data) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,4 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_getloginclass(Thread *thread, ptr<char> namebuf, size_t namelen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setloginclass(Thread *thread, ptr<char> namebuf) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,12 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys___mac_get_pid(Thread *thread, pid_t pid, ptr<struct mac> mac_p) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___mac_get_proc(Thread *thread, ptr<struct mac> mac_p) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___mac_set_proc(Thread *thread, ptr<struct mac> mac_p) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___mac_get_fd(Thread *thread, sint fd, ptr<struct mac> mac_p) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___mac_get_file(Thread *thread, ptr<const char> path, ptr<struct mac> mac_p) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___mac_set_fd(Thread *thread, sint fd, ptr<struct mac> mac_p) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___mac_set_file(Thread *thread, ptr<const char> path, ptr<struct mac> mac_p) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___mac_get_link(Thread *thread, ptr<const char> path_p, ptr<struct mac> mac_p) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___mac_set_link(Thread *thread, ptr<const char> path_p, ptr<struct mac> mac_p) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_mac_syscall(Thread *thread, ptr<const char> policy, sint call, ptr<void> arg) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,6 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_modnext(Thread *thread, sint modid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_modfnext(Thread *thread, sint modid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_modstat(Thread *thread, sint modid, ptr<struct module_stat> stat) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_modfind(Thread *thread, ptr<const char> name) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,7 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_msgctl(Thread *thread, sint msqid, sint cmd, ptr<struct msqid_ds> buf) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_msgget(Thread *thread, key_t key, sint msgflg) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_msgsnd(Thread *thread, sint msqid, ptr<const void> msgp, size_t msgsz, sint msgflg) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_msgrcv(Thread *thread, sint msqid, ptr<void> msgp, size_t msgsz, slong msgtyp, sint msgflg) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_msgsys(Thread *thread, sint which, sint a2, sint a3, sint a4, sint a5, sint a6) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,5 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_ntp_gettime(Thread *thread, ptr<struct ntptimeval> ntvp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ntp_adjtime(Thread *thread, ptr<struct timex> tp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_adjtime(Thread *thread, ptr<struct timeval> delta, ptr<struct timeval> olddelta) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,10 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_sched_setparam(Thread *thread, pid_t pid, ptr<const struct sched_param> param) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sched_getparam(Thread *thread, pid_t pid, ptr<struct sched_param> param) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sched_setscheduler(Thread *thread, pid_t pid, sint policy, ptr<const struct sched_param> param) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sched_getscheduler(Thread *thread, pid_t pid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sched_yield(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sched_get_priority_max(Thread *thread, sint policy) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sched_get_priority_min(Thread *thread, sint policy) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sched_rr_get_interval(Thread *thread, pid_t pid, ptr<struct timespec> interval) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_pipe(Thread *thread) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_pdgetpid(Thread *thread, sint fd, ptr<pid_t> pidp) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_ptrace(Thread *thread, sint req, pid_t pid, caddr_t addr, sint data) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,32 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_getpid(Thread *thread) {
thread->retval[0] = thread->tid;
return {};
}
orbis::SysResult orbis::sys_getppid(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getpgrp(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getpgid(Thread *thread, pid_t pid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getsid(Thread *thread, pid_t pid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getuid(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_geteuid(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getgid(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getegid(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getgroups(Thread *thread, uint gidsetsize, ptr<gid_t> gidset) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setsid(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setpgid(Thread *thread, sint pid, sint pgid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setuid(Thread *thread, uid_t uid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_seteuid(Thread *thread, uid_t euid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setgid(Thread *thread, gid_t gid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setegid(Thread *thread, gid_t egid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setgroups(Thread *thread, uint gidsetsize, ptr<gid_t> gidset) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setreuid(Thread *thread, sint ruid, sint euid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setregid(Thread *thread, sint rgid, sint egid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setresuid(Thread *thread, uid_t ruid, uid_t euid, uid_t suid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setresgid(Thread *thread, gid_t rgid, gid_t egid, gid_t sgid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getresuid(Thread *thread, ptr<uid_t> ruid, ptr<uid_t> euid, ptr<uid_t> suid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getresgid(Thread *thread, ptr<gid_t> rgid, ptr<gid_t> egid, ptr<gid_t> sgid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_issetugid(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___setugid(Thread *thread, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getlogin(Thread *thread, ptr<char> namebuf, uint namelen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setlogin(Thread *thread, ptr<char> namebuf) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_posix_openpt(Thread *thread, sint flags) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,7 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_rctl_get_racct(Thread *thread, ptr<const void> inbufp, size_t inbuflen, ptr<void> outbuf, size_t outbuflen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_rctl_get_rules(Thread *thread, ptr<const void> inbufp, size_t inbuflen, ptr<void> outbuf, size_t outbuflen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_rctl_get_limits(Thread *thread, ptr<const void> inbufp, size_t inbuflen, ptr<void> outbuf, size_t outbuflen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_rctl_add_rule(Thread *thread, ptr<const void> inbufp, size_t inbuflen, ptr<void> outbuf, size_t outbuflen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_rctl_remove_rule(Thread *thread, ptr<const void> inbufp, size_t inbuflen, ptr<void> outbuf, size_t outbuflen) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,12 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_getpriority(Thread *thread, sint which, sint who) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setpriority(Thread *thread, sint which, sint who, sint prio) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_rtprio_thread(Thread *thread, sint function, lwpid_t lwpid, ptr<struct rtprio> rtp) {
std::printf("sys_rtprio_thread: unimplemented\n");
return {};
}
orbis::SysResult orbis::sys_rtprio(Thread *thread, sint function, pid_t pid, ptr<struct rtprio> rtp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setrlimit(Thread *thread, uint which, ptr<struct rlimit> rlp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getrlimit(Thread *thread, uint which, ptr<struct rlimit> rlp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getrusage(Thread *thread, sint who, ptr<struct rusage> rusage) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_setfib(Thread *thread, sint fib) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,870 @@
#include "error.hpp"
#include "module/ModuleInfo.hpp"
#include "module/ModuleInfoEx.hpp"
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_netcontrol(Thread *thread, sint fd, uint op,
ptr<void> buf, uint nbuf) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_netabort(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_netgetsockinfo(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_socketex(Thread *thread, ptr<const char> name,
sint domain, sint type, sint protocol) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_socketclose(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_netgetiflist(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_kqueueex(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_mtypeprotect(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_regmgr_call(Thread *thread, uint32_t op,
uint32_t id, ptr<void> result, ptr<void> value,
uint64_t type) {
if (op == 25) {
struct nonsys_int {
union {
uint64_t encoded_id;
struct {
uint8_t data[4];
uint8_t table;
uint8_t index;
uint16_t checksum;
} encoded_id_parts;
};
uint32_t unk;
uint32_t value;
};
auto int_value = reinterpret_cast<nonsys_int *>(value);
std::printf(" encoded_id = %lx\n", int_value->encoded_id);
std::printf(" data[0] = %02x\n", int_value->encoded_id_parts.data[0]);
std::printf(" data[1] = %02x\n", int_value->encoded_id_parts.data[1]);
std::printf(" data[2] = %02x\n", int_value->encoded_id_parts.data[2]);
std::printf(" data[3] = %02x\n", int_value->encoded_id_parts.data[3]);
std::printf(" table = %u\n", int_value->encoded_id_parts.table);
std::printf(" index = %u\n", int_value->encoded_id_parts.index);
std::printf(" checksum = %x\n", int_value->encoded_id_parts.checksum);
std::printf(" unk = %x\n", int_value->unk);
std::printf(" value = %x\n", int_value->value);
}
return{};
}
orbis::SysResult orbis::sys_jitshm_create(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_jitshm_alias(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dl_get_list(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dl_get_info(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dl_notify_event(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_evf_create(Thread *thread, ptr<char> name,
sint flag, ptr<struct evFlag> evf) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_evf_delete(Thread *thread, sint fd) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_evf_open(Thread *thread, ptr<char> name) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_evf_close(Thread *thread, sint fd) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_evf_wait(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_evf_trywait(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_evf_set(Thread *thread, sint fd) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_evf_clear(Thread *thread, sint fd) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_evf_cancel(Thread *thread, sint fd) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_query_memory_protection(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_batch_map(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_osem_create(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_osem_delete(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_osem_open(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_osem_close(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_osem_wait(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_osem_trywait(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_osem_post(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_osem_cancel(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_namedobj_create(Thread *thread, ptr<const char> name, ptr<void> object, uint64_t type) {
std::printf("sys_namedobj_create(name = %s, object = %p, type = 0x%lx) -> %d\n", name, object, type, 1);
thread->retval[0] = 1;
return {};
}
orbis::SysResult orbis::sys_namedobj_delete(Thread *thread /* TODO */) {
std::printf("TODO: sys_namedobj_delete\n");
return {};
}
orbis::SysResult orbis::sys_set_vm_container(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_debug_init(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_suspend_process(Thread *thread, pid_t pid) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_resume_process(Thread *thread, pid_t pid) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_opmc_enable(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_opmc_disable(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_opmc_set_ctl(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_opmc_set_ctr(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_opmc_get_ctr(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_budget_create(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_budget_delete(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_budget_get(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_budget_set(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_virtual_query(Thread *thread, ptr<void> addr,
uint64_t unk, ptr<void> info,
size_t infosz) {
if (auto virtual_query = thread->tproc->ops->virtual_query) {
return virtual_query(thread, addr, unk, info, infosz);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_mdbg_call(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_sblock_create(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_sblock_delete(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_sblock_enter(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_sblock_exit(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_sblock_xenter(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_sblock_xexit(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_eport_create(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_eport_delete(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_eport_trigger(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_eport_open(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_obs_eport_close(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_is_in_sandbox(Thread *thread /* TODO */) {
std::printf("sys_is_in_sandbox() -> 0\n");
return{};
}
orbis::SysResult orbis::sys_dmem_container(Thread *thread) {
thread->retval[0] = 0; // returns default direct memory device
return {};
}
orbis::SysResult orbis::sys_get_authinfo(Thread *thread, pid_t pid, ptr<void> info) {
struct authinfo {
uint64_t a;
uint64_t b;
};
std::memset(info, 0, 136);
((authinfo *)info)->b = ~0;
return {};
}
orbis::SysResult orbis::sys_mname(Thread *thread, ptr<void> address, uint64_t length, ptr<const char> name) {
std::printf("sys_mname(%p, %p, '%s')\n", address, (char *)address + length, name);
return {};
}
orbis::SysResult orbis::sys_dynlib_dlopen(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dynlib_dlclose(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dynlib_dlsym(Thread *thread, SceKernelModule handle,
ptr<const char> symbol,
ptr<ptr<void>> addrp) {
if (thread->tproc->ops->dynlib_dlsym) {
return thread->tproc->ops->dynlib_dlsym(thread, handle, symbol, addrp);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dynlib_get_list(Thread *thread,
ptr<SceKernelModule> pArray,
size_t numArray,
ptr<size_t> pActualNum) {
std::size_t actualNum = 0;
for (auto [id, module] : thread->tproc->modulesMap) {
if (actualNum >= numArray) {
break;
}
pArray[actualNum++] = id;
}
*pActualNum = actualNum;
return {};
}
orbis::SysResult orbis::sys_dynlib_get_info(Thread *thread,
SceKernelModule handle,
ptr<ModuleInfo> pInfo) {
auto module = thread->tproc->modulesMap.get(handle);
if (module == nullptr) {
return ErrorCode::SRCH;
}
if (pInfo->size != sizeof(ModuleInfo)) {
return ErrorCode::INVAL;
}
ModuleInfo result = {};
result.size = sizeof(ModuleInfo);
std::strncpy(result.name, module->moduleName, sizeof(result.name));
std::memcpy(result.segments, module->segments,
sizeof(ModuleSegment) * module->segmentCount);
result.segmentCount = module->segmentCount;
std::memcpy(result.fingerprint, module->fingerprint,
sizeof(result.fingerprint));
uwrite(pInfo, result);
return {};
}
orbis::SysResult
orbis::sys_dynlib_load_prx(Thread *thread, ptr<const char> name, uint64_t arg1, ptr<ModuleHandle> pHandle, uint64_t arg3) {
if (auto dynlib_load_prx = thread->tproc->ops->dynlib_load_prx) {
return dynlib_load_prx(thread, name, arg1, pHandle, arg3);
}
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_dynlib_unload_prx(Thread *thread, SceKernelModule handle) {
if (auto dynlib_unload_prx = thread->tproc->ops->dynlib_unload_prx) {
return dynlib_unload_prx(thread, handle);
}
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_dynlib_do_copy_relocations(Thread *thread) {
if (auto dynlib_do_copy_relocations = thread->tproc->ops->dynlib_do_copy_relocations) {
return dynlib_do_copy_relocations(thread);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dynlib_prepare_dlclose(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
// template<typename T> using le = T;
orbis::SysResult orbis::sys_dynlib_get_proc_param(Thread *thread,
ptr<ptr<void>> procParam,
ptr<uint64_t> procParamSize) {
auto proc = thread->tproc;
*procParam = proc->processParam;
*procParamSize = proc->processParamSize;
return {};
}
orbis::SysResult orbis::sys_dynlib_process_needed_and_relocate(Thread *thread) {
if (auto processNeeded = thread->tproc->ops->processNeeded) {
auto result = processNeeded(thread);
if (result.value() != 0) {
return result;
}
}
for (auto [id, module] : thread->tproc->modulesMap) {
auto result = module->relocate(thread->tproc);
if (result.isError()) {
return result;
}
}
if (auto registerEhFrames = thread->tproc->ops->registerEhFrames) {
auto result = registerEhFrames(thread);
if (result.value() != 0) {
return result;
}
}
return {};
}
orbis::SysResult orbis::sys_sandbox_path(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
struct mdbg_property {
orbis::int32_t unk;
orbis::int32_t unk2;
orbis::uint64_t addr_ptr;
orbis::uint64_t areaSize;
orbis::int64_t unk3;
orbis::int64_t unk4;
char name[32];
};
orbis::SysResult orbis::sys_mdbg_service(Thread *thread, uint32_t op, ptr<void> arg0, ptr<void> arg1) {
std::printf("sys_mdbg_service(op = %d, arg0 = %p, arg1 = %p)\n", op, arg0, arg1);
switch (op) {
case 1: {
auto *prop = (mdbg_property *)arg0;
std::printf(
"sys_mdbg_service set property (name='%s', address=0x%lx, size=%lu)\n",
prop->name, prop->addr_ptr, prop->areaSize);
break;
}
case 3: {
std::printf("sys_mdbg_service: ERROR CODE: %X\n", (unsigned)reinterpret_cast<uint64_t>(arg0));
break;
}
case 7: {
std::printf("sys_mdbg_service: %s\n", (char *)arg0);
break;
}
default:
break;
}
return{};
}
orbis::SysResult orbis::sys_randomized_path(Thread *thread /* TODO */) {
std::printf("TODO: sys_randomized_path()\n");
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_rdup(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dl_get_metadata(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_workaround8849(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_is_development_mode(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_get_self_auth_info(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_dynlib_get_info_ex(Thread *thread, SceKernelModule handle,
ptr<struct Unk> unk,
ptr<ModuleInfoEx> destModuleInfoEx) {
auto module = thread->tproc->modulesMap.get(handle);
if (module == nullptr) {
return ErrorCode::SRCH;
}
if (destModuleInfoEx->size != sizeof(ModuleInfoEx)) {
return ErrorCode::INVAL;
}
ModuleInfoEx result = {};
result.size = sizeof(ModuleInfoEx);
std::strncpy(result.name, module->moduleName, sizeof(result.name));
result.id = std::to_underlying(handle);
result.tlsIndex = module->tlsIndex;
result.tlsInit = module->tlsInit;
result.tlsInitSize = module->tlsInitSize;
result.tlsSize = module->tlsSize;
result.tlsOffset = module->tlsOffset;
result.tlsAlign = module->tlsAlign;
result.initProc = module->initProc;
result.finiProc = module->finiProc;
result.ehFrameHdr = module->ehFrameHdr;
result.ehFrame = module->ehFrame;
result.ehFrameHdrSize = module->ehFrameHdrSize;
result.ehFrameSize = module->ehFrameSize;
std::memcpy(result.segments, module->segments,
sizeof(ModuleSegment) * module->segmentCount);
result.segmentCount = module->segmentCount;
result.refCount = module->references.load(std::memory_order::relaxed);
uwrite(destModuleInfoEx, result);
return {};
}
orbis::SysResult orbis::sys_budget_getid(Thread *thread) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_budget_get_ptype(Thread *thread, sint budgetId) {
thread->retval[0] = 1;
return {};
}
orbis::SysResult
orbis::sys_get_paging_stats_of_all_threads(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_get_proc_type_info(Thread *thread,
ptr<sint> destProcessInfo) {
std::printf("TODO: sys_get_proc_type_info\n");
struct dargs {
uint64_t size = sizeof(dargs);
uint32_t ptype;
uint32_t pflags;
} args = {
.ptype = 1,
.pflags = 0
};
uwrite((ptr<dargs>)destProcessInfo, args);
return{};
}
orbis::SysResult orbis::sys_get_resident_count(Thread *thread, pid_t pid) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_prepare_to_suspend_process(Thread *thread,
pid_t pid) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_get_resident_fmem_count(Thread *thread, pid_t pid) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_get_name(Thread *thread, lwpid_t lwpid) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_set_gpo(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_get_paging_stats_of_all_objects(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_test_debug_rwmem(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_free_stack(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_suspend_system(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
enum ImpiOpcode {
kIpmiCreateClient = 2
};
struct IpmiCreateClientParams {
orbis::ptr<void> arg0;
orbis::ptr<char> name;
orbis::ptr<void> arg2;
};
static_assert(sizeof(IpmiCreateClientParams) == 0x18);
orbis::SysResult orbis::sys_ipmimgr_call(Thread *thread, uint64_t id, uint64_t arg2, ptr<uint64_t> result, ptr<uint64_t> params, uint64_t paramsSize, uint64_t arg6) {
std::printf("TODO: sys_ipmimgr_call(id = %lld)\n", (unsigned long long)id);
if (id == kIpmiCreateClient) {
if (paramsSize != sizeof(IpmiCreateClientParams)) {
return ErrorCode::INVAL;
}
auto createParams = (ptr<IpmiCreateClientParams>)params;
std::printf("ipmi create client(%p, '%s', %p)\n",
(void *)createParams->arg0,
(char *)createParams->name,
(void *)createParams->arg2
);
return{};
}
if (id == 1131 || id == 1024 || id == 800) {
thread->retval[0] = -0x40004; // HACK
return {};
// return -0x40004;
}
if (id == 3) {
if (result) {
*result = 0;
}
return {};
}
return {};
}
orbis::SysResult orbis::sys_get_gpo(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_get_vm_map_timestamp(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_opmc_set_hw(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_opmc_get_hw(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_get_cpu_usage_all(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_mmap_dmem(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_physhm_open(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_physhm_unlink(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_resume_internal_hdd(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_suspend_ucontext(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_resume_ucontext(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_get_ucontext(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_set_ucontext(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_set_timezone_info(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_set_phys_fmem_limit(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_utc_to_localtime(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_localtime_to_utc(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_set_uevt(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_get_cpu_usage_proc(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_get_map_statistics(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_set_chicken_switches(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_extend_page_table_pool(Thread *thread) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_extend_page_table_pool2(Thread *thread) {
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_get_kernel_mem_statistics(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_get_sdk_compiled_version(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_app_state_change(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dynlib_get_obj_member(Thread *thread, SceKernelModule handle, uint64_t index, ptr<ptr<void>> addrp) {
if (auto dynlib_get_obj_member = thread->tproc->ops->dynlib_get_obj_member) {
return dynlib_get_obj_member(thread, handle, index, addrp);
}
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_budget_get_ptype_of_budget(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_prepare_to_resume_process(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_process_terminate(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_blockpool_open(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_blockpool_map(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_blockpool_unmap(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_dynlib_get_info_for_libdbg(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_blockpool_batch(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_fdatasync(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dynlib_get_list2(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dynlib_get_info2(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_aio_submit(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_aio_multi_delete(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_aio_multi_wait(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_aio_multi_poll(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_aio_get_data(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_aio_multi_cancel(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_get_bio_usage_all(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_aio_create(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_aio_submit_cmd(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_aio_init(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_get_page_table_stats(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_dynlib_get_list_for_libdbg(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_blockpool_move(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_virtual_query_all(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_reserve_2mb_page(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_cpumode_yield(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_wait6(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_cap_rights_limit(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_cap_ioctls_limit(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_cap_ioctls_get(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_cap_fcntls_limit(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_cap_fcntls_get(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_bindat(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_connectat(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_chflagsat(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_accept4(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_pipe2(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_aio_mlock(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_procctl(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_ppoll(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_futimens(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_utimensat(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_numa_getaffinity(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_numa_setaffinity(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_apr_submit(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_apr_resolve(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_apr_stat(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_apr_wait(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_apr_ctrl(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_get_phys_page_size(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_begin_app_mount(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_end_app_mount(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_fsc2h_ctrl(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_streamwrite(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_app_save(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_app_restore(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_saved_app_delete(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_get_ppr_sdk_compiled_version(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_notify_app_event(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_ioreq(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_openintr(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_dl_get_info_2(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_acinfo_add(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_acinfo_delete(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult
orbis::sys_acinfo_get_all_for_coredump(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_ampr_ctrl_debug(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_workspace_ctrl(Thread *thread /* TODO */) {
return ErrorCode::NOSYS;
}

View file

@ -0,0 +1,6 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys___semctl(Thread *thread, sint semid, sint semnum, sint cmd, ptr<union semun> arg) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_semget(Thread *thread, key_t key, sint nsems, sint semflg) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_semop(Thread *thread, sint semid, ptr<struct sembuf> sops, size_t nspos) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_semsys(Thread *thread, sint which, sint a2, sint a3, sint a4, sint a5) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,7 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_shmdt(Thread *thread, ptr<const void> shmaddr) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_shmat(Thread *thread, sint shmid, ptr<const void> shmaddr, sint shmflg) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_shmctl(Thread *thread, sint shmid, sint cmd, ptr<struct shmid_ds> buf) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_shmget(Thread *thread, key_t key, size_t size, sint shmflg) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_shmsys(Thread *thread, sint which, sint a2, sint a3, sint a4) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_reboot(Thread *thread, sint opt) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,44 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_sigaction(Thread *thread, sint sig, ptr<struct sigaction> act, ptr<struct sigaction> oact) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sigprocmask(Thread *thread, sint how, ptr<uint64_t> set, ptr<uint64_t> oset) {
if (oset) {
for (std::size_t i = 0; i < 2; ++i) {
oset[i] = thread->sigMask[i];
}
}
if (set) {
switch (how) {
case 0: // unblock
for (std::size_t i = 0; i < 2; ++i) {
thread->sigMask[i] &= ~set[i];
}
case 1: // block
for (std::size_t i = 0; i < 2; ++i) {
thread->sigMask[i] |= set[i];
}
break;
case 3: // set
for (std::size_t i = 0; i < 2; ++i) {
thread->sigMask[i] = set[i];
}
break;
default:
return ErrorCode::INVAL;
}
}
return {};
}
orbis::SysResult orbis::sys_sigwait(Thread *thread, ptr<const struct sigset> set, ptr<sint> sig) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sigtimedwait(Thread *thread, ptr<const struct sigset> set, ptr<struct siginfo> info, ptr<const struct timespec> timeout) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sigwaitinfo(Thread *thread, ptr<const struct sigset> set, ptr<struct siginfo> info) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sigpending(Thread *thread, ptr<struct sigset> set) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sigsuspend(Thread *thread, ptr<const struct sigset> set) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sigaltstack(Thread *thread, ptr<struct stack_t> ss, ptr<struct stack_t> oss) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kill(Thread *thread, sint pid, sint signum) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_pdkill(Thread *thread, sint fd, sint signum) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sigqueue(Thread *thread, pid_t pid, sint signum, ptr<void> value) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sigreturn(Thread *thread, ptr<struct ucontext> sigcntxp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::nosys(Thread *thread) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_profil(Thread *thread, caddr_t samples, size_t size, size_t offset, uint scale) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,4 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_swapon(Thread *thread, ptr<char> name) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_swapoff(Thread *thread, ptr<const char> name) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_yield(Thread *thread) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,248 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys___sysctl(Thread *thread, ptr<sint> name,
uint namelen, ptr<void> old,
ptr<size_t> oldlenp, ptr<void> new_,
size_t newlen) {
enum sysctl_ctl { unspec, kern, vm, vfs, net, debug, hw, machdep, user };
// machdep.tsc_freq
enum sysctl_kern {
usrstack = 33,
kern_14 = 14,
kern_37 = 37,
// FIXME
smp_cpus = 1000,
sdk_version,
sched_cpusetsize,
proc_ptc,
};
enum sysctl_hw {
pagesize = 7,
};
enum sysctl_machdep {
// FIXME
tsc_freq = 1000
};
// for (unsigned int i = 0; i < namelen; ++i) {
// std::printf(" name[%u] = %u\n", i, name[i]);
// }
if (namelen == 3) {
// 1 - 14 - 41 - debug flags?
if (name[0] == 1 && name[1] == 14 && name[2] == 41) {
// std::printf(" kern.14.41\n");
if (*oldlenp != 4 || new_ != nullptr || newlen != 0) {
return ErrorCode::INVAL;
}
*(uint32_t *)old = 0;
return {};
}
}
if (namelen == 4) {
// 1 - 14 - 35 - 2
// sceKernelGetAppInfo
struct app_info {
char unk[72];
};
if (name[0] == 1 && name[1] == 14 && name[2] == 35) {
// std::printf(" kern.14.35.%u\n", name[3]);
memset(old, 0, sizeof(app_info));
return {};
}
}
if (namelen == 2) {
switch (name[0]) {
case sysctl_ctl::unspec: {
switch (name[1]) {
case 3: {
std::printf(" unspec - get name of '%s'\n",
std::string((char *)new_, newlen).c_str());
auto searchName = std::string_view((char *)new_, newlen);
auto *dest = (std::uint32_t *)old;
std::uint32_t count = 0;
if (searchName == "kern.smp.cpus") {
if (*oldlenp < 2 * sizeof(uint32_t)) {
return ErrorCode::INVAL;
}
dest[count++] = kern;
dest[count++] = smp_cpus;
} else if (searchName == "machdep.tsc_freq") {
if (*oldlenp < 2 * sizeof(uint32_t)) {
return ErrorCode::INVAL;
}
dest[count++] = machdep;
dest[count++] = tsc_freq;
} else if (searchName == "kern.sdk_version") {
if (*oldlenp < 2 * sizeof(uint32_t)) {
return ErrorCode::INVAL;
}
dest[count++] = kern;
dest[count++] = sdk_version;
} else if (searchName == "kern.sched.cpusetsize") {
if (*oldlenp < 2 * sizeof(uint32_t)) {
return ErrorCode::INVAL;
}
dest[count++] = kern;
dest[count++] = sched_cpusetsize;
} else if (searchName == "kern.proc.ptc") {
if (*oldlenp < 2 * sizeof(uint32_t)) {
std::printf(" kern.proc.ptc error\n");
return ErrorCode::INVAL;
}
dest[count++] = kern;
dest[count++] = proc_ptc;
}
if (count == 0) {
return ErrorCode::SRCH;
}
*oldlenp = count * sizeof(uint32_t);
return {};
}
default:
break;
}
std::printf(" unspec_%u\n", name[1]);
return {};
}
case sysctl_ctl::kern:
switch (name[1]) {
case sysctl_kern::usrstack: {
if (*oldlenp != 8 || new_ != nullptr || newlen != 0) {
return ErrorCode::INVAL;
}
std::printf("Reporting stack at %p\n", thread->stackEnd);
*(ptr<void> *)old = thread->stackEnd;
return {};
}
case sysctl_kern::smp_cpus:
if (*oldlenp != 4 || new_ != nullptr || newlen != 0) {
return ErrorCode::INVAL;
}
*(uint32_t *)old = 1;
break;
case sysctl_kern::sdk_version: {
if (*oldlenp != 4 || new_ != nullptr || newlen != 0) {
return ErrorCode::INVAL;
}
auto processParam =
reinterpret_cast<std::byte *>(thread->tproc->processParam);
auto sdkVersion = processParam //
+ sizeof(uint64_t) // size
+ sizeof(uint32_t) // magic
+ sizeof(uint32_t); // entryCount
std::printf("Reporting SDK version %x\n",
*reinterpret_cast<uint32_t *>(sdkVersion));
*(uint32_t *)old = *reinterpret_cast<uint32_t *>(sdkVersion);
break;
}
case sysctl_kern::sched_cpusetsize:
if (*oldlenp != 4 || new_ != nullptr || newlen != 0) {
return ErrorCode::INVAL;
}
*(std::uint32_t *)old = 4;
break;
case sysctl_kern::kern_37: {
struct kern37_value {
std::uint64_t size;
std::uint64_t unk[7];
};
if (*oldlenp != sizeof(kern37_value) || new_ != nullptr ||
newlen != 0) {
return ErrorCode::INVAL;
}
auto value = (kern37_value *)old;
value->size = sizeof(kern37_value);
break;
}
case sysctl_kern::proc_ptc: {
if (*oldlenp != 8 || new_ != nullptr || newlen != 0) {
return ErrorCode::INVAL;
}
*(std::uint64_t *)old = 1357;
}
default:
return ErrorCode::INVAL;
}
break;
case sysctl_ctl::vm:
case sysctl_ctl::vfs:
case sysctl_ctl::net:
case sysctl_ctl::debug:
return ErrorCode::INVAL;
case sysctl_ctl::hw:
switch (name[1]) {
case sysctl_hw::pagesize:
if (*oldlenp != 4 || new_ != nullptr || newlen != 0) {
return ErrorCode::INVAL;
}
*(uint32_t *)old = 0x4000;
break;
default:
break;
}
break;
case sysctl_ctl::machdep:
switch (name[1]) {
case sysctl_machdep::tsc_freq: {
if (*oldlenp != 8 || new_ != nullptr || newlen != 0) {
return ErrorCode::INVAL;
}
*(uint64_t *)old = 1000000000ull;
return {};
default:
return ErrorCode::INVAL;
}
}
case sysctl_ctl::user:
return ErrorCode::INVAL;
}
}
return {};
}

View file

@ -0,0 +1,69 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_thr_create(Thread *thread, ptr<struct ucontext> ctxt, ptr<slong> arg, sint flags) {
if (auto thr_create = thread->tproc->ops->thr_create) {
return thr_create(thread, ctxt, arg, flags);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_new(Thread *thread, ptr<struct thr_param> param, sint param_size) {
if (auto thr_new = thread->tproc->ops->thr_new) {
return thr_new(thread, param, param_size);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_self(Thread *thread, ptr<slong> id) {
uwrite(id, (slong)thread->tid);
return {};
}
orbis::SysResult orbis::sys_thr_exit(Thread *thread, ptr<slong> state) {
if (auto thr_exit = thread->tproc->ops->thr_exit) {
return thr_exit(thread, state);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_kill(Thread *thread, slong id, sint sig) {
if (auto thr_kill = thread->tproc->ops->thr_kill) {
return thr_kill(thread, id, sig);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_kill2(Thread *thread, pid_t pid, slong id, sint sig) {
if (auto thr_kill2 = thread->tproc->ops->thr_kill2) {
return thr_kill2(thread, pid, id, sig);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_suspend(Thread *thread, ptr<const struct timespec> timeout) {
if (auto thr_suspend = thread->tproc->ops->thr_suspend) {
return thr_suspend(thread, timeout);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_wake(Thread *thread, slong id) {
if (auto thr_wake = thread->tproc->ops->thr_wake) {
return thr_wake(thread, id);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_thr_set_name(Thread *thread, slong id, ptr<const char> name) {
if (auto thr_set_name = thread->tproc->ops->thr_set_name) {
return thr_set_name(thread, id, name);
}
return ErrorCode::NOSYS;
}

View file

@ -0,0 +1,15 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_clock_gettime(Thread *thread, clockid_t clock_id, ptr<struct timespec> tp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_clock_settime(Thread *thread, clockid_t clock_id, ptr<const struct timespec> tp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_clock_getres(Thread *thread, clockid_t clock_id, ptr<struct timespec> tp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_nanosleep(Thread *thread, ptr<const struct timespec> rqtp, ptr<struct timespec> rmtp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_gettimeofday(Thread *thread, ptr<struct timeval> tp, ptr<struct timezone> tzp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_settimeofday(Thread *thread, ptr<struct timeval> tp, ptr<struct timezone> tzp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getitimer(Thread *thread, uint which, ptr<struct itimerval> itv) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setitimer(Thread *thread, uint which, ptr<struct itimerval> itv, ptr<struct itimerval> oitv) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ktimer_create(Thread *thread, clockid_t clock_id, ptr<struct sigevent> evp, ptr<sint> timerid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ktimer_delete(Thread *thread, sint timerid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ktimer_settime(Thread *thread, sint timerid, sint flags, ptr<const struct itimerspec> value, ptr<struct itimerspec> ovalue) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ktimer_gettime(Thread *thread, sint timerid, ptr<struct itimerspec> value) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ktimer_getoverrun(Thread *thread, sint timerid) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,22 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_socket(Thread *thread, sint domain, sint type, sint protocol) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_bind(Thread *thread, sint s, caddr_t name, sint namelen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_listen(Thread *thread, sint s, sint backlog) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_accept(Thread *thread, sint s, ptr<struct sockaddr> from, ptr<uint32_t> fromlenaddr) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_connect(Thread *thread, sint s, caddr_t name, sint namelen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_socketpair(Thread *thread, sint domain, sint type, sint protocol, ptr<sint> rsv) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sendto(Thread *thread, sint s, caddr_t buf, size_t len, sint flags, caddr_t to, sint tolen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sendmsg(Thread *thread, sint s, ptr<struct msghdr> msg, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_recvfrom(Thread *thread, sint s, caddr_t buf, size_t len, sint flags, ptr<struct sockaddr> from, ptr<uint32_t> fromlenaddr) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_recvmsg(Thread *thread, sint s, ptr<struct msghdr> msg, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_shutdown(Thread *thread, sint s, sint how) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_setsockopt(Thread *thread, sint s, sint level, sint name, caddr_t val, sint valsize) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getsockopt(Thread *thread, sint s, sint level, sint name, caddr_t val, ptr<sint> avalsize) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getsockname(Thread *thread, sint fdes, ptr<struct sockaddr> asa, ptr<uint32_t> alen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getpeername(Thread *thread, sint fdes, ptr<struct sockaddr> asa, ptr<uint32_t> alen) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sendfile(Thread *thread, sint fd, sint s, off_t offset, size_t nbytes, ptr<struct sf_hdtr> hdtr, ptr<off_t> sbytes, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sctp_peeloff(Thread *thread, sint sd, uint32_t name) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sctp_generic_sendmsg(Thread *thread, sint sd, caddr_t msg, sint mlen, caddr_t to, __socklen_t tolen, ptr<struct sctp_sndrcvinfo> sinfo, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sctp_generic_sendmsg_iov(Thread *thread, sint sd, ptr<struct iovec> iov, sint iovlen, caddr_t to, __socklen_t tolen, ptr<struct sctp_sndrcvinfo> sinfo, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_sctp_generic_recvmsg(Thread *thread, sint sd, ptr<struct iovec> iov, sint iovlen, caddr_t from, __socklen_t fromlen, ptr<struct sctp_sndrcvinfo> sinfo, sint flags) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,8 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_kmq_open(Thread *thread, ptr<const char> path, sint flags, mode_t mode, ptr<const struct mq_attr> attr) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kmq_unlink(Thread *thread, ptr<const char> path) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kmq_setattr(Thread *thread, sint mqd, ptr<const struct mq_attr> attr, ptr<struct mq_attr> oattr) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kmq_timedreceive(Thread *thread, sint mqd, ptr<const char> msg_ptr, size_t msg_len, ptr<uint> msg_prio, ptr<const struct timespec> abstimeout) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kmq_timedsend(Thread *thread, sint mqd, ptr<char> msg_ptr, size_t msg_len, ptr<uint> msg_prio, ptr<const struct timespec> abstimeout) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_kmq_notify(Thread *thread, sint mqd, ptr<const struct sigevent> sigev) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,12 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_ksem_init(Thread *thread, ptr<semid_t> idp, uint value) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ksem_open(Thread *thread, ptr<semid_t> idp, ptr<const char> name, sint oflag, mode_t mode, uint value) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ksem_unlink(Thread *thread, ptr<const char> name) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ksem_close(Thread *thread, semid_t id) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ksem_post(Thread *thread, semid_t id) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ksem_wait(Thread *thread, semid_t id) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ksem_timedwait(Thread *thread, semid_t id, ptr<const struct timespec> abstime) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ksem_trywait(Thread *thread, semid_t id) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ksem_getvalue(Thread *thread, semid_t id, ptr<sint> value) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ksem_destroy(Thread *thread, semid_t id) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,4 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_shm_open(Thread *thread, ptr<const char> path, sint flags, mode_t mode) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_shm_unlink(Thread *thread, ptr<const char> path) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,8 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys__umtx_lock(Thread *thread, ptr<struct umtx> umtx) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys__umtx_unlock(Thread *thread, ptr<struct umtx> umtx) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys__umtx_op(Thread *thread, ptr<void> obj, sint op, ulong val, ptr<void> uaddr1, ptr<void> uaddr2) {
std::printf("TODO: sys__umtx_op\n");
return {};
}

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_uuidgen(Thread *thread, ptr<struct uuid> store, sint count) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,93 @@
#include "sys/sysproto.hpp"
#include "utils/Logs.hpp"
orbis::SysResult orbis::sys_sync(Thread *thread) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_quotactl(Thread *thread, ptr<char> path, sint cmd, sint uid, caddr_t arg) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_statfs(Thread *thread, ptr<char> path, ptr<struct statfs> buf) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fstatfs(Thread *thread, sint fd, ptr<struct statfs> buf) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getfsstat(Thread *thread, ptr<struct statfs> buf, slong bufsize, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fchdir(Thread *thread, sint fd) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_chdir(Thread *thread, ptr<char> path) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_chroot(Thread *thread, ptr<char> path) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_open(Thread *thread, ptr<char> path, sint flags, sint mode) {
ORBIS_LOG_NOTICE("sys_open", path, flags, mode);
if (auto open = thread->tproc->ops->open) {
return open(thread, path, flags, mode);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_openat(Thread *thread, sint fd, ptr<char> path, sint flag, mode_t mode) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_mknod(Thread *thread, ptr<char> path, sint mode, sint dev) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_mknodat(Thread *thread, sint fd, ptr<char> path, mode_t mode, dev_t dev) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_mkfifo(Thread *thread, ptr<char> path, sint mode) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_mkfifoat(Thread *thread, sint fd, ptr<char> path, mode_t mode) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_link(Thread *thread, ptr<char> path, ptr<char> link) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_linkat(Thread *thread, sint fd1, ptr<char> path1, sint fd2, ptr<char> path2, sint flag) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_symlink(Thread *thread, ptr<char> path, ptr<char> link) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_symlinkat(Thread *thread, ptr<char> path1, sint fd, ptr<char> path2) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_undelete(Thread *thread, ptr<char> path) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_unlink(Thread *thread, ptr<char> path) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_unlinkat(Thread *thread, sint fd, ptr<char> path, sint flag) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_lseek(Thread *thread, sint fd, off_t offset, sint whence) {
if (auto lseek = thread->tproc->ops->lseek) {
return lseek(thread, fd, offset, whence);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_freebsd6_lseek(Thread *thread, sint fd, sint, off_t offset, sint whence) {
return sys_lseek(thread, fd, offset, whence);
}
orbis::SysResult orbis::sys_access(Thread *thread, ptr<char> path, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_faccessat(Thread *thread, sint fd, ptr<char> path, sint mode, sint flag) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_eaccess(Thread *thread, ptr<char> path, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_stat(Thread *thread, ptr<char> path, ptr<struct stat> ub) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fstatat(Thread *thread, sint fd, ptr<char> path, ptr<struct stat> buf, sint flag) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_lstat(Thread *thread, ptr<char> path, ptr<struct stat> ub) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_nstat(Thread *thread, ptr<char> path, ptr<struct nstat> ub) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_nlstat(Thread *thread, ptr<char> path, ptr<struct nstat> ub) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_pathconf(Thread *thread, ptr<char> path, sint name) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_lpathconf(Thread *thread, ptr<char> path, sint name) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_readlink(Thread *thread, ptr<char> path, ptr<char> buf, size_t count) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_readlinkat(Thread *thread, sint fd, ptr<char> path, ptr<char> buf, size_t bufsize) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_chflags(Thread *thread, ptr<char> path, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_lchflags(Thread *thread, ptr<const char> path, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fchflags(Thread *thread, sint fd, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_chmod(Thread *thread, ptr<char> path, sint mode) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fchmodat(Thread *thread, sint fd, ptr<char> path, mode_t mode, sint flag) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_lchmod(Thread *thread, ptr<char> path, mode_t mode) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fchmod(Thread *thread, sint fd, sint mode) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_chown(Thread *thread, ptr<char> path, sint uid, sint gid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fchownat(Thread *thread, sint fd, ptr<char> path, uid_t uid, gid_t gid, sint flag) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_lchown(Thread *thread, ptr<char> path, sint uid, sint gid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fchown(Thread *thread, sint fd, sint uid, sint gid) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_utimes(Thread *thread, ptr<char> path, ptr<struct timeval> tptr) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_futimesat(Thread *thread, sint fd, ptr<char> path, ptr<struct timeval> times) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_lutimes(Thread *thread, ptr<char> path, ptr<struct timeval> tptr) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_futimes(Thread *thread, sint fd, ptr<struct timeval> tptr) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_truncate(Thread *thread, ptr<char> path, off_t length) {
if (auto truncate = thread->tproc->ops->truncate) {
return truncate(thread, path, length);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_freebsd6_truncate(Thread *thread, ptr<char> path, sint, off_t length) {
return sys_truncate(thread, path, length);
}
orbis::SysResult orbis::sys_fsync(Thread *thread, sint fd) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_rename(Thread *thread, ptr<char> from, ptr<char> to) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_renameat(Thread *thread, sint oldfd, ptr<char> old, sint newfd, ptr<char> new_) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_mkdir(Thread *thread, ptr<char> path, sint mode) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_mkdirat(Thread *thread, sint fd, ptr<char> path, mode_t mode) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_rmdir(Thread *thread, ptr<char> path) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getdirentries(Thread *thread, sint fd, ptr<char> buf, uint count, ptr<slong> basep) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getdents(Thread *thread, sint fd, ptr<char> buf, size_t count) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_umask(Thread *thread, sint newmask) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_revoke(Thread *thread, ptr<char> path) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_lgetfh(Thread *thread, ptr<char> fname, ptr<struct fhandle> fhp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_getfh(Thread *thread, ptr<char> fname, ptr<struct fhandle> fhp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fhopen(Thread *thread, ptr<const struct fhandle> u_fhp, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fhstat(Thread *thread, ptr<const struct fhandle> u_fhp, ptr<struct stat> sb) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_fhstatfs(Thread *thread, ptr<const struct fhandle> u_fhp, ptr<struct statfs> buf) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_posix_fallocate(Thread *thread, sint fd, off_t offset, off_t len) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_posix_fadvise(Thread *thread, sint fd, off_t offset, off_t len, sint advice) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,14 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys___acl_get_file(Thread *thread, ptr<char> path, acl_type_t type, ptr<struct acl> aclp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_get_link(Thread *thread, ptr<const char> path, acl_type_t type, ptr<struct acl> aclp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_set_file(Thread *thread, ptr<char> path, acl_type_t type, ptr<struct acl> aclp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_set_link(Thread *thread, ptr<const char> path, acl_type_t type, ptr<struct acl> aclp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_get_fd(Thread *thread, sint filedes, acl_type_t type, ptr<struct acl> aclp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_set_fd(Thread *thread, sint filedes, acl_type_t type, ptr<struct acl> aclp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_delete_link(Thread *thread, ptr<const char> path, acl_type_t type) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_delete_file(Thread *thread, ptr<char> path, acl_type_t type) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_delete_fd(Thread *thread, sint filedes, acl_type_t type) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_aclcheck_file(Thread *thread, ptr<char> path, acl_type_t type, ptr<struct acl> aclp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_aclcheck_link(Thread *thread, ptr<const char> path, acl_type_t type, ptr<struct acl> aclp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys___acl_aclcheck_fd(Thread *thread, sint filedes, acl_type_t type, ptr<struct acl> aclp) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,15 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_aio_return(Thread *thread, ptr<struct aiocb> aiocbp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_aio_suspend(Thread *thread, ptr<struct aiocb> aiocbp, sint nent, ptr<const struct timespec> timeout) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_aio_cancel(Thread *thread, sint fd, ptr<struct aiocb> aiocbp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_aio_error(Thread *thread, ptr<struct aiocb> aiocbp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_oaio_read(Thread *thread, ptr<struct aiocb> aiocbp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_aio_read(Thread *thread, ptr<struct aiocb> aiocbp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_oaio_write(Thread *thread, ptr<struct aiocb> aiocbp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_aio_write(Thread *thread, ptr<struct aiocb> aiocbp) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_olio_listio(Thread *thread, sint mode, ptr<cptr<struct aiocb>> acb_list, sint nent, ptr<struct osigevent> sig) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_lio_listio(Thread *thread, sint mode, ptr<cptr<struct aiocb>> aiocbp, sint nent, ptr<struct sigevent> sig) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_aio_waitcomplete(Thread *thread, ptr<ptr<struct aiocb>> aiocbp, ptr<struct timespec> timeout) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_aio_fsync(Thread *thread, sint op, ptr<struct aiocb> aiocbp) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,3 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys___getcwd(Thread *thread, ptr<char> buf, uint buflen) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,15 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_extattrctl(Thread *thread, ptr<char> path, char cmd, ptr<const char> filename, sint attrnamespace, ptr<const char> attrname) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_set_fd(Thread *thread, sint fd, sint attrnamespace, ptr<const char> attrname, ptr<void> data, size_t nbytes) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_set_file(Thread *thread, ptr<char> path, sint attrnamespace, ptr<const char> filename, ptr<void> data, size_t nbytes) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_set_link(Thread *thread, ptr<const char> path, sint attrnamespace, ptr<const char> attrname, ptr<void> data, size_t nbytes) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_get_fd(Thread *thread, sint fd, sint attrnamespace, ptr<const char> attrname, ptr<void> data, size_t nbytes) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_get_file(Thread *thread, ptr<char> path, sint attrnamespace, ptr<const char> filename, ptr<void> data, size_t nbytes) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_get_link(Thread *thread, ptr<const char> path, sint attrnamespace, ptr<const char> attrname, ptr<void> data, size_t nbytes) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_delete_fd(Thread *thread, sint fd, sint attrnamespace, ptr<const char> attrname) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_delete_file(Thread *thread, ptr<char> path, sint attrnamespace, ptr<const char> attrname) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_delete_link(Thread *thread, ptr<const char> path, sint attrnamespace, ptr<const char> attrname) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_list_fd(Thread *thread, sint fd, sint attrnamespace, ptr<void> data, size_t nbytes) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_list_file(Thread *thread, ptr<const char> path, sint attrnamespace, ptr<void> data, size_t nbytes) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_extattr_list_link(Thread *thread, ptr<const char> path, sint attrnamespace, ptr<void> data, size_t nbytes) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,5 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_mount(Thread *thread, ptr<char> type, ptr<char> path, sint flags, caddr_t data) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_unmount(Thread *thread, ptr<char> path, sint flags) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_nmount(Thread *thread, ptr<struct iovec> iovp, uint iovcnt, sint flags) { return ErrorCode::NOSYS; }

View file

@ -0,0 +1,101 @@
#include "error.hpp"
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_sbrk(Thread *, sint) {
return ErrorCode::OPNOTSUPP;
}
orbis::SysResult orbis::sys_sstk(Thread *, sint) {
return ErrorCode::OPNOTSUPP;
}
orbis::SysResult orbis::sys_mmap(Thread *thread, caddr_t addr, size_t len,
sint prot, sint flags, sint fd, off_t pos) {
if (auto impl = thread->tproc->ops->mmap) {
return impl(thread, addr, len, prot, flags, fd, pos);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_freebsd6_mmap(Thread *thread, caddr_t addr,
size_t len, sint prot, sint flags,
sint fd, sint, off_t pos) {
return sys_mmap(thread, addr, len, prot, flags, fd, pos);
}
orbis::SysResult orbis::sys_msync(Thread *thread, ptr<void> addr, size_t len,
sint flags) {
if (auto impl = thread->tproc->ops->msync) {
return impl(thread, addr, len, flags);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_munmap(Thread *thread, ptr<void> addr, size_t len) {
if (auto impl = thread->tproc->ops->munmap) {
return impl(thread, addr, len);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_mprotect(Thread *thread, ptr<const void> addr,
size_t len, sint prot) {
if (auto impl = thread->tproc->ops->mprotect) {
return impl(thread, addr, len, prot);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_minherit(Thread *thread, ptr<void> addr, size_t len,
sint inherit) {
if (auto impl = thread->tproc->ops->minherit) {
return impl(thread, addr, len, inherit);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_madvise(Thread *thread, ptr<void> addr, size_t len,
sint behav) {
if (auto impl = thread->tproc->ops->madvise) {
return impl(thread, addr, len, behav);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_mincore(Thread *thread, ptr<const void> addr,
size_t len, ptr<char> vec) {
if (auto impl = thread->tproc->ops->mincore) {
return impl(thread, addr, len, vec);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_mlock(Thread *thread, ptr<const void> addr,
size_t len) {
if (auto impl = thread->tproc->ops->mlock) {
return impl(thread, addr, len);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_mlockall(Thread *thread, sint how) {
if (auto impl = thread->tproc->ops->mlockall) {
return impl(thread, how);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_munlockall(Thread *thread) {
if (auto impl = thread->tproc->ops->munlockall) {
return impl(thread);
}
return ErrorCode::NOSYS;
}
orbis::SysResult orbis::sys_munlock(Thread *thread, ptr<const void> addr,
size_t len) {
if (auto impl = thread->tproc->ops->munlock) {
return impl(thread, addr, len);
}
return ErrorCode::NOSYS;
}

View file

@ -0,0 +1,4 @@
#include "sys/sysproto.hpp"
orbis::SysResult orbis::sys_obreak(Thread *thread, ptr<char> nsize) { return ErrorCode::NOSYS; }
orbis::SysResult orbis::sys_ovadvise(Thread *thread, sint anom) { return ErrorCode::NOSYS; }