/* Walk the EFI memory map looking for the I/O port range. There can only be one entry of this type, other I/O port ranges should be described via ACPI.  */
u64 efi_get_iobase(void)
/* Walk the EFI memory map looking for the I/O port range. There can only be one entry of this type, other I/O port ranges should be described via ACPI.  */
u64 efi_get_iobase(void)
{
	void *efi_map_start, *efi_map_end, *p;
	efi_memory_desc_t *md;
	u64 efi_desc_size;
	efi_map_start = __va(ia64_boot_param->efi_memmap);
	efi_map_end   = efi_map_start + ia64_boot_param->efi_memmap_size;
	efi_desc_size = ia64_boot_param->efi_memdesc_size;
	for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
		md = p;
		if (md->type == EFI_MEMORY_MAPPED_IO_PORT_SPACE) {
			if (md->attribute & EFI_MEMORY_UC)
				return md->phys_addr;
		}
	}
	return 0;
}