lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 04 Jul 2011 10:28:17 +0800
From:	Guan Xuetao <gxt@...c.pku.edu.cn>
To:	Jonas Bonn <jonas@...thpole.se>
Cc:	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org,
	vapier@...too.org, liqin.chen@...plusct.com
Subject: Re: [PATCH v2 1/1] asm-generic: add MMU variants of io.h functions

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@...thpole.se>
> Cc: vapier@...too.org
> Cc: liqin.chen@...plusct.com
> Cc: gxt@...c.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)


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ