/* * Should we send STARTUP IPIs ? * * Determine this based on the APIC version. * If we don't have an integrated APIC, don't send the STARTUP IPIs. */ if (APIC_INTEGRATED(apic_version[phys_apicid])) num_starts = 2; else num_starts = 0; 
num_starts = 2; 
static int __cpuinit wakeup_secondary_via_INIT(int phys_apicid, unsigned int start_rip){	unsigned long send_status = 0, accept_status = 0;	int maxlvt, timeout, num_starts, j;	Dprintk("Asserting INIT.\n");	/*	 * Turn INIT on target chip	 */	apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(phys_apicid));	/*	 * Send IPI	 */	apic_write(APIC_ICR, APIC_INT_LEVELTRIG | APIC_INT_ASSERT				| APIC_DM_INIT);	Dprintk("Waiting for send to finish...\n");	timeout = 0;	do {		Dprintk("+");		udelay(100);		send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;	} while (send_status && (timeout++ < 1000));	mdelay(10);	Dprintk("Deasserting INIT.\n");	/* Target chip */	apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(phys_apicid));	/* Send IPI */	apic_write(APIC_ICR, APIC_INT_LEVELTRIG | APIC_DM_INIT);	Dprintk("Waiting for send to finish...\n");	timeout = 0;	do {		Dprintk("+");		udelay(100);		send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;	} while (send_status && (timeout++ < 1000));	atomic_set(&init_deasserted, 1);	/*	 * Should we send STARTUP IPIs ?	 *	 * Determine this based on the APIC version.	 * If we don't have an integrated APIC, don't send the STARTUP IPIs.	 */	if (APIC_INTEGRATED(apic_version[phys_apicid]))		num_starts = 2;	else		num_starts = 0;	/*	 * Run STARTUP IPI loop.	 */	Dprintk("#startup loops: %d.\n", num_starts);	maxlvt = get_maxlvt();	for (j = 1; j <= num_starts; j++) {		Dprintk("Sending STARTUP #%d.\n",j);		apic_read_around(APIC_SPIV);		apic_write(APIC_ESR, 0);		apic_read(APIC_ESR);		Dprintk("After apic_write.\n");		/*		 * STARTUP IPI		 */		/* Target chip */		apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(phys_apicid));		/* Boot on the stack */		/* Kick the second */		apic_write(APIC_ICR, APIC_DM_STARTUP | (start_rip >> 12));		/*		 * Give the other CPU some time to accept the IPI.		 */		udelay(300);		Dprintk("Startup point 1.\n");		Dprintk("Waiting for send to finish...\n");		timeout = 0;		do {			Dprintk("+");			udelay(100);			send_status = apic_read(APIC_ICR) & APIC_ICR_BUSY;		} while (send_status && (timeout++ < 1000));		/*		 * Give the other CPU some time to accept the IPI.		 */		udelay(200);		/*		 * Due to the Pentium erratum 3AP.		 */		if (maxlvt > 3) {			apic_read_around(APIC_SPIV);			apic_write(APIC_ESR, 0);		}		accept_status = (apic_read(APIC_ESR) & 0xEF);		if (send_status || accept_status)			break;	}	Dprintk("After Startup.\n");	if (send_status)		printk(KERN_ERR "APIC never delivered???\n");	if (accept_status)		printk(KERN_ERR "APIC delivery error (%lx).\n", accept_status);	return (send_status | accept_status);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/5a40b7c2abdedcf53c9a6ee790991acfcef5b6c7/smpboot.c/clean/arch/x86_64/kernel/smpboot.c