On Fri, 2018-04-06 at 14:43 -0700, Ivan Gorinov wrote:
> Add readq() and writeq() definitions for x86.
> 
> Please note: in 32-bit code readq/writeq will generate two 32-bit
> memory access instructions instead of one atomic 64-bit operation.
> 

Thanks!

FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevche...@linux.intel.com>

> Signed-off-by: Ivan Gorinov <ivan.gori...@intel.com>
> ---
>  arch/x86/include/asm/io.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
> index 263dd8f..4ab0080 100644
> --- a/arch/x86/include/asm/io.h
> +++ b/arch/x86/include/asm/io.h
> @@ -61,16 +61,20 @@
>  #define readb(addr) (*(volatile unsigned char *) (addr))
>  #define readw(addr) (*(volatile unsigned short *) (addr))
>  #define readl(addr) (*(volatile unsigned int *) (addr))
> +#define readq(addr) (*(volatile unsigned long long *) (addr))
>  #define __raw_readb readb
>  #define __raw_readw readw
>  #define __raw_readl readl
> +#define __raw_readq readq
>  
>  #define writeb(b,addr) (*(volatile unsigned char *) (addr) = (b))
>  #define writew(b,addr) (*(volatile unsigned short *) (addr) = (b))
>  #define writel(b,addr) (*(volatile unsigned int *) (addr) = (b))
> +#define writeq(b,addr) (*(volatile unsigned long long *) (addr) =
> (b))
>  #define __raw_writeb writeb
>  #define __raw_writew writew
>  #define __raw_writel writel
> +#define __raw_writeq writeq
>  
>  #define memset_io(a,b,c)     memset((a),(b),(c))
>  #define memcpy_fromio(a,b,c) memcpy((a),(b),(c))

-- 
Andy Shevchenko <andriy.shevche...@linux.intel.com>
Intel Finland Oy
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to