Module: xenomai-rpm
Branch: for-upstream
Commit: ad47c49851ea06ddeb087c2fd92eb6159d9bcf71
URL:    
http://git.xenomai.org/?p=xenomai-rpm.git;a=commit;h=ad47c49851ea06ddeb087c2fd92eb6159d9bcf71

Author: Philippe Gerum <r...@xenomai.org>
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 6cff0bb..4607d3d 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -602,6 +602,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 15236f2..3562bed 100644
--- a/ksrc/nucleus/heap.c
+++ b/ksrc/nucleus/heap.c
@@ -1127,7 +1127,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 36e7905..1856124 100644
--- a/ksrc/nucleus/pipe.c
+++ b/ksrc/nucleus/pipe.c
@@ -923,7 +923,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
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to