m68k: new arch
diff --git a/honggfuzz.c b/honggfuzz.c index 2ea049e..267f880 100644 --- a/honggfuzz.c +++ b/honggfuzz.c
@@ -293,8 +293,8 @@ } if (hfuzz->timing.exitOnTime > 0 && time(NULL) - ATOMIC_GET(hfuzz->timing.lastCovUpdate) > hfuzz->timing.exitOnTime) { - LOG_I("No new coverage was found for the last %ld seconds, terminating", - hfuzz->timing.exitOnTime); + LOG_I("No new coverage was found for the last %" PRIu64 " seconds, terminating", + (uint64_t)hfuzz->timing.exitOnTime); break; } pingThreads(hfuzz);
diff --git a/input.c b/input.c index fa73ac2..a1063a3 100644 --- a/input.c +++ b/input.c
@@ -683,7 +683,7 @@ continue; } - LOG_I("Loading dynamic input file: %s (%lu)", dynamicInputFileName, dynamicFileSz); + LOG_I("Loading dynamic input file: %s (%zu)", dynamicInputFileName, dynamicFileSz); run_t tmp_run; tmp_run.global = hfuzz;
diff --git a/linux/trace.c b/linux/trace.c index ffe0fe8..26a3876 100644 --- a/linux/trace.c +++ b/linux/trace.c
@@ -75,6 +75,8 @@ #define MAX_INSTR_SZ 8 #elif defined(__riscv) #define MAX_INSTR_SZ 4 +#elif defined(__m68k__) +#define MAX_INSTR_SZ 22 #endif #if defined(__i386__) || defined(__x86_64__) @@ -349,6 +351,37 @@ }; #endif /* defined(__riscv) */ +#if defined(__m68k__) +struct user_regs_32 { + long d1; + long d2; + long d3; + long d4; + long d5; + long d6; + long d7; + long a0; + long a1; + long a2; + long a3; + long a4; + long a5; + long a6; + long d0; + long usp; + long orig_d0; + short stkadj; + short sr; + long pc; + short fmtvec; + short __fill; +}; + +union user_regs_t { + struct user_regs_32 regs32; +}; +#endif /* defined(__m68k__) */ + #if defined(__clang__) _Pragma("clang diagnostic push"); _Pragma("clang diagnostic ignored \"-Woverride-init\""); @@ -528,6 +561,16 @@ return 0; #endif /* defined(__riscv) */ +#if defined(__m68k__) + if (pt_iov.iov_len == sizeof(struct user_regs_32)) { + *pc = regs.regs32.pc; + return pt_iov.iov_len; + } + + LOG_W("Unknown registers structure size: '%zd'", pt_iov.iov_len); + return 0; +#endif /* defined(__m68k__) */ + LOG_D("Unknown/unsupported CPU architecture"); return 0; }