TEMU  3.0
The Terma Emulator
Instrumenter.h
Go to the documentation of this file.
1 //===--------------------------------------------------------------*- C -*-===//
2 //
3 // EMUBT: Binary Translation using LLVM
4 // © Terma 2018, 2019
5 // Authors: Mattias Holm <maho@terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef TEMU_INSTRUMENTER_H
10 #define TEMU_INSTRUMENTER_H
11 #include "temu-c/Support/Objsys.h"
12 #include <stdint.h>
13 
14 typedef enum {
15  teIF_Branch = 1 << 0,
17  teIF_Load = 1 << 2,
18  teIF_Store = 1 << 3,
19  teIF_Integer = 1 << 4,
20  teIF_Float = 1 << 5,
21  teIF_Arithmetic = 1 << 6,
22  teIF_Annulled = 1 << 7,
23  teIF_UncondTaken = 1 << 8,
25  teIF_OnPage = 1 << 10,
26  teIF_ModeSwitch = 1 << 11,
28 
29 typedef struct {
30  int (*beginBlock)(void *Obj, uint64_t VA, uint64_t PA);
31  int (*endBlock)(void *Obj, uint64_t VA, uint64_t PA);
32  int (*beginInstr)(void *Obj, uint64_t VA, uint64_t PA, uint32_t Instr,
33  uint32_t Flags);
34  // Arm: 0 = normal / not taken branch
35  // 1 = taken conditional instruction
36  int (*endInstr)(void *Obj, uint64_t VA, uint64_t PA, uint32_t Instr,
37  uint32_t Flags, int Arm);
39 
40 #define TEMU_INSTRUMENTER_IFACE_TYPE "InstrumenterIface"
41 TEMU_IFACE_REFERENCE_TYPE(temu_Instrumenter);
42 
43 #endif // ! TEMU_INSTRUMENTER_H
Definition: Instrumenter.h:24
Definition: Instrumenter.h:25
Definition: Instrumenter.h:23
Definition: Instrumenter.h:26
temu_InstructionFlags
Definition: Instrumenter.h:14
Definition: Instrumenter.h:16
Definition: Instrumenter.h:17
Definition: Instrumenter.h:19
Definition: Instrumenter.h:29
Definition: Instrumenter.h:15
Definition: Instrumenter.h:20
TEMU_IFACE_REFERENCE_TYPE(temu_Instrumenter)
Definition: Instrumenter.h:21
Definition: Instrumenter.h:22
Definition: Instrumenter.h:18