diff options
author | Pranith Kumar <bobby.prani@gmail.com> | 2016-07-14 16:20:13 -0400 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2016-09-16 08:12:11 -0700 |
commit | f65e19bc2c9e8358e634d309606144ac2a3c2936 (patch) | |
tree | 261b19dd382c67ff35f21ff53d64c58f03126764 /tcg/tcg.h | |
parent | be2208e2a50f4b50980d92c26f2e12cb2bda4afc (diff) | |
download | qemu-f65e19bc2c9e8358e634d309606144ac2a3c2936.zip |
Introduce TCGOpcode for memory barrier
This commit introduces the TCGOpcode for memory barrier instruction.
This opcode takes an argument which is the type of memory barrier
which should be generated.
Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
Message-Id: <20160714202026.9727-2-bobby.prani@gmail.com>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'tcg/tcg.h')
-rw-r--r-- | tcg/tcg.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -465,6 +465,23 @@ static inline intptr_t QEMU_ARTIFICIAL GET_TCGV_PTR(TCGv_ptr t) #define TCG_CALL_DUMMY_TCGV MAKE_TCGV_I32(-1) #define TCG_CALL_DUMMY_ARG ((TCGArg)(-1)) +typedef enum { + /* Used to indicate the type of accesses on which ordering + is to be ensured. Modeled after SPARC barriers. */ + TCG_MO_LD_LD = 0x01, + TCG_MO_ST_LD = 0x02, + TCG_MO_LD_ST = 0x04, + TCG_MO_ST_ST = 0x08, + TCG_MO_ALL = 0x0F, /* OR of the above */ + + /* Used to indicate the kind of ordering which is to be ensured by the + instruction. These types are derived from x86/aarch64 instructions. + It should be noted that these are different from C11 semantics. */ + TCG_BAR_LDAQ = 0x10, /* Following ops will not come forward */ + TCG_BAR_STRL = 0x20, /* Previous ops will not be delayed */ + TCG_BAR_SC = 0x30, /* No ops cross barrier; OR of the above */ +} TCGBar; + /* Conditions. Note that these are laid out for easy manipulation by the functions below: bit 0 is used for inverting; |