hdr->boot_cpuid_phys = _prom->cpu; 
static void __init flatten_device_tree(void){	phandle root;	unsigned long offset = reloc_offset();	unsigned long mem_start, mem_end, room;	struct boot_param_header *hdr;	char *namep;	u64 *rsvmap;	/*	 * Check how much room we have between alloc top & bottom (+/- a	 * few pages), crop to 4Mb, as this is our "chuck" size	 */	room = RELOC(alloc_top) - RELOC(alloc_bottom) - 0x4000;	if (room > DEVTREE_CHUNK_SIZE)		room = DEVTREE_CHUNK_SIZE;	prom_debug("starting device tree allocs at %x\n", RELOC(alloc_bottom));	/* Now try to claim that */	mem_start = (unsigned long)alloc_up(room, PAGE_SIZE);	if (mem_start == 0)		prom_panic("Can't allocate initial device-tree chunk\n");	mem_end = RELOC(alloc_top);	/* Get root of tree */	root = call_prom("peer", 1, 1, (phandle)0);	if (root == (phandle)0)		prom_panic ("couldn't get device tree root\n");	/* Build header and make room for mem rsv map */ 	mem_start = _ALIGN(mem_start, 4);	hdr = make_room(&mem_start, &mem_end,			sizeof(struct boot_param_header), 4);	RELOC(dt_header_start) = (unsigned long)hdr;	rsvmap = make_room(&mem_start, &mem_end, sizeof(mem_reserve_map), 8);	/* Start of strings */	mem_start = PAGE_ALIGN(mem_start);	RELOC(dt_string_start) = mem_start;	mem_start += 4; /* hole */	/* Add "linux,phandle" in there, we'll need it */	namep = make_room(&mem_start, &mem_end, 16, 1);	strcpy(namep, RELOC("linux,phandle"));	mem_start = (unsigned long)namep + strlen(namep) + 1;	/* Build string array */	prom_printf("Building dt strings...\n"); 	scan_dt_build_strings(root, &mem_start, &mem_end);	RELOC(dt_string_end) = mem_start;	/* Build structure */	mem_start = PAGE_ALIGN(mem_start);	RELOC(dt_struct_start) = mem_start;	prom_printf("Building dt structure...\n"); 	scan_dt_build_struct(root, &mem_start, &mem_end);	dt_push_token(OF_DT_END, &mem_start, &mem_end);	RELOC(dt_struct_end) = PAGE_ALIGN(mem_start);	/* Finish header */	hdr->magic = OF_DT_HEADER;	hdr->totalsize = RELOC(dt_struct_end) - RELOC(dt_header_start);	hdr->off_dt_struct = RELOC(dt_struct_start) - RELOC(dt_header_start);	hdr->off_dt_strings = RELOC(dt_string_start) - RELOC(dt_header_start);	hdr->dt_strings_size = RELOC(dt_string_end) - RELOC(dt_string_start);	hdr->off_mem_rsvmap = ((unsigned long)rsvmap) - RELOC(dt_header_start);	hdr->version = OF_DT_VERSION;	/* Version 16 is not backward compatible */	hdr->last_comp_version = 0x10;	/* Reserve the whole thing and copy the reserve map in, we	 * also bump mem_reserve_cnt to cause further reservations to	 * fail since it's too late.	 */	reserve_mem(RELOC(dt_header_start), hdr->totalsize);	memcpy(rsvmap, RELOC(mem_reserve_map), sizeof(mem_reserve_map));#ifdef DEBUG_PROM	{		int i;		prom_printf("reserved memory map:\n");		for (i = 0; i < RELOC(mem_reserve_cnt); i++)			prom_printf("  %x - %x\n", RELOC(mem_reserve_map)[i].base,				    RELOC(mem_reserve_map)[i].size);	}#endif	RELOC(mem_reserve_cnt) = MEM_RESERVE_MAP_SIZE;	prom_printf("Device tree strings 0x%x -> 0x%x\n",		    RELOC(dt_string_start), RELOC(dt_string_end)); 	prom_printf("Device tree struct  0x%x -> 0x%x\n",		    RELOC(dt_struct_start), RELOC(dt_struct_end));}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/1bc2a3bb86688ffca691ba2ad30a2d5dcba774cf/prom_init.c/clean/arch/ppc64/kernel/prom_init.c