diff options
author | Graf Yang <graf.yang@analog.com> | 2011-03-28 07:53:29 -0400 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2011-03-28 07:53:29 -0400 |
commit | b554cb426a955a267dba524f98f99e29bc947643 (patch) | |
tree | 525676c9164059fb4f03bab86c3b0cb9c6f21d32 | |
parent | eac522ef438f8ea173569fd0469371bc5d317947 (diff) |
NOMMU: support SMP dynamic percpu_alloc
The percpu code requires more functions to be implemented in the mm core
which nommu currently does not provide. So add inline implementations
since these are largely meaningless on nommu systems.
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Greg Ungerer <gerg@uclinux.org>
-rw-r--r-- | include/linux/vmalloc.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 4ed6fcd6b726..9332e52ea8c2 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -95,10 +95,27 @@ extern struct vm_struct *remove_vm_area(const void *addr); | |||
95 | 95 | ||
96 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 96 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
97 | struct page ***pages); | 97 | struct page ***pages); |
98 | #ifdef CONFIG_MMU | ||
98 | extern int map_kernel_range_noflush(unsigned long start, unsigned long size, | 99 | extern int map_kernel_range_noflush(unsigned long start, unsigned long size, |
99 | pgprot_t prot, struct page **pages); | 100 | pgprot_t prot, struct page **pages); |
100 | extern void unmap_kernel_range_noflush(unsigned long addr, unsigned long size); | 101 | extern void unmap_kernel_range_noflush(unsigned long addr, unsigned long size); |
101 | extern void unmap_kernel_range(unsigned long addr, unsigned long size); | 102 | extern void unmap_kernel_range(unsigned long addr, unsigned long size); |
103 | #else | ||
104 | static inline int | ||
105 | map_kernel_range_noflush(unsigned long start, unsigned long size, | ||
106 | pgprot_t prot, struct page **pages) | ||
107 | { | ||
108 | return size >> PAGE_SHIFT; | ||
109 | } | ||
110 | static inline void | ||
111 | unmap_kernel_range_noflush(unsigned long addr, unsigned long size) | ||
112 | { | ||
113 | } | ||
114 | static inline void | ||
115 | unmap_kernel_range(unsigned long addr, unsigned long size) | ||
116 | { | ||
117 | } | ||
118 | #endif | ||
102 | 119 | ||
103 | /* Allocate/destroy a 'vmalloc' VM area. */ | 120 | /* Allocate/destroy a 'vmalloc' VM area. */ |
104 | extern struct vm_struct *alloc_vm_area(size_t size); | 121 | extern struct vm_struct *alloc_vm_area(size_t size); |
@@ -116,11 +133,26 @@ extern struct vm_struct *vmlist; | |||
116 | extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); | 133 | extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); |
117 | 134 | ||
118 | #ifdef CONFIG_SMP | 135 | #ifdef CONFIG_SMP |
136 | # ifdef CONFIG_MMU | ||
119 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, | 137 | struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, |
120 | const size_t *sizes, int nr_vms, | 138 | const size_t *sizes, int nr_vms, |
121 | size_t align); | 139 | size_t align); |
122 | 140 | ||
123 | void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); | 141 | void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); |
142 | # else | ||
143 | static inline struct vm_struct ** | ||
144 | pcpu_get_vm_areas(const unsigned long *offsets, | ||
145 | const size_t *sizes, int nr_vms, | ||
146 | size_t align) | ||
147 | { | ||
148 | return NULL; | ||
149 | } | ||
150 | |||
151 | static inline void | ||
152 | pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms) | ||
153 | { | ||
154 | } | ||
155 | # endif | ||
124 | #endif | 156 | #endif |
125 | 157 | ||
126 | #endif /* _LINUX_VMALLOC_H */ | 158 | #endif /* _LINUX_VMALLOC_H */ |