ia64/xen-unstable

changeset 12934:8515e163f1df

[POWERPC][XEN] Move gmfn_to_mfn() from page.h to mm.h to avoid recursive header dependencies.
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Tue Oct 03 18:23:21 2006 -0500 (2006-10-03)
parents a0b47a11b52d
children 6f6a37ee8b97
files xen/include/asm-powerpc/mm.h xen/include/asm-powerpc/page.h
line diff
     1.1 --- a/xen/include/asm-powerpc/mm.h	Mon Oct 02 21:43:09 2006 -0400
     1.2 +++ b/xen/include/asm-powerpc/mm.h	Tue Oct 03 18:23:21 2006 -0500
     1.3 @@ -28,6 +28,7 @@
     1.4  #include <asm/system.h>
     1.5  #include <asm/flushtlb.h>
     1.6  #include <asm/uaccess.h>
     1.7 +#include <asm/debugger.h>
     1.8  
     1.9  #define memguard_guard_range(_p,_l)    ((void)0)
    1.10  #define memguard_unguard_range(_p,_l)    ((void)0)
    1.11 @@ -274,4 +275,26 @@ extern void free_extents(struct domain *
    1.12  extern int steal_page(struct domain *d, struct page_info *page,
    1.13                          unsigned int memflags);
    1.14  
    1.15 +static inline unsigned long gmfn_to_mfn(struct domain *d, unsigned long gmfn)
    1.16 +{
    1.17 +    int mtype;
    1.18 +    ulong mfn;
    1.19 +    
    1.20 +    mfn = pfn2mfn(d, gmfn, &mtype);
    1.21 +    if (mfn != INVALID_MFN) {
    1.22 +        switch (mtype) {
    1.23 +        case PFN_TYPE_RMA:
    1.24 +        case PFN_TYPE_LOGICAL:
    1.25 +            break;
    1.26 +        default:
    1.27 +            WARN();
    1.28 +            mfn = INVALID_MFN;
    1.29 +            break;
    1.30 +        }
    1.31 +    }
    1.32 +    return mfn;
    1.33 +}
    1.34 +
    1.35 +#define mfn_to_gmfn(_d, mfn) (mfn)
    1.36 +
    1.37  #endif
     2.1 --- a/xen/include/asm-powerpc/page.h	Mon Oct 02 21:43:09 2006 -0400
     2.2 +++ b/xen/include/asm-powerpc/page.h	Tue Oct 03 18:23:21 2006 -0500
     2.3 @@ -30,7 +30,6 @@
     2.4  
     2.5  #include <xen/config.h>
     2.6  #include <asm/cache.h>
     2.7 -#include <asm/debugger.h>
     2.8  
     2.9  #define PFN_DOWN(x)   ((x) >> PAGE_SHIFT)
    2.10  #define PFN_UP(x)     (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)