]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/valgrind/src/valgrind-3.6.0-svn/include/pub_l4re.h
8eec5a01e14b1a23b17e9788373b8702e38d9d9d
[l4.git] / l4 / pkg / valgrind / src / valgrind-3.6.0-svn / include / pub_l4re.h
1 /*--------------------------------------------------------------------*/
2 /*--- L4 stuff                                          pub_l4re.h ---*/
3 /*--------------------------------------------------------------------*/
4
5 /*
6    This file is part of Valgrind, a dynamic binary instrumentation
7    framework.
8
9    Copyright (C) 2000-2008 Julian Seward
10       jseward@acm.org
11
12    This program is free software; you can redistribute it and/or
13    modify it under the terms of the GNU General Public License as
14    published by the Free Software Foundation; either version 2 of the
15    License, or (at your option) any later version.
16
17    This program is distributed in the hope that it will be useful, but
18    WITHOUT ANY WARRANTY; without even the implied warranty of
19    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20    General Public License for more details.
21
22    You should have received a copy of the GNU General Public License
23    along with this program; if not, write to the Free Software
24    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25    02111-1307, USA.
26
27    The GNU General Public License is contained in the file COPYING.
28 */
29
30 #ifndef __PUB_L4RE_H
31 #define __PUB_L4RE_H
32
33 #include "pub_tool_basics.h"
34 //#include "pub_core_ume.h"
35 #include <l4/re/env.h>
36 #include <unistd.h>
37 #include <l4/sys/kdebug.h>
38
39 /*
40  * Therefore coregrind knows which tool actually runs, 
41  * every tool must export his name.
42  */
43 extern HChar *VG_(toolname);
44
45 /*
46  * Function-Wrapping stuff
47  */
48 struct vg_l4re_capfunc_info {
49         void (*vg_cap_alloc)(ThreadId tid, long idx);
50         void (*vg_cap_free)(ThreadId tid, long idx);
51 };
52
53 void vg_cap_alloc(long, long);
54 void vg_cap_free(long, long);
55
56 /*--------------------------------------------------------------------*/
57 /*--- L4 VRM                                                       ---*/
58 /*--------------------------------------------------------------------*/
59
60 extern l4_cap_idx_t l4_vcap_thread;
61
62
63 struct vrm_area {
64     l4_addr_t     start;
65     l4_addr_t     end;
66     unsigned char flags;
67 };
68
69 struct vrm_region {
70     l4_addr_t     start;
71     l4_addr_t     end;
72     l4_addr_t     size;
73     unsigned char flags;
74     l4_addr_t     offset_in_ds;
75     l4_cap_idx_t  ds;
76 };
77
78 struct vrm_region_lists {
79     l4_addr_t  min_addr;
80     l4_addr_t  max_addr;
81     unsigned  region_count;
82     unsigned  area_count;
83     struct vrm_region *regions;
84     struct vrm_area   *areas;
85 };
86
87
88 void vrm_get_lists(struct vrm_region_lists *rlist, unsigned num_regions, unsigned num_areas);
89
90 /*
91  * Start the L4Re vcap thread
92  */
93 void l4re_vcap_start_thread(void);
94 EXTERN_C void vcap_init(void);
95
96 /*
97  * Instrument L4Re env with vcap modifications
98  *
99  * \param envp - old environment
100  * \return pointer to new environment
101  */
102 void *l4re_vcap_modify_env(struct ume_auxv *envp);
103
104 extern void *client_env;
105 extern unsigned int client_env_size;
106
107 #endif   // __PUB_L4RE_H
108
109 /*--------------------------------------------------------------------*/
110 /*--- end                                                          ---*/
111 /*--------------------------------------------------------------------*/