l = call_prom("package-to-path", 3, 1, node, namep, *mem_end - *mem_start); 
room = *mem_end - *mem_start; if (room > 255) room = 255; l = call_prom("package-to-path", 3, 1, node, namep, room); 
static void __init scan_dt_build_struct(phandle node, unsigned long *mem_start,					unsigned long *mem_end){	phandle child;	char *namep, *prev_name, *sstart, *p, *ep, *lp, *path;	unsigned long soff;	unsigned char *valp;	static char pname[MAX_PROPERTY_NAME];	int l;	dt_push_token(OF_DT_BEGIN_NODE, mem_start, mem_end);	/* get the node's full name */	namep = (char *)*mem_start;	l = call_prom("package-to-path", 3, 1, node,		      namep, *mem_end - *mem_start);	if (l >= 0) {		/* Didn't fit?  Get more room. */		if ((l+1) > (*mem_end - *mem_start)) {			namep = make_room(mem_start, mem_end, l+1, 1);			call_prom("package-to-path", 3, 1, node, namep, l);		}		namep[l] = '\0';		/* Fixup an Apple bug where they have bogus \0 chars in the		 * middle of the path in some properties, and extract		 * the unit name (everything after the last '/').		 */		for (lp = p = namep, ep = namep + l; p < ep; p++) {			if (*p == '/')				lp = namep;			else if (*p != 0)				*lp++ = *p;		}		*lp = 0;		*mem_start = _ALIGN((unsigned long)lp + 1, 4);	}	/* get it again for debugging */	path = RELOC(prom_scratch);	memset(path, 0, PROM_SCRATCH_SIZE);	call_prom("package-to-path", 3, 1, node, path, PROM_SCRATCH_SIZE-1);	/* get and store all properties */	prev_name = RELOC("");	sstart = (char *)RELOC(dt_string_start);	for (;;) {		if (call_prom("nextprop", 3, 1, node, prev_name,			      RELOC(pname)) != 1)			break; 		/* skip "name" */ 		if (strcmp(RELOC(pname), RELOC("name")) == 0) { 			prev_name = RELOC("name"); 			continue; 		}		/* find string offset */		soff = dt_find_string(RELOC(pname));		if (soff == 0) {			prom_printf("WARNING: Can't find string index for"				    " <%s>, node %s\n", RELOC(pname), path);			break;		}		prev_name = sstart + soff;		/* get length */		l = call_prom("getproplen", 2, 1, node, RELOC(pname));		/* sanity checks */		if (l == PROM_ERROR)			continue;		if (l > MAX_PROPERTY_LENGTH) {			prom_printf("WARNING: ignoring large property ");			/* It seems OF doesn't null-terminate the path :-( */			prom_printf("[%s] ", path);			prom_printf("%s length 0x%x\n", RELOC(pname), l);			continue;		}		/* push property head */		dt_push_token(OF_DT_PROP, mem_start, mem_end);		dt_push_token(l, mem_start, mem_end);		dt_push_token(soff, mem_start, mem_end);		/* push property content */		valp = make_room(mem_start, mem_end, l, 4);		call_prom("getprop", 4, 1, node, RELOC(pname), valp, l);		*mem_start = _ALIGN(*mem_start, 4);	}	/* Add a "linux,phandle" property. */	soff = dt_find_string(RELOC("linux,phandle"));	if (soff == 0)		prom_printf("WARNING: Can't find string index for"			    " <linux-phandle> node %s\n", path);	else {		dt_push_token(OF_DT_PROP, mem_start, mem_end);		dt_push_token(4, mem_start, mem_end);		dt_push_token(soff, mem_start, mem_end);		valp = make_room(mem_start, mem_end, 4, 4);		*(u32 *)valp = node;	}	/* do all our children */	child = call_prom("child", 1, 1, node);	while (child != 0) {		scan_dt_build_struct(child, mem_start, mem_end);		child = call_prom("peer", 1, 1, child);	}	dt_push_token(OF_DT_END_NODE, mem_start, mem_end);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/c49888203d7a316cb947bb8a1cf2ae191f28bcd3/prom_init.c/buggy/arch/powerpc/kernel/prom_init.c