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

1994/1108/pc/ns16552.h (diff list | history)

1994/1106/sys/src/9/pc/ns16552.h:14,201994/1108/sys/src/9/pc/ns16552.h:14,20 (short | long | prev | next)
Change ns16552setup to add name.
rsc Fri Mar 4 12:44:25 2005
1994/0902    
#define uartwrreg(u,r,v)	outb((u)->port + r, (u)->sticky[r] | (v)) 
#define uartrdreg(u,r)		inb((u)->port + r) 
 
void	ns16552setup(ulong, ulong); 
1994/1108    
void	ns16552setup(ulong, ulong, char*); 
1994/0902    
 
/* 
 *  definition of an optional serial card 
1994/1106/sys/src/9/pc/ns16552.h:87,921994/1108/sys/src/9/pc/ns16552.h:87,93
1994/0902    
	int i, j, port; 
1994/1007    
	char *p; 
1994/0902    
	Scard *sc; 
1994/1108    
	char name[NAMELEN]; 
1994/1007    
	static int already; 
1994/0902    
 
1994/1007    
	if(already) 
1994/1106/sys/src/9/pc/ns16552.h:94,1021994/1108/sys/src/9/pc/ns16552.h:95,103
1994/1007    
	already = 1; 
 
1994/0902    
	/* first two ports are always there and always the normal frequency */ 
	ns16552setup(0x3F8, UartFREQ); 
1994/1108    
	ns16552setup(0x3F8, UartFREQ, "eia0"); 
1994/0902    
	setvec(Uart0vec, ns16552intrx, (void*)0); 
	ns16552setup(0x2F8, UartFREQ); 
1994/1108    
	ns16552setup(0x2F8, UartFREQ, "eia1"); 
1994/0902    
	setvec(Uart1vec, ns16552intrx, (void*)1); 
1994/1007    
 
	/* set up a serial console */ 
1994/1106/sys/src/9/pc/ns16552.h:128,1341994/1108/sys/src/9/pc/ns16552.h:129,136
1994/0902    
			setvec(Int0vec+sc->irq, mp008intr, sc); 
			port = sc->port; 
			for(j=0; j < sc->size; j++){ 
				ns16552setup(port, sc->freq); 
1994/1108    
				sprint(name, "eia%d%2.2d", i, j); 
				ns16552setup(port, sc->freq, name); 
1994/0902    
				port += 8; 
			} 
1994/1106    
		} else if(strcmp(sc->type, "com") == 0 || strcmp(sc->type, "COM") == 0){ 
1994/1106/sys/src/9/pc/ns16552.h:139,1451994/1108/sys/src/9/pc/ns16552.h:141,148
1994/0902    
			 */ 
1994/1106    
			if(sc->freq == 0) 
				sc->freq = UartFREQ; 
1994/0902    
			ns16552setup(sc->port, sc->freq); 
1994/1108    
			sprint(name, "eia%d00", i); 
			ns16552setup(sc->port, sc->freq, name); 
1994/0902    
			setvec(Int0vec+sc->irq, ns16552intrx, (void*)(nuart-1)); 
		} 
	} 


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