diff options
Diffstat (limited to 'include/linux/highmem.h')
-rw-r--r-- | include/linux/highmem.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 0690679832d4..ea5cdbd8c2c3 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -36,7 +36,31 @@ static inline void invalidate_kernel_vmap_range(void *vaddr, int size) | |||
36 | 36 | ||
37 | /* declarations for linux/mm/highmem.c */ | 37 | /* declarations for linux/mm/highmem.c */ |
38 | unsigned int nr_free_highpages(void); | 38 | unsigned int nr_free_highpages(void); |
39 | extern unsigned long totalhigh_pages; | 39 | extern atomic_long_t _totalhigh_pages; |
40 | static inline unsigned long totalhigh_pages(void) | ||
41 | { | ||
42 | return (unsigned long)atomic_long_read(&_totalhigh_pages); | ||
43 | } | ||
44 | |||
45 | static inline void totalhigh_pages_inc(void) | ||
46 | { | ||
47 | atomic_long_inc(&_totalhigh_pages); | ||
48 | } | ||
49 | |||
50 | static inline void totalhigh_pages_dec(void) | ||
51 | { | ||
52 | atomic_long_dec(&_totalhigh_pages); | ||
53 | } | ||
54 | |||
55 | static inline void totalhigh_pages_add(long count) | ||
56 | { | ||
57 | atomic_long_add(count, &_totalhigh_pages); | ||
58 | } | ||
59 | |||
60 | static inline void totalhigh_pages_set(long val) | ||
61 | { | ||
62 | atomic_long_set(&_totalhigh_pages, val); | ||
63 | } | ||
40 | 64 | ||
41 | void kmap_flush_unused(void); | 65 | void kmap_flush_unused(void); |
42 | 66 | ||
@@ -51,7 +75,7 @@ static inline struct page *kmap_to_page(void *addr) | |||
51 | return virt_to_page(addr); | 75 | return virt_to_page(addr); |
52 | } | 76 | } |
53 | 77 | ||
54 | #define totalhigh_pages 0UL | 78 | static inline unsigned long totalhigh_pages(void) { return 0UL; } |
55 | 79 | ||
56 | #ifndef ARCH_HAS_KMAP | 80 | #ifndef ARCH_HAS_KMAP |
57 | static inline void *kmap(struct page *page) | 81 | static inline void *kmap(struct page *page) |