git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
drivers/block/floppy.c: convert some #include <asm/ to #include <linux/
[safe/jmp/linux-2.6]
/
init
/
main.c
diff --git
a/init/main.c
b/init/main.c
index
8451878
..
a1ab78c
100644
(file)
--- a/
init/main.c
+++ b/
init/main.c
@@
-149,6
+149,20
@@
static int __init nosmp(char *str)
early_param("nosmp", nosmp);
early_param("nosmp", nosmp);
+/* this is hard limit */
+static int __init nrcpus(char *str)
+{
+ int nr_cpus;
+
+ get_option(&str, &nr_cpus);
+ if (nr_cpus > 0 && nr_cpus < nr_cpu_ids)
+ nr_cpu_ids = nr_cpus;
+
+ return 0;
+}
+
+early_param("nr_cpus", nrcpus);
+
static int __init maxcpus(char *str)
{
get_option(&str, &setup_max_cpus);
static int __init maxcpus(char *str)
{
get_option(&str, &setup_max_cpus);
@@
-160,7
+174,7
@@
static int __init maxcpus(char *str)
early_param("maxcpus", maxcpus);
#else
early_param("maxcpus", maxcpus);
#else
-const unsigned int setup_max_cpus = NR_CPUS;
+
static
const unsigned int setup_max_cpus = NR_CPUS;
#endif
/*
#endif
/*
@@
-416,7
+430,9
@@
static noinline void __init_refok rest_init(void)
kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
numa_default_policy();
pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES);
kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
numa_default_policy();
pid = kernel_thread(kthreadd, NULL, CLONE_FS | CLONE_FILES);
+ rcu_read_lock();
kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns);
kthreadd_task = find_task_by_pid_ns(pid, &init_pid_ns);
+ rcu_read_unlock();
unlock_kernel();
/*
unlock_kernel();
/*
@@
-602,7
+618,7
@@
asmlinkage void __init start_kernel(void)
local_irq_enable();
/* Interrupts are enabled now so all GFP allocations are safe. */
local_irq_enable();
/* Interrupts are enabled now so all GFP allocations are safe. */
-
set_gfp_allowed_mask(__GFP_BITS_MASK)
;
+
gfp_allowed_mask = __GFP_BITS_MASK
;
kmem_cache_init_late();
kmem_cache_init_late();
@@
-806,11
+822,6
@@
static noinline int init_post(void)
system_state = SYSTEM_RUNNING;
numa_default_policy();
system_state = SYSTEM_RUNNING;
numa_default_policy();
- if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
- printk(KERN_WARNING "Warning: unable to open an initial console.\n");
-
- (void) sys_dup(0);
- (void) sys_dup(0);
current->signal->flags |= SIGNAL_UNKILLABLE;
current->signal->flags |= SIGNAL_UNKILLABLE;
@@
-836,7
+847,8
@@
static noinline int init_post(void)
run_init_process("/bin/init");
run_init_process("/bin/sh");
run_init_process("/bin/init");
run_init_process("/bin/sh");
- panic("No init found. Try passing init= option to kernel.");
+ panic("No init found. Try passing init= option to kernel. "
+ "See Linux Documentation/init.txt for guidance.");
}
static int __init kernel_init(void * unused)
}
static int __init kernel_init(void * unused)
@@
-873,6
+885,12
@@
static int __init kernel_init(void * unused)
do_basic_setup();
do_basic_setup();
+ /* Open the /dev/console on the rootfs, this should never fail */
+ if (sys_open((const char __user *) "/dev/console", O_RDWR, 0) < 0)
+ printk(KERN_WARNING "Warning: unable to open an initial console.\n");
+
+ (void) sys_dup(0);
+ (void) sys_dup(0);
/*
* check if there is an early userspace init. If yes, let it do all
* the work
/*
* check if there is an early userspace init. If yes, let it do all
* the work