x86: Update the io.h file to use {out|in}_{be|le}X macros
PATCH 1/1 x86: Update the io.h file to use {out|in}_{be|le}X macros
The commit 3f70a6f57734 ("x86: Add clr/setbits functions") introduced the {read|write}_ macros to manipulate data.
Those macros are not used by any code in the u-boot project (despite the io.h itself). Other architectures use io.h with {in|out}_* macros.
This commit brings some unification across u-boot supported architectures.
---
arch/x86/include/asm/io.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
arch/x86/include/asm/io.h +17 -17
@@ -76,34 +76,34 @@#define memcpy_fromio (a,b,c) memcpy((a),(b),(c))#define memcpy_toio (a,b,c) memcpy((a),(b),(c)) -#define write_arch (type, endian, a, v) __raw_write##type(cpu_to_##endian(v), a) -#define read_arch (type, endian, a) endian##_to_cpu(__raw_read##type(a)) +#define out_arch (type, endian, a, v) __raw_write##type(cpu_to_##endian(v), a) +#define in_arch (type, endian, a) endian##_to_cpu(__raw_read##type(a)) -#define write_le64 (a, v) write_arch(q, le64, a, v) -#define write_le32 (a, v) write_arch(l, le32, a, v) -#define write_le16 (a, v) write_arch(w, le16, a, v) +#define out_le64 (a, v) out_arch(q, le64, a, v) +#define out_le32 (a, v) out_arch(l, le32, a, v) +#define out_le16 (a, v) out_arch(w, le16, a, v) -#define read_le64 (a) read_arch(q, le64, a) -#define read_le32 (a) read_arch(l, le32, a) -#define read_le16 (a) read_arch(w, le16, a) +#define in_le64 (a) in_arch(q, le64, a) +#define in_le32 (a) in_arch(l, le32, a) +#define in_le16 (a) in_arch(w, le16, a) -#define write_be32 (a, v) write_arch(l, be32, a, v) -#define write_be16 (a, v) write_arch(w, be16, a, v) +#define out_be32 (a, v) out_arch(l, be32, a, v) +#define out_be16 (a, v) out_arch(w, be16, a, v) -#define read_be32 (a) read_arch(l, be32, a) -#define read_be16 (a) read_arch(w, be16, a) +#define in_be32 (a) in_arch(l, be32, a) +#define in_be16 (a) in_arch(w, be16, a) -#define write_8 (a, v) __raw_writeb(v, a) -#define read_8 (a) __raw_readb(a) +#define out_8 (a, v) __raw_writeb(v, a) +#define in_8 (a) __raw_readb(a)#define clrbits (type, addr, clear) \ - write_##type((addr), read_##type(addr) & ~(clear)) + out_##type((addr), in_##type(addr) & ~(clear))#define setbits (type, addr, set) \ - write_##type((addr), read_##type(addr) | (set)) + out_##type((addr), in_##type(addr) | (set))#define clrsetbits (type, addr, clear, set) \ - write_##type((addr), (read_##type(addr) & ~(clear)) | (set)) + out_##type((addr), (in_##type(addr) & ~(clear)) | (set))#define clrbits_be32 (addr, clear) clrbits(be32, addr, clear)#define setbits_be32 (addr, set) setbits(be32, addr, set)
Signature · 1 line
2.11.0
PATCH 1/1 x86: Update the io.h file to use {out|in}_{be|le}X macros
Quoted 6 lines · Lukasz Majewski
The commit
3f70a6f57734("x86: Add clr/setbits functions") introduced the {read|write}_ macros to manipulate data.Those macros are not used by any code in the u-boot project (despite the
io.hitself). Other architectures useio.hwith {in|out}_* macros.
Quoted 8 lines
This commit brings some unification across u-boot supported architectures.
Signed-off-by Lukasz Majewski <[email protected]>---
arch/x86/include/asm/io.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
PATCH 1/1 x86: Update the io.h file to use {out|in}_{be|le}X macros
Quoted 9 lines · Bin Meng
Quoted 8 lines · Lukasz Majewski
The commit
3f70a6f57734("x86: Add clr/setbits functions") introduced the {read|write}_ macros to manipulate data.Those macros are not used by any code in the u-boot project (despite the
io.hitself). Other architectures useio.hwith {in|out}_* macros.This commit brings some unification across u-boot supported architectures.
Quoted 8 lines
Quoted 6 lines
Signed-off-by Lukasz Majewski <[email protected]>---
arch/x86/include/asm/io.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)Reviewed-by Bin Meng <[email protected]>
applied to u-boot-x86, thanks!