From 616de1d6bf2c56f7fc2dc77d8f572cfce8854df9 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Wed, 1 Mar 2017 15:23:31 +0000 Subject: [PATCH] xen: move round_pg{up,down} to pfn.h They are going to be needed in multiple places. Instead of replicating more, move them to pfn.h. Signed-off-by: Wei Liu Reviewed-by: Jan Beulich --- xen/arch/x86/domain_build.c | 3 --- xen/common/page_alloc.c | 4 +--- xen/include/xen/pfn.h | 3 +++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index 124416161d..632640dca3 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -267,9 +267,6 @@ boolean_param("ro-hpet", ro_hpet); #define L3_PROT (BASE_PROT|_PAGE_DIRTY) #define L4_PROT (BASE_PROT|_PAGE_DIRTY) -#define round_pgup(_p) (((_p)+(PAGE_SIZE-1))&PAGE_MASK) -#define round_pgdown(_p) ((_p)&PAGE_MASK) - static unsigned int __initdata memflags = MEMF_no_dma|MEMF_exact_node; static struct page_info * __init alloc_chunk( diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 530ede1d20..42c20cb201 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -131,6 +131,7 @@ #include #include #include +#include #include #include #include @@ -176,9 +177,6 @@ size_param("bootscrub_chunk", opt_bootscrub_chunk); static unsigned int dma_bitsize; integer_param("dma_bits", dma_bitsize); -#define round_pgdown(_p) ((_p)&PAGE_MASK) -#define round_pgup(_p) (((_p)+(PAGE_SIZE-1))&PAGE_MASK) - /* Offlined page list, protected by heap_lock. */ PAGE_LIST_HEAD(page_offlined_list); /* Broken page list, protected by heap_lock. */ diff --git a/xen/include/xen/pfn.h b/xen/include/xen/pfn.h index 3626197de3..24a4c2ff7c 100644 --- a/xen/include/xen/pfn.h +++ b/xen/include/xen/pfn.h @@ -6,4 +6,7 @@ #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) +#define round_pgup(p) (((p) + (PAGE_SIZE - 1)) & PAGE_MASK) +#define round_pgdown(p) ((p) & PAGE_MASK) + #endif /* __XEN_PFN_H__ */ -- 2.39.5