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

1990/0722/power/trap.c (diff list | history)

1990/0619/sys/src/9/power/trap.c:126,1451990/0722/sys/src/9/power/trap.c:126,151 (short | long | prev | next)
1990/0227    
		break; 
 
	case CCPU: 
		if(u->p->fpstate == FPinit) { 
1990/0722    
		if(u && u->p && u->p->fpstate == FPinit) { 
1990/0227    
			restfpregs(&initfp); 
			u->p->fpstate = FPactive; 
			ur->status |= CU1; 
			break; 
		} 
		if(u->p->fpstate == FPinactive) { 
1990/0722    
		if(u && u->p && u->p->fpstate == FPinactive) { 
1990/0227    
			restfpregs(&u->fpsave); 
			u->p->fpstate = FPactive; 
			ur->status |= CU1; 
			break; 
		} 
1990/0722    
		goto Default; 
1990/0227    
 
	default: 
1990/0722    
		if(u && u->p && u->p->fpstate == FPactive){ 
			savefpregs(&u->fpsave); 
			u->p->fpstate = FPinactive; 
			ur->status &= ~CU1; 
		} 
1990/0227    
	Default: 
		/* 
		 * This isn't good enough; can still deadlock because we may hold print's locks 
1990/0619/sys/src/9/power/trap.c:433,4391990/0722/sys/src/9/power/trap.c:439,445
1990/0227    
	 * guarantee anything about registers, 
	 */ 
	if(u->p->fpstate == FPactive) { 
		u->p->fpstate = FPinit;		/* BUG */ 
1990/0722    
		u->p->fpstate = FPinit; 
1990/0227    
		ur->status &= ~CU1; 
	} 
	spllo(); 


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