aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-m32r/page.h
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2005-09-03 18:54:30 -0400
committerLinus Torvalds <torvalds@evo.osdl.org>2005-09-05 03:05:39 -0400
commitfd4fd5aac1282825195c6816ed40a2a6d42db5bf (patch)
tree5908cf4c88a7c9d69ea7bdc1c354d51b6ff47f86 /include/asm-m32r/page.h
parent28ae55c98e4d16eac9a05a8a259d7763ef3aeb18 (diff)
[PATCH] mm: consolidate get_order
Someone mentioned that almost all the architectures used basically the same implementation of get_order. This patch consolidates them into asm-generic/page.h and includes that in the appropriate places. The exceptions are ia64 and ppc which have their own (presumably optimised) versions. Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-m32r/page.h')
-rw-r--r--include/asm-m32r/page.h21
1 files changed, 2 insertions, 19 deletions
diff --git a/include/asm-m32r/page.h b/include/asm-m32r/page.h
index 1c6abb9f3f1f..4ab578876361 100644
--- a/include/asm-m32r/page.h
+++ b/include/asm-m32r/page.h
@@ -61,25 +61,6 @@ typedef struct { unsigned long pgprot; } pgprot_t;
61 61
62/* This handles the memory map.. */ 62/* This handles the memory map.. */
63 63
64#ifndef __ASSEMBLY__
65
66/* Pure 2^n version of get_order */
67static __inline__ int get_order(unsigned long size)
68{
69 int order;
70
71 size = (size - 1) >> (PAGE_SHIFT - 1);
72 order = -1;
73 do {
74 size >>= 1;
75 order++;
76 } while (size);
77
78 return order;
79}
80
81#endif /* __ASSEMBLY__ */
82
83#define __MEMORY_START CONFIG_MEMORY_START 64#define __MEMORY_START CONFIG_MEMORY_START
84#define __MEMORY_SIZE CONFIG_MEMORY_SIZE 65#define __MEMORY_SIZE CONFIG_MEMORY_SIZE
85 66
@@ -111,5 +92,7 @@ static __inline__ int get_order(unsigned long size)
111 92
112#endif /* __KERNEL__ */ 93#endif /* __KERNEL__ */
113 94
95#include <asm-generic/page.h>
96
114#endif /* _ASM_M32R_PAGE_H */ 97#endif /* _ASM_M32R_PAGE_H */
115 98