diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-03-14 20:19:51 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-03-14 20:23:41 -0400 |
commit | 5368a2be34b96fda9c05d79424fa63a73ead04ed (patch) | |
tree | 14051f2c2e82d802bef7d69913e82135eef67b4f /arch/x86/kernel | |
parent | 93dbda7cbcd70a0bd1a99f39f44a9ccde8ab9040 (diff) |
x86: move brk initialization out of #ifdef CONFIG_BLK_DEV_INITRD
Impact: build fix
The brk initialization functions were incorrectly located inside
an #ifdef CONFIG_VLK_DEV_INITRD block, causing the obvious build failure in
minimal configurations.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/setup.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index e6b742d2a3f5..b8329029c150 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -272,6 +272,35 @@ static inline void copy_edd(void) | |||
272 | } | 272 | } |
273 | #endif | 273 | #endif |
274 | 274 | ||
275 | void * __init extend_brk(size_t size, size_t align) | ||
276 | { | ||
277 | size_t mask = align - 1; | ||
278 | void *ret; | ||
279 | |||
280 | BUG_ON(_brk_start == 0); | ||
281 | BUG_ON(align & mask); | ||
282 | |||
283 | _brk_end = (_brk_end + mask) & ~mask; | ||
284 | BUG_ON((char *)(_brk_end + size) > __brk_limit); | ||
285 | |||
286 | ret = (void *)_brk_end; | ||
287 | _brk_end += size; | ||
288 | |||
289 | memset(ret, 0, size); | ||
290 | |||
291 | return ret; | ||
292 | } | ||
293 | |||
294 | static void __init reserve_brk(void) | ||
295 | { | ||
296 | if (_brk_end > _brk_start) | ||
297 | reserve_early(__pa(_brk_start), __pa(_brk_end), "BRK"); | ||
298 | |||
299 | /* Mark brk area as locked down and no longer taking any | ||
300 | new allocations */ | ||
301 | _brk_start = 0; | ||
302 | } | ||
303 | |||
275 | #ifdef CONFIG_BLK_DEV_INITRD | 304 | #ifdef CONFIG_BLK_DEV_INITRD |
276 | 305 | ||
277 | #ifdef CONFIG_X86_32 | 306 | #ifdef CONFIG_X86_32 |
@@ -340,34 +369,6 @@ static void __init relocate_initrd(void) | |||
340 | } | 369 | } |
341 | #endif | 370 | #endif |
342 | 371 | ||
343 | void * __init extend_brk(size_t size, size_t align) | ||
344 | { | ||
345 | size_t mask = align - 1; | ||
346 | void *ret; | ||
347 | |||
348 | BUG_ON(_brk_start == 0); | ||
349 | BUG_ON(align & mask); | ||
350 | |||
351 | _brk_end = (_brk_end + mask) & ~mask; | ||
352 | BUG_ON((char *)(_brk_end + size) > __brk_limit); | ||
353 | |||
354 | ret = (void *)_brk_end; | ||
355 | _brk_end += size; | ||
356 | |||
357 | memset(ret, 0, size); | ||
358 | |||
359 | return ret; | ||
360 | } | ||
361 | |||
362 | static void __init reserve_brk(void) | ||
363 | { | ||
364 | if (_brk_end > _brk_start) | ||
365 | reserve_early(__pa(_brk_start), __pa(_brk_end), "BRK"); | ||
366 | |||
367 | /* Mark brk area as locked down and no longer taking any new allocations */ | ||
368 | _brk_start = 0; | ||
369 | } | ||
370 | |||
371 | static void __init reserve_initrd(void) | 372 | static void __init reserve_initrd(void) |
372 | { | 373 | { |
373 | u64 ramdisk_image = boot_params.hdr.ramdisk_image; | 374 | u64 ramdisk_image = boot_params.hdr.ramdisk_image; |