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

1991/0318/port/devboot.c (diff list | history)

1991/0318/sys/src/9/port/devboot.c:74,801991/0411/sys/src/9/port/devboot.c:74,80 (short | long | prev | next)
1990/0424    
} 
 
long	  
bootread(Chan *c, void *buf, long n) 
1991/0411    
bootread(Chan *c, void *buf, long n, ulong offset) 
1990/0424    
{ 
1990/1127    
	switch(c->qid.path & ~CHDIR){ 
1990/0424    
	case Qdir: 
1991/0318/sys/src/9/port/devboot.c:85,911991/0411/sys/src/9/port/devboot.c:85,91
1990/0424    
} 
 
long	  
bootwrite(Chan *c, void *buf, long n) 
1991/0411    
bootwrite(Chan *c, void *buf, long n, ulong offset) 
1990/0424    
{ 
	ulong pc; 
 
1991/0318/sys/src/9/port/devboot.c:92,1051991/0411/sys/src/9/port/devboot.c:92,105
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){ 
1991/0411    
		if(offset>=KZERO && offset<KZERO+conf.npage*BY2PG){ 
1990/0424    
/*			print("%ux, %d\n", c->offset, n);/**/ 
			if(c->offset+n > KZERO+conf.npage*BY2PG) 
				n = KZERO+conf.npage*BY2PG - c->offset; 
1991/0318    
			memmove((char*)c->offset, buf, 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; 
		} 
1990/1127    
		print("bootwrite: bad addr %lux\n", c->offset); 
1991/0411    
		print("bootwrite: bad addr %lux\n", offset); 
1990/11211    
		error(Ebadarg); 
1990/0424    
 
	case Qboot: 


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