Title: [9759] trunk: nommu: move new percpu funcs to header as inline funcs so they get optimized away
Revision
9759
Author
vapier
Date
2011-03-23 11:51:30 -0400 (Wed, 23 Mar 2011)

Log Message

nommu: move new percpu funcs to header as inline funcs so they get optimized away

Modified Paths

Diff

Modified: trunk/include/linux/vmalloc.h (9758 => 9759)


--- trunk/include/linux/vmalloc.h	2011-03-23 15:49:21 UTC (rev 9758)
+++ trunk/include/linux/vmalloc.h	2011-03-23 15:51:30 UTC (rev 9759)
@@ -98,10 +98,27 @@
 
 extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
 			struct page ***pages);
+#ifdef CONFIG_MMU
 extern int map_kernel_range_noflush(unsigned long start, unsigned long size,
 				    pgprot_t prot, struct page **pages);
 extern void unmap_kernel_range_noflush(unsigned long addr, unsigned long size);
 extern void unmap_kernel_range(unsigned long addr, unsigned long size);
+#else
+static inline int
+map_kernel_range_noflush(unsigned long start, unsigned long size,
+			pgprot_t prot, struct page **pages)
+{
+	return size >> PAGE_SHIFT;
+}
+static inline void
+unmap_kernel_range_noflush(unsigned long addr, unsigned long size)
+{
+}
+static inline void
+unmap_kernel_range(unsigned long addr, unsigned long size)
+{
+}
+#endif
 
 /* Allocate/destroy a 'vmalloc' VM area. */
 extern struct vm_struct *alloc_vm_area(size_t size);
@@ -119,11 +136,26 @@
 extern __init void vm_area_register_early(struct vm_struct *vm, size_t align);
 
 #ifdef CONFIG_SMP
+# ifdef CONFIG_MMU
 struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
 				     const size_t *sizes, int nr_vms,
 				     size_t align);
 
 void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);
+# else
+static inline struct vm_struct **
+pcpu_get_vm_areas(const unsigned long *offsets,
+		const size_t *sizes, int nr_vms,
+		size_t align)
+{
+	return NULL;
+}
+
+static inline void
+pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms)
+{
+}
+# endif
 #endif
 
 #endif /* _LINUX_VMALLOC_H */

Modified: trunk/mm/nommu.c (9758 => 9759)


--- trunk/mm/nommu.c	2011-03-23 15:49:21 UTC (rev 9758)
+++ trunk/mm/nommu.c	2011-03-23 15:51:30 UTC (rev 9759)
@@ -2099,27 +2099,3 @@
 	up_write(&nommu_region_sem);
 	return 0;
 }
-
-#ifdef CONFIG_SMP
-int map_kernel_range_noflush(unsigned long addr, unsigned long size,
-					pgprot_t prot, struct page **pages)
-{
-	return size >> PAGE_SHIFT;
-}
-
-void unmap_kernel_range_noflush(unsigned long addr, unsigned long size)
-{
-}
-
-struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
-					const size_t *sizes, int nr_vms,
-					size_t align)
-{
-	pr_warning("Cannot get vmalloc areas from blackfin SMP kernel\n");
-	return NULL;
-}
-
-void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms)
-{
-}
-#endif
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to