From 5da8b16972f6d9ce34c3c200b3acabace9b956f5 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Mon, 16 Dec 2024 07:54:22 +0100
Subject: Move some basic data type definitions.

---
 plugins/pychrysalide/arch/module.c |  3 ---
 plugins/pychrysalide/constants.c   |  1 -
 src/arch/archbase.h                |  6 ++++--
 src/arch/vmpa.h                    |  1 -
 src/common/datatypes.h             | 26 ++++++++++++++++++++++++++
 src/common/entropy.h               |  3 ++-
 6 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/plugins/pychrysalide/arch/module.c b/plugins/pychrysalide/arch/module.c
index bbdaf76..0127348 100644
--- a/plugins/pychrysalide/arch/module.c
+++ b/plugins/pychrysalide/arch/module.c
@@ -28,9 +28,6 @@
 #include <assert.h>
 
 
-#include <arch/archbase.h>
-
-
 /*
 #include "context.h"
 #include "instriter.h"
diff --git a/plugins/pychrysalide/constants.c b/plugins/pychrysalide/constants.c
index 8142284..34caa12 100644
--- a/plugins/pychrysalide/constants.c
+++ b/plugins/pychrysalide/constants.c
@@ -25,7 +25,6 @@
 #include "constants.h"
 
 
-#include <arch/archbase.h>
 #include <common/datatypes.h>
 
 
diff --git a/src/arch/archbase.h b/src/arch/archbase.h
index 59bf18e..b29d2a1 100644
--- a/src/arch/archbase.h
+++ b/src/arch/archbase.h
@@ -50,6 +50,7 @@ typedef uint64_t vmpa_t;
 #define VMPA_MAX_SIZE   19
 
 
+#if 0
 /* Taille des données intégrées */
 typedef enum _MemoryDataSize
 {
@@ -68,6 +69,7 @@ typedef enum _MemoryDataSize
     MDS_64_BITS_SIGNED      = 0x85          /* Opérande sur 64 bits signés */
 
 } MemoryDataSize;
+#endif
 
 
 #define MDS_RANGE(mds) ((mds & 0xf) - 1)
@@ -99,13 +101,13 @@ typedef enum _MemoryDataSize
         __result;                                   \
     })
 
-
+#if 0
 #define MDS_4_BITS  MDS_4_BITS_UNSIGNED
 #define MDS_8_BITS  MDS_8_BITS_UNSIGNED
 #define MDS_16_BITS MDS_16_BITS_UNSIGNED
 #define MDS_32_BITS MDS_32_BITS_UNSIGNED
 #define MDS_64_BITS MDS_64_BITS_UNSIGNED
-
+#endif
 
 
 /* Etablit la comparaison entre deux adresses. */
diff --git a/src/arch/vmpa.h b/src/arch/vmpa.h
index 42136e2..8a9b961 100644
--- a/src/arch/vmpa.h
+++ b/src/arch/vmpa.h
@@ -30,7 +30,6 @@
 #include <stdint.h>
 
 
-#include "archbase.h"
 #include "../common/cpp.h"
 #include "../common/datatypes.h"
 #include "../common/packed.h"
diff --git a/src/common/datatypes.h b/src/common/datatypes.h
index 3983267..681e232 100644
--- a/src/common/datatypes.h
+++ b/src/common/datatypes.h
@@ -52,5 +52,31 @@ typedef enum _SourceEndian
 } SourceEndian;
 
 
+/* Taille des données intégrées */
+typedef enum _MemoryDataSize
+{
+    MDS_UNDEFINED           = 0x0,          /* Taille non définie          */
+
+    MDS_4_BITS_UNSIGNED     = 0x1,          /* Opérande sur 4 bits n.-s.   */
+    MDS_8_BITS_UNSIGNED     = 0x2,          /* Opérande sur 8 bits n.-s.   */
+    MDS_16_BITS_UNSIGNED    = 0x3,          /* Opérande sur 16 bits n.-s.  */
+    MDS_32_BITS_UNSIGNED    = 0x4,          /* Opérande sur 32 bits n.-s.  */
+    MDS_64_BITS_UNSIGNED    = 0x5,          /* Opérande sur 64 bits n.-s.  */
+
+    MDS_4_BITS_SIGNED       = 0x8 | 0x1,    /* Opérande sur 4 bits  signés */
+    MDS_8_BITS_SIGNED       = 0x8 | 0x2,    /* Opérande sur 8 bits  signés */
+    MDS_16_BITS_SIGNED      = 0x8 | 0x3,    /* Opérande sur 16 bits signés */
+    MDS_32_BITS_SIGNED      = 0x8 | 0x4,    /* Opérande sur 32 bits signés */
+    MDS_64_BITS_SIGNED      = 0x8 | 0x5     /* Opérande sur 64 bits signés */
+
+} MemoryDataSize;
+
+#define MDS_4_BITS  MDS_4_BITS_UNSIGNED
+#define MDS_8_BITS  MDS_8_BITS_UNSIGNED
+#define MDS_16_BITS MDS_16_BITS_UNSIGNED
+#define MDS_32_BITS MDS_32_BITS_UNSIGNED
+#define MDS_64_BITS MDS_64_BITS_UNSIGNED
+
+
 
 #endif  /* _COMMON_DATATYPES_H */
diff --git a/src/common/entropy.h b/src/common/entropy.h
index b677a77..cfd51ef 100644
--- a/src/common/entropy.h
+++ b/src/common/entropy.h
@@ -26,9 +26,10 @@
 
 
 #include <stdbool.h>
+#include <stddef.h>
 
 
-#include "../arch/archbase.h"
+#include "../common/datatypes.h"
 
 
 
-- 
cgit v0.11.2-87-g4458