blob: 1458d95003814dbc591d6e0d5b124485488218c9 [file] [log] [blame]
Michael Ellerman5cd16ee2005-11-11 14:25:24 +11001#ifndef _ASM_POWERPC_PAGE_32_H
2#define _ASM_POWERPC_PAGE_32_H
3
Kumar Gala37dd2ba2008-04-22 04:22:34 +10004#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 Ellerman5cd16ee2005-11-11 14:25:24 +110010#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32
11
Benjamin Herrenschmidt52142e72007-11-19 19:25:06 +110012#ifdef CONFIG_NOT_COHERENT_CACHE
13#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
14#endif
15
Becky Bruce4ee70842008-09-24 11:01:24 -050016#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
Ilya Yanokca9153a2008-12-11 04:55:41 +030022#define PTE_SHIFT (PAGE_SHIFT - PTE_T_LOG2) /* full page */
23
Michael Ellerman5cd16ee2005-11-11 14:25:24 +110024#ifndef __ASSEMBLY__
25/*
26 * The basic type of a PTE - 64 bits for those CPUs with > 32 bit
Becky Bruce4ee70842008-09-24 11:01:24 -050027 * physical addressing.
Michael Ellerman5cd16ee2005-11-11 14:25:24 +110028 */
29#ifdef CONFIG_PTE_64BIT
30typedef unsigned long long pte_basic_t;
Michael Ellerman5cd16ee2005-11-11 14:25:24 +110031#else
32typedef unsigned long pte_basic_t;
Michael Ellerman5cd16ee2005-11-11 14:25:24 +110033#endif
34
35struct page;
36extern void clear_pages(void *page, int order);
37static inline void clear_page(void *page) { clear_pages(page, 0); }
38extern void copy_page(void *to, void *from);
39
David Howellsef55d532006-12-08 02:37:53 -080040#include <asm-generic/page.h>
Michael Ellerman5cd16ee2005-11-11 14:25:24 +110041
Ilya Yanokca9153a2008-12-11 04:55:41 +030042#define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
43#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
44
Michael Ellerman5cd16ee2005-11-11 14:25:24 +110045#endif /* __ASSEMBLY__ */
46
Michael Ellerman5cd16ee2005-11-11 14:25:24 +110047#endif /* _ASM_POWERPC_PAGE_32_H */