diff --git a/softmmu/main.c b/softmmu/main.c index 7f73b35f08..ce95c16af8 100644 --- a/softmmu/main.c +++ b/softmmu/main.c @@ -46,6 +46,7 @@ int main(int argc, char **argv) /* Begin LibAFL instrumentation */ #include "sysemu/runstate.h" +#include "sysemu/cpu-timers.h" #include "migration/snapshot.h" #include "hw/core/cpu.h" #include "qapi/error.h" @@ -62,6 +63,7 @@ int libafl_snapshot_save( const char* ); int libafl_snapshot_load( const char* ); void libafl_phys_read(vaddr, uint8_t*, int); void libafl_phys_write(vaddr, uint8_t*, int); +int64_t libafl_get_clock( void ); void libafl_qemu_main_loop( void ) { @@ -101,6 +103,11 @@ void libafl_phys_write(vaddr addr, uint8_t* buf, int len) cpu_physical_memory_write(addr, buf, len); } +int64_t libafl_get_clock( void ) +{ + return cpus_get_virtual_clock(); +} + #ifndef AS_SHARED_LIB int main(int argc, char **argv, char **envp) { diff --git a/starter.sh b/starter.sh index 2690c95f62..c527a4b8bc 100755 --- a/starter.sh +++ b/starter.sh @@ -6,5 +6,5 @@ build/qemu-system-arm -machine mps2-an385 -monitor null -semihosting \ --semihosting-config enable=on,target=native \ -kernel $1 \ -serial stdio -nographic \ - -snapshot -drive if=none,format=qcow2,file=dummy.qcow2 - # -S + -snapshot -drive if=none,format=qcow2,file=dummy.qcow2 \ + -icount shift=auto,align=off,sleep=off