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

1991/0927/port/fault.c (diff list | history)

1991/0927/sys/src/9/port/fault.c:8,131991/1105/sys/src/9/port/fault.c:8,15 (short | long | prev | next)
1990/0227    
 
1991/0705    
#define DPRINT 
 
1991/1105    
void	faultexit(char*); 
 
1990/1212    
int 
fault(ulong addr, int read) 
1990/0227    
{ 
1991/0927/sys/src/9/port/fault.c:160,1691991/1105/sys/src/9/port/fault.c:162,167
1991/0705    
	if(loadrec == 0) {			/* This is demand load */ 
		c = s->image->c; 
		qlock(&c->rdl); 
1991/0906    
		/* We are unable to correctly error up throught the kernel 
		 * during faults. Therefore note delivery is postponed until 
		 * we leave the system. Read errors cause the process to die. 
		 */ 
		while(waserror()) { 
			if(strcmp(u->error, errstrtab[Eintr]) == 0) 
				continue; 
1991/0927/sys/src/9/port/fault.c:170,1761991/1105/sys/src/9/port/fault.c:168,174
1991/0705    
			qunlock(&c->rdl); 
			kunmap(k); 
			putpage(new); 
			pexit("demand load I/O error", 0); 
1991/1105    
			faultexit("sys: demand load I/O error"); 
1991/0705    
		} 
 
		ask = s->flen-soff; 
1991/0927/sys/src/9/port/fault.c:206,2121991/1105/sys/src/9/port/fault.c:204,210
1991/0705    
			putpage(new); 
			qlock(&s->lk); 
			qunlock(&s->lk); 
			pexit("page in I/O error", 0); 
1991/1105    
			faultexit("sys: page in I/O error"); 
1991/0705    
		} 
 
		n = (*devtab[c->type].read)(c, kaddr, BY2PG, daddr); 
1991/0927/sys/src/9/port/fault.c:229,2341991/1105/sys/src/9/port/fault.c:227,242
1991/0705    
		else 
			putpage(new); 
	} 
1991/1105    
} 
 
void 
faultexit(char *s) 
{ 
	if(u->nerrlab) { 
		postnote(u->p, 1, s, NDebug); 
		errors(s); 
	} 
	pexit(s, 0); 
1990/0227    
} 
 
/* 


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