aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/highmem.h
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-10-27 18:32:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-27 21:03:05 -0400
commita8e23a291852cd7c4fb5ca696dbb93912185ad10 (patch)
treedf0cf7cfe8d8600563a96cb5426de69759165e52 /include/linux/highmem.h
parent12ba8d1e9262ce81a695795410bd9ee5c9407ba1 (diff)
mm,x86: fix kmap_atomic_push vs ioremap_32.c
It appears i386 uses kmap_atomic infrastructure regardless of CONFIG_HIGHMEM which results in a compile error when highmem is disabled. Cure this by providing the needed few bits for both CONFIG_HIGHMEM and CONFIG_X86_32. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Reported-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/highmem.h')
-rw-r--r--include/linux/highmem.h46
1 files changed, 25 insertions, 21 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 8a85ec109a3a..102f76be90da 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -37,27 +37,6 @@ extern unsigned long totalhigh_pages;
37 37
38void kmap_flush_unused(void); 38void kmap_flush_unused(void);
39 39
40DECLARE_PER_CPU(int, __kmap_atomic_idx);
41
42static inline int kmap_atomic_idx_push(void)
43{
44 int idx = __get_cpu_var(__kmap_atomic_idx)++;
45#ifdef CONFIG_DEBUG_HIGHMEM
46 WARN_ON_ONCE(in_irq() && !irqs_disabled());
47 BUG_ON(idx > KM_TYPE_NR);
48#endif
49 return idx;
50}
51
52static inline int kmap_atomic_idx_pop(void)
53{
54 int idx = --__get_cpu_var(__kmap_atomic_idx);
55#ifdef CONFIG_DEBUG_HIGHMEM
56 BUG_ON(idx < 0);
57#endif
58 return idx;
59}
60
61#else /* CONFIG_HIGHMEM */ 40#else /* CONFIG_HIGHMEM */
62 41
63static inline unsigned int nr_free_highpages(void) { return 0; } 42static inline unsigned int nr_free_highpages(void) { return 0; }
@@ -95,6 +74,31 @@ static inline void __kunmap_atomic(void *addr)
95 74
96#endif /* CONFIG_HIGHMEM */ 75#endif /* CONFIG_HIGHMEM */
97 76
77#if defined(CONFIG_HIGHMEM) || defined(CONFIG_X86_32)
78
79DECLARE_PER_CPU(int, __kmap_atomic_idx);
80
81static inline int kmap_atomic_idx_push(void)
82{
83 int idx = __get_cpu_var(__kmap_atomic_idx)++;
84#ifdef CONFIG_DEBUG_HIGHMEM
85 WARN_ON_ONCE(in_irq() && !irqs_disabled());
86 BUG_ON(idx > KM_TYPE_NR);
87#endif
88 return idx;
89}
90
91static inline int kmap_atomic_idx_pop(void)
92{
93 int idx = --__get_cpu_var(__kmap_atomic_idx);
94#ifdef CONFIG_DEBUG_HIGHMEM
95 BUG_ON(idx < 0);
96#endif
97 return idx;
98}
99
100#endif
101
98/* 102/*
99 * Make both: kmap_atomic(page, idx) and kmap_atomic(page) work. 103 * Make both: kmap_atomic(page, idx) and kmap_atomic(page) work.
100 */ 104 */