From eb5d1c92c4e79c04a9d2e0027728e1378ba61f49 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 24 Apr 2024 19:51:31 -0400 Subject: kernel: Add ioctl support Signed-off-by: Ian Moffett --- sys/include/sys/device.h | 1 + sys/include/sys/syscall.h | 1 + sys/include/sys/system.h | 2 ++ 3 files changed, 4 insertions(+) (limited to 'sys/include') 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 +#include #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_ */ -- cgit v1.2.3