kernels/linux-2.4.0/arch/ia64/kernel/palinfo.c
/*
 * Take a 64bit vector and produces a string such that
 * if bit n is set then 2^n in clear text is generated. The adjustment
 * to the right unit is also done.
 *
 * Input:
 *	- a pointer to a buffer to hold the string
 * 	- a 64-bit vector
 * Ouput:
 *	- a pointer to the end of the buffer
 *
 */
Take a 64bit vector and produces a string such that
if bit n is set then 2^n in clear text is generated. The adjustment
to the right unit is also done.

- a pointer to a buffer to hold the string
- a 64-bit vector
Ouput:
- a pointer to the end of the buffer
Take a 64bit vector and produces a string such that if bit n is set then 2^n in clear text is generated . The adjustment to the right unit is also done . - a pointer to a buffer to hold the string - a 64 - bit vector Ouput : - a pointer to the end of the buffer
static char *
bitvector_process(char *p, u64 vector)
{
	int i,j;
	const char *units[]={ "", "K", "M", "G", "T" };
	for (i=0, j=0; i < 64; i++ , j=i/10) {
		if (vector & 0x1) {
			p += sprintf(p, "%d%s ", 1 << (i-j*10), units[j]);
		}
		vector >>= 1;
	}
	return p;
}
static char * bitvector_process ( char * p , u64 vector ) { int i , j ; const char * units [ ] = { " " , " " , " " , " " , " " } ; for ( i = 0 , j = 0 ; i < 64 ; i ++ , j = i / 10 ) { if ( vector & 0x1 ) { p += sprintf ( p , " " , 1 << ( i - j * 10 ) , units [ j ] ) ; } vector >>= 1 ; } return p ; }
Take a 64bit vector and produces a string such that
 if bit n is set then 2^n in clear text is generated.
Take a 64bit vector and produces a string such that if bit n is set then 2^n in clear text is generated .