ia64/xen-unstable

changeset 14110:f61992cb82fe

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>
author Keir Fraser <keir@xensource.com>
date Sat Feb 24 14:19:42 2007 +0000 (2007-02-24)
parents aa1be6f5150e
children 3dac99b6034e
files tools/libxc/xc_linux_restore.c tools/libxc/xc_linux_save.c tools/libxc/xg_private.h tools/libxc/xg_save_restore.h
line diff
     1.1 --- a/tools/libxc/xc_linux_restore.c	Sat Feb 24 14:19:05 2007 +0000
     1.2 +++ b/tools/libxc/xc_linux_restore.c	Sat Feb 24 14:19:42 2007 +0000
     1.3 @@ -11,6 +11,7 @@
     1.4  
     1.5  #include "xg_private.h"
     1.6  #include "xg_save_restore.h"
     1.7 +#include "xc_dom.h"
     1.8  
     1.9  /* max mfn of the current host machine */
    1.10  static unsigned long max_mfn;
     2.1 --- a/tools/libxc/xc_linux_save.c	Sat Feb 24 14:19:05 2007 +0000
     2.2 +++ b/tools/libxc/xc_linux_save.c	Sat Feb 24 14:19:42 2007 +0000
     2.3 @@ -13,6 +13,7 @@
     2.4  #include <sys/time.h>
     2.5  
     2.6  #include "xc_private.h"
     2.7 +#include "xc_dom.h"
     2.8  #include "xg_private.h"
     2.9  #include "xg_save_restore.h"
    2.10  
     3.1 --- a/tools/libxc/xg_private.h	Sat Feb 24 14:19:05 2007 +0000
     3.2 +++ b/tools/libxc/xg_private.h	Sat Feb 24 14:19:42 2007 +0000
     3.3 @@ -146,6 +146,23 @@ typedef l4_pgentry_64_t l4_pgentry_t;
     3.4  #define PAGE_SIZE_IA64          (1UL << PAGE_SHIFT_IA64)
     3.5  #define PAGE_MASK_IA64          (~(PAGE_SIZE_IA64-1))
     3.6  
     3.7 +#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
     3.8 +
     3.9 +/* Size in bytes of the P2M (rounded up to the nearest PAGE_SIZE bytes) */
    3.10 +#define P2M_SIZE        ROUNDUP((max_pfn * sizeof(xen_pfn_t)), PAGE_SHIFT)
    3.11 +
    3.12 +/* Number of xen_pfn_t in a page */
    3.13 +#define fpp             (PAGE_SIZE/sizeof(xen_pfn_t))
    3.14 +
    3.15 +/* Number of entries in the pfn_to_mfn_frame_list_list */
    3.16 +#define P2M_FLL_ENTRIES (((max_pfn)+(fpp*fpp)-1)/(fpp*fpp))
    3.17 +
    3.18 +/* Number of entries in the pfn_to_mfn_frame_list */
    3.19 +#define P2M_FL_ENTRIES  (((max_pfn)+fpp-1)/fpp)
    3.20 +
    3.21 +/* Size in bytes of the pfn_to_mfn_frame_list     */
    3.22 +#define P2M_FL_SIZE     ((P2M_FL_ENTRIES)*sizeof(unsigned long))
    3.23 +
    3.24  #define PAEKERN_no           0
    3.25  #define PAEKERN_yes          1
    3.26  #define PAEKERN_extended_cr3 2
     4.1 --- a/tools/libxc/xg_save_restore.h	Sat Feb 24 14:19:05 2007 +0000
     4.2 +++ b/tools/libxc/xg_save_restore.h	Sat Feb 24 14:19:42 2007 +0000
     4.3 @@ -81,7 +81,6 @@ static inline int get_platform_info(int 
     4.4  */
     4.5  
     4.6  #define PFN_TO_KB(_pfn) ((_pfn) << (PAGE_SHIFT - 10))
     4.7 -#define ROUNDUP(_x,_w) (((unsigned long)(_x)+(1UL<<(_w))-1) & ~((1UL<<(_w))-1))
     4.8  
     4.9  
    4.10  /*
    4.11 @@ -94,25 +93,5 @@ static inline int get_platform_info(int 
    4.12  #define M2P_SIZE(_m)    ROUNDUP(((_m) * sizeof(xen_pfn_t)), M2P_SHIFT)
    4.13  #define M2P_CHUNKS(_m)  (M2P_SIZE((_m)) >> M2P_SHIFT)
    4.14  
    4.15 -/* Size in bytes of the P2M (rounded up to the nearest PAGE_SIZE bytes) */
    4.16 -#define P2M_SIZE        ROUNDUP((max_pfn * sizeof(xen_pfn_t)), PAGE_SHIFT)
    4.17 -
    4.18 -/* Number of xen_pfn_t in a page */
    4.19 -#define fpp             (PAGE_SIZE/sizeof(xen_pfn_t))
    4.20 -
    4.21 -/* Number of entries in the pfn_to_mfn_frame_list */
    4.22 -#define P2M_FL_ENTRIES  (((max_pfn)+fpp-1)/fpp)
    4.23 -
    4.24 -/* Size in bytes of the pfn_to_mfn_frame_list     */
    4.25 -#define P2M_FL_SIZE     ((P2M_FL_ENTRIES)*sizeof(unsigned long))
    4.26 -
    4.27 -/* Number of entries in the pfn_to_mfn_frame_list_list */
    4.28 -#define P2M_FLL_ENTRIES (((max_pfn)+(fpp*fpp)-1)/(fpp*fpp))
    4.29 -
    4.30  /* Returns TRUE if the PFN is currently mapped */
    4.31  #define is_mapped(pfn_type) (!((pfn_type) & 0x80000000UL))
    4.32 -
    4.33 -#define INVALID_P2M_ENTRY   (~0UL)
    4.34 -
    4.35 -
    4.36 -