1 #ifndef _GCOV_H_
2 #define _GCOV_H_
3 
4 #include <xen/guest_access.h>
5 #include <xen/types.h>
6 
7 /*
8  * Profiling data types used for gcc 3.4 and above - these are defined by
9  * gcc and need to be kept as close to the original definition as possible to
10  * remain compatible.
11  */
12 #define GCOV_DATA_MAGIC         ((unsigned int)0x67636461)
13 #define GCOV_TAG_FUNCTION       ((unsigned int)0x01000000)
14 #define GCOV_TAG_COUNTER_BASE   ((unsigned int)0x01a10000)
15 #define GCOV_TAG_FOR_COUNTER(count)				\
16 	GCOV_TAG_COUNTER_BASE + ((unsigned int)(count) << 17)
17 
18 #define GCC_VERSION (__GNUC__ * 10000           \
19                      + __GNUC_MINOR__ * 100     \
20                      + __GNUC_PATCHLEVEL__)
21 
22 #if BITS_PER_LONG >= 64
23 typedef long gcov_type;
24 #else
25 typedef long long gcov_type;
26 #endif
27 
28 /* Opaque gcov_info -- tied to specific gcc gcov formats */
29 struct gcov_info;
30 
31 void gcov_info_link(struct gcov_info *info);
32 struct gcov_info *gcov_info_next(const struct gcov_info *info);
33 void gcov_info_reset(struct gcov_info *info);
34 const char *gcov_info_filename(const struct gcov_info *info);
35 size_t gcov_info_to_gcda(char *buffer, const struct gcov_info *info);
36 
37 size_t gcov_store_uint32(void *buffer, size_t off, uint32_t v);
38 size_t gcov_store_uint64(void *buffer, size_t off, uint64_t v);
39 
40 #endif	/* _GCOV_H_ */
41