]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-x86/page_32.h
x86: thread_info: merge thread_info allocation
[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
24 #ifdef CONFIG_X86_PAE
25 #define __PHYSICAL_MASK_SHIFT   36
26 #define __VIRTUAL_MASK_SHIFT    32
27 #define PAGETABLE_LEVELS        3
28
29 #ifndef __ASSEMBLY__
30 typedef u64     pteval_t;
31 typedef u64     pmdval_t;
32 typedef u64     pudval_t;
33 typedef u64     pgdval_t;
34 typedef u64     pgprotval_t;
35 typedef u64     phys_addr_t;
36
37 typedef union {
38         struct {
39                 unsigned long pte_low, pte_high;
40         };
41         pteval_t pte;
42 } pte_t;
43 #endif  /* __ASSEMBLY__
44  */
45 #else  /* !CONFIG_X86_PAE */
46 #define __PHYSICAL_MASK_SHIFT   32
47 #define __VIRTUAL_MASK_SHIFT    32
48 #define PAGETABLE_LEVELS        2
49
50 #ifndef __ASSEMBLY__
51 typedef unsigned long   pteval_t;
52 typedef unsigned long   pmdval_t;
53 typedef unsigned long   pudval_t;
54 typedef unsigned long   pgdval_t;
55 typedef unsigned long   pgprotval_t;
56 typedef unsigned long   phys_addr_t;
57
58 typedef union {
59         pteval_t pte;
60         pteval_t pte_low;
61 } pte_t;
62
63 #endif  /* __ASSEMBLY__ */
64 #endif  /* CONFIG_X86_PAE */
65
66 #ifndef __ASSEMBLY__
67 typedef struct page *pgtable_t;
68 #endif
69
70 #ifdef CONFIG_HUGETLB_PAGE
71 #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
72 #endif
73
74 #ifndef __ASSEMBLY__
75 #define __phys_addr(x)          ((x) - PAGE_OFFSET)
76 #define __phys_reloc_hide(x)    RELOC_HIDE((x), 0)
77
78 #ifdef CONFIG_FLATMEM
79 #define pfn_valid(pfn)          ((pfn) < max_mapnr)
80 #endif /* CONFIG_FLATMEM */
81
82 extern int nx_enabled;
83
84 /*
85  * This much address space is reserved for vmalloc() and iomap()
86  * as well as fixmap mappings.
87  */
88 extern unsigned int __VMALLOC_RESERVE;
89 extern int sysctl_legacy_va_layout;
90
91 #define VMALLOC_RESERVE         ((unsigned long)__VMALLOC_RESERVE)
92 #define MAXMEM                  (-__PAGE_OFFSET - __VMALLOC_RESERVE)
93
94 #ifdef CONFIG_X86_USE_3DNOW
95 #include <asm/mmx.h>
96
97 static inline void clear_page(void *page)
98 {
99         mmx_clear_page(page);
100 }
101
102 static inline void copy_page(void *to, void *from)
103 {
104         mmx_copy_page(to, from);
105 }
106 #else  /* !CONFIG_X86_USE_3DNOW */
107 #include <linux/string.h>
108
109 static inline void clear_page(void *page)
110 {
111         memset(page, 0, PAGE_SIZE);
112 }
113
114 static inline void copy_page(void *to, void *from)
115 {
116         memcpy(to, from, PAGE_SIZE);
117 }
118 #endif  /* CONFIG_X86_3DNOW */
119 #endif  /* !__ASSEMBLY__ */
120
121 #endif /* _ASM_X86_PAGE_32_H */