/* Fixup an Apple bug where they have bogus \0 chars in the * middle of the path in some properties */ for (p = (char *)mem_start, ep = p + l; p < ep; p++) if ((*p) == '\0') { memmove(p, p+1, ep - p); ep--; } 
inspect_node(phandle node, struct device_node *dad,	     unsigned long mem_start, unsigned long mem_end,	     struct device_node ***allnextpp){	int l;	phandle child;	struct device_node *np;	struct property *pp, **prev_propp;	char *prev_name, *namep;	unsigned char *valp;	np = (struct device_node *) mem_start;	mem_start += sizeof(struct device_node);	memset(np, 0, sizeof(*np));	np->node = node;	**allnextpp = PTRUNRELOC(np);	*allnextpp = &np->allnext;	if (dad != 0) {		np->parent = PTRUNRELOC(dad);		/* we temporarily use the `next' field as `last_child'. */		if (dad->next == 0)			dad->child = PTRUNRELOC(np);		else			dad->next->sibling = PTRUNRELOC(np);		dad->next = np;	}	/* get and store all properties */	prev_propp = &np->properties;	prev_name = "";	for (;;) {		pp = (struct property *) mem_start;		namep = (char *) (pp + 1);		pp->name = PTRUNRELOC(namep);		if (call_prom("nextprop", 3, 1, node, prev_name, namep) <= 0)			break;		mem_start = ALIGNUL((unsigned long)namep + strlen(namep) + 1);		prev_name = namep;		valp = (unsigned char *) mem_start;		pp->value = PTRUNRELOC(valp);		pp->length = call_prom("getprop", 4, 1, node, namep,				       valp, mem_end - mem_start);		if (pp->length < 0)			continue;#ifdef MAX_PROPERTY_LENGTH		if (pp->length > MAX_PROPERTY_LENGTH)			continue; /* ignore this property */#endif		mem_start = ALIGNUL(mem_start + pp->length);		*prev_propp = PTRUNRELOC(pp);		prev_propp = &pp->next;	}	if (np->node != 0) {		/* Add a "linux,phandle" property" */		pp = (struct property *) mem_start;		*prev_propp = PTRUNRELOC(pp);		prev_propp = &pp->next;		namep = (char *) (pp + 1);		pp->name = PTRUNRELOC(namep);		strcpy(namep, "linux,phandle");		mem_start = ALIGNUL((unsigned long)namep + strlen(namep) + 1);		pp->value = (unsigned char *) PTRUNRELOC(&np->node);		pp->length = sizeof(np->node);	}	*prev_propp = NULL;	/* get the node's full name */	l = call_prom("package-to-path", 3, 1, node,		      mem_start, mem_end - mem_start);	if (l >= 0) {		np->full_name = PTRUNRELOC((char *) mem_start);		*(char *)(mem_start + l) = 0;		mem_start = ALIGNUL(mem_start + l + 1);	}	/* do all our children */	child = call_prom("child", 1, 1, node);	while (child != 0) {		mem_start = inspect_node(child, np, mem_start, mem_end,					 allnextpp);		child = call_prom("peer", 1, 1, child);	}	return mem_start;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f93ea2349832c040bdf66dc7495aa87bfe3394b8/prom_init.c/clean/arch/ppc/syslib/prom_init.c