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

1992/1108/port/devbit.c (diff list | history)

1992/1107/sys/src/9/port/devbit.c:2104,21121992/1108/sys/src/9/port/devbit.c:2104,2112 (short | long | prev | next)
1992/1106    
} 
 
/* 
 *  swizzle a bitmap 
1992/1108    
 *  reverse the bits in a bitmap (converting between little & big endian) 
1992/1106    
 */ 
uchar cswizzle[] = { 
1992/1108    
uchar bitrevtab[] = { 
1992/1106    
	0x00,	0x80,	0x40,	0xc0,	0x20,	0xa0,	0x60,	0xe0, 
	0x10,	0x90,	0x50,	0xd0,	0x30,	0xb0,	0x70,	0xf0, 
	0x08,	0x88,	0x48,	0xc8,	0x28,	0xa8,	0x68,	0xe8, 
1992/1107/sys/src/9/port/devbit.c:2148,21521992/1108/sys/src/9/port/devbit.c:2148,2152
1992/1106    
 
	e = p + l; 
	for(; p < e; p++) 
		*p = cswizzle[*p]; 
1992/1108    
		*p = bitrevtab[*p]; 
1990/0324    
} 


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