All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v6] x86: Add 64-bit memory-mapped I/O functions
@ 2018-04-06 21:43 Ivan Gorinov
  2018-04-07 14:03 ` Andy Shevchenko
  2018-04-08  5:47 ` Bin Meng
  0 siblings, 2 replies; 4+ messages in thread
From: Ivan Gorinov @ 2018-04-06 21:43 UTC (permalink / raw)
  To: u-boot

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.

Signed-off-by: Ivan Gorinov <ivan.gorinov@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))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v6] x86: Add 64-bit memory-mapped I/O functions
  2018-04-06 21:43 [U-Boot] [PATCH v6] x86: Add 64-bit memory-mapped I/O functions Ivan Gorinov
@ 2018-04-07 14:03 ` Andy Shevchenko
  2018-04-08  5:47 ` Bin Meng
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2018-04-07 14:03 UTC (permalink / raw)
  To: u-boot

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.shevchenko@linux.intel.com>

> Signed-off-by: Ivan Gorinov <ivan.gorinov@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.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v6] x86: Add 64-bit memory-mapped I/O functions
  2018-04-06 21:43 [U-Boot] [PATCH v6] x86: Add 64-bit memory-mapped I/O functions Ivan Gorinov
  2018-04-07 14:03 ` Andy Shevchenko
@ 2018-04-08  5:47 ` Bin Meng
  2018-04-09  1:28   ` Bin Meng
  1 sibling, 1 reply; 4+ messages in thread
From: Bin Meng @ 2018-04-08  5:47 UTC (permalink / raw)
  To: u-boot

On Sat, Apr 7, 2018 at 5:43 AM, Ivan Gorinov <ivan.gorinov@intel.com> 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.
>
> Signed-off-by: Ivan Gorinov <ivan.gorinov@intel.com>
> ---
>  arch/x86/include/asm/io.h | 4 ++++
>  1 file changed, 4 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH v6] x86: Add 64-bit memory-mapped I/O functions
  2018-04-08  5:47 ` Bin Meng
@ 2018-04-09  1:28   ` Bin Meng
  0 siblings, 0 replies; 4+ messages in thread
From: Bin Meng @ 2018-04-09  1:28 UTC (permalink / raw)
  To: u-boot

On Sun, Apr 8, 2018 at 1:47 PM, Bin Meng <bmeng.cn@gmail.com> wrote:
> On Sat, Apr 7, 2018 at 5:43 AM, Ivan Gorinov <ivan.gorinov@intel.com> 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.
>>
>> Signed-off-by: Ivan Gorinov <ivan.gorinov@intel.com>
>> ---
>>  arch/x86/include/asm/io.h | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-04-09  1:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-06 21:43 [U-Boot] [PATCH v6] x86: Add 64-bit memory-mapped I/O functions Ivan Gorinov
2018-04-07 14:03 ` Andy Shevchenko
2018-04-08  5:47 ` Bin Meng
2018-04-09  1:28   ` Bin Meng

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.