/arch/powerpc/include/asm/page_32.h
C Header | 51 lines | 36 code | 11 blank | 4 comment | 3 complexity | efac917117ce482c243c0d89b12901ea MD5 | raw file
Possible License(s): CC-BY-SA-3.0, GPL-2.0, LGPL-2.0, AGPL-1.0
1#ifndef _ASM_POWERPC_PAGE_32_H
2#define _ASM_POWERPC_PAGE_32_H
3
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
10#define VM_DATA_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS32
11
12#ifdef CONFIG_NOT_COHERENT_CACHE
13#define ARCH_KMALLOC_MINALIGN L1_CACHE_BYTES
14#endif
15
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
22#ifdef CONFIG_PPC_256K_PAGES
23#define PTE_SHIFT (PAGE_SHIFT - PTE_T_LOG2 - 2) /* 1/4 of a page */
24#else
25#define PTE_SHIFT (PAGE_SHIFT - PTE_T_LOG2) /* full page */
26#endif
27
28#ifndef __ASSEMBLY__
29/*
30 * The basic type of a PTE - 64 bits for those CPUs with > 32 bit
31 * physical addressing.
32 */
33#ifdef CONFIG_PTE_64BIT
34typedef unsigned long long pte_basic_t;
35#else
36typedef unsigned long pte_basic_t;
37#endif
38
39struct page;
40extern void clear_pages(void *page, int order);
41static inline void clear_page(void *page) { clear_pages(page, 0); }
42extern void copy_page(void *to, void *from);
43
44#include <asm-generic/getorder.h>
45
46#define PGD_T_LOG2 (__builtin_ffs(sizeof(pgd_t)) - 1)
47#define PTE_T_LOG2 (__builtin_ffs(sizeof(pte_t)) - 1)
48
49#endif /* __ASSEMBLY__ */
50
51#endif /* _ASM_POWERPC_PAGE_32_H */