aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_core.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2009-12-01 13:53:14 +0000
committerKeir Fraser <keir.fraser@citrix.com>2009-12-01 13:53:14 +0000
commit60999322eb87ccd91f5208bdd684f1762d664c2e (patch)
tree6b08eb3020ecc7c0fc4828cfff3229154ffaa9b8 /tools/libxc/xc_core.c
parentd47a8e863a56c4e2db18198ebfe21100be086b77 (diff)
downloadxen-60999322eb87ccd91f5208bdd684f1762d664c2e.tar.gz
xen-60999322eb87ccd91f5208bdd684f1762d664c2e.tar.bz2
xen-60999322eb87ccd91f5208bdd684f1762d664c2e.zip
libxc: create a domain_info_context structure to store guest_width and p2m_size for macros.
Macro now refers to guest_width and p2m_size through a dinfo pointer. Signed-off-by: Vincent Hanquez <vincent.hanquez@eu.citrix.com>
Diffstat (limited to 'tools/libxc/xc_core.c')
-rw-r--r--tools/libxc/xc_core.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c
index 9778ea0a94..d5e686b7cf 100644
--- a/tools/libxc/xc_core.c
+++ b/tools/libxc/xc_core.c
@@ -427,7 +427,8 @@ xc_domain_dumpcore_via_callback(int xc_handle,
{
xc_dominfo_t info;
shared_info_any_t *live_shinfo = NULL;
- unsigned int guest_width;
+ struct domain_info_context _dinfo = {};
+ struct domain_info_context *dinfo = &_dinfo;
int nr_vcpus = 0;
char *dump_mem, *dump_mem_start = NULL;
@@ -462,7 +463,7 @@ xc_domain_dumpcore_via_callback(int xc_handle,
struct xc_core_section_headers *sheaders = NULL;
Elf64_Shdr *shdr;
- if ( get_guest_width(xc_handle, domid, &guest_width) != 0 )
+ if ( get_guest_width(xc_handle, domid, &dinfo->guest_width) != 0 )
{
PERROR("Could not get address size for domain");
return sts;
@@ -547,7 +548,7 @@ xc_domain_dumpcore_via_callback(int xc_handle,
goto out;
}
- sts = xc_core_arch_map_p2m(xc_handle, guest_width, &info, live_shinfo,
+ sts = xc_core_arch_map_p2m(xc_handle, dinfo->guest_width, &info, live_shinfo,
&p2m, &p2m_size);
if ( sts != 0 )
goto out;
@@ -745,7 +746,7 @@ xc_domain_dumpcore_via_callback(int xc_handle,
goto out;
/* elf note section: xen version */
- sts = elfnote_dump_xen_version(args, dump_rtn, xc_handle, guest_width);
+ sts = elfnote_dump_xen_version(args, dump_rtn, xc_handle, dinfo->guest_width);
if ( sts != 0 )
goto out;
@@ -805,9 +806,9 @@ xc_domain_dumpcore_via_callback(int xc_handle,
if ( !auto_translated_physmap )
{
- if ( guest_width >= sizeof(unsigned long) )
+ if ( dinfo->guest_width >= sizeof(unsigned long) )
{
- if ( guest_width == sizeof(unsigned long) )
+ if ( dinfo->guest_width == sizeof(unsigned long) )
gmfn = p2m[i];
else
gmfn = ((uint64_t *)p2m)[i];