if (EFI_MEMDESC_SIZE != sizeof(efi_memory_desc_t)) { printk(KERN_WARNING PFX "Warning! Kernel-defined memdesc doesn't " "match the one from EFI!\n"); } 
memmap.map_end = memmap.map + (memmap.nr_map * memmap.desc_size);  
void __init efi_init(void){	efi_config_table_t *config_tables;	efi_runtime_services_t *runtime;	efi_char16_t *c16;	char vendor[100] = "unknown";	unsigned long num_config_tables;	int i = 0;	memset(&efi, 0, sizeof(efi) );	memset(&efi_phys, 0, sizeof(efi_phys));	efi_phys.systab = EFI_SYSTAB;	memmap.phys_map = EFI_MEMMAP;	memmap.nr_map = EFI_MEMMAP_SIZE/EFI_MEMDESC_SIZE;	memmap.desc_version = EFI_MEMDESC_VERSION;	efi.systab = (efi_system_table_t *)		boot_ioremap((unsigned long) efi_phys.systab,			sizeof(efi_system_table_t));	/*	 * Verify the EFI Table	 */	if (efi.systab == NULL)		printk(KERN_ERR PFX "Woah! Couldn't map the EFI system table.\n");	if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)		printk(KERN_ERR PFX "Woah! EFI system table signature incorrect\n");	if ((efi.systab->hdr.revision ^ EFI_SYSTEM_TABLE_REVISION) >> 16 != 0)		printk(KERN_ERR PFX		       "Warning: EFI system table major version mismatch: "		       "got %d.%02d, expected %d.%02d\n",		       efi.systab->hdr.revision >> 16,		       efi.systab->hdr.revision & 0xffff,		       EFI_SYSTEM_TABLE_REVISION >> 16,		       EFI_SYSTEM_TABLE_REVISION & 0xffff);	/*	 * Grab some details from the system table	 */	num_config_tables = efi.systab->nr_tables;	config_tables = (efi_config_table_t *)efi.systab->tables;	runtime = efi.systab->runtime;	/*	 * Show what we know for posterity	 */	c16 = (efi_char16_t *) boot_ioremap(efi.systab->fw_vendor, 2);	if (c16) {		for (i = 0; i < sizeof(vendor) && *c16; ++i)			vendor[i] = *c16++;		vendor[i] = '\0';	} else		printk(KERN_ERR PFX "Could not map the firmware vendor!\n");	printk(KERN_INFO PFX "EFI v%u.%.02u by %s \n",	       efi.systab->hdr.revision >> 16,	       efi.systab->hdr.revision & 0xffff, vendor);	/*	 * Let's see what config tables the firmware passed to us.	 */	config_tables = (efi_config_table_t *)				boot_ioremap((unsigned long) config_tables,			        num_config_tables * sizeof(efi_config_table_t));	if (config_tables == NULL)		printk(KERN_ERR PFX "Could not map EFI Configuration Table!\n");	for (i = 0; i < num_config_tables; i++) {		if (efi_guidcmp(config_tables[i].guid, MPS_TABLE_GUID) == 0) {			efi.mps = (void *)config_tables[i].table;			printk(KERN_INFO " MPS=0x%lx ", config_tables[i].table);		} else		    if (efi_guidcmp(config_tables[i].guid, ACPI_20_TABLE_GUID) == 0) {			efi.acpi20 = __va(config_tables[i].table);			printk(KERN_INFO " ACPI 2.0=0x%lx ", config_tables[i].table);		} else		    if (efi_guidcmp(config_tables[i].guid, ACPI_TABLE_GUID) == 0) {			efi.acpi = __va(config_tables[i].table);			printk(KERN_INFO " ACPI=0x%lx ", config_tables[i].table);		} else		    if (efi_guidcmp(config_tables[i].guid, SMBIOS_TABLE_GUID) == 0) {			efi.smbios = (void *) config_tables[i].table;			printk(KERN_INFO " SMBIOS=0x%lx ", config_tables[i].table);		} else		    if (efi_guidcmp(config_tables[i].guid, HCDP_TABLE_GUID) == 0) {			efi.hcdp = (void *)config_tables[i].table;			printk(KERN_INFO " HCDP=0x%lx ", config_tables[i].table);		} else		    if (efi_guidcmp(config_tables[i].guid, UGA_IO_PROTOCOL_GUID) == 0) {			efi.uga = (void *)config_tables[i].table;			printk(KERN_INFO " UGA=0x%lx ", config_tables[i].table);		}	}	printk("\n");	/*	 * Check out the runtime services table. We need to map	 * the runtime services table so that we can grab the physical	 * address of several of the EFI runtime functions, needed to	 * set the firmware into virtual mode.	 */	runtime = (efi_runtime_services_t *) boot_ioremap((unsigned long)						runtime,				      		sizeof(efi_runtime_services_t));	if (runtime != NULL) {		/*	 	 * We will only need *early* access to the following		 * two EFI runtime services before set_virtual_address_map		 * is invoked. 	 	 */		efi_phys.get_time = (efi_get_time_t *) runtime->get_time;		efi_phys.set_virtual_address_map =			(efi_set_virtual_address_map_t *)				runtime->set_virtual_address_map;	} else		printk(KERN_ERR PFX "Could not map the runtime service table!\n");	/* Map the EFI memory map for use until paging_init() */	memmap.map = (efi_memory_desc_t *)		boot_ioremap((unsigned long) EFI_MEMMAP, EFI_MEMMAP_SIZE);	if (memmap.map == NULL)		printk(KERN_ERR PFX "Could not map the EFI memory map!\n");	if (EFI_MEMDESC_SIZE != sizeof(efi_memory_desc_t)) {		printk(KERN_WARNING PFX "Warning! Kernel-defined memdesc doesn't "			   "match the one from EFI!\n");	}#if EFI_DEBUG	print_efi_memmap();#endif}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/7ae65fd334232468a9d6b523a4fc141cd6ec5ea4/efi.c/buggy/arch/i386/kernel/efi.c