summaryrefslogtreecommitdiff
path: root/src/arch/processor.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-05-11 23:42:48 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-05-11 23:42:48 (GMT)
commit96cb6971ee3ca529958b8cb1e8e55a6eb4e60eae (patch)
tree68e49f325de3e93ef186d3e078da8ddc473aedf7 /src/arch/processor.h
parent80dc0ac97987ad9246bee7c47458a015339453bf (diff)
Reorganized the way the program is built again and added partial support for the JVM.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@63 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/processor.h')
-rw-r--r--src/arch/processor.h52
1 files changed, 48 insertions, 4 deletions
diff --git a/src/arch/processor.h b/src/arch/processor.h
index 6c65e95..0c6d852 100644
--- a/src/arch/processor.h
+++ b/src/arch/processor.h
@@ -30,7 +30,6 @@
#include "operand.h" /* AsmSyntax */
#include "instruction.h"
-#include "../format/exe_format.h"
@@ -57,12 +56,57 @@ asm_processor *create_processor(void);
+
+
+#include <glib-object.h>
+
+
+#include "../common/endianness.h"
+
+
+
+#define G_TYPE_ARCH_PROCESSOR g_arch_processor_get_type()
+#define G_ARCH_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_arch_processor_get_type(), GArchProcessor))
+#define G_IS_ARCH_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_arch_processor_get_type()))
+#define G_ARCH_PROCESSOR_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), g_arch_processor_get_type(), GArchProcessorIface))
+
+
+/* Ligne de représentation générique (instance) */
+typedef struct _GArchProcessor GArchProcessor;
+
+/* Ligne de représentation générique (classe) */
+typedef struct _GArchProcessorClass GArchProcessorClass;
+
+
+/* Indique le type défini pour un processeur d'architecture. */
+GType g_arch_processor_get_type(void);
+
+/* Fournit le boustime du processeur d'une architecture. */
+SourceEndian g_arch_processor_get_endianness(const GArchProcessor *);
+
/* Décode une instruction dans un flux de données. */
-asm_instr *decode_instruction(const asm_processor *, const uint8_t *, off_t *, off_t, off_t, uint64_t);
+GArchInstruction *g_arch_processor_decode_instruction(const GArchProcessor *, const bin_t *, off_t *, off_t, off_t, vmpa_t);
+
+
+
+/* ------------------------ ARCHITECTURES DANS LEUR ENSEMBLE ------------------------ */
+
+
+/* Type de processeurs disponibles */
+typedef enum _ArchProcessorType
+{
+ APT_JVM, /* Java Virtual Machine */
+
+ APT_COUNT
+
+} ArchProcessorType;
+
-/* Traduit une instruction en version humainement lisible. */
-void print_hinstruction(const asm_processor *, const exe_format *, const asm_instr *, char *, size_t, AsmSyntax);
+/* Procède au chargement des différentes architectures. */
+bool init_all_processors(void);
+/* Fournit le processeur d'architecture correspondant à un type. */
+GArchProcessor *get_arch_processor_for_type(ArchProcessorType);