From: Kenn H. <ke...@us...> - 2002-12-04 10:48:53
|
Update of /cvsroot/linux-vax/kernel-2.5/init In directory sc8-pr-cvs1:/tmp/cvs-serv4896/init Modified Files: main.c Log Message: Merge Linus' 2.5.6 release Index: main.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/init/main.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- main.c 29 Oct 2002 00:52:51 -0000 1.6 +++ main.c 4 Dec 2002 10:48:49 -0000 1.7 @@ -274,8 +274,35 @@ #define smp_init() do { } while (0) #endif +static inline void setup_per_cpu_areas(void) +{ +} #else +#ifndef __HAVE_ARCH_PER_CPU +unsigned long __per_cpu_offset[NR_CPUS]; + +static void __init setup_per_cpu_areas(void) +{ + unsigned long size, i; + char *ptr; + /* Created by linker magic */ + extern char __per_cpu_start[], __per_cpu_end[]; + + /* Copy section for each CPU (we discard the original) */ + size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES); + if (!size) + return; + + ptr = alloc_bootmem(size * NR_CPUS); + + for (i = 0; i < NR_CPUS; i++, ptr += size) { + __per_cpu_offset[i] = ptr - __per_cpu_start; + memcpy(ptr, __per_cpu_start, size); + } +} +#endif /* !__HAVE_ARCH_PER_CPU */ + /* Called by boot processor to activate the rest. */ static void __init smp_init(void) { @@ -318,6 +345,7 @@ lock_kernel(); printk(linux_banner); setup_arch(&command_line); + setup_per_cpu_areas(); printk("Kernel command line: %s\n", saved_command_line); parse_options(command_line); trap_init(); @@ -358,9 +386,8 @@ #endif mem_init(); kmem_cache_sizes_init(); -#if defined(CONFIG_X86_PAE) pgtable_cache_init(); -#endif + mempages = num_physpages; fork_init(mempages); @@ -382,6 +409,7 @@ printk("POSIX conformance testing by UNIFIX\n"); init_idle(current, smp_processor_id()); + /* * We count on the initial thread going ok * Like idlers init is an unlocked kernel thread, which will @@ -418,7 +446,12 @@ */ static void __init do_basic_setup(void) { - + /* + * Let the per-CPU migration threads start up: + */ +#if CONFIG_SMP + migration_init(); +#endif /* * Tell the world that we're going to be the grim * reaper of innocent orphaned children. @@ -460,6 +493,8 @@ static int init(void * unused) { + static char * argv_sh[] = { "sh", NULL, }; + lock_kernel(); do_basic_setup(); @@ -491,6 +526,6 @@ execve("/sbin/init",argv_init,envp_init); execve("/etc/init",argv_init,envp_init); execve("/bin/init",argv_init,envp_init); - execve("/bin/sh",argv_init,envp_init); + execve("/bin/sh",argv_sh,envp_init); panic("No init found. Try passing init= option to kernel."); } |