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

2000/0611/port/rdb.c (diff list | history)

1999/1031/sys/src/9/port/rdb.c:45,552000/0611/sys/src/9/port/rdb.c:45,55 (short | long | prev | next)
Add 'w' message to write words.
rsc Fri Mar 4 12:44:25 2005
1999/0820    
} 
 
static void* 
addr(char *s, Ureg *ureg) 
2000/0611    
addr(char *s, Ureg *ureg, char **p) 
1999/0820    
{ 
	ulong a; 
 
	a = strtoul(s, 0, 16); 
2000/0611    
	a = strtoul(s, p, 16); 
1999/0820    
	if(a < sizeof(Ureg)) 
		return ((uchar*)ureg)+a; 
	return (void*)a; 
1999/1031/sys/src/9/port/rdb.c:59,642000/0611/sys/src/9/port/rdb.c:59,65
1999/0820    
talkrdb(Ureg *ureg) 
{ 
	uchar *a; 
2000/0611    
	char *p; 
1999/0820    
	char *req; 
 
	printq = nil;	// turn off serial console 
1999/1031/sys/src/9/port/rdb.c:68,762000/0611/sys/src/9/port/rdb.c:69,83
1999/0820    
		req = getline(); 
		switch(*req){ 
		case 'r': 
			a = addr(req+1, ureg); 
2000/0611    
			a = addr(req+1, ureg, nil); 
1999/0820    
			DBG("read %p\n", a); 
			iprint("R%.8lux %.2ux %.2ux %.2ux %.2ux\n", strtoul(req+1, 0, 16), a[0], a[1], a[2], a[3]); 
2000/0611    
			break; 
 
		case 'w': 
			a = addr(req+1, ureg, &p); 
			*(ulong*)a = strtoul(p, nil, 16); 
			iprint("W\n"); 
1999/0820    
			break; 
/* 
 *		case Tmput: 


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