Implement cmpxchg

This commit is contained in:
Theodore Dubois 2018-05-25 17:52:34 -07:00
parent 5b0ad80d37
commit fa00fa7ba4
2 changed files with 7 additions and 1 deletions

View File

@ -33,3 +33,9 @@
pop %rdi
pop %rsi
gret
.gadget cmpxchg32_mem
write_prep
cmpxchg %tmpd, (%_addrq)
gret 1
.gadget_array cmpxchg

View File

@ -223,7 +223,7 @@ static inline void gen_op(struct gen_state *state, gadget_t *gadgets, enum arg a
#define REPZ(op, z) strop(op, repz, z)
#define REPNZ(op, z) strop(op, repnz, z)
#define CMPXCHG(src, dst,z) UNDEFINED
#define CMPXCHG(src, dst,z) load(src, z); op(cmpxchg, dst, z)
#define XADD(src, dst,z) UNDEFINED
#define RDTSC g(rdtsc)