add libafl_get_clock
This commit is contained in:
parent
88a0358a4e
commit
6ec50ee9c3
@ -46,6 +46,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
/* Begin LibAFL instrumentation */
|
/* Begin LibAFL instrumentation */
|
||||||
#include "sysemu/runstate.h"
|
#include "sysemu/runstate.h"
|
||||||
|
#include "sysemu/cpu-timers.h"
|
||||||
#include "migration/snapshot.h"
|
#include "migration/snapshot.h"
|
||||||
#include "hw/core/cpu.h"
|
#include "hw/core/cpu.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
@ -62,6 +63,7 @@ int libafl_snapshot_save( const char* );
|
|||||||
int libafl_snapshot_load( const char* );
|
int libafl_snapshot_load( const char* );
|
||||||
void libafl_phys_read(vaddr, uint8_t*, int);
|
void libafl_phys_read(vaddr, uint8_t*, int);
|
||||||
void libafl_phys_write(vaddr, uint8_t*, int);
|
void libafl_phys_write(vaddr, uint8_t*, int);
|
||||||
|
int64_t libafl_get_clock( void );
|
||||||
|
|
||||||
void libafl_qemu_main_loop( 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);
|
cpu_physical_memory_write(addr, buf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int64_t libafl_get_clock( void )
|
||||||
|
{
|
||||||
|
return cpus_get_virtual_clock();
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef AS_SHARED_LIB
|
#ifndef AS_SHARED_LIB
|
||||||
int main(int argc, char **argv, char **envp)
|
int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
|
@ -6,5 +6,5 @@ build/qemu-system-arm -machine mps2-an385 -monitor null -semihosting \
|
|||||||
--semihosting-config enable=on,target=native \
|
--semihosting-config enable=on,target=native \
|
||||||
-kernel $1 \
|
-kernel $1 \
|
||||||
-serial stdio -nographic \
|
-serial stdio -nographic \
|
||||||
-snapshot -drive if=none,format=qcow2,file=dummy.qcow2
|
-snapshot -drive if=none,format=qcow2,file=dummy.qcow2 \
|
||||||
# -S
|
-icount shift=auto,align=off,sleep=off
|
||||||
|
Loading…
x
Reference in New Issue
Block a user