1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-27 11:55:06 +00:00

ofed: Define barriers for mips and arm.

I used the strongest barriers available on the architectures, so if
the future analysis show that it is excessive, the barriers could be
relaxed. Still, it is unlikely that it is meaningful to run IB on 32bit
ARM or current MIPS machines, so the change is to make WITH_OFED to pass
tinderbox.

Sponsored by:	Mellanox Technologies
Reviewed by:	hselasky
Differential revision:	https://reviews.freebsd.org/D13329
This commit is contained in:
Konstantin Belousov 2017-12-11 11:59:45 +00:00
parent 0521e6e192
commit b258727e79
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=326765

View File

@ -96,6 +96,14 @@
#define udma_to_device_barrier() asm volatile("dsb st" ::: "memory");
#elif defined(__sparc__) || defined(__s390x__)
#define udma_to_device_barrier() asm volatile("" ::: "memory")
#elif defined(__mips__)
#include <sys/types.h>
#include <machine/atomic.h>
#define udma_to_device_barrier() mips_sync()
#elif defined(__arm__)
#include <sys/types.h>
#include <machine/atomic.h>
#define udma_to_device_barrier() dmb()
#else
#error No architecture specific memory barrier defines found!
#endif
@ -128,6 +136,10 @@
#define udma_from_device_barrier() asm volatile("dsb ld" ::: "memory");
#elif defined(__sparc__) || defined(__s390x__)
#define udma_from_device_barrier() asm volatile("" ::: "memory")
#elif defined(__mips__)
#define udma_from_device_barrier() mips_sync()
#elif defined(__arm__)
#define udma_from_device_barrier() dmb()
#else
#error No architecture specific memory barrier defines found!
#endif
@ -192,6 +204,10 @@
#define mmio_flush_writes() asm volatile("dsb st" ::: "memory");
#elif defined(__sparc__) || defined(__s390x__)
#define mmio_flush_writes() asm volatile("" ::: "memory")
#elif defined(__mips__)
#define mmio_flush_writes() mips_sync()
#elif defined(__arm__)
#define mmio_flush_writes() dmb()
#else
#error No architecture specific memory barrier defines found!
#endif