 /* * On pSeries, inform the firmware about our capabilities */ if (RELOC(of_platform) & PLATFORM_PSERIES) prom_send_capabilities(); 
unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long pp,			       unsigned long r6, unsigned long r7){		unsigned long offset = reloc_offset();       	struct prom_t *_prom = PTRRELOC(&prom);	unsigned long phys = KERNELBASE - offset;	u32 getprop_rval;		/*	 * First zero the BSS	 */	memset(PTRRELOC(&__bss_start), 0, __bss_stop - __bss_start);	/*	 * Init interface to Open Firmware, get some node references,	 * like /chosen	 */	prom_init_client_services(pp);	/*	 * Init prom stdout device	 */	prom_init_stdout();	prom_debug("klimit=0x%x\n", RELOC(klimit));	prom_debug("offset=0x%x\n", offset);	/*	 * Check for an initrd	 */	prom_check_initrd(r3, r4);	/*	 * Get default machine type. At this point, we do not differenciate	 * between pSeries SMP and pSeries LPAR	 */	RELOC(of_platform) = prom_find_machine_type();	getprop_rval = RELOC(of_platform);	prom_setprop(_prom->chosen, "linux,platform",		     &getprop_rval, sizeof(getprop_rval));	/*	 * On pSeries, copy the CPU hold code	 */       	if (RELOC(of_platform) & PLATFORM_PSERIES)       		copy_and_flush(0, KERNELBASE - offset, 0x100, 0);	/*	 * Get memory cells format	 */	getprop_rval = 1;	prom_getprop(_prom->root, "#size-cells",		     &getprop_rval, sizeof(getprop_rval));	_prom->root_size_cells = getprop_rval;	getprop_rval = 2;	prom_getprop(_prom->root, "#address-cells",		     &getprop_rval, sizeof(getprop_rval));	_prom->root_addr_cells = getprop_rval;	/*	 * Do early parsing of command line	 */	early_cmdline_parse();	/*	 * Initialize memory management within prom_init	 */	prom_init_mem();	/*	 * Determine which cpu is actually running right _now_	 */	prom_find_boot_cpu();	/* 	 * Initialize display devices	 */	prom_check_displays();	/*	 * Initialize IOMMU (TCE tables) on pSeries. Do that before anything else	 * that uses the allocator, we need to make sure we get the top of memory	 * available for us here...	 */	if (RELOC(of_platform) == PLATFORM_PSERIES)		prom_initialize_tce_table();	/*	 * On non-powermacs, try to instantiate RTAS and puts all CPUs	 * in spin-loops. PowerMacs don't have a working RTAS and use	 * a different way to spin CPUs	 */	if (RELOC(of_platform) != PLATFORM_POWERMAC) {		prom_instantiate_rtas();		prom_hold_cpus();	}	/*	 * Fill in some infos for use by the kernel later on	 */	if (RELOC(ppc64_iommu_off))		prom_setprop(_prom->chosen, "linux,iommu-off", NULL, 0);	if (RELOC(iommu_force_on))		prom_setprop(_prom->chosen, "linux,iommu-force-on", NULL, 0);	if (RELOC(prom_memory_limit))		prom_setprop(_prom->chosen, "linux,memory-limit",			PTRRELOC(&prom_memory_limit), sizeof(RELOC(prom_memory_limit)));	if (RELOC(prom_tce_alloc_start)) {		prom_setprop(_prom->chosen, "linux,tce-alloc-start",			PTRRELOC(&prom_tce_alloc_start), sizeof(RELOC(prom_tce_alloc_start)));		prom_setprop(_prom->chosen, "linux,tce-alloc-end",			PTRRELOC(&prom_tce_alloc_end), sizeof(RELOC(prom_tce_alloc_end)));	}	/*	 * Fixup any known bugs in the device-tree	 */	fixup_device_tree();	/*	 * Now finally create the flattened device-tree	 */       	prom_printf("copying OF device tree ...\n");       	flatten_device_tree();	/* in case stdin is USB and still active on IBM machines... */	prom_close_stdin();	/*	 * Call OF "quiesce" method to shut down pending DMA's from	 * devices etc...	 */	prom_printf("Calling quiesce ...\n");	call_prom("quiesce", 0, 0);	/*	 * And finally, call the kernel passing it the flattened device	 * tree and NULL as r5, thus triggering the new entry point which	 * is common to us and kexec	 */	prom_printf("returning from prom_init\n");	prom_debug("->dt_header_start=0x%x\n", RELOC(dt_header_start));	prom_debug("->phys=0x%x\n", phys);	__start(RELOC(dt_header_start), phys, 0);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/05fda3b1d88ebac1fc866fc3ed5b7ef5a4672fa6/prom_init.c/clean/arch/ppc64/kernel/prom_init.c