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

Author: Luis Herrera-Bendezu <lherr...@harris.com>
Date:   Mon Nov 23 19:20:54 2009 +0100

rtdm: Extend rtdm_iomap_to_user to map phys addr > 4G

rtdm_iomap_to_user does not handle I/O memory mapping of physical I/O
address grater than 4 GB. This patch changes the src_addr argument and
underlying code to handle this case.

Signed-off-by: Luis Herrera-Bendezu <lherr...@harris.com>
Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 include/asm-generic/system.h   |    2 +-
 include/asm-generic/wrappers.h |    4 ++++
 include/rtdm/rtdm_driver.h     |    2 +-
 ksrc/skins/rtdm/drvlib.c       |    9 +++++----
 4 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h
index c0f1698..e872711 100644
--- a/include/asm-generic/system.h
+++ b/include/asm-generic/system.h
@@ -442,7 +442,7 @@ static inline int xnarch_remap_vm_page(struct 
vm_area_struct *vma,
 static inline int xnarch_remap_io_page_range(struct file *filp,
                                             struct vm_area_struct *vma,
                                             unsigned long from,
-                                            unsigned long to,
+                                            phys_addr_t to,
                                             unsigned long size,
                                             pgprot_t prot)
 {
diff --git a/include/asm-generic/wrappers.h b/include/asm-generic/wrappers.h
index 2ef6016..9927e89 100644
--- a/include/asm-generic/wrappers.h
+++ b/include/asm-generic/wrappers.h
@@ -544,6 +544,10 @@ static inline int wrap_raise_cap(int cap)
 }
 #endif /* LINUX_VERSION_CODE >= 2.6.29 */
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28)
+typedef unsigned long phys_addr_t;
+#endif
+
 #ifdef CONFIG_PROC_FS
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30)
 #include <linux/module.h>
diff --git a/include/rtdm/rtdm_driver.h b/include/rtdm/rtdm_driver.h
index 7c6a39c..2278e57 100644
--- a/include/rtdm/rtdm_driver.h
+++ b/include/rtdm/rtdm_driver.h
@@ -1219,7 +1219,7 @@ int rtdm_mmap_to_user(rtdm_user_info_t *user_info,
                      struct vm_operations_struct *vm_ops,
                      void *vm_private_data);
 int rtdm_iomap_to_user(rtdm_user_info_t *user_info,
-                      unsigned long src_addr, size_t len,
+                      phys_addr_t src_addr, size_t len,
                       int prot, void **pptr,
                       struct vm_operations_struct *vm_ops,
                       void *vm_private_data);
diff --git a/ksrc/skins/rtdm/drvlib.c b/ksrc/skins/rtdm/drvlib.c
index 8177f7d..5181108 100644
--- a/ksrc/skins/rtdm/drvlib.c
+++ b/ksrc/skins/rtdm/drvlib.c
@@ -1789,7 +1789,7 @@ void rtdm_nrtsig_pend(rtdm_nrtsig_t *nrt_sig);
 #if defined(CONFIG_XENO_OPT_PERVASIVE) || defined(DOXYGEN_CPP)
 struct rtdm_mmap_data {
        void *src_vaddr;
-       unsigned long src_paddr;
+       phys_addr_t src_paddr;
        struct vm_operations_struct *vm_ops;
        void *vm_private_data;
 };
@@ -1797,14 +1797,15 @@ struct rtdm_mmap_data {
 static int rtdm_mmap_buffer(struct file *filp, struct vm_area_struct *vma)
 {
        struct rtdm_mmap_data *mmap_data = filp->private_data;
-       unsigned long vaddr, paddr, maddr, size;
+       unsigned long vaddr, maddr, size;
+       phys_addr_t paddr;
        int ret;
 
        vma->vm_ops = mmap_data->vm_ops;
        vma->vm_private_data = mmap_data->vm_private_data;
 
        vaddr = (unsigned long)mmap_data->src_vaddr;
-       paddr = (unsigned long)mmap_data->src_paddr;
+       paddr = mmap_data->src_paddr;
        if (!paddr)
                /* kmalloc memory */
                paddr = virt_to_phys((void *)vaddr);
@@ -2006,7 +2007,7 @@ EXPORT_SYMBOL(rtdm_mmap_to_user);
  * Rescheduling: possible.
  */
 int rtdm_iomap_to_user(rtdm_user_info_t *user_info,
-                      unsigned long src_addr, size_t len,
+                      phys_addr_t src_addr, size_t len,
                       int prot, void **pptr,
                       struct vm_operations_struct *vm_ops,
                       void *vm_private_data)


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

Reply via email to