Michael Ellerman | 5cd16ee | 2005-11-11 14:25:24 +1100 | [diff] [blame] | 1 | #ifndef _ASM_POWERPC_PAGE_32_H |
| 2 | #define _ASM_POWERPC_PAGE_32_H |
| 3 | |
| 4 | #define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32 |
| 5 | |
Paul Mackerras | 493f25e | 2005-11-14 17:32:50 +1100 | [diff] [blame] | 6 | #define PPC_MEMSTART 0 |
| 7 | |
Michael Ellerman | 5cd16ee | 2005-11-11 14:25:24 +1100 | [diff] [blame] | 8 | #ifndef __ASSEMBLY__ |
| 9 | /* |
| 10 | * The basic type of a PTE - 64 bits for those CPUs with > 32 bit |
| 11 | * physical addressing. For now this just the IBM PPC440. |
| 12 | */ |
| 13 | #ifdef CONFIG_PTE_64BIT |
| 14 | typedef unsigned long long pte_basic_t; |
| 15 | #define PTE_SHIFT (PAGE_SHIFT - 3) /* 512 ptes per page */ |
| 16 | #define PTE_FMT "%16Lx" |
| 17 | #else |
| 18 | typedef unsigned long pte_basic_t; |
| 19 | #define PTE_SHIFT (PAGE_SHIFT - 2) /* 1024 ptes per page */ |
| 20 | #define PTE_FMT "%.8lx" |
| 21 | #endif |
| 22 | |
| 23 | struct page; |
| 24 | extern void clear_pages(void *page, int order); |
| 25 | static inline void clear_page(void *page) { clear_pages(page, 0); } |
| 26 | extern void copy_page(void *to, void *from); |
| 27 | |
| 28 | /* Pure 2^n version of get_order */ |
| 29 | extern __inline__ int get_order(unsigned long size) |
| 30 | { |
| 31 | int lz; |
| 32 | |
| 33 | size = (size-1) >> PAGE_SHIFT; |
| 34 | asm ("cntlzw %0,%1" : "=r" (lz) : "r" (size)); |
| 35 | return 32 - lz; |
| 36 | } |
| 37 | |
| 38 | #endif /* __ASSEMBLY__ */ |
| 39 | |
| 40 | #endif /* _ASM_POWERPC_PAGE_32_H */ |