]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - include/asm-x86/page_32.h
generic: add phys_addr_t for holding physical addresses
[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 /* 44=32+12, the limit we can fit into an unsigned long pfn */
26 #define __PHYSICAL_MASK_SHIFT   44
27 #define __VIRTUAL_MASK_SHIFT    32
28 #define PAGETABLE_LEVELS        3
29
30 #ifndef __ASSEMBLY__
31 typedef u64     pteval_t;
32 typedef u64     pmdval_t;
33 typedef u64     pudval_t;
34 typedef u64     pgdval_t;
35 typedef u64     pgprotval_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
57 typedef union {
58         pteval_t pte;
59         pteval_t pte_low;
60 } pte_t;
61
62 #endif  /* __ASSEMBLY__ */
63 #endif  /* CONFIG_X86_PAE */
64
65 #ifndef __ASSEMBLY__
66 typedef struct page *pgtable_t;
67 #endif
68
69 #ifdef CONFIG_HUGETLB_PAGE
70 #define HAVE_ARCH_HUGETLB_UNMAPPED_AREA
71 #endif
72
73 #ifndef __ASSEMBLY__
74 #define __phys_addr(x)          ((x) - PAGE_OFFSET)
75 #define __phys_reloc_hide(x)    RELOC_HIDE((x), 0)
76
77 #ifdef CONFIG_FLATMEM
78 #define pfn_valid(pfn)          ((pfn) < max_mapnr)
79 #endif /* CONFIG_FLATMEM */
80
81 extern int nx_enabled;
82
83 /*
84  * This much address space is reserved for vmalloc() and iomap()
85  * as well as fixmap mappings.
86  */
87 extern unsigned int __VMALLOC_RESERVE;
88 extern int sysctl_legacy_va_layout;
89
90 #define VMALLOC_RESERVE         ((unsigned long)__VMALLOC_RESERVE)
91 #define MAXMEM                  (-__PAGE_OFFSET - __VMALLOC_RESERVE)
92
93 extern void find_low_pfn_range(void);
94 extern unsigned long init_memory_mapping(unsigned long start,
95                                          unsigned long end);
96 extern void initmem_init(unsigned long, unsigned long);
97 extern void setup_bootmem_allocator(void);
98
99
100 #ifdef CONFIG_X86_USE_3DNOW
101 #include <asm/mmx.h>
102
103 static inline void clear_page(void *page)
104 {
105         mmx_clear_page(page);
106 }
107
108 static inline void copy_page(void *to, void *from)
109 {
110         mmx_copy_page(to, from);
111 }
112 #else  /* !CONFIG_X86_USE_3DNOW */
113 #include <linux/string.h>
114
115 static inline void clear_page(void *page)
116 {
117         memset(page, 0, PAGE_SIZE);
118 }
119
120 static inline void copy_page(void *to, void *from)
121 {
122         memcpy(to, from, PAGE_SIZE);
123 }
124 #endif  /* CONFIG_X86_3DNOW */
125 #endif  /* !__ASSEMBLY__ */
126
127 #endif /* _ASM_X86_PAGE_32_H */