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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Jul 16 13:41:01 2009 +0200

nucleus: port to 2.6.30

---

 include/asm-generic/wrappers.h |   13 +++++++++++++
 ksrc/arch/generic/hal.c        |    4 ++--
 ksrc/nucleus/module.c          |    4 ++--
 ksrc/nucleus/registry.c        |    4 ++--
 4 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index 943ed34..7add800 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -400,4 +400,17 @@ static inline int wrap_raise_cap(int cap)
 }
 #endif /* LINUX_VERSION_CODE >= 2.6.29 */
 
+#ifdef CONFIG_PROC_FS
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+static inline void wrap_proc_dir_entry_owner(struct proc_dir_entry *entry)
+{
+    entry->owner = THIS_MODULE;
+}
+#else  /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */
+#define wrap_proc_dir_entry_owner(entry)
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) */
+#endif /* CONFIG_PROC_FS */
+
 #endif /* _XENO_ASM_GENERIC_WRAPPERS_H */
diff --git a/ksrc/arch/generic/hal.c b/ksrc/arch/generic/hal.c
index 1eab154..dcb9a49 100644
--- a/ksrc/arch/generic/hal.c
+++ b/ksrc/arch/generic/hal.c
@@ -739,7 +739,7 @@ struct proc_dir_entry *__rthal_add_proc_leaf(const char 
*name,
         entry->data = data;
         entry->read_proc = rdproc;
         entry->write_proc = wrproc;
-        entry->owner = THIS_MODULE;
+       wrap_proc_dir_entry_owner(entry);
     }
 
     return entry;
@@ -754,7 +754,7 @@ static int rthal_proc_register(void)
         return -1;
     }
 
-    rthal_proc_root->owner = THIS_MODULE;
+    wrap_proc_dir_entry_owner(rthal_proc_root);
 
     __rthal_add_proc_leaf("hal", &hal_read_proc, NULL, NULL, rthal_proc_root);
 
diff --git a/ksrc/nucleus/module.c b/ksrc/nucleus/module.c
index 9b87865..bc3bc59 100644
--- a/ksrc/nucleus/module.c
+++ b/ksrc/nucleus/module.c
@@ -1001,7 +1001,7 @@ static struct proc_dir_entry *add_proc_leaf(const char 
*name,
        entry->data = data;
        entry->read_proc = rdproc;
        entry->write_proc = wrproc;
-       entry->owner = THIS_MODULE;
+       wrap_proc_dir_entry_owner(entry);
 
        return entry;
 }
@@ -1019,7 +1019,7 @@ static struct proc_dir_entry *add_proc_fops(const char 
*name,
                return NULL;
 
        entry->proc_fops = fops;
-       entry->owner = THIS_MODULE;
+       wrap_proc_dir_entry_owner(entry);
 
        if (size)
                entry->size = size;
diff --git a/ksrc/nucleus/registry.c b/ksrc/nucleus/registry.c
index b073cb7..794b2f6 100644
--- a/ksrc/nucleus/registry.c
+++ b/ksrc/nucleus/registry.c
@@ -246,7 +246,7 @@ static struct proc_dir_entry *add_proc_leaf(const char 
*name,
        entry->data = data;
        entry->read_proc = rdproc;
        entry->write_proc = wrproc;
-       entry->owner = THIS_MODULE;
+       wrap_proc_dir_entry_owner(entry);
 
        return entry;
 }
@@ -267,7 +267,7 @@ static struct proc_dir_entry *add_proc_link(const char 
*name,
        if (!entry)
                return NULL;
 
-       entry->owner = THIS_MODULE;
+       wrap_proc_dir_entry_owner(entry);
 
        return entry;
 }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to