common: add PAGE_ALIGN_DOWN macro
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@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
d32b75f003
commit
f8fd03225d
|
@ -226,6 +226,7 @@ int run_shell(void);
|
||||||
#define PAGE_SIZE 4096
|
#define PAGE_SIZE 4096
|
||||||
#define PAGE_SHIFT 12
|
#define PAGE_SHIFT 12
|
||||||
#define PAGE_ALIGN(s) (((s) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1))
|
#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);
|
int memory_display(char *addr, loff_t offs, ulong nbytes, int size, int swab);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue