aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xg_private.h
diff options
context:
space:
mode:
authorKeir Fraser <keir@xensource.com>2007-02-24 14:19:42 +0000
committerKeir Fraser <keir@xensource.com>2007-02-24 14:19:42 +0000
commit4062095bcbc7a0bf38a65ee90e8ffd2506d83950 (patch)
treee3ee5744442d35b35591906588edfedfd1bac445 /tools/libxc/xg_private.h
parent7a439455bd341e342e544fb02b8a4e7ca9ba2741 (diff)
downloadxen-4062095bcbc7a0bf38a65ee90e8ffd2506d83950.tar.gz
xen-4062095bcbc7a0bf38a65ee90e8ffd2506d83950.tar.bz2
xen-4062095bcbc7a0bf38a65ee90e8ffd2506d83950.zip
Move some definitions from xg_save_resotre.h to xg_private.h
which are necessary for the new dump core implementation. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Diffstat (limited to 'tools/libxc/xg_private.h')
-rw-r--r--tools/libxc/xg_private.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index 3cf6fbf22a..2b66a29763 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -146,6 +146,23 @@ typedef l4_pgentry_64_t l4_pgentry_t;
#define PAGE_SIZE_IA64 (1UL << PAGE_SHIFT_IA64)
#define PAGE_MASK_IA64 (~(PAGE_SIZE_IA64-1))
+#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
+
+/* Size in bytes of the P2M (rounded up to the nearest PAGE_SIZE bytes) */
+#define P2M_SIZE ROUNDUP((max_pfn * sizeof(xen_pfn_t)), PAGE_SHIFT)
+
+/* Number of xen_pfn_t in a page */
+#define fpp (PAGE_SIZE/sizeof(xen_pfn_t))
+
+/* Number of entries in the pfn_to_mfn_frame_list_list */
+#define P2M_FLL_ENTRIES (((max_pfn)+(fpp*fpp)-1)/(fpp*fpp))
+
+/* Number of entries in the pfn_to_mfn_frame_list */
+#define P2M_FL_ENTRIES (((max_pfn)+fpp-1)/fpp)
+
+/* Size in bytes of the pfn_to_mfn_frame_list */
+#define P2M_FL_SIZE ((P2M_FL_ENTRIES)*sizeof(unsigned long))
+
#define PAEKERN_no 0
#define PAEKERN_yes 1
#define PAEKERN_extended_cr3 2