diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-10-29 16:45:50 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2020-10-29 16:45:50 +0000 |
commit | 9cbbed12d156ecf1daa8ef806ac875a8e662f9a6 (patch) | |
tree | d327bf2f0c00b10ffd21868f88d9abebb5f2d7d3 /sys/dev/pci/drm/include | |
parent | bf7c064c0faba1cb4cf202663658c706080f3372 (diff) |
We need more memory barriers on powerpc.
ok tobhe@
Diffstat (limited to 'sys/dev/pci/drm/include')
-rw-r--r-- | sys/dev/pci/drm/include/linux/io.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/dev/pci/drm/include/linux/io.h b/sys/dev/pci/drm/include/linux/io.h index 09c66b0d877..89f56e0106e 100644 --- a/sys/dev/pci/drm/include/linux/io.h +++ b/sys/dev/pci/drm/include/linux/io.h @@ -16,12 +16,18 @@ #define memcpy_fromio(d, s, n) memcpy(d, s, n) #define memset_io(d, b, n) memset(d, b, n) +#ifdef __powerpc__ +#define iobarrier() mb() +#else +#define iobarrier() barrier() +#endif + static inline u8 ioread8(const volatile void __iomem *addr) { uint8_t val; - barrier(); + iobarrier(); val = *(volatile uint8_t *)addr; rmb(); return val; @@ -47,7 +53,7 @@ ioread16(const volatile void __iomem *addr) { uint16_t val; - barrier(); + iobarrier(); val = *(volatile uint16_t *)addr; rmb(); return val; @@ -58,7 +64,7 @@ ioread32(const volatile void __iomem *addr) { uint32_t val; - barrier(); + iobarrier(); val = *(volatile uint32_t *)addr; rmb(); return val; @@ -69,7 +75,7 @@ ioread64(const volatile void __iomem *addr) { uint64_t val; - barrier(); + iobarrier(); val = *(volatile uint64_t *)addr; rmb(); return val; @@ -103,7 +109,7 @@ ioread16(const volatile void __iomem *addr) { uint16_t val; - barrier(); + iobarrier(); val = lemtoh16(addr); rmb(); return val; @@ -114,7 +120,7 @@ ioread32(const volatile void __iomem *addr) { uint32_t val; - barrier(); + iobarrier(); val = lemtoh32(addr); rmb(); return val; @@ -125,7 +131,7 @@ ioread64(const volatile void __iomem *addr) { uint64_t val; - barrier(); + iobarrier(); val = lemtoh64(addr); rmb(); return val; |