From f2b4acb2fe6a366288b19843e0d2678b8590bdf4 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 25 Apr 2021 13:43:14 +0200 Subject: Chu chuu, using the bus for everything now! Well, I know: bus != train. But I like trains. So I don't care. Go away! --- libs/libc/inc/sys.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'libs/libc/inc/sys.h') diff --git a/libs/libc/inc/sys.h b/libs/libc/inc/sys.h index 72a8029..8c8e217 100644 --- a/libs/libc/inc/sys.h +++ b/libs/libc/inc/sys.h @@ -15,6 +15,7 @@ #define SYS_BOOT_SHUTDOWN 0xdead enum sys { + SYS_MIN, SYS_ALLOC, // Allocate memory SYS_SHACCESS, // Access shared memory SYS_FREE, // Free memory @@ -29,10 +30,12 @@ enum sys { SYS_EXIT, // Exit current process SYS_BOOT, // Boot functions (e.g. reboot/shutdown) SYS_YIELD, // Switch to next process + SYS_MAX, }; enum io_type { IO_MIN, + IO_LOGGER, IO_FRAMEBUFFER, IO_NETWORK, IO_KEYBOARD, @@ -44,8 +47,14 @@ enum io_type { // I/O control declarations #define IOCTL_FB_GET 0 -#define IOCTL_BUS_CONNECT 0 -#define IOCTL_BUS_REGISTER 1 +#define IOCTL_BUS_CONNECT_BUS 0 +#define IOCTL_BUS_CONNECT_CONN 1 +#define IOCTL_BUS_REGISTER 2 + +struct bus_header { + u32 conn; + // Data starts here +}; struct event_keyboard { u32 magic; @@ -84,7 +93,7 @@ res exec(const char *path, ...) ATTR((nonnull(1))) SENTINEL; res io_poll(enum io_type *devs) NONNULL; res io_read(enum io_type io, void *buf, u32 offset, u32 count) NONNULL; -res io_write(enum io_type io, void *buf, u32 offset, u32 count) NONNULL; +res io_write(enum io_type io, const void *buf, u32 offset, u32 count) NONNULL; res io_control(enum io_type io, ...); res yield(void); -- cgit v1.2.3