33 lines
1.1 KiB
C
33 lines
1.1 KiB
C
#include <stdint.h>
|
|
#include <system/system.h>
|
|
#include <syscall/syscall.h>
|
|
#include <sysdefs/syscall.h>
|
|
#include <sysdefs/ioctl.h>
|
|
#include <sysdefs/processctl.h>
|
|
#include <sysdefs/ipcpipe.h>
|
|
#include <uprintf.h>
|
|
|
|
void debugprint(const char *string) {
|
|
syscall(SYS_DEBUGPRINT, (uint64_t)string, 0, 0, 0, 0, 0);
|
|
}
|
|
|
|
int32_t ioctl(uint64_t ioh, uint64_t cmd, uint64_t arg1, uint64_t arg2, uint64_t arg3) {
|
|
return syscall(SYS_IOCTL, ioh, cmd, arg1, arg2, arg3, 0);
|
|
}
|
|
|
|
int32_t processctl(uint64_t pid, uint64_t cmd, uint64_t arg1, uint64_t arg2, uint64_t arg3) {
|
|
return syscall(SYS_PROCESSCTL, pid, cmd, arg1, arg2, arg3, 0);
|
|
}
|
|
|
|
int32_t ipcpipe(uint64_t pid, uint64_t pipenum, uint64_t cmd, uint8_t *buffer, size_t len) {
|
|
return syscall(SYS_IPCPIPE, pid, pipenum, cmd, (uint64_t)buffer, (uint64_t)len, 0);
|
|
}
|
|
|
|
int32_t mman_map(uint8_t *addr, size_t size, uint64_t prot, uint64_t flags, uint8_t **out) {
|
|
return syscall(SYS_MMAN_MAP, (uint64_t)addr, (uint64_t)size, prot, flags, (uint64_t)out, 0);
|
|
}
|
|
|
|
int32_t mman_unmap(uint8_t *addr) {
|
|
return syscall(SYS_MMAN_UNMAP, (uint64_t)addr, 0, 0, 0, 0, 0);
|
|
}
|