plan 9 kernel history: overview | file list | diff list

2001/0830/pc/mp.c (diff list | history)

2001/0527/sys/src/9/pc/mp.c:462,4672001/0830/sys/src/9/pc/mp.c:462,469 (short | long | prev | next)
1997/0327    
void 
mpinit(void) 
{ 
2001/0830    
	int ncpu; 
	char *cp; 
1997/0327    
	PCMP *pcmp; 
	uchar *e, *p; 
1997/0405    
	Apic *apic, *bpapic; 
2001/0527/sys/src/9/pc/mp.c:562,5722001/0830/sys/src/9/pc/mp.c:564,585
1997/0405    
	/* 
	 * Initialise the application processors. 
	 */ 
2001/0830    
	if(cp = getconf("*ncpu")){ 
		ncpu = strtol(cp, 0, 0); 
		if(ncpu < 1) 
			ncpu = 1; 
	} 
	else 
		ncpu = MaxAPICNO; 
1997/0405    
	memmove((void*)APBOOTSTRAP, apbootstrap, sizeof(apbootstrap)); 
	for(apic = mpapic; apic <= &mpapic[MaxAPICNO]; apic++){ 
2001/0830    
		if(ncpu <= 1) 
			break; 
1999/0402    
		if((apic->flags & (PcmpBP|PcmpEN)) == PcmpEN 
2001/0527    
		&& apic->type == PcmpPROCESSOR) 
2001/0830    
		&& apic->type == PcmpPROCESSOR){ 
1997/0405    
			mpstartap(apic); 
2001/0830    
			ncpu--; 
		} 
1997/0327    
	} 
 
	/* 
2001/0527/sys/src/9/pc/mp.c:631,6472001/0830/sys/src/9/pc/mp.c:644,674
1998/0910    
			continue; 
 
		/* 
1999/0402    
		 * Check not already enabled. This is a bad thing as it implies 
		 * the same device is requesting the same interrupt to be 
		 * enabled multiple times. The RDT read here is safe for now 
		 * as currently interrupts are never disabled once enabled. 
2001/0830    
		 * Check if already enabled. Multifunction devices may share 
		 * INT[A-D]# so, if already enabled, check the polarity matches 
		 * and the trigger is level. 
		 * 
		 * Should check the devices differ only in the function number, 
		 * but that can wait for the planned enable/disable rewrite. 
		 * The RDT read here is safe for now as currently interrupts 
		 * are never disabled once enabled. 
1998/0910    
		 */ 
		apic = aintr->apic; 
		ioapicrdtr(apic, aintr->intr->intin, 0, &lo); 
		if(!(lo & ApicIMASK)){ 
1999/0402    
			print("mpintrenable: multiple enable irq%d, tbdf %uX\n", 
				v->irq, tbdf); 
1998/0910    
			return -1; 
2001/0830    
			vno = lo & 0xFF; 
			n = mpintrinit(bus, aintr->intr, vno, v->irq); 
			n |= ApicLOGICAL; 
			if(n != lo || !(n & ApicLEVEL)){ 
				print("mpintrenable: multiple botch irq%d, tbdf %uX, lo %8.8uX, n %8.8uX\n", 
					v->irq, tbdf, lo, n); 
				return -1; 
			} 
 
			v->isr = lapicisr; 
			v->eoi = lapiceoi; 
 
			return vno; 
1997/0327    
		} 
 
1998/0910    
		/* 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)