int timeout, cpu; 
int timeout; 
static void __init do_boot_cpu (int apicid){	struct task_struct *idle;	unsigned long boot_error;	int timeout, cpu;	unsigned long start_rip;	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);	x86_cpu_to_apicid[cpu] = apicid;	cpu_pda[cpu].pcurrent = idle;	start_rip = setup_trampoline();	init_rsp = idle->thread.rsp; 	per_cpu(init_tss,cpu).rsp0 = init_rsp;	initial_code = start_secondary;	clear_ti_thread_flag(idle->thread_info, TIF_FORK);	printk(KERN_INFO "Booting processor %d/%d rip %lx rsp %lx\n", cpu, apicid, 	       start_rip, init_rsp);	/*	 * This grunge runs the startup process for	 * the targeted processor.	 */	atomic_set(&init_deasserted, 0);	Dprintk("Setting warm reset code and vector.\n");	CMOS_WRITE(0xa, 0xf);	local_flush_tlb();	Dprintk("1.\n");	*((volatile unsigned short *) phys_to_virt(0x469)) = start_rip >> 4;	Dprintk("2.\n");	*((volatile unsigned short *) phys_to_virt(0x467)) = start_rip & 0xf;	Dprintk("3.\n");	/*	 * Be paranoid about clearing APIC errors.	 */	if (APIC_INTEGRATED(apic_version[apicid])) {		apic_read_around(APIC_SPIV);		apic_write(APIC_ESR, 0);		apic_read(APIC_ESR);	}	/*	 * Status is now clean	 */	boot_error = 0;	/*	 * Starting actual IPI sequence...	 */	boot_error = wakeup_secondary_via_INIT(apicid, start_rip); 	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");			print_cpu_info(&cpu_data[cpu]);			Dprintk("CPU has booted.\n");		} else {			boot_error = 1;			if (*((volatile unsigned char *)phys_to_virt(SMP_TRAMPOLINE_BASE))					== 0xA5)				/* trampoline started but...? */				printk("Stuck ??\n");			else				/* trampoline code not run */				printk("Not responding.\n");#if APIC_DEBUG			inquire_remote_apic(apicid);#endif		}	}	if (boot_error) {		cpu_clear(cpu, cpu_callout_map); /* was set here (do_boot_cpu()) */		clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */		cpucount--;		x86_cpu_to_apicid[cpu] = BAD_APICID;		x86_cpu_to_log_apicid[cpu] = BAD_APICID;	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a8ab26fe5bfeef43bdcde5182ca051ae0647607e/smpboot.c/buggy/arch/x86_64/kernel/smpboot.c