int i, k, off, valid; 
unsigned int i, k, off; 
write_src(void){	int i, k, off, valid;	unsigned int best_idx[256];	unsigned int *markers;	char buf[KSYM_NAME_LEN+1];	printf("#include <asm/types.h>\n");	printf("#if BITS_PER_LONG == 64\n");	printf("#define PTR .quad\n");	printf("#define ALGN .align 8\n");	printf("#else\n");	printf("#define PTR .long\n");	printf("#define ALGN .align 4\n");	printf("#endif\n");	printf(".data\n");	output_label("kallsyms_addresses");	valid = 0;	for (i = 0; i < cnt; i++) {		if (table[i].flags & SYM_FLAG_VALID) {			printf("\tPTR\t%#llx\n", table[i].addr);			valid++;		}	}	printf("\n");	output_label("kallsyms_num_syms");	printf("\tPTR\t%d\n", valid);	printf("\n");	/* table of offset markers, that give the offset in the compressed stream	 * every 256 symbols */	markers = (unsigned int *) malloc(sizeof(unsigned int)*((valid + 255) / 256));	output_label("kallsyms_names");	valid = 0;	off = 0;	for (i = 0; i < cnt; i++) {		if (!table[i].flags & SYM_FLAG_VALID)			continue;		if ((valid & 0xFF) == 0)			markers[valid >> 8] = off;		printf("\t.byte 0x%02x", table[i].len);		for (k = 0; k < table[i].len; k++)			printf(", 0x%02x", table[i].sym[k]);		printf("\n");		off += table[i].len + 1;		valid++;	}	printf("\n");	output_label("kallsyms_markers");	for (i = 0; i < ((valid + 255) >> 8); i++)		printf("\tPTR\t%d\n", markers[i]);	printf("\n");	free(markers);	output_label("kallsyms_token_table");	off = 0;	for (i = 0; i < 256; i++) {		best_idx[i] = off;		expand_symbol(best_table[i],best_table_len[i],buf);		printf("\t.asciz\t\"%s\"\n", buf);		off += strlen(buf) + 1;	}	printf("\n");	output_label("kallsyms_token_index");	for (i = 0; i < 256; i++)		printf("\t.short\t%d\n", best_idx[i]);	printf("\n");}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b3dbb4ecd46767b621df3dedd28788da93ee0cac/kallsyms.c/clean/scripts/kallsyms.c