aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-10-15 07:46:29 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-15 07:46:29 -0400
commitb2aaf8f74cdc84a9182f6cabf198b7763bcb9d40 (patch)
tree53ccb1c2c14751fe69cf93102e76e97021f6df07 /init
parent4f962d4d65923d7b722192e729840cfb79af0a5a (diff)
parent278429cff8809958d25415ba0ed32b59866ab1a8 (diff)
Merge branch 'linus' into stackprotector
Conflicts: arch/x86/kernel/Makefile include/asm-x86/pda.h
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig57
-rw-r--r--init/calibrate.c60
-rw-r--r--init/do_mounts.c10
-rw-r--r--init/do_mounts.h1
-rw-r--r--init/do_mounts_md.c40
-rw-r--r--init/do_mounts_rd.c37
-rw-r--r--init/initramfs.c22
-rw-r--r--init/main.c54
-rw-r--r--init/version.c3
9 files changed, 121 insertions, 163 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 6199d1120900..8a8e2d00c40e 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -171,7 +171,7 @@ config BSD_PROCESS_ACCT_V3
171 process and it's parent. Note that this file format is incompatible 171 process and it's parent. Note that this file format is incompatible
172 with previous v0/v1/v2 file formats, so you will need updated tools 172 with previous v0/v1/v2 file formats, so you will need updated tools
173 for processing it. A preliminary version of these tools is available 173 for processing it. A preliminary version of these tools is available
174 at <http://www.physik3.uni-rostock.de/tim/kernel/utils/acct/>. 174 at <http://www.gnu.org/software/acct/>.
175 175
176config TASKSTATS 176config TASKSTATS
177 bool "Export task/process statistics through netlink (EXPERIMENTAL)" 177 bool "Export task/process statistics through netlink (EXPERIMENTAL)"
@@ -486,7 +486,7 @@ config PID_NS
486 default n 486 default n
487 depends on NAMESPACES && EXPERIMENTAL 487 depends on NAMESPACES && EXPERIMENTAL
488 help 488 help
489 Suport process id namespaces. This allows having multiple 489 Support process id namespaces. This allows having multiple
490 process with the same pid as long as they are in different 490 process with the same pid as long as they are in different
491 pid namespaces. This is a building block of containers. 491 pid namespaces. This is a building block of containers.
492 492
@@ -522,7 +522,7 @@ config CC_OPTIMIZE_FOR_SIZE
522 Enabling this option will pass "-Os" instead of "-O2" to gcc 522 Enabling this option will pass "-Os" instead of "-O2" to gcc
523 resulting in a smaller kernel. 523 resulting in a smaller kernel.
524 524
525 If unsure, say N. 525 If unsure, say Y.
526 526
527config SYSCTL 527config SYSCTL
528 bool 528 bool
@@ -558,17 +558,6 @@ config SYSCTL_SYSCALL
558 558
559 If unsure say Y here. 559 If unsure say Y here.
560 560
561config SYSCTL_SYSCALL_CHECK
562 bool "Sysctl checks" if EMBEDDED
563 depends on SYSCTL_SYSCALL
564 default y
565 ---help---
566 sys_sysctl uses binary paths that have been found challenging
567 to properly maintain and use. This enables checks that help
568 you to keep things correct.
569
570 If unsure say Y here.
571
572config KALLSYMS 561config KALLSYMS
573 bool "Load all symbols for debugging/ksymoops" if EMBEDDED 562 bool "Load all symbols for debugging/ksymoops" if EMBEDDED
574 default y 563 default y
@@ -790,18 +779,12 @@ config MARKERS
790 779
791source "arch/Kconfig" 780source "arch/Kconfig"
792 781
793config PROC_PAGE_MONITOR
794 default y
795 depends on PROC_FS && MMU
796 bool "Enable /proc page monitoring" if EMBEDDED
797 help
798 Various /proc files exist to monitor process memory utilization:
799 /proc/pid/smaps, /proc/pid/clear_refs, /proc/pid/pagemap,
800 /proc/kpagecount, and /proc/kpageflags. Disabling these
801 interfaces will reduce the size of the kernel by approximately 4kb.
802
803endmenu # General setup 782endmenu # General setup
804 783
784config HAVE_GENERIC_DMA_COHERENT
785 bool
786 default n
787
805config SLABINFO 788config SLABINFO
806 bool 789 bool
807 depends on PROC_FS 790 depends on PROC_FS
@@ -841,9 +824,10 @@ menuconfig MODULES
841 824
842 If unsure, say Y. 825 If unsure, say Y.
843 826
827if MODULES
828
844config MODULE_FORCE_LOAD 829config MODULE_FORCE_LOAD
845 bool "Forced module loading" 830 bool "Forced module loading"
846 depends on MODULES
847 default n 831 default n
848 help 832 help
849 Allow loading of modules without version information (ie. modprobe 833 Allow loading of modules without version information (ie. modprobe
@@ -852,12 +836,11 @@ config MODULE_FORCE_LOAD
852 836
853config MODULE_UNLOAD 837config MODULE_UNLOAD
854 bool "Module unloading" 838 bool "Module unloading"
855 depends on MODULES
856 help 839 help
857 Without this option you will not be able to unload any 840 Without this option you will not be able to unload any
858 modules (note that some modules may not be unloadable 841 modules (note that some modules may not be unloadable
859 anyway), which makes your kernel slightly smaller and 842 anyway), which makes your kernel smaller, faster
860 simpler. If unsure, say Y. 843 and simpler. If unsure, say Y.
861 844
862config MODULE_FORCE_UNLOAD 845config MODULE_FORCE_UNLOAD
863 bool "Forced module unloading" 846 bool "Forced module unloading"
@@ -871,7 +854,6 @@ config MODULE_FORCE_UNLOAD
871 854
872config MODVERSIONS 855config MODVERSIONS
873 bool "Module versioning support" 856 bool "Module versioning support"
874 depends on MODULES
875 help 857 help
876 Usually, you have to use modules compiled with your kernel. 858 Usually, you have to use modules compiled with your kernel.
877 Saying Y here makes it sometimes possible to use modules 859 Saying Y here makes it sometimes possible to use modules
@@ -882,7 +864,6 @@ config MODVERSIONS
882 864
883config MODULE_SRCVERSION_ALL 865config MODULE_SRCVERSION_ALL
884 bool "Source checksum for all modules" 866 bool "Source checksum for all modules"
885 depends on MODULES
886 help 867 help
887 Modules which contain a MODULE_VERSION get an extra "srcversion" 868 Modules which contain a MODULE_VERSION get an extra "srcversion"
888 field inserted into their modinfo section, which contains a 869 field inserted into their modinfo section, which contains a
@@ -893,16 +874,12 @@ config MODULE_SRCVERSION_ALL
893 will be created for all modules. If unsure, say N. 874 will be created for all modules. If unsure, say N.
894 875
895config KMOD 876config KMOD
896 bool "Automatic kernel module loading" 877 def_bool y
897 depends on MODULES 878 help
898 help 879 This is being removed soon. These days, CONFIG_MODULES
899 Normally when you have selected some parts of the kernel to 880 implies CONFIG_KMOD, so use that instead.
900 be created as kernel modules, you must load them (using the 881
901 "modprobe" command) before you can use them. If you say Y 882endif # MODULES
902 here, some parts of the kernel will be able to load modules
903 automatically: when a part of the kernel needs a module, it
904 runs modprobe with the appropriate arguments, thereby
905 loading the module if it is available. If unsure, say Y.
906 883
907config STOP_MACHINE 884config STOP_MACHINE
908 bool 885 bool
diff --git a/init/calibrate.c b/init/calibrate.c
index ecb3822d4f70..a379c9061199 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -8,7 +8,9 @@
8#include <linux/delay.h> 8#include <linux/delay.h>
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/timex.h> 10#include <linux/timex.h>
11#include <linux/smp.h>
11 12
13unsigned long lpj_fine;
12unsigned long preset_lpj; 14unsigned long preset_lpj;
13static int __init lpj_setup(char *str) 15static int __init lpj_setup(char *str)
14{ 16{
@@ -33,9 +35,9 @@ static unsigned long __cpuinit calibrate_delay_direct(void)
33 unsigned long pre_start, start, post_start; 35 unsigned long pre_start, start, post_start;
34 unsigned long pre_end, end, post_end; 36 unsigned long pre_end, end, post_end;
35 unsigned long start_jiffies; 37 unsigned long start_jiffies;
36 unsigned long tsc_rate_min, tsc_rate_max; 38 unsigned long timer_rate_min, timer_rate_max;
37 unsigned long good_tsc_sum = 0; 39 unsigned long good_timer_sum = 0;
38 unsigned long good_tsc_count = 0; 40 unsigned long good_timer_count = 0;
39 int i; 41 int i;
40 42
41 if (read_current_timer(&pre_start) < 0 ) 43 if (read_current_timer(&pre_start) < 0 )
@@ -79,22 +81,24 @@ static unsigned long __cpuinit calibrate_delay_direct(void)
79 } 81 }
80 read_current_timer(&post_end); 82 read_current_timer(&post_end);
81 83
82 tsc_rate_max = (post_end - pre_start) / DELAY_CALIBRATION_TICKS; 84 timer_rate_max = (post_end - pre_start) /
83 tsc_rate_min = (pre_end - post_start) / DELAY_CALIBRATION_TICKS; 85 DELAY_CALIBRATION_TICKS;
86 timer_rate_min = (pre_end - post_start) /
87 DELAY_CALIBRATION_TICKS;
84 88
85 /* 89 /*
86 * If the upper limit and lower limit of the tsc_rate is 90 * If the upper limit and lower limit of the timer_rate is
87 * >= 12.5% apart, redo calibration. 91 * >= 12.5% apart, redo calibration.
88 */ 92 */
89 if (pre_start != 0 && pre_end != 0 && 93 if (pre_start != 0 && pre_end != 0 &&
90 (tsc_rate_max - tsc_rate_min) < (tsc_rate_max >> 3)) { 94 (timer_rate_max - timer_rate_min) < (timer_rate_max >> 3)) {
91 good_tsc_count++; 95 good_timer_count++;
92 good_tsc_sum += tsc_rate_max; 96 good_timer_sum += timer_rate_max;
93 } 97 }
94 } 98 }
95 99
96 if (good_tsc_count) 100 if (good_timer_count)
97 return (good_tsc_sum/good_tsc_count); 101 return (good_timer_sum/good_timer_count);
98 102
99 printk(KERN_WARNING "calibrate_delay_direct() failed to get a good " 103 printk(KERN_WARNING "calibrate_delay_direct() failed to get a good "
100 "estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n"); 104 "estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");
@@ -108,6 +112,10 @@ static unsigned long __cpuinit calibrate_delay_direct(void) {return 0;}
108 * This is the number of bits of precision for the loops_per_jiffy. Each 112 * This is the number of bits of precision for the loops_per_jiffy. Each
109 * bit takes on average 1.5/HZ seconds. This (like the original) is a little 113 * bit takes on average 1.5/HZ seconds. This (like the original) is a little
110 * better than 1% 114 * better than 1%
115 * For the boot cpu we can skip the delay calibration and assign it a value
116 * calculated based on the timer frequency.
117 * For the rest of the CPUs we cannot assume that the timer frequency is same as
118 * the cpu frequency, hence do the calibration for those.
111 */ 119 */
112#define LPS_PREC 8 120#define LPS_PREC 8
113 121
@@ -118,20 +126,20 @@ void __cpuinit calibrate_delay(void)
118 126
119 if (preset_lpj) { 127 if (preset_lpj) {
120 loops_per_jiffy = preset_lpj; 128 loops_per_jiffy = preset_lpj;
121 printk("Calibrating delay loop (skipped)... " 129 printk(KERN_INFO
122 "%lu.%02lu BogoMIPS preset\n", 130 "Calibrating delay loop (skipped) preset value.. ");
123 loops_per_jiffy/(500000/HZ), 131 } else if ((smp_processor_id() == 0) && lpj_fine) {
124 (loops_per_jiffy/(5000/HZ)) % 100); 132 loops_per_jiffy = lpj_fine;
133 printk(KERN_INFO
134 "Calibrating delay loop (skipped), "
135 "value calculated using timer frequency.. ");
125 } else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) { 136 } else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) {
126 printk("Calibrating delay using timer specific routine.. "); 137 printk(KERN_INFO
127 printk("%lu.%02lu BogoMIPS (lpj=%lu)\n", 138 "Calibrating delay using timer specific routine.. ");
128 loops_per_jiffy/(500000/HZ),
129 (loops_per_jiffy/(5000/HZ)) % 100,
130 loops_per_jiffy);
131 } else { 139 } else {
132 loops_per_jiffy = (1<<12); 140 loops_per_jiffy = (1<<12);
133 141
134 printk(KERN_DEBUG "Calibrating delay loop... "); 142 printk(KERN_INFO "Calibrating delay loop... ");
135 while ((loops_per_jiffy <<= 1) != 0) { 143 while ((loops_per_jiffy <<= 1) != 0) {
136 /* wait for "start of" clock tick */ 144 /* wait for "start of" clock tick */
137 ticks = jiffies; 145 ticks = jiffies;
@@ -161,12 +169,8 @@ void __cpuinit calibrate_delay(void)
161 if (jiffies != ticks) /* longer than 1 tick */ 169 if (jiffies != ticks) /* longer than 1 tick */
162 loops_per_jiffy &= ~loopbit; 170 loops_per_jiffy &= ~loopbit;
163 } 171 }
164
165 /* Round the value and print it */
166 printk("%lu.%02lu BogoMIPS (lpj=%lu)\n",
167 loops_per_jiffy/(500000/HZ),
168 (loops_per_jiffy/(5000/HZ)) % 100,
169 loops_per_jiffy);
170 } 172 }
171 173 printk(KERN_CONT "%lu.%02lu BogoMIPS (lpj=%lu)\n",
174 loops_per_jiffy/(500000/HZ),
175 (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
172} 176}
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 660c1e50c91b..d055b1914c3d 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -12,6 +12,7 @@
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/fs.h> 14#include <linux/fs.h>
15#include <linux/initrd.h>
15 16
16#include <linux/nfs_fs.h> 17#include <linux/nfs_fs.h>
17#include <linux/nfs_fs_sb.h> 18#include <linux/nfs_fs_sb.h>
@@ -22,7 +23,7 @@
22int __initdata rd_doload; /* 1 = load RAM disk, 0 = don't load */ 23int __initdata rd_doload; /* 1 = load RAM disk, 0 = don't load */
23 24
24int root_mountflags = MS_RDONLY | MS_SILENT; 25int root_mountflags = MS_RDONLY | MS_SILENT;
25char * __initdata root_device_name; 26static char * __initdata root_device_name;
26static char __initdata saved_root_name[64]; 27static char __initdata saved_root_name[64];
27static int __initdata root_wait; 28static int __initdata root_wait;
28 29
@@ -262,6 +263,10 @@ retry:
262 printk("Please append a correct \"root=\" boot option; here are the available partitions:\n"); 263 printk("Please append a correct \"root=\" boot option; here are the available partitions:\n");
263 264
264 printk_all_partitions(); 265 printk_all_partitions();
266#ifdef CONFIG_DEBUG_BLOCK_EXT_DEVT
267 printk("DEBUG_BLOCK_EXT_DEVT is enabled, you need to specify "
268 "explicit textual name for \"root=\" boot option.\n");
269#endif
265 panic("VFS: Unable to mount root fs on %s", b); 270 panic("VFS: Unable to mount root fs on %s", b);
266 } 271 }
267 272
@@ -372,7 +377,8 @@ void __init prepare_namespace(void)
372 377
373 if (saved_root_name[0]) { 378 if (saved_root_name[0]) {
374 root_device_name = saved_root_name; 379 root_device_name = saved_root_name;
375 if (!strncmp(root_device_name, "mtd", 3)) { 380 if (!strncmp(root_device_name, "mtd", 3) ||
381 !strncmp(root_device_name, "ubi", 3)) {
376 mount_block_root(root_device_name, root_mountflags); 382 mount_block_root(root_device_name, root_mountflags);
377 goto out; 383 goto out;
378 } 384 }
diff --git a/init/do_mounts.h b/init/do_mounts.h
index 735705d137ff..9aa968d54329 100644
--- a/init/do_mounts.h
+++ b/init/do_mounts.h
@@ -11,7 +11,6 @@ void change_floppy(char *fmt, ...);
11void mount_block_root(char *name, int flags); 11void mount_block_root(char *name, int flags);
12void mount_root(void); 12void mount_root(void);
13extern int root_mountflags; 13extern int root_mountflags;
14extern char *root_device_name;
15 14
16static inline int create_dev(char *name, dev_t dev) 15static inline int create_dev(char *name, dev_t dev)
17{ 16{
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
index 693d24694a6c..48b3fadd83ed 100644
--- a/init/do_mounts_md.c
+++ b/init/do_mounts_md.c
@@ -12,7 +12,12 @@
12 * The code for that is here. 12 * The code for that is here.
13 */ 13 */
14 14
15static int __initdata raid_noautodetect, raid_autopart; 15#ifdef CONFIG_MD_AUTODETECT
16static int __initdata raid_noautodetect;
17#else
18static int __initdata raid_noautodetect=1;
19#endif
20static int __initdata raid_autopart;
16 21
17static struct { 22static struct {
18 int minor; 23 int minor;
@@ -252,6 +257,8 @@ static int __init raid_setup(char *str)
252 257
253 if (!strncmp(str, "noautodetect", wlen)) 258 if (!strncmp(str, "noautodetect", wlen))
254 raid_noautodetect = 1; 259 raid_noautodetect = 1;
260 if (!strncmp(str, "autodetect", wlen))
261 raid_noautodetect = 0;
255 if (strncmp(str, "partitionable", wlen)==0) 262 if (strncmp(str, "partitionable", wlen)==0)
256 raid_autopart = 1; 263 raid_autopart = 1;
257 if (strncmp(str, "part", wlen)==0) 264 if (strncmp(str, "part", wlen)==0)
@@ -264,17 +271,32 @@ static int __init raid_setup(char *str)
264__setup("raid=", raid_setup); 271__setup("raid=", raid_setup);
265__setup("md=", md_setup); 272__setup("md=", md_setup);
266 273
274static void autodetect_raid(void)
275{
276 int fd;
277
278 /*
279 * Since we don't want to detect and use half a raid array, we need to
280 * wait for the known devices to complete their probing
281 */
282 printk(KERN_INFO "md: Waiting for all devices to be available before autodetect\n");
283 printk(KERN_INFO "md: If you don't use raid, use raid=noautodetect\n");
284 while (driver_probe_done() < 0)
285 msleep(100);
286 fd = sys_open("/dev/md0", 0, 0);
287 if (fd >= 0) {
288 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
289 sys_close(fd);
290 }
291}
292
267void __init md_run_setup(void) 293void __init md_run_setup(void)
268{ 294{
269 create_dev("/dev/md0", MKDEV(MD_MAJOR, 0)); 295 create_dev("/dev/md0", MKDEV(MD_MAJOR, 0));
296
270 if (raid_noautodetect) 297 if (raid_noautodetect)
271 printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=noautodetect)\n"); 298 printk(KERN_INFO "md: Skipping autodetection of RAID arrays. (raid=autodetect will force)\n");
272 else { 299 else
273 int fd = sys_open("/dev/md0", 0, 0); 300 autodetect_raid();
274 if (fd >= 0) {
275 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
276 sys_close(fd);
277 }
278 }
279 md_setup_drive(); 301 md_setup_drive();
280} 302}
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index 46dfd64ae8fb..fedef93b586f 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -10,8 +10,6 @@
10 10
11#include "do_mounts.h" 11#include "do_mounts.h"
12 12
13#define BUILD_CRAMDISK
14
15int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */ 13int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */
16 14
17static int __init prompt_ramdisk(char *str) 15static int __init prompt_ramdisk(char *str)
@@ -162,14 +160,8 @@ int __init rd_load_image(char *from)
162 goto done; 160 goto done;
163 161
164 if (nblocks == 0) { 162 if (nblocks == 0) {
165#ifdef BUILD_CRAMDISK
166 if (crd_load(in_fd, out_fd) == 0) 163 if (crd_load(in_fd, out_fd) == 0)
167 goto successful_load; 164 goto successful_load;
168#else
169 printk(KERN_NOTICE
170 "RAMDISK: Kernel does not support compressed "
171 "RAM disk images\n");
172#endif
173 goto done; 165 goto done;
174 } 166 }
175 167
@@ -267,8 +259,6 @@ int __init rd_load_disk(int n)
267 return rd_load_image("/dev/root"); 259 return rd_load_image("/dev/root");
268} 260}
269 261
270#ifdef BUILD_CRAMDISK
271
272/* 262/*
273 * gzip declarations 263 * gzip declarations
274 */ 264 */
@@ -313,32 +303,11 @@ static int crd_infd, crd_outfd;
313 303
314static int __init fill_inbuf(void); 304static int __init fill_inbuf(void);
315static void __init flush_window(void); 305static void __init flush_window(void);
316static void __init *malloc(size_t size);
317static void __init free(void *where);
318static void __init error(char *m); 306static void __init error(char *m);
319static void __init gzip_mark(void **);
320static void __init gzip_release(void **);
321
322#include "../lib/inflate.c"
323 307
324static void __init *malloc(size_t size) 308#define NO_INFLATE_MALLOC
325{
326 return kmalloc(size, GFP_KERNEL);
327}
328
329static void __init free(void *where)
330{
331 kfree(where);
332}
333
334static void __init gzip_mark(void **ptr)
335{
336}
337
338static void __init gzip_release(void **ptr)
339{
340}
341 309
310#include "../lib/inflate.c"
342 311
343/* =========================================================================== 312/* ===========================================================================
344 * Fill the input buffer. This is called only when the buffer is empty 313 * Fill the input buffer. This is called only when the buffer is empty
@@ -425,5 +394,3 @@ static int __init crd_load(int in_fd, int out_fd)
425 kfree(window); 394 kfree(window);
426 return result; 395 return result;
427} 396}
428
429#endif /* BUILD_CRAMDISK */
diff --git a/init/initramfs.c b/init/initramfs.c
index 8eeeccb328c9..644fc01ad5f0 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -14,16 +14,6 @@ static void __init error(char *x)
14 message = x; 14 message = x;
15} 15}
16 16
17static void __init *malloc(size_t size)
18{
19 return kmalloc(size, GFP_KERNEL);
20}
21
22static void __init free(void *where)
23{
24 kfree(where);
25}
26
27/* link hash */ 17/* link hash */
28 18
29#define N_ALIGN(len) ((((len) + 1) & ~3) + 2) 19#define N_ALIGN(len) ((((len) + 1) & ~3) + 2)
@@ -407,18 +397,10 @@ static long bytes_out;
407 397
408static void __init flush_window(void); 398static void __init flush_window(void);
409static void __init error(char *m); 399static void __init error(char *m);
410static void __init gzip_mark(void **);
411static void __init gzip_release(void **);
412 400
413#include "../lib/inflate.c" 401#define NO_INFLATE_MALLOC
414 402
415static void __init gzip_mark(void **ptr) 403#include "../lib/inflate.c"
416{
417}
418
419static void __init gzip_release(void **ptr)
420{
421}
422 404
423/* =========================================================================== 405/* ===========================================================================
424 * Write the output window window[0..outcnt-1] and update crc and bytes_out. 406 * Write the output window window[0..outcnt-1] and update crc and bytes_out.
diff --git a/init/main.c b/init/main.c
index b44e4eb0f5e3..6aaff34a38c0 100644
--- a/init/main.c
+++ b/init/main.c
@@ -23,7 +23,6 @@
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/smp_lock.h> 24#include <linux/smp_lock.h>
25#include <linux/initrd.h> 25#include <linux/initrd.h>
26#include <linux/hdreg.h>
27#include <linux/bootmem.h> 26#include <linux/bootmem.h>
28#include <linux/tty.h> 27#include <linux/tty.h>
29#include <linux/gfp.h> 28#include <linux/gfp.h>
@@ -32,6 +31,7 @@
32#include <linux/kernel_stat.h> 31#include <linux/kernel_stat.h>
33#include <linux/start_kernel.h> 32#include <linux/start_kernel.h>
34#include <linux/security.h> 33#include <linux/security.h>
34#include <linux/smp.h>
35#include <linux/workqueue.h> 35#include <linux/workqueue.h>
36#include <linux/profile.h> 36#include <linux/profile.h>
37#include <linux/rcupdate.h> 37#include <linux/rcupdate.h>
@@ -87,8 +87,6 @@ extern void init_IRQ(void);
87extern void fork_init(unsigned long); 87extern void fork_init(unsigned long);
88extern void mca_init(void); 88extern void mca_init(void);
89extern void sbus_init(void); 89extern void sbus_init(void);
90extern void pidhash_init(void);
91extern void pidmap_init(void);
92extern void prio_tree_init(void); 90extern void prio_tree_init(void);
93extern void radix_tree_init(void); 91extern void radix_tree_init(void);
94extern void free_initmem(void); 92extern void free_initmem(void);
@@ -415,6 +413,13 @@ static void __init smp_init(void)
415{ 413{
416 unsigned int cpu; 414 unsigned int cpu;
417 415
416 /*
417 * Set up the current CPU as possible to migrate to.
418 * The other ones will be done by cpu_up/cpu_down()
419 */
420 cpu = smp_processor_id();
421 cpu_set(cpu, cpu_active_map);
422
418 /* FIXME: This should be done in userspace --RR */ 423 /* FIXME: This should be done in userspace --RR */
419 for_each_present_cpu(cpu) { 424 for_each_present_cpu(cpu) {
420 if (num_online_cpus() >= setup_max_cpus) 425 if (num_online_cpus() >= setup_max_cpus)
@@ -636,9 +641,11 @@ asmlinkage void __init start_kernel(void)
636 641
637#ifdef CONFIG_BLK_DEV_INITRD 642#ifdef CONFIG_BLK_DEV_INITRD
638 if (initrd_start && !initrd_below_start_ok && 643 if (initrd_start && !initrd_below_start_ok &&
639 initrd_start < min_low_pfn << PAGE_SHIFT) { 644 page_to_pfn(virt_to_page((void *)initrd_start)) < min_low_pfn) {
640 printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - " 645 printk(KERN_CRIT "initrd overwritten (0x%08lx < 0x%08lx) - "
641 "disabling it.\n",initrd_start,min_low_pfn << PAGE_SHIFT); 646 "disabling it.\n",
647 page_to_pfn(virt_to_page((void *)initrd_start)),
648 min_low_pfn);
642 initrd_start = 0; 649 initrd_start = 0;
643 } 650 }
644#endif 651#endif
@@ -691,7 +698,7 @@ asmlinkage void __init start_kernel(void)
691 rest_init(); 698 rest_init();
692} 699}
693 700
694static int __initdata initcall_debug; 701static int initcall_debug;
695 702
696static int __init initcall_debug_setup(char *str) 703static int __init initcall_debug_setup(char *str)
697{ 704{
@@ -700,7 +707,7 @@ static int __init initcall_debug_setup(char *str)
700} 707}
701__setup("initcall_debug", initcall_debug_setup); 708__setup("initcall_debug", initcall_debug_setup);
702 709
703static void __init do_one_initcall(initcall_t fn) 710int do_one_initcall(initcall_t fn)
704{ 711{
705 int count = preempt_count(); 712 int count = preempt_count();
706 ktime_t t0, t1, delta; 713 ktime_t t0, t1, delta;
@@ -708,7 +715,7 @@ static void __init do_one_initcall(initcall_t fn)
708 int result; 715 int result;
709 716
710 if (initcall_debug) { 717 if (initcall_debug) {
711 print_fn_descriptor_symbol("calling %s\n", fn); 718 printk("calling %pF @ %i\n", fn, task_pid_nr(current));
712 t0 = ktime_get(); 719 t0 = ktime_get();
713 } 720 }
714 721
@@ -718,8 +725,8 @@ static void __init do_one_initcall(initcall_t fn)
718 t1 = ktime_get(); 725 t1 = ktime_get();
719 delta = ktime_sub(t1, t0); 726 delta = ktime_sub(t1, t0);
720 727
721 print_fn_descriptor_symbol("initcall %s", fn); 728 printk("initcall %pF returned %d after %Ld msecs\n",
722 printk(" returned %d after %Ld msecs\n", result, 729 fn, result,
723 (unsigned long long) delta.tv64 >> 20); 730 (unsigned long long) delta.tv64 >> 20);
724 } 731 }
725 732
@@ -737,19 +744,20 @@ static void __init do_one_initcall(initcall_t fn)
737 local_irq_enable(); 744 local_irq_enable();
738 } 745 }
739 if (msgbuf[0]) { 746 if (msgbuf[0]) {
740 print_fn_descriptor_symbol(KERN_WARNING "initcall %s", fn); 747 printk("initcall %pF returned with %s\n", fn, msgbuf);
741 printk(" returned with %s\n", msgbuf);
742 } 748 }
749
750 return result;
743} 751}
744 752
745 753
746extern initcall_t __initcall_start[], __initcall_end[]; 754extern initcall_t __initcall_start[], __initcall_end[], __early_initcall_end[];
747 755
748static void __init do_initcalls(void) 756static void __init do_initcalls(void)
749{ 757{
750 initcall_t *call; 758 initcall_t *call;
751 759
752 for (call = __initcall_start; call < __initcall_end; call++) 760 for (call = __early_initcall_end; call < __initcall_end; call++)
753 do_one_initcall(*call); 761 do_one_initcall(*call);
754 762
755 /* Make sure there is no pending stuff from the initcall sequence */ 763 /* Make sure there is no pending stuff from the initcall sequence */
@@ -765,6 +773,7 @@ static void __init do_initcalls(void)
765 */ 773 */
766static void __init do_basic_setup(void) 774static void __init do_basic_setup(void)
767{ 775{
776 rcu_init_sched(); /* needed by module_init stage. */
768 /* drivers will send hotplug events */ 777 /* drivers will send hotplug events */
769 init_workqueues(); 778 init_workqueues();
770 usermodehelper_init(); 779 usermodehelper_init();
@@ -773,23 +782,12 @@ static void __init do_basic_setup(void)
773 do_initcalls(); 782 do_initcalls();
774} 783}
775 784
776static int __initdata nosoftlockup;
777
778static int __init nosoftlockup_setup(char *str)
779{
780 nosoftlockup = 1;
781 return 1;
782}
783__setup("nosoftlockup", nosoftlockup_setup);
784
785static void __init do_pre_smp_initcalls(void) 785static void __init do_pre_smp_initcalls(void)
786{ 786{
787 extern int spawn_ksoftirqd(void); 787 initcall_t *call;
788 788
789 migration_init(); 789 for (call = __initcall_start; call < __early_initcall_end; call++)
790 spawn_ksoftirqd(); 790 do_one_initcall(*call);
791 if (!nosoftlockup)
792 spawn_softlockup_task();
793} 791}
794 792
795static void run_init_process(char *init_filename) 793static void run_init_process(char *init_filename)
diff --git a/init/version.c b/init/version.c
index 9d17d70ee02d..52a8b98642b8 100644
--- a/init/version.c
+++ b/init/version.c
@@ -13,10 +13,13 @@
13#include <linux/utsrelease.h> 13#include <linux/utsrelease.h>
14#include <linux/version.h> 14#include <linux/version.h>
15 15
16#ifndef CONFIG_KALLSYMS
16#define version(a) Version_ ## a 17#define version(a) Version_ ## a
17#define version_string(a) version(a) 18#define version_string(a) version(a)
18 19
20extern int version_string(LINUX_VERSION_CODE);
19int version_string(LINUX_VERSION_CODE); 21int version_string(LINUX_VERSION_CODE);
22#endif
20 23
21struct uts_namespace init_uts_ns = { 24struct uts_namespace init_uts_ns = {
22 .kref = { 25 .kref = {