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

1991/0115/gnot/devport.c (diff list | history)

1991/0115/sys/src/9/gnot/devport.c:106,1121991/0411/sys/src/9/gnot/devport.c:106,112 (short | long | prev | next)
1991/0110    
{} 
 
long 
portread(Chan *c, char *a, long n) 
1991/0411    
portread(Chan *c, char *a, long n, ulong offset) 
1991/0110    
{ 
	long s, k; 
	if (n == 0) 
1991/0115/sys/src/9/gnot/devport.c:115,1231991/0411/sys/src/9/gnot/devport.c:115,123
1991/0110    
	case Qdir: 
		return devdirread(c, a, n, portdir, NPORT, devgen); 
	case Qdata: 
		if (!conf.portispaged || (s = c->offset >> PORTSHIFT) > 0xff) 
1991/0411    
		if (!conf.portispaged || (s = offset >> PORTSHIFT) > 0xff) 
1991/0110    
			s = -1; 
		k = c->offset % PORTSIZE; 
1991/0411    
		k = offset % PORTSIZE; 
1991/0110    
		P_qlock(s); 
		switch ((int)n) { 
		case 1: 
1991/0115/sys/src/9/gnot/devport.c:139,1451991/0411/sys/src/9/gnot/devport.c:139,145
1991/0110    
} 
 
long 
portwrite(Chan *c, char *a, long n) 
1991/0411    
portwrite(Chan *c, char *a, long n, ulong offset) 
1991/0110    
{ 
	long s, k; 
	if (n == 0) 
1991/0115/sys/src/9/gnot/devport.c:146,1541991/0411/sys/src/9/gnot/devport.c:146,154
1991/0110    
		return 0; 
	switch ((int)c->qid.path) { 
	case Qdata: 
		if (!conf.portispaged || (s = c->offset >> PORTSHIFT) > 0xff) 
1991/0411    
		if (!conf.portispaged || (s = offset >> PORTSHIFT) > 0xff) 
1991/0110    
			s = -1; 
		k = c->offset % PORTSIZE; 
1991/0411    
		k = offset % PORTSIZE; 
1991/0110    
		P_qlock(s); 
		switch ((int)n) { 
		case 1: 


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