]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-x86/page_32.h
m32r: fix build due to notify_cpu_starting() change
[linux-2.6-omap-h63xx.git] / include / asm-x86 / page_32.h
1 #ifndef ASM_X86__PAGE_32_H
2 #define ASM_X86__PAGE_32_H
3
4 /*
5  * This handles the memory map.
6  *
7  * A __PAGE_OFFSET of 0xC0000000 means that the kernel has
8  * a virtual address space of one gigabyte, which limits the
9  * amount of physical memory you can use to about 950MB.
10  *
11  * If you want more physical memory than this then see the CONFIG_HIGHMEM4G
12  * and CONFIG_HIGHMEM64G options in the kernel configuration.
13  */
14 #define __PAGE_OFFSET           _AC(CONFIG_PAGE_OFFSET, UL)
15
16 #ifdef CONFIG_4KSTACKS
17 #define THREAD_ORDER    0
18 #else
19 #define THREAD_ORDER    1
20 #endif
21 #define THREAD_SIZE     (PAGE_SIZE << THREAD_ORDER)
22
23 #define STACKFAULT_STACK 0
24 #define DOUBLEFAULT_STACK 1
25 #define NMI_STACK 0
26 #define DEBUG_STACK 0
27 #define MCE_STACK 0
28 #define N_EXCEPTION_STACKS 1
29
30 #ifdef CONFIG_X86_PAE
31 /* 44=32+12, the limit we can fit into an unsigned long pfn */
32 #define __PHYSICAL_MASK_SHIFT   44
33 #define __VIRTUAL_MASK_SHIFT    32
34 #define PAGETABLE_LEVELS        3
35
36 #ifndef __ASSEMBLY__
37 typedef u64     pteval_t;
38 typedef u64     pmdval_t;
39 typedef u64     pudval_t;
40 typedef u64     pgdval_t;
41 typedef u64     pgprotval_t;
42 typedef u64     phys_addr_t;
43
44 typedef union {
45         struct {
46                 unsigned long pte_low, pte_high;
47         };
48         pteval_t pte;
49 } pte_t;
50 #endif  /* __ASSEMBLY__
51  */
52 #else  /* !CONFIG_X86_PAE */
53 #define __PHYSICAL_MASK_SHIFT   32
54 #define __VIRTUAL_MASK_SHIFT    32
55 #define PAGETABLE_LEVELS        2
56
57 #ifndef __ASSEMBLY__
58 typedef unsigned long   pteval_t;
59 typedef unsigned long   pmdval_t;
60 typedef unsigned long   pudval_t;
61 typedef unsigned long   pgdval_t;
62 typedef unsigned long   pgprotval_t;
63 typedef unsigned long   phys_addr_t;
64
65 typedef union {
66         pteval_t pte;
67         pteval_t pte_low;
68 } pte_t;
69
70 #endif  /* __ASSEMBLY__ */
71 #endif  /* CONFIG_X86_PAE */
72
73 #ifndef __ASSEMBLY__
74 typedef struct page *pgtable_t;
75 #endif
76
77 #ifdef CONFIG_HUGETLB_PAGE
78 #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
79 #endif
80
81 #ifndef __ASSEMBLY__
82 #define __phys_addr_nodebug(x)  ((x) - PAGE_OFFSET)
83 #ifdef CONFIG_DEBUG_VIRTUAL
84 extern unsigned long __phys_addr(unsigned long);
85 #else
86 #define __phys_addr(x)          __phys_addr_nodebug(x)
87 #endif
88 #define __phys_reloc_hide(x)    RELOC_HIDE((x), 0)
89
90 #ifdef CONFIG_FLATMEM
91 #define pfn_valid(pfn)          ((pfn) < max_mapnr)
92 #endif /* CONFIG_FLATMEM */
93
94 extern int nx_enabled;
95
96 /*
97  * This much address space is reserved for vmalloc() and iomap()
98  * as well as fixmap mappings.
99  */
100 extern unsigned int __VMALLOC_RESERVE;
101 extern int sysctl_legacy_va_layout;
102
103 extern void find_low_pfn_range(void);
104 extern unsigned long init_memory_mapping(unsigned long start,
105                                          unsigned long end);
106 extern void initmem_init(unsigned long, unsigned long);
107 extern void free_initmem(void);
108 extern void setup_bootmem_allocator(void);
109
110
111 #ifdef CONFIG_X86_USE_3DNOW
112 #include <asm/mmx.h>
113
114 static inline void clear_page(void *page)
115 {
116         mmx_clear_page(page);
117 }
118
119 static inline void copy_page(void *to, void *from)
120 {
121         mmx_copy_page(to, from);
122 }
123 #else  /* !CONFIG_X86_USE_3DNOW */
124 #include <linux/string.h>
125
126 static inline void clear_page(void *page)
127 {
128         memset(page, 0, PAGE_SIZE);
129 }
130
131 static inline void copy_page(void *to, void *from)
132 {
133         memcpy(to, from, PAGE_SIZE);
134 }
135 #endif  /* CONFIG_X86_3DNOW */
136 #endif  /* !__ASSEMBLY__ */
137
138 #endif /* ASM_X86__PAGE_32_H */