summaryrefslogtreecommitdiff
path: root/plugins/arm
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-05-12 22:09:53 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-05-12 22:09:53 (GMT)
commit00e93226e72bdb18853580f553e32df111422936 (patch)
tree9c346903d4506cae2df19b9314cf307c783c0cb3 /plugins/arm
parente44ffc323c8a9d4b446baba6e0b131107312fa84 (diff)
Simplified the way processors are registered.
Diffstat (limited to 'plugins/arm')
-rw-r--r--plugins/arm/v7/core.c2
-rw-r--r--plugins/arm/v7/processor.c21
2 files changed, 12 insertions, 11 deletions
diff --git a/plugins/arm/v7/core.c b/plugins/arm/v7/core.c
index 5fd355c..6849171 100644
--- a/plugins/arm/v7/core.c
+++ b/plugins/arm/v7/core.c
@@ -106,7 +106,7 @@ bool init_armv7_core(void)
register_armv7_gtypes();
- result = register_processor_type("armv7", "ARM v7", G_TYPE_ARMV7_PROCESSOR);
+ result = register_processor_type(G_TYPE_ARMV7_PROCESSOR);
return result;
diff --git a/plugins/arm/v7/processor.c b/plugins/arm/v7/processor.c
index b7a73f4..fca1415 100644
--- a/plugins/arm/v7/processor.c
+++ b/plugins/arm/v7/processor.c
@@ -96,11 +96,20 @@ static void g_armv7_processor_class_init(GArmV7ProcessorClass *klass)
GArchProcessorClass *proc; /* Encore une autre vision... */
object_class = G_OBJECT_CLASS(klass);
- proc = G_ARCH_PROCESSOR_CLASS(klass);
object_class->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_processor_dispose;
object_class->finalize = (GObjectFinalizeFunc)g_armv7_processor_finalize;
+ proc = G_ARCH_PROCESSOR_CLASS(klass);
+
+ proc->key = "armv7";
+ proc->desc = "ARM v7";
+
+ proc->endianness = SRE_LITTLE;
+ proc->memsize = MDS_32_BITS;
+ proc->inssize = MDS_32_BITS;
+ proc->virt_space = true;
+
proc->get_ctx = (get_processor_context_fc)g_armv7_processor_get_context;
proc->disassemble = (disass_instr_fc)g_armv7_processor_disassemble;
@@ -122,14 +131,6 @@ static void g_armv7_processor_class_init(GArmV7ProcessorClass *klass)
static void g_armv7_processor_init(GArmV7Processor *proc)
{
- GArchProcessor *parent; /* Instance parente */
-
- parent = G_ARCH_PROCESSOR(proc);
-
- parent->endianness = SRE_LITTLE;
- parent->memsize = MDS_32_BITS;
- parent->inssize = MDS_32_BITS;
- parent->virt_space = true;
}
@@ -238,7 +239,7 @@ static GArchInstruction *g_armv7_processor_disassemble(const GArmV7Processor *pr
uint32_t raw32; /* Donnée 32 bits à analyser */
ArmV7InstrSet iset; /* Type de jeu d'instructions */
- endian = G_ARCH_PROCESSOR(proc)->endianness;
+ endian = G_ARCH_PROCESSOR_GET_CLASS(proc)->endianness;
iset = g_armv7_context_find_encoding(ctx, get_virt_addr(pos));