diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-09-03 18:54:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:05:39 -0400 |
commit | fd4fd5aac1282825195c6816ed40a2a6d42db5bf (patch) | |
tree | 5908cf4c88a7c9d69ea7bdc1c354d51b6ff47f86 /include/asm-m68knommu | |
parent | 28ae55c98e4d16eac9a05a8a259d7763ef3aeb18 (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-m68knommu')
-rw-r--r-- | include/asm-m68knommu/page.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/include/asm-m68knommu/page.h b/include/asm-m68knommu/page.h index ff6a9265ed1c..942dfbead27f 100644 --- a/include/asm-m68knommu/page.h +++ b/include/asm-m68knommu/page.h | |||
@@ -48,20 +48,6 @@ typedef struct { unsigned long pgprot; } pgprot_t; | |||
48 | /* to align the pointer to the (next) page boundary */ | 48 | /* to align the pointer to the (next) page boundary */ |
49 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) | 49 | #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) |
50 | 50 | ||
51 | /* Pure 2^n version of get_order */ | ||
52 | extern __inline__ int get_order(unsigned long size) | ||
53 | { | ||
54 | int order; | ||
55 | |||
56 | size = (size-1) >> (PAGE_SHIFT-1); | ||
57 | order = -1; | ||
58 | do { | ||
59 | size >>= 1; | ||
60 | order++; | ||
61 | } while (size); | ||
62 | return order; | ||
63 | } | ||
64 | |||
65 | extern unsigned long memory_start; | 51 | extern unsigned long memory_start; |
66 | extern unsigned long memory_end; | 52 | extern unsigned long memory_end; |
67 | 53 | ||
@@ -93,4 +79,6 @@ extern unsigned long memory_end; | |||
93 | 79 | ||
94 | #endif /* __KERNEL__ */ | 80 | #endif /* __KERNEL__ */ |
95 | 81 | ||
82 | #include <asm-generic/page.h> | ||
83 | |||
96 | #endif /* _M68KNOMMU_PAGE_H */ | 84 | #endif /* _M68KNOMMU_PAGE_H */ |