aboutsummaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorMarvin Borner2021-04-14 13:39:42 +0200
committerMarvin Borner2021-04-14 13:39:42 +0200
commit212582f69dea4c99c292081b15ea526014b9ad44 (patch)
treec4fc1643c5acb8821fc0cfbd1b9c0983a50afe97 /libs
parent9ded3a2bde80eede5fd887812d70c2f834b53c84 (diff)
Even more I/O - started new PS/2 driver
Diffstat (limited to 'libs')
-rw-r--r--libs/libc/inc/ioctl.h11
-rw-r--r--libs/libc/inc/sys.h13
-rw-r--r--libs/libc/sys.c2
3 files changed, 13 insertions, 13 deletions
diff --git a/libs/libc/inc/ioctl.h b/libs/libc/inc/ioctl.h
deleted file mode 100644
index c3eec56..0000000
--- a/libs/libc/inc/ioctl.h
+++ /dev/null
@@ -1,11 +0,0 @@
-// MIT License, Copyright (c) 2021 Marvin Borner
-
-#ifndef IOCTL
-#define IOCTL
-
-// FB interface
-#define IO_FB_GET 0
-
-int ioctl_is_awesome; // GCC is not
-
-#endif
diff --git a/libs/libc/inc/sys.h b/libs/libc/inc/sys.h
index e7acc49..c181a64 100644
--- a/libs/libc/inc/sys.h
+++ b/libs/libc/inc/sys.h
@@ -21,10 +21,10 @@ enum sys {
SYS_STAT, // Get file information
SYS_READ, // Read file (non-blocking)
SYS_WRITE, // Write to file
- SYS_IOCTL, // Interact with an I/O device
SYS_IOPOLL, // Block proc until I/O device is ready
SYS_IOREAD, // Read data from I/O device (blocking)
SYS_IOWRITE, // Write data to I/O device
+ SYS_IOCONTROL, // Interact with an I/O device
SYS_EXEC, // Execute path
SYS_EXIT, // Exit current process
SYS_BOOT, // Boot functions (e.g. reboot/shutdown)
@@ -36,6 +36,17 @@ enum sys {
/* SYS_NET_RECEIVE, // Receive data from socket */
};
+enum io_type {
+ IO_MIN,
+ IO_FRAMEBUFFER,
+ IO_NETWORK,
+ IO_KEYBOARD,
+ IO_MOUSE,
+ IO_TIMER,
+ IO_BUS,
+ IO_MAX,
+};
+
struct event_keyboard {
u32 magic;
u32 scancode;
diff --git a/libs/libc/sys.c b/libs/libc/sys.c
index 7563fb4..ce90fed 100644
--- a/libs/libc/sys.c
+++ b/libs/libc/sys.c
@@ -120,7 +120,7 @@ res ioctl(const char *path, ...)
args[i] = va_arg(ap, int);
va_end(ap);
- return sys5(SYS_IOCTL, (int)path, args[0], args[1], args[2], args[3]);
+ return sys5(SYS_IOCONTROL, (int)path, args[0], args[1], args[2], args[3]);
}
res stat(const char *path, struct stat *buf)