|
5 | 5 | #ifndef _METAG_PGTABLE_H
|
6 | 6 | #define _METAG_PGTABLE_H
|
7 | 7 |
|
| 8 | +#include <asm/pgtable-bits.h> |
8 | 9 | #include <asm-generic/pgtable-nopmd.h>
|
9 | 10 |
|
10 | 11 | /* Invalid regions on Meta: 0x00000000-0x001FFFFF and 0xFFFF0000-0xFFFFFFFF */
|
|
20 | 21 | #define VMALLOC_END 0x7FFFFFFF
|
21 | 22 | #endif
|
22 | 23 |
|
23 |
| -/* |
24 |
| - * Definitions for MMU descriptors |
25 |
| - * |
26 |
| - * These are the hardware bits in the MMCU pte entries. |
27 |
| - * Derived from the Meta toolkit headers. |
28 |
| - */ |
29 |
| -#define _PAGE_PRESENT MMCU_ENTRY_VAL_BIT |
30 |
| -#define _PAGE_WRITE MMCU_ENTRY_WR_BIT |
31 |
| -#define _PAGE_PRIV MMCU_ENTRY_PRIV_BIT |
32 |
| -/* Write combine bit - this can cause writes to occur out of order */ |
33 |
| -#define _PAGE_WR_COMBINE MMCU_ENTRY_WRC_BIT |
34 |
| -/* Sys coherent bit - this bit is never used by Linux */ |
35 |
| -#define _PAGE_SYS_COHERENT MMCU_ENTRY_SYS_BIT |
36 |
| -#define _PAGE_ALWAYS_ZERO_1 0x020 |
37 |
| -#define _PAGE_CACHE_CTRL0 0x040 |
38 |
| -#define _PAGE_CACHE_CTRL1 0x080 |
39 |
| -#define _PAGE_ALWAYS_ZERO_2 0x100 |
40 |
| -#define _PAGE_ALWAYS_ZERO_3 0x200 |
41 |
| -#define _PAGE_ALWAYS_ZERO_4 0x400 |
42 |
| -#define _PAGE_ALWAYS_ZERO_5 0x800 |
43 |
| - |
44 |
| -/* These are software bits that we stuff into the gaps in the hardware |
45 |
| - * pte entries that are not used. Note, these DO get stored in the actual |
46 |
| - * hardware, but the hardware just does not use them. |
47 |
| - */ |
48 |
| -#define _PAGE_ACCESSED _PAGE_ALWAYS_ZERO_1 |
49 |
| -#define _PAGE_DIRTY _PAGE_ALWAYS_ZERO_2 |
50 |
| - |
51 |
| -/* Pages owned, and protected by, the kernel. */ |
52 |
| -#define _PAGE_KERNEL _PAGE_PRIV |
53 |
| - |
54 |
| -/* No cacheing of this page */ |
55 |
| -#define _PAGE_CACHE_WIN0 (MMCU_CWIN_UNCACHED << MMCU_ENTRY_CWIN_S) |
56 |
| -/* burst cacheing - good for data streaming */ |
57 |
| -#define _PAGE_CACHE_WIN1 (MMCU_CWIN_BURST << MMCU_ENTRY_CWIN_S) |
58 |
| -/* One cache way per thread */ |
59 |
| -#define _PAGE_CACHE_WIN2 (MMCU_CWIN_C1SET << MMCU_ENTRY_CWIN_S) |
60 |
| -/* Full on cacheing */ |
61 |
| -#define _PAGE_CACHE_WIN3 (MMCU_CWIN_CACHED << MMCU_ENTRY_CWIN_S) |
62 |
| - |
63 |
| -#define _PAGE_CACHEABLE (_PAGE_CACHE_WIN3 | _PAGE_WR_COMBINE) |
64 |
| - |
65 |
| -/* which bits are used for cache control ... */ |
66 |
| -#define _PAGE_CACHE_MASK (_PAGE_CACHE_CTRL0 | _PAGE_CACHE_CTRL1 | \ |
67 |
| - _PAGE_WR_COMBINE) |
68 |
| - |
69 |
| -/* This is a mask of the bits that pte_modify is allowed to change. */ |
70 |
| -#define _PAGE_CHG_MASK (PAGE_MASK) |
71 |
| - |
72 |
| -#define _PAGE_SZ_SHIFT 1 |
73 |
| -#define _PAGE_SZ_4K (0x0) |
74 |
| -#define _PAGE_SZ_8K (0x1 << _PAGE_SZ_SHIFT) |
75 |
| -#define _PAGE_SZ_16K (0x2 << _PAGE_SZ_SHIFT) |
76 |
| -#define _PAGE_SZ_32K (0x3 << _PAGE_SZ_SHIFT) |
77 |
| -#define _PAGE_SZ_64K (0x4 << _PAGE_SZ_SHIFT) |
78 |
| -#define _PAGE_SZ_128K (0x5 << _PAGE_SZ_SHIFT) |
79 |
| -#define _PAGE_SZ_256K (0x6 << _PAGE_SZ_SHIFT) |
80 |
| -#define _PAGE_SZ_512K (0x7 << _PAGE_SZ_SHIFT) |
81 |
| -#define _PAGE_SZ_1M (0x8 << _PAGE_SZ_SHIFT) |
82 |
| -#define _PAGE_SZ_2M (0x9 << _PAGE_SZ_SHIFT) |
83 |
| -#define _PAGE_SZ_4M (0xa << _PAGE_SZ_SHIFT) |
84 |
| -#define _PAGE_SZ_MASK (0xf << _PAGE_SZ_SHIFT) |
85 |
| - |
86 |
| -#if defined(CONFIG_PAGE_SIZE_4K) |
87 |
| -#define _PAGE_SZ (_PAGE_SZ_4K) |
88 |
| -#elif defined(CONFIG_PAGE_SIZE_8K) |
89 |
| -#define _PAGE_SZ (_PAGE_SZ_8K) |
90 |
| -#elif defined(CONFIG_PAGE_SIZE_16K) |
91 |
| -#define _PAGE_SZ (_PAGE_SZ_16K) |
92 |
| -#endif |
93 |
| -#define _PAGE_TABLE (_PAGE_SZ | _PAGE_PRESENT) |
94 |
| - |
95 |
| -#if defined(CONFIG_HUGETLB_PAGE_SIZE_8K) |
96 |
| -# define _PAGE_SZHUGE (_PAGE_SZ_8K) |
97 |
| -#elif defined(CONFIG_HUGETLB_PAGE_SIZE_16K) |
98 |
| -# define _PAGE_SZHUGE (_PAGE_SZ_16K) |
99 |
| -#elif defined(CONFIG_HUGETLB_PAGE_SIZE_32K) |
100 |
| -# define _PAGE_SZHUGE (_PAGE_SZ_32K) |
101 |
| -#elif defined(CONFIG_HUGETLB_PAGE_SIZE_64K) |
102 |
| -# define _PAGE_SZHUGE (_PAGE_SZ_64K) |
103 |
| -#elif defined(CONFIG_HUGETLB_PAGE_SIZE_128K) |
104 |
| -# define _PAGE_SZHUGE (_PAGE_SZ_128K) |
105 |
| -#elif defined(CONFIG_HUGETLB_PAGE_SIZE_256K) |
106 |
| -# define _PAGE_SZHUGE (_PAGE_SZ_256K) |
107 |
| -#elif defined(CONFIG_HUGETLB_PAGE_SIZE_512K) |
108 |
| -# define _PAGE_SZHUGE (_PAGE_SZ_512K) |
109 |
| -#elif defined(CONFIG_HUGETLB_PAGE_SIZE_1M) |
110 |
| -# define _PAGE_SZHUGE (_PAGE_SZ_1M) |
111 |
| -#elif defined(CONFIG_HUGETLB_PAGE_SIZE_2M) |
112 |
| -# define _PAGE_SZHUGE (_PAGE_SZ_2M) |
113 |
| -#elif defined(CONFIG_HUGETLB_PAGE_SIZE_4M) |
114 |
| -# define _PAGE_SZHUGE (_PAGE_SZ_4M) |
115 |
| -#endif |
116 |
| - |
117 | 24 | /*
|
118 | 25 | * The Linux memory management assumes a three-level page table setup. On
|
119 | 26 | * Meta, we use that, but "fold" the mid level into the top-level page
|
|
0 commit comments