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

1992/0625/port/devboot.c (diff list | history)

1992/0522/sys/src/9/port/devboot.c:76,831992/0625/sys/src/9/port/devboot.c:76,94 (short | long | prev | next)
1991/0411    
bootread(Chan *c, void *buf, long n, ulong offset) 
1990/0424    
{ 
1990/1127    
	switch(c->qid.path & ~CHDIR){ 
1992/0625    
 
1990/0424    
	case Qdir: 
		return devdirread(c, buf, n, bootdir, NBOOT, devgen); 
1992/0625    
 
	case Qmem: 
		/* kernel memory */ 
		if(offset>=KZERO && offset<KZERO+conf.npage*BY2PG){ 
			if(offset+n > KZERO+conf.npage*BY2PG) 
				n = KZERO+conf.npage*BY2PG - offset; 
			memmove(buf, (char*)offset, n); 
			return n; 
		} 
		error(Ebadarg); 
1990/0424    
	} 
 
1990/11211    
	error(Egreg); 
1992/0522/sys/src/9/port/devboot.c:93,1051992/0625/sys/src/9/port/devboot.c:104,114
1990/0424    
	case Qmem: 
1991/1206    
		/* kernel memory */ 
1991/0411    
		if(offset>=KZERO && offset<KZERO+conf.npage*BY2PG){ 
1991/1206    
/* print("%ux, %d\n", c->offset, n);/**/ 
1991/0411    
			if(offset+n > KZERO+conf.npage*BY2PG) 
				n = KZERO+conf.npage*BY2PG - offset; 
			memmove((char*)offset, buf, n); 
1990/0424    
			return n; 
		} 
1991/0411    
		print("bootwrite: bad addr %lux\n", offset); 
1990/11211    
		error(Ebadarg); 
1990/0424    
 
	case Qboot: 
1992/0522/sys/src/9/port/devboot.c:107,1131992/0625/sys/src/9/port/devboot.c:116,121
1990/0424    
		splhi(); 
		gotopc(pc); 
	} 
1990/1127    
	print("bootwrite: bad path %d\n", c->qid.path); 
1990/11211    
	error(Ebadarg); 
1992/0522    
	return 0;	/* not reached */ 
1990/0424    
} 


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