aboutsummaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-04-24 19:51:31 -0400
committerIan Moffett <ian@osmora.org>2024-04-24 19:51:31 -0400
commiteb5d1c92c4e79c04a9d2e0027728e1378ba61f49 (patch)
tree11f2dd9d5c722924bafff87362a22c6eacafa8ac /sys/include
parent0dd63753b6e8c3cbcc1a790c3c6ecd40d8320048 (diff)
kernel: Add ioctl support
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/device.h1
-rw-r--r--sys/include/sys/syscall.h1
-rw-r--r--sys/include/sys/system.h2
3 files changed, 4 insertions, 0 deletions
diff --git a/sys/include/sys/device.h b/sys/include/sys/device.h
index a3ce983..9851ee2 100644
--- a/sys/include/sys/device.h
+++ b/sys/include/sys/device.h
@@ -41,6 +41,7 @@ struct device {
size_t blocksize;
int(*write)(struct device *dev, struct sio_txn *sio);
int(*read)(struct device *dev, struct sio_txn *sio);
+ int(*ioctl)(struct device *dev, uint32_t cmd, uintptr_t arg);
paddr_t(*mmap)(struct device *dev, off_t off, vm_prot_t prot);
TAILQ_ENTRY(device) link;
};
diff --git a/sys/include/sys/syscall.h b/sys/include/sys/syscall.h
index 59b6036..0f5abf0 100644
--- a/sys/include/sys/syscall.h
+++ b/sys/include/sys/syscall.h
@@ -45,6 +45,7 @@ enum {
SYS_lseek,
SYS_mmap,
SYS_munmap,
+ SYS_ioctl,
__MAX_SYSCALLS
};
diff --git a/sys/include/sys/system.h b/sys/include/sys/system.h
index c2e47c2..03ac710 100644
--- a/sys/include/sys/system.h
+++ b/sys/include/sys/system.h
@@ -31,11 +31,13 @@
#define _SYS_SYSTEM_H_
#include <sys/types.h>
+#include <sys/syscall.h>
#if defined(_KERNEL)
int copyin(uintptr_t uaddr, void *kaddr, size_t len);
int copyout(const void *kaddr, uintptr_t uaddr, size_t len);
int copyinstr(uintptr_t uaddr, char *kaddr, size_t len);
+uint64_t sys_ioctl(struct syscall_args *args);
#endif
#endif /* !_SYS_SYSTEM_H_ */