1 /******************************************************************************
4 * Coverage structures exported by Xen.
5 * Structure is different from Gcc one.
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to
9 * deal in the Software without restriction, including without limitation the
10 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
25 * Copyright (c) 2013, Citrix Systems R&D Ltd.
28 #ifndef __XEN_PUBLIC_GCOV_H__
29 #define __XEN_PUBLIC_GCOV_H__ __XEN_PUBLIC_GCOV_H__
31 #define XENCOV_COUNTERS 5
32 #define XENCOV_TAG_BASE 0x58544300u
33 #define XENCOV_TAG_FILE (XENCOV_TAG_BASE+0x46u)
34 #define XENCOV_TAG_FUNC (XENCOV_TAG_BASE+0x66u)
35 #define XENCOV_TAG_COUNTER(n) (XENCOV_TAG_BASE+0x30u+((n)&0xfu))
36 #define XENCOV_TAG_END (XENCOV_TAG_BASE+0x2eu)
37 #define XENCOV_IS_TAG_COUNTER(n) \
38 ((n) >= XENCOV_TAG_COUNTER(0) && (n) < XENCOV_TAG_COUNTER(XENCOV_COUNTERS))
39 #define XENCOV_COUNTER_NUM(n) ((n)-XENCOV_TAG_COUNTER(0))
42 * The main structure for the blob is
44 * FILE := TAG_FILE VERSION STAMP FILENAME COUNTERS FUNCTIONS
45 * FILENAME := LEN characters
46 * characters are padded to 32 bit
48 * COUNTERS := TAG_COUNTER(n) NUM COUNTER..
50 * COUNTER := 64 bit value
51 * FUNCTIONS := TAG_FUNC NUM FUNCTION..
52 * FUNCTION := IDENT CHECKSUM NUM_COUNTERS
54 * All tagged structures are aligned to 8 bytes
59 * Prefixed with XENCOV_TAG_FILE and a string with filename
64 uint32_t tag; /* XENCOV_TAG_FILE */
73 * Counters information
74 * Prefixed with XENCOV_TAG_COUNTER(n) where n is 0..(XENCOV_COUNTERS-1)
79 uint32_t tag; /* XENCOV_TAG_COUNTER(n) */
85 * Information for each function
86 * Number of counter is equal to the number of counter structures got before
88 struct xencov_function
92 uint32_t num_counters[1];
96 * Information for all functions
99 struct xencov_functions
101 uint32_t tag; /* XENCOV_TAG_FUNC */
103 struct xencov_function xencov_function[1];
111 uint32_t tag; /* XENCOV_TAG_END */
114 #endif /* __XEN_PUBLIC_GCOV_H__ */