| #ifndef KVM__KVM_BARRIER_H | |
| #define KVM__KVM_BARRIER_H | |
| #define nop() __asm__ __volatile__ ("nop") | |
| #define RISCV_FENCE(p, s) \ | |
| __asm__ __volatile__ ("fence " #p "," #s : : : "memory") | |
| /* These barriers need to enforce ordering on both devices or memory. */ | |
| #define mb() RISCV_FENCE(iorw,iorw) | |
| #define rmb() RISCV_FENCE(ir,ir) | |
| #define wmb() RISCV_FENCE(ow,ow) | |
| #endif /* KVM__KVM_BARRIER_H */ |