Move all syscalls into one file
This commit is contained in:
@ -10,7 +10,6 @@ SRCFILES := $(call GRABSRC, \
|
|||||||
string \
|
string \
|
||||||
system \
|
system \
|
||||||
printf \
|
printf \
|
||||||
devices \
|
|
||||||
)
|
)
|
||||||
|
|
||||||
CFLAGS += -isystem $(ROOT)/share -isystem $(ROOT)/ulib -isystem $(ROOT)/std/include \
|
CFLAGS += -isystem $(ROOT)/share -isystem $(ROOT)/ulib -isystem $(ROOT)/std/include \
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#include <sysdefs/ipcpipe.h>
|
|
||||||
#include <system/ipcpipe.h>
|
|
||||||
|
|
||||||
int32_t dev_ps2kb_read(int32_t *ch) {
|
|
||||||
return ipcpipe(1, 0, IPCPIPE_READ, (uint8_t *)ch, sizeof(*ch));
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
#ifndef ULIB_DEVICES_PS2KB_H_
|
|
||||||
#define ULIB_DEVICES_PS2KB_H_
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
#define PS2KB_C(x) ((x) - '@')
|
|
||||||
|
|
||||||
int32_t dev_ps2kb_read(int32_t *ch);
|
|
||||||
|
|
||||||
#endif // ULIB_DEVICES_PS2KB_H_
|
|
@ -1,6 +1,6 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <system/system.h>
|
||||||
#include <sysdefs/ipcpipe.h>
|
#include <sysdefs/ipcpipe.h>
|
||||||
#include <system/ipcpipe.h>
|
|
||||||
#include <printf/printf.h>
|
#include <printf/printf.h>
|
||||||
|
|
||||||
void putchar_(char c) {
|
void putchar_(char c) {
|
||||||
|
@ -1,11 +0,0 @@
|
|||||||
#include <stdint.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <system/ioctl.h>
|
|
||||||
#include <sysdefs/ioctl.h>
|
|
||||||
#include <sysdefs/syscall.h>
|
|
||||||
#include <syscall/syscall.h>
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
#ifndef ULIB_SYSTEM_IOCTL_H_
|
|
||||||
#define ULIB_SYSTEM_IOCTL_H_
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
#define IOCTL_PATH(p) ((uint64_t)(p))
|
|
||||||
#define IOCTL_BUF(b) ((uint64_t)(b))
|
|
||||||
#define IOCTL_SIZE(sz) ((uint64_t)(sz))
|
|
||||||
#define IOCTL_OFF(off) ((uint64_t)(off))
|
|
||||||
|
|
||||||
int32_t ioctl(uint64_t ioh, uint64_t cmd, uint64_t arg1, uint64_t arg2, uint64_t arg3);
|
|
||||||
|
|
||||||
#endif // ULIB_SYSTEM_IOCTL_H_
|
|
@ -1,10 +0,0 @@
|
|||||||
#include <stdint.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
#include "ipcpipe.h"
|
|
||||||
#include <sysdefs/ipcpipe.h>
|
|
||||||
#include <sysdefs/syscall.h>
|
|
||||||
#include <syscall/syscall.h>
|
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
#ifndef ULIB_SYSTEM_IPCPIPE_H_
|
|
||||||
#define ULIB_SYSTEM_IPCPIPE_H_
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
int32_t ipcpipe(uint64_t pid, uint64_t pipenum, uint64_t cmd, uint8_t *buffer, size_t len);
|
|
||||||
|
|
||||||
#endif // ULIB_SYSTEM_IPCPIPE_H_
|
|
@ -1,8 +0,0 @@
|
|||||||
#include <stdint.h>
|
|
||||||
#include <sysdefs/processctl.h>
|
|
||||||
#include <sysdefs/syscall.h>
|
|
||||||
#include <syscall/syscall.h>
|
|
||||||
|
|
||||||
int32_t processctl(uint64_t pid, uint64_t cmd, void *extra) {
|
|
||||||
return syscall(SYS_PROCESSCTL, pid, cmd, (uint64_t)extra, 0, 0, 0);
|
|
||||||
}
|
|
@ -1,6 +0,0 @@
|
|||||||
#ifndef ULIB_SYSTEM_PROCESSCTL_H_
|
|
||||||
#define ULIB_SYSTEM_PROCESSCTL_H_
|
|
||||||
|
|
||||||
int32_t processctl(uint64_t pid, uint64_t cmd, void *extra);
|
|
||||||
|
|
||||||
#endif // ULIB_SYSTEM_PROCESSCTL_H_
|
|
@ -7,3 +7,14 @@ void debugprint(const char *string) {
|
|||||||
syscall(SYS_DEBUGPRINT, (uint64_t)string, 0, 0, 0, 0, 0);
|
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, void *extra) {
|
||||||
|
return syscall(SYS_PROCESSCTL, pid, cmd, (uint64_t)extra, 0, 0, 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);
|
||||||
|
}
|
||||||
|
@ -2,7 +2,11 @@
|
|||||||
#define ULIB_SYSTEM_SYSTEM_H_
|
#define ULIB_SYSTEM_SYSTEM_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
void debugprint(const char *string);
|
void debugprint(const char *string);
|
||||||
|
int32_t ioctl(uint64_t ioh, uint64_t cmd, uint64_t arg1, uint64_t arg2, uint64_t arg3);
|
||||||
|
int32_t processctl(uint64_t pid, uint64_t cmd, void *extra);
|
||||||
|
int32_t ipcpipe(uint64_t pid, uint64_t pipenum, uint64_t cmd, uint8_t *buffer, size_t len);
|
||||||
|
|
||||||
#endif // ULIB_SYSTEM_SYSTEM_H_
|
#endif // ULIB_SYSTEM_SYSTEM_H_
|
||||||
|
@ -2,12 +2,9 @@
|
|||||||
#include <string/string.h>
|
#include <string/string.h>
|
||||||
#include <system/system.h>
|
#include <system/system.h>
|
||||||
#include <sysdefs/ioctl.h>
|
#include <sysdefs/ioctl.h>
|
||||||
#include <system/ioctl.h>
|
#include <sysdefs/ipcpipe.h>
|
||||||
#include <uprintf.h>
|
#include <uprintf.h>
|
||||||
#include <ansiq/all.h>
|
#include <ansiq/all.h>
|
||||||
#include <sysdefs/ipcpipe.h>
|
|
||||||
#include <system/ipcpipe.h>
|
|
||||||
#include <devices/ps2kb.h>
|
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
debugprint(ANSIQ_SCR_CLR_ALL);
|
debugprint(ANSIQ_SCR_CLR_ALL);
|
||||||
|
Reference in New Issue
Block a user