0001
0002 #ifndef _PPC_BOOT_PAGE_H
0003 #define _PPC_BOOT_PAGE_H
0004
0005
0006
0007
0008 #ifdef __ASSEMBLY__
0009 #define ASM_CONST(x) x
0010 #else
0011 #define __ASM_CONST(x) x##UL
0012 #define ASM_CONST(x) __ASM_CONST(x)
0013 #endif
0014
0015
0016 #define PAGE_SHIFT 12
0017 #define PAGE_SIZE (ASM_CONST(1) << PAGE_SHIFT)
0018 #define PAGE_MASK (~(PAGE_SIZE-1))
0019
0020
0021 #define _ALIGN_UP(addr, size) (((addr)+((size)-1))&(~((typeof(addr))(size)-1)))
0022 #define _ALIGN_DOWN(addr, size) ((addr)&(~((typeof(addr))(size)-1)))
0023
0024
0025 #define _ALIGN(addr,size) _ALIGN_UP(addr,size)
0026
0027
0028 #define PAGE_ALIGN(addr) _ALIGN(addr, PAGE_SIZE)
0029
0030 #endif