Skip to content

Commit

Permalink
Implement cmpxchg
Browse files Browse the repository at this point in the history
  • Loading branch information
tbodt committed May 26, 2018
1 parent 5b0ad80 commit fa00fa7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions emu/gadgets-x86/misc.S
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@
pop %rdi
pop %rsi
gret

.gadget cmpxchg32_mem
write_prep
cmpxchg %tmpd, (%_addrq)
gret 1
.gadget_array cmpxchg
2 changes: 1 addition & 1 deletion emu/gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fa00fa7

Please sign in to comment.