[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] xen: move round_pg{up,down} to pfn.h



commit 616de1d6bf2c56f7fc2dc77d8f572cfce8854df9
Author:     Wei Liu <wei.liu2@xxxxxxxxxx>
AuthorDate: Wed Mar 1 15:23:31 2017 +0000
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Fri Mar 3 12:43:41 2017 +0000

    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 <wei.liu2@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 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 1244161..632640d 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 530ede1..42c20cb 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -131,6 +131,7 @@
 #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. */
diff --git a/xen/include/xen/pfn.h b/xen/include/xen/pfn.h
index 3626197..24a4c2f 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__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.