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>

authored by Graf Yang and committed by David Howells b554cb42 eac522ef

+32
+32
include/linux/vmalloc.h
··· 95 96 extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 97 struct page ***pages); 98 extern int map_kernel_range_noflush(unsigned long start, unsigned long size, 99 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(unsigned long addr, unsigned long size); 102 103 /* Allocate/destroy a 'vmalloc' VM area. */ 104 extern struct vm_struct *alloc_vm_area(size_t size); ··· 133 extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); 134 135 #ifdef CONFIG_SMP 136 struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, 137 const size_t *sizes, int nr_vms, 138 size_t align); 139 140 void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); 141 #endif 142 143 #endif /* _LINUX_VMALLOC_H */
··· 95 96 extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 97 struct page ***pages); 98 + #ifdef CONFIG_MMU 99 extern int map_kernel_range_noflush(unsigned long start, unsigned long size, 100 pgprot_t prot, struct page **pages); 101 extern void unmap_kernel_range_noflush(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 119 120 /* Allocate/destroy a 'vmalloc' VM area. */ 121 extern struct vm_struct *alloc_vm_area(size_t size); ··· 116 extern __init void vm_area_register_early(struct vm_struct *vm, size_t align); 117 118 #ifdef CONFIG_SMP 119 + # ifdef CONFIG_MMU 120 struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets, 121 const size_t *sizes, int nr_vms, 122 size_t align); 123 124 void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms); 125 + # else 126 + static inline struct vm_struct ** 127 + pcpu_get_vm_areas(const unsigned long *offsets, 128 + const size_t *sizes, int nr_vms, 129 + size_t align) 130 + { 131 + return NULL; 132 + } 133 + 134 + static inline void 135 + pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms) 136 + { 137 + } 138 + # endif 139 #endif 140 141 #endif /* _LINUX_VMALLOC_H */