From: Jan Kiszka <jan.kiszka@domain.hid>
To: "Herrera-Bendezu, Luis" <lherrera@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] rtdm: Extend rtdm_iomap_to_user to map phys addr > 4G
Date: Sat, 21 Nov 2009 09:43:01 +0100 [thread overview]
Message-ID: <4B07A815.6020309@domain.hid> (raw)
In-Reply-To: <6FCCA913376DD7488F4139A4D11B8F48FD1B53@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 3997 bytes --]
Herrera-Bendezu, Luis wrote:
> 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 <lherrera@domain.hid>
^^^^^^^^^^^
Something made your mail address unreadable. This is pointless (your
address is already archived on this list). Moreover, we need a proper
signature as a declaration that you are authorized to contribute this
patch. One may argue that the patch is trivial and not "copyrightable",
but we better avoid being sloppy even in that case.
Besides this, the patch is unfortunately line wrap. Make sure that
wrapping is switched off or use a different mailer.
Thanks,
Jan
> ---
> diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h
> index 020e763..f2a9424 100644
> --- a/include/asm-generic/system.h
> +++ b/include/asm-generic/system.h
> @@ -417,7 +417,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 943ed34..239eb93 100644
> --- a/include/asm-generic/wrappers.h
> +++ b/include/asm-generic/wrappers.h
> @@ -400,4 +400,8 @@ 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
> +
> #endif /* _XENO_ASM_GENERIC_WRAPPERS_H */
> diff --git a/include/rtdm/rtdm_driver.h b/include/rtdm/rtdm_driver.h
> index 3026aff..0340de8 100644
> --- a/include/rtdm/rtdm_driver.h
> +++ b/include/rtdm/rtdm_driver.h
> @@ -1168,7 +1168,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 65c630f..8922689 100644
> --- a/ksrc/skins/rtdm/drvlib.c
> +++ b/ksrc/skins/rtdm/drvlib.c
> @@ -1765,7 +1765,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;
> };
> @@ -1773,14 +1773,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);
> @@ -1982,7 +1983,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)
> ---
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
next prev parent reply other threads:[~2009-11-21 8:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 16:42 [Xenomai-core] rtdm_iomap_to_user with phys addr > 4GB Herrera-Bendezu, Luis
2009-11-10 17:02 ` Jan Kiszka
2009-11-10 17:58 ` Herrera-Bendezu, Luis
2009-11-10 18:13 ` Jan Kiszka
2009-11-10 18:29 ` Herrera-Bendezu, Luis
2009-11-10 18:54 ` Jan Kiszka
2009-11-10 19:20 ` Herrera-Bendezu, Luis
2009-11-10 21:21 ` Jan Kiszka
2009-11-11 12:38 ` Herrera-Bendezu, Luis
2009-11-11 14:06 ` Jan Kiszka
2009-11-11 15:40 ` Herrera-Bendezu, Luis
2009-11-18 16:00 ` [Xenomai-core] rtdm_iomap_to_user with phys addr > 4G Herrera-Bendezu, Luis
2009-11-18 16:42 ` Jan Kiszka
[not found] ` <6FCCA913376DD7488F4139A4D11B8F48FD187B@troe2k1.cs.myharris.net>
2009-11-20 10:35 ` Jan Kiszka
2009-11-20 16:41 ` [Xenomai-core] [PATCH] rtdm: Extend rtdm_iomap_to_user to map " Herrera-Bendezu, Luis
2009-11-21 8:43 ` Jan Kiszka [this message]
2009-11-21 15:11 ` Herrera-Bendezu, Luis
2009-11-23 18:32 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B07A815.6020309@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=lherrera@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.