]> xenbits.xensource.com Git - xen.git/commitdiff
xen: move round_pg{up,down} to pfn.h
authorWei Liu <wei.liu2@citrix.com>
Wed, 1 Mar 2017 15:23:31 +0000 (15:23 +0000)
committerWei Liu <wei.liu2@citrix.com>
Fri, 3 Mar 2017 12:43:41 +0000 (12:43 +0000)
They are going to be needed in multiple places. Instead of replicating
more, move them to pfn.h.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain_build.c
xen/common/page_alloc.c
xen/include/xen/pfn.h

index 124416161d840ca29f99fc4621eb2de7417e240e..632640dca34b12b69a84fb44fcd5917289ac4153 100644 (file)
@@ -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(
index 530ede1d2011784687d45d1ae5b204a3bbb00ff4..42c20cb201cae42b5fdccad6975b1348b76cf89f 100644 (file)
 #include <xen/domain_page.h>
 #include <xen/keyhandler.h>
 #include <xen/perfc.h>
+#include <xen/pfn.h>
 #include <xen/numa.h>
 #include <xen/nodemask.h>
 #include <xen/event.h>
@@ -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. */
index 3626197de364a8e6c39d98b81aed7617b8d41113..24a4c2ff7cfd7a840c4293b47a6164cbc7fb2efc 100644 (file)
@@ -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__ */