GEL  0.99
gel_plugin.h
Go to the documentation of this file.
1 /* $Id$ */
2 
3 #ifndef GEL_PLUGIN_H
4 #define GEL_PLUGIN_H
5 
6 /*==============================================================================
7  * gel_plugin.h
8  *==============================================================================
9  * \file ce fichier contient toutes les definitions accessibles � un plugin
10  * d'architecture ou systeme
11  *==============================================================================
12  * Auteur : Sylvain Lemouzy (syl.lemouzy@free.fr)
13  * Cr�e le : 02/08/2006
14  *==============================================================================
15  */
16 
32 #include <gel/common.h>
33 #include "gel_public.h"
34 #include "gel_types_plugin.h"
35 #include "gel_base_plugin.h"
36 #include "gel_load_plugin.h"
37 #include "gel_memory_plugin.h"
38 
40 
41 /*==============================================================================
42  * Definition des macros utilisees dans gel
43  *==============================================================================
44  */
45 
46 #define PAGE_TRUNC(a,x) ((x) - ((x) & ((a)->arch->psize - 1)))
47 
48 /* calcule l'adresse virtuelle de debut d'un bloc */
49 #define VSTART_BLOCK(block) (block->exec_begin + block->base_vaddr)
50 
51 /* calcule l'adresse virtuelle de fin d'un bloc */
52 #define VEND_BLOCK(block) (block->exec_begin + block->base_vaddr + block->exec_size-1)
53 
54 /* calcule le debut du cluster contenant une adresse */
55 #define CLUSTER_TRUNC(address,clustersize) ((address) - ((address) & (clustersize - 1)))
56 
58 #define SAME_CLUSTER(address1, address2, clustersize) ((address1 & (~(clustersize -1))) == (address2 & (~(clustersize-1))))
59 
61 #define VADDR2VRELOC(f,a) ((a) + (f)->base_vaddr)
62 
64 #define VRELOC2VADDR(f,a) ((a) - (f)->base_vaddr)
65 
67 #define VADDR2RADDR(f,a) ((a) + (u8_t *)(f)->base_raddr)
68 
70 #define RADDR2VADDR(f,a) ((intptr_t)((raddr_t)(a) - (f)->base_raddr))
71 
73 #define VRELOC2RADDR(f,a) (VADDR2RADDR((f),VRELOC2VADDR((f),(a))))
74 
76 #define RADDR2VRELOC(f,a) (VADDR2VRELOC((f), RADDR2VADDR((f),(a))))
77 
84 /*gel_platform_t *gel_sect_platform(gel_sect_t *s); unused function */
85 
92 /*gel_platform_t *gel_image_platform(gel_image_t *i); unused functi�on*/
93 
95 
96 #endif /* GEL_PLUGIN_H */
#define __END_DECLS
Definition: common.h:29
#define __BEGIN_DECLS
Definition: common.h:28