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

1990/11211/port/devboot.c (diff list | history)

1990/11211/sys/src/9/port/devboot.c:13,201990/1127/sys/src/9/port/devboot.c:13,20 (short | long | prev | next)
1990/0424    
}; 
 
Dirtab bootdir[]={ 
	"boot",		Qboot,		0,			0666, 
	"mem",		Qmem,		0,			0666, 
1990/1127    
	"boot",		{Qboot},	0,	0666, 
	"mem",		{Qmem},		0,	0666, 
1990/0424    
}; 
 
#define	NBOOT	(sizeof bootdir/sizeof(Dirtab)) 
1990/11211/sys/src/9/port/devboot.c:76,821990/1127/sys/src/9/port/devboot.c:76,82
1990/0424    
long	  
bootread(Chan *c, void *buf, long n) 
{ 
	switch(c->qid & ~CHDIR){ 
1990/1127    
	switch(c->qid.path & ~CHDIR){ 
1990/0424    
	case Qdir: 
		return devdirread(c, buf, n, bootdir, NBOOT, devgen); 
	} 
1990/11211/sys/src/9/port/devboot.c:89,951990/1127/sys/src/9/port/devboot.c:89,95
1990/0424    
{ 
	ulong pc; 
 
	switch(c->qid & ~CHDIR){ 
1990/1127    
	switch(c->qid.path & ~CHDIR){ 
1990/0424    
	case Qmem: 
		/* kernel memory.  BUG: shouldn't be so easygoing. BUG: mem mapping? */ 
		if(c->offset>=KZERO && c->offset<KZERO+conf.npage*BY2PG){ 
1990/11211/sys/src/9/port/devboot.c:99,1041990/1127/sys/src/9/port/devboot.c:99,105
1990/0424    
			memcpy((char*)c->offset, buf, n); 
			return n; 
		} 
1990/1127    
		print("bootwrite: bad addr %lux\n", c->offset); 
1990/11211    
		error(Ebadarg); 
1990/0424    
 
	case Qboot: 
1990/11211/sys/src/9/port/devboot.c:106,1111990/1127/sys/src/9/port/devboot.c:107,113
1990/0424    
		splhi(); 
		gotopc(pc); 
	} 
1990/1127    
	print("bootwrite: bad path %d\n", c->qid.path); 
1990/11211    
	error(Ebadarg); 
1990/0424    
} 
 


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