diff options
author | Ivan Gorinov <ivan.gorinov@intel.com> | 2018-04-06 14:43:04 -0700 |
---|---|---|
committer | Bin Meng <bmeng.cn@gmail.com> | 2018-04-16 16:54:51 +0800 |
commit | 53cabe3d8eaac128788db9bce3f9d4874068806d (patch) | |
tree | 4a063fb5c2bd003c5af8a37a07da0d9c38f1512f /arch/x86/include/asm | |
parent | ebca902aeb3af3eaedd2787928184ad84a86b98f (diff) |
x86: Add 64-bit memory-mapped I/O functions
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>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/io.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index 263dd8fd17..4ab008074a 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)) |