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 | |
Kumar Gala | 37dd2ba | 2008-04-22 04:22:34 +1000 | [diff] [blame] | 4 | #if defined(CONFIG_PHYSICAL_ALIGN) && (CONFIG_PHYSICAL_START != 0) |
| 5 | #if (CONFIG_PHYSICAL_START % CONFIG_PHYSICAL_ALIGN) != 0 |
| 6 | #error "CONFIG_PHYSICAL_START must be a multiple of CONFIG_PHYSICAL_ALIGN" |
| 7 | #endif |
| 8 | #endif |
| 9 | |
Michael Ellerman | 5cd16ee | 2005-11-11 14:25:24 +1100 | [diff] [blame] | 10 | #define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32 |
| 11 | |
Benjamin Herrenschmidt | 52142e7 | 2007-11-19 19:25:06 +1100 | [diff] [blame] | 12 | #ifdef CONFIG_NOT_COHERENT_CACHE |
FUJITA Tomonori | a6eb9fe | 2010-08-10 18:03:22 -0700 | [diff] [blame] | 13 | #define ARCH_DMA_MINALIGN L1_CACHE_BYTES |
Benjamin Herrenschmidt | 52142e7 | 2007-11-19 19:25:06 +1100 | [diff] [blame] | 14 | #endif |
| 15 | |
Becky Bruce | 4ee7084 | 2008-09-24 11:01:24 -0500 | [diff] [blame] | 16 | #ifdef CONFIG_PTE_64BIT |
| 17 | #define PTE_FLAGS_OFFSET 4 /* offset of PTE flags, in bytes */ |
| 18 | #else |
| 19 | #define PTE_FLAGS_OFFSET 0 |
| 20 | #endif |
| 21 | |
Yuri Tikhonov | e124012 | 2009-01-29 01:40:44 +0000 | [diff] [blame] | 22 | #ifdef CONFIG_PPC_256K_PAGES |
| 23 | #define PTE_SHIFT (PAGE_SHIFT - PTE_T_LOG2 - 2) /* 1/4 of a page */ |
| 24 | #else |
Ilya Yanok | ca9153a | 2008-12-11 04:55:41 +0300 | [diff] [blame] | 25 | #define PTE_SHIFT (PAGE_SHIFT - PTE_T_LOG2) /* full page */ |
Yuri Tikhonov | e124012 | 2009-01-29 01:40:44 +0000 | [diff] [blame] | 26 | #endif |
Ilya Yanok | ca9153a | 2008-12-11 04:55:41 +0300 | [diff] [blame] | 27 | |
Michael Ellerman | 5cd16ee | 2005-11-11 14:25:24 +1100 | [diff] [blame] | 28 | #ifndef __ASSEMBLY__ |
| 29 | /* |
| 30 | * The basic type of a PTE - 64 bits for those CPUs with > 32 bit |
Becky Bruce | 4ee7084 | 2008-09-24 11:01:24 -0500 | [diff] [blame] | 31 | * physical addressing. |
Michael Ellerman | 5cd16ee | 2005-11-11 14:25:24 +1100 | [diff] [blame] | 32 | */ |
| 33 | #ifdef CONFIG_PTE_64BIT |
| 34 | typedef unsigned long long pte_basic_t; |
Michael Ellerman | 5cd16ee | 2005-11-11 14:25:24 +1100 | [diff] [blame] | 35 | #else |
| 36 | typedef unsigned long pte_basic_t; |
Michael Ellerman | 5cd16ee | 2005-11-11 14:25:24 +1100 | [diff] [blame] | 37 | #endif |
| 38 | |
| 39 | struct page; |
| 40 | extern void clear_pages(void *page, int order); |
| 41 | static inline void clear_page(void *page) { clear_pages(page, 0); } |
| 42 | extern void copy_page(void *to, void *from); |
| 43 | |
Arnd Bergmann | 5b17e1c | 2009-05-13 22:56:30 +0000 | [diff] [blame] | 44 | #include <asm-generic/getorder.h> |
Michael Ellerman | 5cd16ee | 2005-11-11 14:25:24 +1100 | [diff] [blame] | 45 | |
Ilya Yanok | ca9153a | 2008-12-11 04:55:41 +0300 | [diff] [blame] | 46 | #define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1) |
| 47 | #define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1) |
| 48 | |
Michael Ellerman | 5cd16ee | 2005-11-11 14:25:24 +1100 | [diff] [blame] | 49 | #endif /* __ASSEMBLY__ */ |
| 50 | |
Michael Ellerman | 5cd16ee | 2005-11-11 14:25:24 +1100 | [diff] [blame] | 51 | #endif /* _ASM_POWERPC_PAGE_32_H */ |