Module: xenomai-head
Branch: master
Commit: e3c13f0685c2edf2a2ce30cd239b3f2a4858e8ae
URL:    
http://git.xenomai.org/?p=xenomai-head.git;a=commit;h=e3c13f0685c2edf2a2ce30cd239b3f2a4858e8ae

Author: Philippe Gerum <[email protected]>
Date:   Tue Sep  6 16:40:47 2011 +0200

hal/generic: missing bits to support vfiles over linux 2.4

---

 include/asm-generic/wrappers.h |    8 ++++++--
 ksrc/nucleus/Config.in         |    5 ++++-
 ksrc/nucleus/heap.c            |    2 +-
 ksrc/nucleus/pipe.c            |    2 +-
 ksrc/nucleus/shadow.c          |   11 +++++------
 5 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index 9c44042..ebfc343 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -41,6 +41,8 @@
 #include <linux/bitops.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
+#include <linux/kernel.h>
+#include <linux/linkage.h>
 #include <linux/moduleparam.h> /* Use the backport. */
 #include <asm/atomic.h>
 
@@ -90,6 +92,7 @@
 
 /* Seqfiles */
 #define SEQ_START_TOKEN ((void *)1)
+#define SEQ_SKIP       0       /* not implemented. */
 
 /* Sched and process flags */
 #define MAX_RT_PRIO 100
@@ -295,6 +298,7 @@ void show_stack(struct task_struct *task,
 #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
 #endif
 
+#define GFP_DMA32  GFP_DMA
 #define __GFP_BITS_SHIFT 20
 #define pgprot_noncached(p) (p)
 
@@ -624,11 +628,11 @@ 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,        \
+       int 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)
+       long name(struct file *filp, unsigned int cmd, unsigned long arg)
 #endif
 
 #ifndef DEFINE_SEMAPHORE
diff --git a/ksrc/nucleus/Config.in b/ksrc/nucleus/Config.in
index c0a94f5..fcf1abd 100644
--- a/ksrc/nucleus/Config.in
+++ b/ksrc/nucleus/Config.in
@@ -7,6 +7,9 @@ if [ "$CONFIG_XENOMAI" = "y" ]; then
 dep_tristate 'Nucleus' CONFIG_XENO_OPT_NUCLEUS $CONFIG_XENOMAI
 
 if [ "$CONFIG_XENO_OPT_NUCLEUS" != "n" ]; then
+       if [ "$CONFIG_PROC_FS" != "n" ]; then
+            define_bool CONFIG_XENO_OPT_VFILE y
+       fi
        mainmenu_option next_comment
        comment 'Nucleus options'
        bool 'Pervasive real-time support in user-space' 
CONFIG_XENO_OPT_PERVASIVE
@@ -41,7 +44,7 @@ if [ "$CONFIG_XENO_OPT_NUCLEUS" != "n" ]; then
                   int 'Maximum number of pending replenishments' 
CONFIG_XENO_OPT_SCHED_SPORADIC_MAXREPL 8
                fi
        fi
-       bool 'Statistics collection' CONFIG_XENO_OPT_STATS
+       dep_bool 'Statistics collection' CONFIG_XENO_OPT_STATS 
$CONFIG_XENO_OPT_VFILE
        int 'Size of private semaphores heap (Kb)' CONFIG_XENO_OPT_SEM_HEAPSZ 12
        int 'Size of global semaphores heap (Kb)' 
CONFIG_XENO_OPT_GLOBAL_SEM_HEAPSZ 12
        bool 'Debug support' CONFIG_XENO_OPT_DEBUG
diff --git a/ksrc/nucleus/heap.c b/ksrc/nucleus/heap.c
index 0c1ceeb..e0715d6 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 DECLARE_IOCTL_HANDLER(xnheap_ioctl, file, cmd, arg)
+static 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 b6d0a23..1e6bcf2 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 DECLARE_IOCTL_HANDLER(xnpipe_ioctl, file, cmd, arg)
+static DECLARE_IOCTL_HANDLER(xnpipe_ioctl, file, cmd, arg)
 {
        struct xnpipe_state *state = file->private_data;
        int ret = 0;
diff --git a/ksrc/nucleus/shadow.c b/ksrc/nucleus/shadow.c
index bd0096f..21cc191 100644
--- a/ksrc/nucleus/shadow.c
+++ b/ksrc/nucleus/shadow.c
@@ -2170,8 +2170,10 @@ static void *xnshadow_sys_event(int event, void *data)
                err = xnheap_init_mapped(&p->sem_heap,
                                         CONFIG_XENO_OPT_SEM_HEAPSZ * 1024,
                                         XNARCH_SHARED_HEAP_FLAGS);
-               if (err)
-                       goto err_free_host_mem;
+               if (err) {
+                       xnarch_free_host_mem(p, sizeof(*p));
+                       return ERR_PTR(err);
+               }
 
                xnheap_set_label(&p->sem_heap,
                                 "private sem heap [%d]", current->pid);
@@ -2182,11 +2184,8 @@ static void *xnshadow_sys_event(int event, void *data)
                        printk(KERN_WARNING
                               "Xenomai: %s[%d] cannot map MAYDAY page\n",
                               current->comm, current->pid);
-                       err = -ENOMEM;
-
-                 err_free_host_mem:
                        xnarch_free_host_mem(p, sizeof(*p));
-                       return ERR_PTR(err);
+                       return ERR_PTR(-ENOMEM);
                }
 #endif /* XNARCH_HAVE_MAYDAY */
                xnarch_atomic_set(&p->refcnt, 1);


_______________________________________________
Xenomai-git mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-git

Reply via email to