diff options
Diffstat (limited to 'src/arch/processor-int.h')
-rw-r--r-- | src/arch/processor-int.h | 53 |
1 files changed, 49 insertions, 4 deletions
diff --git a/src/arch/processor-int.h b/src/arch/processor-int.h index 6ceb7df..873ec72 100644 --- a/src/arch/processor-int.h +++ b/src/arch/processor-int.h @@ -25,6 +25,12 @@ #define _ARCH_PROCESSOR_INT_H + + + + + + #include <stdint.h> #include <sys/types.h> @@ -38,11 +44,12 @@ + /* Décode une instruction dans un flux de données. */ -typedef asm_instr * (* fetch_instruction) (const asm_processor *, const uint8_t *, off_t *, off_t, uint64_t); +typedef asm_instr * (* fetch_instruction_) (const asm_processor *, const uint8_t *, off_t *, off_t, uint64_t); /* Traduit une instruction en version humainement lisible. */ -typedef void (* print_instruction) (const asm_processor *, const exe_format *, const asm_instr *, char *, size_t, AsmSyntax); +typedef void (* print_instruction_) (const asm_processor *, const exe_format *, const asm_instr *, char *, size_t, AsmSyntax); @@ -50,9 +57,9 @@ typedef void (* print_instruction) (const asm_processor *, const exe_format *, c struct _asm_processor { - fetch_instruction fetch_instr; /* Lecture d'une instruction */ + fetch_instruction_ fetch_instr; /* Lecture d'une instruction */ - print_instruction print_instr; /* Version lisible d'une instr.*/ + print_instruction_ print_instr; /* Version lisible d'une instr.*/ }; @@ -68,4 +75,42 @@ char *escape_crlf_bin_string(char *); + + +/* Décode une instruction dans un flux de données. */ +typedef GArchInstruction * (* decode_instruction_fc) (const GArchProcessor *, const bin_t *, off_t *, off_t, vmpa_t); + + +/* Définition générique d'un processeur d'architecture (instance) */ +struct _GArchProcessor +{ + GObject parent; /* A laisser en premier */ + + SourceEndian endianness; /* Boutisme de l'architecture */ + + decode_instruction_fc decode; /* Traduction en instructions */ + +}; + + + + + + + +/* Définition générique d'un processeur d'architecture (classe) */ +struct _GArchProcessorClass +{ + GObjectClass parent; /* A laisser en premier */ + +}; + + + + + + + + + #endif /* _ARCH_PROCESSOR_INT_H */ |