diff options
| author | Ingo Molnar <mingo@elte.hu> | 2010-03-01 03:28:53 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2010-03-01 03:28:58 -0500 |
| commit | e2f4699ac15fe36de1288505bc6e6e5a8603ab1b (patch) | |
| tree | 8078d3ff21eaa0a0ed6e446ac94f3681e831cad1 /lib | |
| parent | 1883c79a57a5fe25309007590cccb1b2782c41b2 (diff) | |
| parent | 30ff056c42c665b9ea535d8515890857ae382540 (diff) | |
Merge branch 'linus' into core/rcu
Merge reason: Backmerge latest upstream to queue up dependent fix in the
scheduler.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Kconfig.debug | 2 | ||||
| -rw-r--r-- | lib/hweight.c | 7 | ||||
| -rw-r--r-- | lib/lmb.c | 13 |
3 files changed, 19 insertions, 3 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 4cdab452bfe2..5e3407d997b2 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
| @@ -355,7 +355,7 @@ config SLUB_STATS | |||
| 355 | config DEBUG_KMEMLEAK | 355 | config DEBUG_KMEMLEAK |
| 356 | bool "Kernel memory leak detector" | 356 | bool "Kernel memory leak detector" |
| 357 | depends on DEBUG_KERNEL && EXPERIMENTAL && !MEMORY_HOTPLUG && \ | 357 | depends on DEBUG_KERNEL && EXPERIMENTAL && !MEMORY_HOTPLUG && \ |
| 358 | (X86 || ARM || PPC || S390) | 358 | (X86 || ARM || PPC || S390 || SUPERH) |
| 359 | 359 | ||
| 360 | select DEBUG_FS if SYSFS | 360 | select DEBUG_FS if SYSFS |
| 361 | select STACKTRACE if STACKTRACE_SUPPORT | 361 | select STACKTRACE if STACKTRACE_SUPPORT |
diff --git a/lib/hweight.c b/lib/hweight.c index 389424ecb129..63ee4eb1228d 100644 --- a/lib/hweight.c +++ b/lib/hweight.c | |||
| @@ -11,11 +11,18 @@ | |||
| 11 | 11 | ||
| 12 | unsigned int hweight32(unsigned int w) | 12 | unsigned int hweight32(unsigned int w) |
| 13 | { | 13 | { |
| 14 | #ifdef ARCH_HAS_FAST_MULTIPLIER | ||
| 15 | w -= (w >> 1) & 0x55555555; | ||
| 16 | w = (w & 0x33333333) + ((w >> 2) & 0x33333333); | ||
| 17 | w = (w + (w >> 4)) & 0x0f0f0f0f; | ||
| 18 | return (w * 0x01010101) >> 24; | ||
| 19 | #else | ||
| 14 | unsigned int res = w - ((w >> 1) & 0x55555555); | 20 | unsigned int res = w - ((w >> 1) & 0x55555555); |
| 15 | res = (res & 0x33333333) + ((res >> 2) & 0x33333333); | 21 | res = (res & 0x33333333) + ((res >> 2) & 0x33333333); |
| 16 | res = (res + (res >> 4)) & 0x0F0F0F0F; | 22 | res = (res + (res >> 4)) & 0x0F0F0F0F; |
| 17 | res = res + (res >> 8); | 23 | res = res + (res >> 8); |
| 18 | return (res + (res >> 16)) & 0x000000FF; | 24 | return (res + (res >> 16)) & 0x000000FF; |
| 25 | #endif | ||
| 19 | } | 26 | } |
| 20 | EXPORT_SYMBOL(hweight32); | 27 | EXPORT_SYMBOL(hweight32); |
| 21 | 28 | ||
| @@ -205,9 +205,8 @@ long lmb_add(u64 base, u64 size) | |||
| 205 | 205 | ||
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | long lmb_remove(u64 base, u64 size) | 208 | static long __lmb_remove(struct lmb_region *rgn, u64 base, u64 size) |
| 209 | { | 209 | { |
| 210 | struct lmb_region *rgn = &(lmb.memory); | ||
| 211 | u64 rgnbegin, rgnend; | 210 | u64 rgnbegin, rgnend; |
| 212 | u64 end = base + size; | 211 | u64 end = base + size; |
| 213 | int i; | 212 | int i; |
| @@ -254,6 +253,16 @@ long lmb_remove(u64 base, u64 size) | |||
| 254 | return lmb_add_region(rgn, end, rgnend - end); | 253 | return lmb_add_region(rgn, end, rgnend - end); |
| 255 | } | 254 | } |
| 256 | 255 | ||
| 256 | long lmb_remove(u64 base, u64 size) | ||
| 257 | { | ||
| 258 | return __lmb_remove(&lmb.memory, base, size); | ||
| 259 | } | ||
| 260 | |||
| 261 | long __init lmb_free(u64 base, u64 size) | ||
| 262 | { | ||
| 263 | return __lmb_remove(&lmb.reserved, base, size); | ||
| 264 | } | ||
| 265 | |||
| 257 | long __init lmb_reserve(u64 base, u64 size) | 266 | long __init lmb_reserve(u64 base, u64 size) |
| 258 | { | 267 | { |
| 259 | struct lmb_region *_rgn = &lmb.reserved; | 268 | struct lmb_region *_rgn = &lmb.reserved; |
