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

1994/0208/port/devcons.c (diff list | history)

1993/1228/sys/src/9/port/devcons.c:44,531994/0208/sys/src/9/port/devcons.c:44,53 (short | long | prev | next)
1991/0809    
 *   or uart code.  Multi-line messages to serial consoles may get 
 *   interspersed with other messages. 
1990/0227    
 */ 
void 
putstrn(char *str, int n) 
1994/0208    
static void 
putstrn0(char *str, int n, int usewrite) 
1990/0227    
{ 
1991/0809    
	int m; 
1994/0208    
	int m, x; 
1990/0227    
	char *t; 
1993/0806    
	char buf[PRINTSIZE+2]; 
1990/0227    
 
1993/1228/sys/src/9/port/devcons.c:73,891994/0208/sys/src/9/port/devcons.c:73,106
1991/0809    
			memmove(buf, str, m); 
			buf[m] = '\r'; 
			buf[m+1] = '\n'; 
1993/0601    
			qwrite(printq, buf, m+2, 1); 
1994/0208    
			if(usewrite) 
				qwrite(printq, buf, m+2, 0); 
			else { 
				x = splhi(); 
				qproduce(printq, buf, m+2); 
				splx(x); 
			} 
1991/0809    
			str = t + 1; 
			n -= m + 1; 
1993/0806    
		} 
		else { 
1993/0601    
			qwrite(printq, str, n, 1); 
1994/0208    
		} else { 
			if(usewrite) 
				qwrite(printq, str, n, 0); 
			else { 
				x = splhi(); 
				qproduce(printq, str, n); 
				splx(x); 
			} 
1991/0809    
			break; 
		} 
1990/0227    
	} 
} 
 
1994/0208    
void 
putstrn(char *str, int n) 
{ 
	putstrn0(str, n, 0); 
} 
 
1990/0227    
int 
sprint(char *s, char *fmt, ...) 
{ 
1993/1228/sys/src/9/port/devcons.c:734,7401994/0208/sys/src/9/port/devcons.c:751,757
1991/1116    
			if(bp > sizeof buf) 
				bp = sizeof buf; 
			memmove(buf, a, bp); 
			putstrn(a, bp); 
1994/0208    
			putstrn0(a, bp, 1); 
1991/1116    
			a += bp; 
			l -= bp; 
1991/1224    
		} 


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