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

[xen master] move PAGE_ALIGN() to common header



commit 751235f6d12076963918af6e70310e20d4c23027
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu Aug 10 15:09:25 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu Aug 10 15:09:25 2023 +0200

    move PAGE_ALIGN() to common header
    
    Much like we have PAGE_OFFSET() there already, there's also no reason
    for each arch to define identical PAGE_ALIGN().
    
    While there re-pad PAGE_OFFSET() to match the other macros.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 xen/arch/arm/include/asm/page.h | 2 --
 xen/arch/x86/include/asm/page.h | 2 --
 xen/include/xen/page-size.h     | 3 ++-
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/xen/arch/arm/include/asm/page.h b/xen/arch/arm/include/asm/page.h
index ea96983ab9..657c4b33db 100644
--- a/xen/arch/arm/include/asm/page.h
+++ b/xen/arch/arm/include/asm/page.h
@@ -303,8 +303,6 @@ static inline int gva_to_ipa(vaddr_t va, paddr_t *paddr, 
unsigned int flags)
 
 #endif /* __ASSEMBLY__ */
 
-#define PAGE_ALIGN(x) (((x) + PAGE_SIZE - 1) & PAGE_MASK)
-
 #endif /* __ARM_PAGE_H__ */
 
 /*
diff --git a/xen/arch/x86/include/asm/page.h b/xen/arch/x86/include/asm/page.h
index 3647bb1260..c9466172ba 100644
--- a/xen/arch/x86/include/asm/page.h
+++ b/xen/arch/x86/include/asm/page.h
@@ -404,8 +404,6 @@ static inline void invalidate_icache(void)
 
 #endif /* !__ASSEMBLY__ */
 
-#define PAGE_ALIGN(x) (((x) + PAGE_SIZE - 1) & PAGE_MASK)
-
 #endif /* __X86_PAGE_H__ */
 
 /*
diff --git a/xen/include/xen/page-size.h b/xen/include/xen/page-size.h
index dc5ade107b..78ea57f324 100644
--- a/xen/include/xen/page-size.h
+++ b/xen/include/xen/page-size.h
@@ -10,7 +10,8 @@
  */
 #define PAGE_SIZE           (_AC(1,L) << PAGE_SHIFT)
 #define PAGE_MASK           (~(PAGE_SIZE-1))
-#define PAGE_OFFSET(ptr)   ((unsigned long)(ptr) & ~PAGE_MASK)
+#define PAGE_OFFSET(ptr)    ((unsigned long)(ptr) & ~PAGE_MASK)
+#define PAGE_ALIGN(x)       (((x) + PAGE_SIZE - 1) & PAGE_MASK)
 
 #define PADDR_MASK          ((_AC(1,ULL) << PADDR_BITS) - 1)
 #define VADDR_MASK          (~_AC(0,UL) >> (BITS_PER_LONG - VADDR_BITS))
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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