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

1991/0411/port/devkprof.c (diff list | history)

1991/0318/sys/src/9/port/devkprof.c:118,1361991/0411/sys/src/9/port/devkprof.c:118,136 (short | long | prev | next)
1990/0330    
} 
 
1990/03292    
long 
1990/0330    
kprofread(Chan *c, void *a, long n) 
1991/0411    
kprofread(Chan *c, void *a, long n, ulong offset) 
1990/03292    
{ 
	switch((int)(c->qid&~CHDIR)){ 
	case Kprofdirqid: 
1990/0330    
		return devdirread(c, a, n, kproftab, Nkproftab, devgen); 
1990/03292    
	case Kprofdataqid: 
1990/0330    
		if(c->offset >= NBUF*sizeof timerbuf[0]){ 
1991/0411    
		if(offset >= NBUF*sizeof timerbuf[0]){ 
1990/0330    
			n = 0; 
1990/03292    
			break; 
		} 
1990/0330    
		if(c->offset+n > NBUF*sizeof timerbuf[0]) 
			n = NBUF*sizeof timerbuf[0]-c->offset; 
1991/0318    
		memmove(a, ((char *)timerbuf)+c->offset, n); 
1991/0411    
		if(offset+n > NBUF*sizeof timerbuf[0]) 
			n = NBUF*sizeof timerbuf[0]-offset; 
		memmove(a, ((char *)timerbuf)+offset, n); 
1990/03292    
		break; 
	default: 
		n=0; 
1991/0318/sys/src/9/port/devkprof.c:140,1461991/0411/sys/src/9/port/devkprof.c:140,146
1990/03292    
} 
 
long 
kprofwrite(Chan *c, char *a, long n) 
1991/0411    
kprofwrite(Chan *c, char *a, long n, ulong offset) 
1990/03292    
{ 
	switch((int)(c->qid&~CHDIR)){ 
	case Kprofstartclrqid: 


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