debuggers.hg

view tools/libxc/xc_core.h @ 16715:c5deb251b9dc

Update version to 3.2.0-rc4
author Keir Fraser <keir.fraser@citrix.com>
date Sat Dec 29 17:57:37 2007 +0000 (2007-12-29)
parents 263fc122f62b
children b0d7780794eb
line source
1 /*
2 * Copyright (c) 2006 Isaku Yamahata <yamahata at valinux co jp>
3 * VA Linux Systems Japan K.K.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
21 #ifndef XC_CORE_H
22 #define XC_CORE_H
24 #include "xen/version.h"
25 #include "xg_private.h"
26 #include "xen/elfstructs.h"
28 /* section names */
29 #define XEN_DUMPCORE_SEC_NOTE ".note.Xen"
30 #define XEN_DUMPCORE_SEC_PRSTATUS ".xen_prstatus"
31 #define XEN_DUMPCORE_SEC_SHARED_INFO ".xen_shared_info"
32 #define XEN_DUMPCORE_SEC_P2M ".xen_p2m"
33 #define XEN_DUMPCORE_SEC_PFN ".xen_pfn"
34 #define XEN_DUMPCORE_SEC_PAGES ".xen_pages"
36 #define XEN_DUMPCORE_SEC_IA64_MAPPED_REGS ".xen_ia64_mapped_regs"
38 /* elf note name */
39 #define XEN_DUMPCORE_ELFNOTE_NAME "Xen"
40 /* note numbers are defined in xen/elfnote.h */
42 struct elfnote {
43 uint32_t namesz; /* Elf_Note note; */
44 uint32_t descsz;
45 uint32_t type;
46 char name[4]; /* sizeof("Xen") = 4
47 * Fotunately this is 64bit aligned so that
48 * we can use same structore for both 32/64bit
49 */
50 };
52 struct xen_dumpcore_elfnote_none_desc {
53 /* nothing */
54 };
56 struct xen_dumpcore_elfnote_header_desc {
57 uint64_t xch_magic;
58 uint64_t xch_nr_vcpus;
59 uint64_t xch_nr_pages;
60 uint64_t xch_page_size;
61 };
63 struct xen_dumpcore_elfnote_xen_version_desc {
64 uint64_t major_version;
65 uint64_t minor_version;
66 xen_extraversion_t extra_version;
67 xen_compile_info_t compile_info;
68 xen_capabilities_info_t capabilities;
69 xen_changeset_info_t changeset;
70 xen_platform_parameters_t platform_parameters;
71 uint64_t pagesize;
72 };
74 #define XEN_DUMPCORE_FORMAT_VERSION(major, minor) \
75 ((major) << 32) | ((minor) & 0xffffffff)
76 #define XEN_DUMPCORE_FORMAT_MAJOR(version) ((major) >> 32)
77 #define XEN_DUMPCORE_FORMAT_MINOR(version) ((minor) & 0xffffffff)
79 #define XEN_DUMPCORE_FORMAT_MAJOR_CURRENT ((uint64_t)0)
80 #define XEN_DUMPCORE_FORMAT_MINOR_CURRENT ((uint64_t)1)
81 #define XEN_DUMPCORE_FORMAT_VERSION_CURRENT \
82 XEN_DUMPCORE_FORMAT_VERSION(XEN_DUMPCORE_FORMAT_MAJOR_CURRENT, \
83 XEN_DUMPCORE_FORMAT_MINOR_CURRENT)
85 struct xen_dumpcore_elfnote_format_version_desc {
86 uint64_t version;
87 };
90 struct xen_dumpcore_elfnote_none {
91 struct elfnote elfnote;
92 struct xen_dumpcore_elfnote_none_desc none;
93 };
95 struct xen_dumpcore_elfnote_header {
96 struct elfnote elfnote;
97 struct xen_dumpcore_elfnote_header_desc header;
98 };
100 struct xen_dumpcore_elfnote_xen_version {
101 struct elfnote elfnote;
102 struct xen_dumpcore_elfnote_xen_version_desc xen_version;
103 };
105 struct xen_dumpcore_elfnote_format_version {
106 struct elfnote elfnote;
107 struct xen_dumpcore_elfnote_format_version_desc format_version;
108 };
110 #define XC_CORE_INVALID_PFN (~(uint64_t)0)
111 #define XC_CORE_INVALID_GMFN (~(uint64_t)0)
112 struct xen_dumpcore_p2m {
113 uint64_t pfn;
114 uint64_t gmfn;
115 };
118 struct xc_core_strtab;
119 struct xc_core_section_headers;
121 Elf64_Shdr*
122 xc_core_shdr_get(struct xc_core_section_headers *sheaders);
123 int
124 xc_core_shdr_set(Elf64_Shdr *shdr,
125 struct xc_core_strtab *strtab,
126 const char *name, uint32_t type,
127 uint64_t offset, uint64_t size,
128 uint64_t addralign, uint64_t entsize);
130 struct xc_core_memory_map {
131 uint64_t addr;
132 uint64_t size;
133 };
134 typedef struct xc_core_memory_map xc_core_memory_map_t;
135 int xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info);
136 struct xc_core_arch_context;
137 int xc_core_arch_memory_map_get(int xc_handle,
138 struct xc_core_arch_context *arch_ctxt,
139 xc_dominfo_t *info, shared_info_t *live_shinfo,
140 xc_core_memory_map_t **mapp,
141 unsigned int *nr_entries);
142 int xc_core_arch_map_p2m(int xc_handle, xc_dominfo_t *info,
143 shared_info_t *live_shinfo, xen_pfn_t **live_p2m,
144 unsigned long *pfnp);
147 #if defined (__i386__) || defined (__x86_64__)
148 # include "xc_core_x86.h"
149 #elif defined (__ia64__)
150 # include "xc_core_ia64.h"
151 #elif defined (__powerpc__)
152 # include "xc_core_powerpc.h"
153 #else
154 # error "unsupported architecture"
155 #endif
157 #ifndef ELF_CORE_EFLAGS
158 # define ELF_CORE_EFLAGS 0
159 #endif
161 #endif /* XC_CORE_H */
163 /*
164 * Local variables:
165 * mode: C
166 * c-set-style: "BSD"
167 * c-basic-offset: 4
168 * tab-width: 4
169 * indent-tabs-mode: nil
170 * End:
171 */