int timeout, cpu; 
int timeout; 
static int __devinit do_boot_cpu(int apicid)/* * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad * (ie clustered apic addressing mode), this is a LOGICAL apic ID. * Returns zero if CPU booted OK, else error code from wakeup_secondary_cpu. */{	struct task_struct *idle;	unsigned long boot_error;	int timeout, cpu;	unsigned long start_eip;	unsigned short nmi_high = 0, nmi_low = 0;	cpu = ++cpucount;	/*	 * We can't use kernel_thread since we must avoid to	 * reschedule the child.	 */	idle = fork_idle(cpu);	if (IS_ERR(idle))		panic("failed fork for CPU %d", cpu);	idle->thread.eip = (unsigned long) start_secondary;	/* start_eip had better be page-aligned! */	start_eip = setup_trampoline();	/* So we see what's up   */	printk("Booting processor %d/%d eip %lx\n", cpu, apicid, start_eip);	/* Stack for startup_32 can be just as for start_secondary onwards */	stack_start.esp = (void *) idle->thread.esp;	irq_ctx_init(cpu);	/*	 * This grunge runs the startup process for	 * the targeted processor.	 */	atomic_set(&init_deasserted, 0);	Dprintk("Setting warm reset code and vector.\n");	store_NMI_vector(&nmi_high, &nmi_low);	smpboot_setup_warm_reset_vector(start_eip);	/*	 * Starting actual IPI sequence...	 */	boot_error = wakeup_secondary_cpu(apicid, start_eip);	if (!boot_error) {		/*		 * allow APs to start initializing.		 */		Dprintk("Before Callout %d.\n", cpu);		cpu_set(cpu, cpu_callout_map);		Dprintk("After Callout %d.\n", cpu);		/*		 * Wait 5s total for a response		 */		for (timeout = 0; timeout < 50000; timeout++) {			if (cpu_isset(cpu, cpu_callin_map))				break;	/* It has booted */			udelay(100);		}		if (cpu_isset(cpu, cpu_callin_map)) {			/* number CPUs logically, starting from 1 (BSP is 0) */			Dprintk("OK.\n");			printk("CPU%d: ", cpu);			print_cpu_info(&cpu_data[cpu]);			Dprintk("CPU has booted.\n");		} else {			boot_error= 1;			if (*((volatile unsigned char *)trampoline_base)					== 0xA5)				/* trampoline started but...? */				printk("Stuck ??\n");			else				/* trampoline code not run */				printk("Not responding.\n");			inquire_remote_apic(apicid);		}	}	x86_cpu_to_apicid[cpu] = apicid;	if (boot_error) {		/* Try to put things back the way they were before ... */		unmap_cpu_to_logical_apicid(cpu);		cpu_clear(cpu, cpu_callout_map); /* was set here (do_boot_cpu()) */		cpu_clear(cpu, cpu_initialized); /* was set by cpu_init() */		cpucount--;	}	/* mark "stuck" area as not stuck */	*((volatile unsigned long *)trampoline_base) = 0;	return boot_error;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/e1367daf3eed5cd619ee88c9907e1e6ddaa58406/smpboot.c/clean/arch/i386/kernel/smpboot.c