-
Notifications
You must be signed in to change notification settings - Fork 1
/
cpu_event_listener.h
26 lines (24 loc) · 1.12 KB
/
cpu_event_listener.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// *** WARNING ***
// This file is generated by genevents.rb
// Keep untouched or ruin the abstraction
#pragma once
#include "utils.h"
#include "cpu.h"
typedef void (*cpu_event_callback_on_decode_t)(void *context, cpu_ref cpu, uint16_t pc);
typedef void (*cpu_event_callback_on_read_t)(void *context, cpu_ref cpu, uint16_t addr, size_t size);
typedef void (*cpu_event_callback_on_write_t)(void *context, cpu_ref cpu, uint16_t addr, size_t length);
typedef void (*cpu_event_callback_on_step_t)(void *context, cpu_ref cpu);
typedef void (*cpu_event_callback_on_interrupt_t)(void *context, cpu_ref cpu, interruption_type_t acks);
typedef struct cpu_event_listener {
void *context;
// called before decoding an instruction after processed interruption
cpu_event_callback_on_decode_t on_decode;
// called on cpu_read
cpu_event_callback_on_read_t on_read;
// called on cpu_write
cpu_event_callback_on_write_t on_write;
// called on decoded an instruction
cpu_event_callback_on_step_t on_step;
// called on handled an interruption
cpu_event_callback_on_interrupt_t on_interrupt;
} cpu_event_listener_t;