diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-05-14 19:40:07 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-05-14 19:40:07 (GMT) |
commit | 0286b53bad21abf91cbe17c4772ca9cde6a89cbc (patch) | |
tree | 3bec9dc7e118c00ce9c748576b01606a71880ad7 /src/core | |
parent | 267b1ae8608ed4bf52de743798e8647c903ee1b4 (diff) |
Created an instruction database for Chrysalide.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core.c | 2 | ||||
-rw-r--r-- | src/core/processors.c | 28 | ||||
-rw-r--r-- | src/core/processors.h | 2 | ||||
-rw-r--r-- | src/core/queue.c | 12 | ||||
-rw-r--r-- | src/core/queue.h | 3 |
5 files changed, 44 insertions, 3 deletions
diff --git a/src/core/core.c b/src/core/core.c index 5e3a4d0..bc1a9dc 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -106,6 +106,8 @@ bool load_all_basic_components(void) result &= init_segment_content_hash_table(); + register_arch_gtypes(); + result &= load_hard_coded_processors_definitions(); result &= load_hard_coded_formats_definitions(); diff --git a/src/core/processors.c b/src/core/processors.c index 0251f6f..12c63cf 100644 --- a/src/core/processors.c +++ b/src/core/processors.c @@ -29,6 +29,11 @@ #include <string.h> +#include "../arch/immediate.h" +#include "../arch/raw.h" +#include "../arch/register.h" +#include "../arch/target.h" +#include "../arch/undefined.h" //#include "../arch/jvm/processor.h" @@ -58,6 +63,29 @@ static proc_t *find_processor_by_key(const char *); /****************************************************************************** * * +* Paramètres : - * +* * +* Description : Assure l'enregistrement de types pour les caches à charger. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void register_arch_gtypes(void) +{ + g_type_ensure(G_TYPE_RAW_INSTRUCTION); + g_type_ensure(G_TYPE_UNDEF_INSTRUCTION); + + g_type_ensure(G_TYPE_IMM_OPERAND); + g_type_ensure(G_TYPE_REGISTER_OPERAND); + +} + + +/****************************************************************************** +* * * Paramètres : key = désignation rapide et interne d'un processeur. * * name = désignation humaine de l'architecture. * * instance = type GLib représentant le type à instancier. * diff --git a/src/core/processors.h b/src/core/processors.h index 10bbcf3..f202114 100644 --- a/src/core/processors.h +++ b/src/core/processors.h @@ -32,6 +32,8 @@ #include "../arch/processor.h" +/* Assure l'enregistrement de types pour les caches à charger. */ +void register_arch_gtypes(void); /* Enregistre un processeur pour une architecture donnée. */ bool register_processor_type(const char *, const char *, GType); diff --git a/src/core/queue.c b/src/core/queue.c index 79a87b2..4439e61 100644 --- a/src/core/queue.c +++ b/src/core/queue.c @@ -67,6 +67,13 @@ bool init_global_works(void) g_work_queue_define_work_group(queue); #endif +#ifndef NDEBUG + expected = g_work_queue_define_work_group(queue); + assert(expected == STORAGE_WORK_GROUP); +#else + g_work_queue_define_work_group(queue); +#endif + return true; } @@ -111,9 +118,10 @@ void wait_for_all_global_works(void) { GWorkQueue *queue; /* Singleton pour tâches */ - static const wgroup_id_t group_ids[] = { + static const wgroup_id_t group_ids[GLOBAL_WORK_GROUPS_COUNT] = { DEFAULT_WORK_GROUP, - LOADING_WORK_GROUP + LOADING_WORK_GROUP, + STORAGE_WORK_GROUP }; queue = get_work_queue(); diff --git a/src/core/queue.h b/src/core/queue.h index bee16a4..a1b82f2 100644 --- a/src/core/queue.h +++ b/src/core/queue.h @@ -35,8 +35,9 @@ #define DEFAULT_WORK_GROUP 0 #define LOADING_WORK_GROUP 1 +#define STORAGE_WORK_GROUP 2 -#define GLOBAL_WORK_GROUPS_COUNT 2 +#define GLOBAL_WORK_GROUPS_COUNT 3 /* Met en place les mécanismes de traitements parallèles. */ |