add hard-coded libafl_exec_systick_hook
This commit is contained in:
parent
8a379ba198
commit
a5a49c3292
@ -39,8 +39,30 @@ static inline int64_t systick_scale(SysTickState *s)
|
||||
}
|
||||
}
|
||||
|
||||
/* Begin LibAFL instrumentation */
|
||||
extern void libafl_send_irq(int irqn);
|
||||
extern int64_t libafl_get_clock( void );
|
||||
volatile unsigned int libafl_int_offset = 0;
|
||||
volatile bool libafl_int_done = false;
|
||||
/* This can be moved to a helper function later */
|
||||
inline void libafl_exec_systick_hook(void);
|
||||
inline void libafl_exec_systick_hook(void)
|
||||
{
|
||||
if (libafl_int_offset!=0 && libafl_int_offset) {
|
||||
if (libafl_get_clock() >= libafl_int_offset) {
|
||||
if (!libafl_int_done) {
|
||||
libafl_int_done = true;
|
||||
libafl_send_irq(0);
|
||||
}
|
||||
} else {
|
||||
libafl_int_done = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
static void systick_timer_tick(void *opaque)
|
||||
{
|
||||
libafl_exec_systick_hook();
|
||||
/* End LibAFL instrumentation */
|
||||
SysTickState *s = (SysTickState *)opaque;
|
||||
|
||||
trace_systick_timer_tick();
|
||||
|
Loading…
x
Reference in New Issue
Block a user