common header for qemu and unicorn

This commit is contained in:
Andrea Fioraldi
2019-08-29 15:28:42 +02:00
parent d3e173b6e6
commit 132ad08885
6 changed files with 113 additions and 70 deletions

View File

@ -32,7 +32,7 @@
*/
#include "../../config.h"
#include "afl-qemu-common.h"
#include "tcg.h"
#include "tcg-op.h"
@ -45,20 +45,6 @@ extern u8 afl_compcov_level;
void tcg_gen_afl_compcov_log_call(void *func, target_ulong cur_loc,
TCGv_i64 arg1, TCGv_i64 arg2);
#if (defined(__x86_64__) || defined(__i386__)) && defined(AFL_QEMU_NOT_ZERO)
# define INC_AFL_AREA(loc) \
asm volatile ( \
"incb (%0, %1, 1)\n" \
"adcb $0, (%0, %1, 1)\n" \
: /* no out */ \
: "r" (afl_area_ptr), "r" (loc) \
: "memory", "eax" \
)
#else
# define INC_AFL_AREA(loc) \
afl_area_ptr[loc]++
#endif
static void afl_compcov_log_16(target_ulong cur_loc, target_ulong arg1,
target_ulong arg2) {