Module: xenomai-head Branch: master Commit: 35849a7819595c0807bc9e899d1863498cbb7eb2 URL: http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=35849a7819595c0807bc9e899d1863498cbb7eb2
Author: Philippe Gerum <[email protected]> Date: Sat Jun 18 09:10:27 2011 +0200 nucleus: fix ioctl() prototypes for pre-2.6.11 The file inode argument disappeared from the unlocked ioctl() signature which we have been using since 2.6.11, compared to the old (locked) form used in older kernels. Pick the appropriate signature for Xenomai ioctl() handlers conditionally, depending on whether the locked or unlocked form is being used under the hood. --- include/asm-generic/wrappers.h | 6 ++++++ ksrc/nucleus/heap.c | 2 +- ksrc/nucleus/pipe.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h index b91ad89..75c0c5d 100644 --- a/include/asm-generic/wrappers.h +++ b/include/asm-generic/wrappers.h @@ -620,6 +620,12 @@ static inline void wrap_proc_dir_entry_owner(struct proc_dir_entry *entry) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,11) #define unlocked_ioctl ioctl +#define DECLARE_IOCTL_HANDLER(name, filp, cmd, arg) \ + name(struct inode *__inode__, struct file *filp, \ + unsigned int cmd, unsigned long arg) +#else +#define DECLARE_IOCTL_HANDLER(name, filp, cmd, arg) \ + name(struct file *filp, unsigned int cmd, unsigned long arg) #endif #ifndef DEFINE_SEMAPHORE diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c index a26e4fe..0ab5114 100644 --- a/ksrc/nucleus/heap.c +++ b/ksrc/nucleus/heap.c @@ -1215,7 +1215,7 @@ static inline struct xnheap *__validate_heap_addr(void *addr) return NULL; } -static long xnheap_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +static long DECLARE_IOCTL_HANDLER(xnheap_ioctl, file, cmd, arg) { file->private_data = (void *)arg; return 0; diff --git a/ksrc/nucleus/pipe.c b/ksrc/nucleus/pipe.c index 721fd70..b6d0a23 100644 --- a/ksrc/nucleus/pipe.c +++ b/ksrc/nucleus/pipe.c @@ -917,7 +917,7 @@ static ssize_t xnpipe_write(struct file *file, return (ssize_t)count; } -static long xnpipe_ioctl(struct file *file, unsigned int cmd, unsigned long arg) +static long DECLARE_IOCTL_HANDLER(xnpipe_ioctl, file, cmd, arg) { struct xnpipe_state *state = file->private_data; int ret = 0; _______________________________________________ Xenomai-git mailing list [email protected] https://mail.gna.org/listinfo/xenomai-git
