From cdf029471736f43776452930b7195a06ab143654 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 17 Apr 2021 22:59:57 +0200 Subject: Added I/O bus implementation for efficient IPC This was a nice coding session. See ya tomorrow! --- libs/libc/inc/crypto.h | 4 ++++ libs/libc/inc/sys.h | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'libs/libc/inc') diff --git a/libs/libc/inc/crypto.h b/libs/libc/inc/crypto.h index 16cdf86..b672c50 100644 --- a/libs/libc/inc/crypto.h +++ b/libs/libc/inc/crypto.h @@ -8,4 +8,8 @@ void md5(const void *initial_msg, u32 initial_len, u8 digest[16]) NONNULL; u32 crc32(u32 crc, const void *buf, u32 size) NONNULL; +#ifdef KERNEL +u32 crc32_user(u32 crc, const void *buf, u32 size) NONNULL; +#endif + #endif diff --git a/libs/libc/inc/sys.h b/libs/libc/inc/sys.h index 461db2e..72a8029 100644 --- a/libs/libc/inc/sys.h +++ b/libs/libc/inc/sys.h @@ -42,6 +42,11 @@ enum io_type { IO_MAX, }; +// I/O control declarations +#define IOCTL_FB_GET 0 +#define IOCTL_BUS_CONNECT 0 +#define IOCTL_BUS_REGISTER 1 + struct event_keyboard { u32 magic; u32 scancode; @@ -77,7 +82,7 @@ res write(const char *path, const void *buf, u32 offset, u32 count) NONNULL; res stat(const char *path, struct stat *buf) NONNULL; res exec(const char *path, ...) ATTR((nonnull(1))) SENTINEL; -res io_poll(u32 *devs) NONNULL; +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_control(enum io_type io, ...); -- cgit v1.2.3