/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Copyright (C) 2014-15 Synopsys, Inc. (www.synopsys.com)3*/45#ifndef __ASM_BARRIER_H6#define __ASM_BARRIER_H78#ifdef CONFIG_ISA_ARCV2910/*11* ARCv2 based HS38 cores are in-order issue, but still weakly ordered12* due to micro-arch buffering/queuing of load/store, cache hit vs. miss ...13*14* Explicit barrier provided by DMB instruction15* - Operand supports fine grained load/store/load+store semantics16* - Ensures that selected memory operation issued before it will complete17* before any subsequent memory operation of same type18* - DMB guarantees SMP as well as local barrier semantics19* (asm-generic/barrier.h ensures sane smp_*mb if not defined here, i.e.20* UP: barrier(), SMP: smp_*mb == *mb)21* - DSYNC provides DMB+completion_of_cache_bpu_maintenance_ops hence not needed22* in the general case. Plus it only provides full barrier.23*/2425#define mb() asm volatile("dmb 3\n" : : : "memory")26#define rmb() asm volatile("dmb 1\n" : : : "memory")27#define wmb() asm volatile("dmb 2\n" : : : "memory")2829#else3031/*32* ARCompact based cores (ARC700) only have SYNC instruction which is super33* heavy weight as it flushes the pipeline as well.34* There are no real SMP implementations of such cores.35*/3637#define mb() asm volatile("sync\n" : : : "memory")3839#endif4041#include <asm-generic/barrier.h>4243#endif444546