]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/valgrind/src/valgrind-3.6.0-svn/include/pub_l4re.h
update
[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_core_ume.h"
34 #include <l4/re/env.h>
35 #undef offsetof
36 #include <stddef.h>
37 #include <unistd.h>
38 #include <l4/sys/kdebug.h>
39
40 #include "pub_tool_basics.h"
41 /*
42  * Therefore coregrind knows which tool actually runs, 
43  * every tool must export his name.
44  */
45 extern HChar *VG_(toolname);
46
47 /*
48  * Function-Wrapping stuff
49  */
50 struct vg_l4re_capfunc_info {
51         void (*vg_cap_alloc)(ThreadId tid, long idx);
52         void (*vg_cap_free)(ThreadId tid, long idx);
53 };
54
55 void vg_cap_alloc(long, long);
56 void vg_cap_free(long, long);
57
58 /*--------------------------------------------------------------------*/
59 /*--- L4 VRM                                                       ---*/
60 /*--------------------------------------------------------------------*/
61
62 extern l4_cap_idx_t l4_vcap_thread;
63
64
65 struct vrm_area {
66     l4_addr_t     start;
67     l4_addr_t     end;
68     unsigned char flags;
69 };
70
71 struct vrm_region {
72     l4_addr_t     start;
73     l4_addr_t     end;
74     l4_addr_t     size;
75     unsigned char flags;
76     l4_addr_t     offset_in_ds;
77     l4_cap_idx_t  ds;
78 };
79
80 struct vrm_region_lists {
81     l4_addr_t  min_addr;
82     l4_addr_t  max_addr;
83     unsigned  region_count;
84     unsigned  area_count;
85     struct vrm_region *regions;
86     struct vrm_area   *areas;
87 };
88
89
90 void vrm_get_lists(struct vrm_region_lists *rlist, unsigned num_regions, unsigned num_areas);
91
92 /*
93  * Start the L4Re vcap thread
94  */
95 void l4re_vcap_start_thread(void);
96 EXTERN_C void vcap_init(void);
97
98 struct ume_auxv;
99
100 /*
101  * Instrument L4Re env with vcap modifications
102  *
103  * \param envp - old environment
104  * \return pointer to new environment
105  */
106 void *l4re_vcap_modify_env(struct ume_auxv *envp, Addr client_l4re_env_addr);
107
108 extern void *client_env;
109 extern unsigned int client_env_size;
110
111 #endif   // __PUB_L4RE_H
112
113 /*--------------------------------------------------------------------*/
114 /*--- end                                                          ---*/
115 /*--------------------------------------------------------------------*/