[PATCH 4/8] common: add PAGE_ALIGN_DOWN macro

Alexander Aring alex.aring at gmail.com
Tue Jan 15 08:48:46 EST 2013


Add PAGE_ALIGN_DOWN macro, which is like PAGE_ALIGN macro but
returns the lower page boundary of address.

Signed-off-by: Alexander Aring <alex.aring at gmail.com>
---
 include/common.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/common.h b/include/common.h
index 9533344..3e67164 100644
--- a/include/common.h
+++ b/include/common.h
@@ -226,6 +226,7 @@ int run_shell(void);
 #define PAGE_SIZE	4096
 #define PAGE_SHIFT	12
 #define PAGE_ALIGN(s) (((s) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
+#define PAGE_ALIGN_DOWN(x) ((x) & ~(PAGE_SIZE - 1))
 
 int memory_display(char *addr, loff_t offs, ulong nbytes, int size, int swab);
 
-- 
1.8.1




More information about the barebox mailing list