public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Guan Xuetao <gxt@mprc.pku.edu.cn>
To: Jonas Bonn <jonas@southpole.se>
Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
	vapier@gentoo.org, liqin.chen@sunplusct.com
Subject: Re: [PATCH v2 1/1] asm-generic: add MMU variants of io.h functions
Date: Mon, 04 Jul 2011 10:28:17 +0800	[thread overview]
Message-ID: <1309746497.2291.3.camel@epip-laptop> (raw)
In-Reply-To: <1309628168-3413-1-git-send-email-jonas@southpole.se>

It's very good to me, thanks.

Guan Xuetao

On Sat, 2011-07-02 at 19:36 +0200, Jonas Bonn wrote:
> Some of the implementations, in particular the ioremap variants, in
> asm-generic/io.h are for systems without an MMU.  In order to be able to
> use the generic header file for systems with an MMU, this patch wraps
> these implementations in checks for CONFIG_MMU.
> 
> Tested on OpenRISC.
> 
> Signed-off-by: Jonas Bonn <jonas@southpole.se>
> Cc: vapier@gentoo.org
> Cc: liqin.chen@sunplusct.com
> Cc: gxt@mprc.pku.edu.cn
> ---
>  include/asm-generic/io.h |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
> index e0ffa3d..a1caf2d 100644
> --- a/include/asm-generic/io.h
> +++ b/include/asm-generic/io.h
> @@ -307,7 +307,11 @@ static inline void *phys_to_virt(unsigned long address)
>  
>  /*
>   * Change "struct page" to physical address.
> + *
> + * This implementation is for the no-MMU case only... if you have an MMU
> + * you'll need to provide your own definitions.
>   */
> +#ifndef CONFIG_MMU
>  static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
>  {
>  	return (void __iomem*) (unsigned long)offset;
> @@ -326,6 +330,7 @@ static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
>  static inline void iounmap(void *addr)
>  {
>  }
> +#endif /* CONFIG_MMU */
>  
>  #ifndef CONFIG_GENERIC_IOMAP
>  static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
> @@ -342,7 +347,7 @@ extern void ioport_unmap(void __iomem *p);
>  #endif /* CONFIG_GENERIC_IOMAP */
>  
>  #define xlate_dev_kmem_ptr(p)	p
> -#define xlate_dev_mem_ptr(p)	((void *) (p))
> +#define xlate_dev_mem_ptr(p)	__va(p)
>  
>  #ifndef virt_to_bus
>  static inline unsigned long virt_to_bus(volatile void *address)

      parent reply	other threads:[~2011-07-04  2:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-02 15:53 [PATCH 1/2] asm-generic: add MMU variants of io.h functions Jonas Bonn
2011-07-02 15:53 ` Jonas Bonn
2011-07-02 15:53 ` [PATCH 2/2] iomap: make IOPORT/PCI mapping functions conditional Jonas Bonn
2011-07-02 19:46   ` Arnd Bergmann
2011-07-02 19:54     ` Jonas Bonn
2011-07-02 20:15       ` Arnd Bergmann
2011-07-02 16:38 ` [PATCH 1/2] asm-generic: add MMU variants of io.h functions Mike Frysinger
2011-07-02 16:47   ` Jonas Bonn
2011-07-02 17:04     ` Mike Frysinger
2011-07-02 17:04       ` Mike Frysinger
2011-07-02 17:36       ` [PATCH v2 1/1] " Jonas Bonn
2011-07-02 18:43         ` Mike Frysinger
2011-07-02 19:44         ` Arnd Bergmann
2011-07-04  2:28         ` Guan Xuetao [this message]

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=1309746497.2291.3.camel@epip-laptop \
    --to=gxt@mprc.pku.edu.cn \
    --cc=jonas@southpole.se \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liqin.chen@sunplusct.com \
    --cc=vapier@gentoo.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox