diff options
Diffstat (limited to 'arch/x86/mm/highmem_32.c')
-rw-r--r-- | arch/x86/mm/highmem_32.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c index bcc079c282dd..522db5e3d0bf 100644 --- a/arch/x86/mm/highmem_32.c +++ b/arch/x86/mm/highmem_32.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/highmem.h> | 1 | #include <linux/highmem.h> |
2 | #include <linux/module.h> | 2 | #include <linux/module.h> |
3 | #include <linux/swap.h> /* for totalram_pages */ | ||
3 | 4 | ||
4 | void *kmap(struct page *page) | 5 | void *kmap(struct page *page) |
5 | { | 6 | { |
@@ -120,22 +121,13 @@ void kunmap_atomic(void *kvaddr, enum km_type type) | |||
120 | pagefault_enable(); | 121 | pagefault_enable(); |
121 | } | 122 | } |
122 | 123 | ||
123 | /* This is the same as kmap_atomic() but can map memory that doesn't | 124 | /* |
125 | * This is the same as kmap_atomic() but can map memory that doesn't | ||
124 | * have a struct page associated with it. | 126 | * have a struct page associated with it. |
125 | */ | 127 | */ |
126 | void *kmap_atomic_pfn(unsigned long pfn, enum km_type type) | 128 | void *kmap_atomic_pfn(unsigned long pfn, enum km_type type) |
127 | { | 129 | { |
128 | enum fixed_addresses idx; | 130 | return kmap_atomic_prot_pfn(pfn, type, kmap_prot); |
129 | unsigned long vaddr; | ||
130 | |||
131 | pagefault_disable(); | ||
132 | |||
133 | idx = type + KM_TYPE_NR*smp_processor_id(); | ||
134 | vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); | ||
135 | set_pte(kmap_pte-idx, pfn_pte(pfn, kmap_prot)); | ||
136 | arch_flush_lazy_mmu_mode(); | ||
137 | |||
138 | return (void*) vaddr; | ||
139 | } | 131 | } |
140 | EXPORT_SYMBOL_GPL(kmap_atomic_pfn); /* temporarily in use by i915 GEM until vmap */ | 132 | EXPORT_SYMBOL_GPL(kmap_atomic_pfn); /* temporarily in use by i915 GEM until vmap */ |
141 | 133 | ||
@@ -156,3 +148,27 @@ EXPORT_SYMBOL(kmap); | |||
156 | EXPORT_SYMBOL(kunmap); | 148 | EXPORT_SYMBOL(kunmap); |
157 | EXPORT_SYMBOL(kmap_atomic); | 149 | EXPORT_SYMBOL(kmap_atomic); |
158 | EXPORT_SYMBOL(kunmap_atomic); | 150 | EXPORT_SYMBOL(kunmap_atomic); |
151 | |||
152 | void __init set_highmem_pages_init(void) | ||
153 | { | ||
154 | struct zone *zone; | ||
155 | int nid; | ||
156 | |||
157 | for_each_zone(zone) { | ||
158 | unsigned long zone_start_pfn, zone_end_pfn; | ||
159 | |||
160 | if (!is_highmem(zone)) | ||
161 | continue; | ||
162 | |||
163 | zone_start_pfn = zone->zone_start_pfn; | ||
164 | zone_end_pfn = zone_start_pfn + zone->spanned_pages; | ||
165 | |||
166 | nid = zone_to_nid(zone); | ||
167 | printk(KERN_INFO "Initializing %s for node %d (%08lx:%08lx)\n", | ||
168 | zone->name, nid, zone_start_pfn, zone_end_pfn); | ||
169 | |||
170 | add_highpages_with_active_regions(nid, zone_start_pfn, | ||
171 | zone_end_pfn); | ||
172 | } | ||
173 | totalram_pages += totalhigh_pages; | ||
174 | } | ||