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

1991/01151/ss/main.c (diff list | history)

1991/0115/sys/src/9/ss/main.c:71,801991/01151/sys/src/9/ss/main.c:71,77 (short | long | prev | next)
1990/1223    
	memset(m, 0, sizeof(Mach)); 
	m->machno = n; 
	m->mmask = 1<<m->machno; 
#ifdef adsf 
	m->fpstate = FPinit; 
	fprestore(&initfp); 
#endif 
} 
 
void 
1991/0115/sys/src/9/ss/main.c:109,1141991/01151/sys/src/9/ss/main.c:106,112
1990/1223    
	p = newproc(); 
	p->pgrp = newpgrp(); 
	strcpy(p->text, "*init*"); 
1991/01151    
	savefpregs(&initfp); 
1990/1223    
	p->fpstate = FPinit; 
 
	/* 
1991/0115/sys/src/9/ss/main.c:344,4061991/01151/sys/src/9/ss/main.c:342,345
1990/1231    
	lp->rp = (Etherpkt*)k->va; 
1991/0108    
	lp->ltp = lp->lrp+lp->nrrb; 
	lp->tp = lp->rp+lp->nrrb; 
1990/1223    
} 
                 
/* 
 *  set up floating point for a new process 
 */ 
void 
procsetup(Proc *p) 
{ 
#ifdef asdf 
	long fpnull; 
                 
	fpnull = 0; 
	splhi(); 
	m->fpstate = FPinit; 
	p->fpstate = FPinit; 
	fprestore((FPsave*)&fpnull); 
	spllo(); 
#endif 
} 
                 
/* 
 * Save the part of the process state. 
 */ 
void 
procsave(uchar *state, int len) 
{ 
#ifdef asdf 
	fpsave(&u->fpsave); 
	if(u->fpsave.type){ 
		if(u->fpsave.size > sizeof u->fpsave.junk) 
			panic("fpsize %d max %d\n", u->fpsave.size, sizeof u->fpsave.junk); 
		fpregsave(u->fpsave.reg); 
		u->p->fpstate = FPactive; 
		m->fpstate = FPdirty; 
	} 
#endif 
} 
                 
/* 
 *  Restore what procsave() saves 
 * 
 *  Procsave() makes sure that what state points to is long enough 
 */ 
void 
procrestore(Proc *p, uchar *state) 
{ 
#ifdef asdf 
	if(p->fpstate != m->fpstate){ 
		if(p->fpstate == FPinit){ 
			u->p->fpstate = FPinit; 
			fprestore(&initfp); 
			m->fpstate = FPinit; 
		}else{ 
			fpregrestore(u->fpsave.reg); 
			fprestore(&u->fpsave); 
			m->fpstate = FPdirty; 
		} 
	} 
#endif 
} 


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