summaryrefslogtreecommitdiff
path: root/src/arch/vmpa.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-07-31 05:53:06 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-07-31 05:53:06 (GMT)
commita5d8e3fc30cda2e13d30f099e93ab1b182fdc0bd (patch)
treecf183906b2301cd3c726af820292fd0f2458bfa1 /src/arch/vmpa.h
parentdc436357ff29158dddd836d368d152d42d5b086b (diff)
Improved the way code is decoded by avoiding to propagate the base address everywhere.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@385 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/vmpa.h')
-rw-r--r--src/arch/vmpa.h40
1 files changed, 36 insertions, 4 deletions
diff --git a/src/arch/vmpa.h b/src/arch/vmpa.h
index fa14fda..5df9b8a 100644
--- a/src/arch/vmpa.h
+++ b/src/arch/vmpa.h
@@ -25,11 +25,22 @@
#define _ARCH_VMPA_H
+#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <sys/types.h>
+#include "archbase.h"
+#include "../common/cpp.h"
+
+
+
+
+
+
+#define VMPA_MAX_SIZE (sizeof(STR(ULLONG_MAX)) + 1)
+
@@ -39,6 +50,11 @@ struct _vmpa2_t
off_t physical; /* Position physique */
uint64_t virtual; /* Adresse virtuelle */
+ MemoryDataSize last_phy_size; /* Dernière taille demandée #1 */
+ MemoryDataSize last_virt_size; /* Dernière taille demandée #2 */
+ char phy_cache[VMPA_MAX_SIZE]; /* Impression physique cachée */
+ char virt_cache[VMPA_MAX_SIZE]; /* Impression virtuelle cachée */
+
};
@@ -47,20 +63,36 @@ struct _vmpa2_t
typedef struct _vmpa2_t vmpa2_t;
+typedef struct _vmpa2_t vmpa2t;
+
+
/* Initialise une localisation dans l'espace mémoire/physique. */
-void init_vmpa(vmpa2_t *, off_t, uint64_t);
+void init_vmpa(vmpa2t *, off_t, uint64_t);
/* Crée une localisation dans l'adressage mémoire. */
-vmpa2_t *make_vmpa(off_t, uint64_t);
+vmpa2t *make_vmpa(off_t, uint64_t);
+
+
+
+#define cmp_vmpa(a, b) 0
+
+
+
+/* Lit la définition d'une adresse depuis un flux réseau. */
+bool recv_vmpa(vmpa2t *, int, int);
+/* Ecrit la définition d'une adresse dans un flux réseau. */
+bool send_vmpa(const vmpa2t *, int, int);
-#define load_vmpa_from_fd(vmpa, fd) true
+/* Transforme une adresse physique en chaîne de caractères. */
+const char *vmpa2_phy_to_string(vmpa2t *, MemoryDataSize);
-#define store_vmpa_to_fd(vmpa, fd) true
+/* Transforme une adresse virtuelle en chaîne de caractères. */
+const char *vmpa2_virt_to_string(vmpa2t *, MemoryDataSize);