aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xg_save_restore.h
diff options
context:
space:
mode:
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-04-15 10:07:31 +0100
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>2006-04-15 10:07:31 +0100
commitc702fb4c9dcc27c2ab09cf1a4bd0e5f6f6b4d6ac (patch)
tree414c242496d1fa205931b1a0d16727cc2e234243 /tools/libxc/xg_save_restore.h
parent660442fdafa7c0d0b145c0ae372aa3e93c7322eb (diff)
downloadxen-c702fb4c9dcc27c2ab09cf1a4bd0e5f6f6b4d6ac.tar.gz
xen-c702fb4c9dcc27c2ab09cf1a4bd0e5f6f6b4d6ac.tar.bz2
xen-c702fb4c9dcc27c2ab09cf1a4bd0e5f6f6b4d6ac.zip
Fix whitespace in libxc. Tabs are manually fixed.
Trailing whitespace removed with: perl -p -i -e 's/\s+$/\n/g' tools/libxc/*.[ch] Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
Diffstat (limited to 'tools/libxc/xg_save_restore.h')
-rw-r--r--tools/libxc/xg_save_restore.h82
1 files changed, 41 insertions, 41 deletions
diff --git a/tools/libxc/xg_save_restore.h b/tools/libxc/xg_save_restore.h
index 7c530b293c..08a27e99de 100644
--- a/tools/libxc/xg_save_restore.h
+++ b/tools/libxc/xg_save_restore.h
@@ -1,7 +1,7 @@
/*
** xg_save_restore.h
-**
-** Defintions and utilities for save / restore.
+**
+** Defintions and utilities for save / restore.
*/
#include "xc_private.h"
@@ -29,8 +29,8 @@ while (0)
/*
-** We process save/restore/migrate in batches of pages; the below
-** determines how many pages we (at maximum) deal with in each batch.
+** We process save/restore/migrate in batches of pages; the below
+** determines how many pages we (at maximum) deal with in each batch.
*/
#define MAX_BATCH_SIZE 1024 /* up to 1024 pages (4MB) at a time */
@@ -40,56 +40,56 @@ while (0)
/*
-** Determine various platform information required for save/restore, in
-** particular:
+** Determine various platform information required for save/restore, in
+** particular:
+**
+** - the maximum MFN on this machine, used to compute the size of
+** the M2P table;
+**
+** - the starting virtual address of the the hypervisor; we use this
+** to determine which parts of guest address space(s) do and don't
+** require canonicalization during save/restore; and
**
-** - the maximum MFN on this machine, used to compute the size of
-** the M2P table;
-**
-** - the starting virtual address of the the hypervisor; we use this
-** to determine which parts of guest address space(s) do and don't
-** require canonicalization during save/restore; and
-**
-** - the number of page-table levels for save/ restore. This should
-** be a property of the domain, but for the moment we just read it
+** - the number of page-table levels for save/ restore. This should
+** be a property of the domain, but for the moment we just read it
** from the hypervisor.
**
-** Returns 1 on success, 0 on failure.
+** Returns 1 on success, 0 on failure.
*/
-static int get_platform_info(int xc_handle, uint32_t dom,
- /* OUT */ unsigned long *max_mfn,
- /* OUT */ unsigned long *hvirt_start,
+static int get_platform_info(int xc_handle, uint32_t dom,
+ /* OUT */ unsigned long *max_mfn,
+ /* OUT */ unsigned long *hvirt_start,
/* OUT */ unsigned int *pt_levels)
-
-{
+
+{
xen_capabilities_info_t xen_caps = "";
xen_platform_parameters_t xen_params;
if (xc_version(xc_handle, XENVER_platform_parameters, &xen_params) != 0)
return 0;
-
+
if (xc_version(xc_handle, XENVER_capabilities, &xen_caps) != 0)
return 0;
*max_mfn = xc_memory_op(xc_handle, XENMEM_maximum_ram_page, NULL);
-
+
*hvirt_start = xen_params.virt_start;
if (strstr(xen_caps, "xen-3.0-x86_64"))
*pt_levels = 4;
else if (strstr(xen_caps, "xen-3.0-x86_32p"))
- *pt_levels = 3;
+ *pt_levels = 3;
else if (strstr(xen_caps, "xen-3.0-x86_32"))
- *pt_levels = 2;
- else
- return 0;
-
+ *pt_levels = 2;
+ else
+ return 0;
+
return 1;
-}
+}
-/*
-** Save/restore deal with the mfn_to_pfn (M2P) and pfn_to_mfn (P2M) tables.
+/*
+** Save/restore deal with the mfn_to_pfn (M2P) and pfn_to_mfn (P2M) tables.
** The M2P simply holds the corresponding PFN, while the top bit of a P2M
** entry tell us whether or not the the PFN is currently mapped.
*/
@@ -98,18 +98,18 @@ static int get_platform_info(int xc_handle, uint32_t dom,
#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
-/*
-** The M2P is made up of some number of 'chunks' of at least 2MB in size.
-** The below definitions and utility function(s) deal with mapping the M2P
-** regarldess of the underlying machine memory size or architecture.
+/*
+** The M2P is made up of some number of 'chunks' of at least 2MB in size.
+** The below definitions and utility function(s) deal with mapping the M2P
+** regarldess of the underlying machine memory size or architecture.
*/
-#define M2P_SHIFT L2_PAGETABLE_SHIFT_PAE
-#define M2P_CHUNK_SIZE (1 << M2P_SHIFT)
-#define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(unsigned long)), M2P_SHIFT)
+#define M2P_SHIFT L2_PAGETABLE_SHIFT_PAE
+#define M2P_CHUNK_SIZE (1 << M2P_SHIFT)
+#define M2P_SIZE(_m) ROUNDUP(((_m) * sizeof(unsigned long)), M2P_SHIFT)
#define M2P_CHUNKS(_m) (M2P_SIZE((_m)) >> M2P_SHIFT)
/* Size in bytes of the P2M (rounded up to the nearest PAGE_SIZE bytes) */
-#define P2M_SIZE ROUNDUP((max_pfn * sizeof(unsigned long)), PAGE_SHIFT)
+#define P2M_SIZE ROUNDUP((max_pfn * sizeof(unsigned long)), PAGE_SHIFT)
/* Number of unsigned longs in a page */
#define ulpp (PAGE_SIZE/sizeof(unsigned long))
@@ -127,12 +127,12 @@ static int get_platform_info(int xc_handle, uint32_t dom,
#define NR_SLACK_ENTRIES ((8 * 1024 * 1024) / PAGE_SIZE)
/* Is the given PFN within the 'slack' region at the top of the P2M? */
-#define IS_REAL_PFN(_pfn) ((max_pfn - (_pfn)) > NR_SLACK_ENTRIES)
+#define IS_REAL_PFN(_pfn) ((max_pfn - (_pfn)) > NR_SLACK_ENTRIES)
/* Returns TRUE if the PFN is currently mapped */
#define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL))
-#define INVALID_P2M_ENTRY (~0UL)
+#define INVALID_P2M_ENTRY (~0UL)