Commit c0019f57 authored by Ard Biesheuvel's avatar Ard Biesheuvel

efi/ia64: Use existing helpers to locate ESI table

Instead of iterating over the EFI config table array manually,
declare it as an arch table so it gets picked up by the existing
config table handling code.

Tested-by: Tony Luck <tony.luck@intel.com> # arch/ia64
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent 14fb4209
...@@ -45,13 +45,19 @@ ...@@ -45,13 +45,19 @@
#define EFI_DEBUG 0 #define EFI_DEBUG 0
#define ESI_TABLE_GUID \
EFI_GUID(0x43EA58DC, 0xCF28, 0x4b06, 0xB3, \
0x91, 0xB7, 0x50, 0x59, 0x34, 0x2B, 0xD4)
static unsigned long mps_phys = EFI_INVALID_TABLE_ADDR; static unsigned long mps_phys = EFI_INVALID_TABLE_ADDR;
static __initdata unsigned long palo_phys; static __initdata unsigned long palo_phys;
unsigned long __initdata esi_phys = EFI_INVALID_TABLE_ADDR;
unsigned long hcdp_phys = EFI_INVALID_TABLE_ADDR; unsigned long hcdp_phys = EFI_INVALID_TABLE_ADDR;
unsigned long sal_systab_phys = EFI_INVALID_TABLE_ADDR; unsigned long sal_systab_phys = EFI_INVALID_TABLE_ADDR;
static __initdata efi_config_table_type_t arch_tables[] = { static __initdata efi_config_table_type_t arch_tables[] = {
{ESI_TABLE_GUID, "ESI", &esi_phys},
{HCDP_TABLE_GUID, "HCDP", &hcdp_phys}, {HCDP_TABLE_GUID, "HCDP", &hcdp_phys},
{MPS_TABLE_GUID, "MPS", &mps_phys}, {MPS_TABLE_GUID, "MPS", &mps_phys},
{PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID, "PALO", &palo_phys}, {PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID, "PALO", &palo_phys},
......
...@@ -19,10 +19,6 @@ MODULE_LICENSE("GPL"); ...@@ -19,10 +19,6 @@ MODULE_LICENSE("GPL");
#define MODULE_NAME "esi" #define MODULE_NAME "esi"
#define ESI_TABLE_GUID \
EFI_GUID(0x43EA58DC, 0xCF28, 0x4b06, 0xB3, \
0x91, 0xB7, 0x50, 0x59, 0x34, 0x2B, 0xD4)
enum esi_systab_entry_type { enum esi_systab_entry_type {
ESI_DESC_ENTRY_POINT = 0 ESI_DESC_ENTRY_POINT = 0
}; };
...@@ -48,27 +44,18 @@ struct pdesc { ...@@ -48,27 +44,18 @@ struct pdesc {
static struct ia64_sal_systab *esi_systab; static struct ia64_sal_systab *esi_systab;
extern unsigned long esi_phys;
static int __init esi_init (void) static int __init esi_init (void)
{ {
efi_config_table_t *config_tables;
struct ia64_sal_systab *systab; struct ia64_sal_systab *systab;
unsigned long esi = 0;
char *p; char *p;
int i; int i;
config_tables = __va(efi.systab->tables); if (esi_phys == EFI_INVALID_TABLE_ADDR)
for (i = 0; i < (int) efi.systab->nr_tables; ++i) {
if (efi_guidcmp(config_tables[i].guid, ESI_TABLE_GUID) == 0) {
esi = config_tables[i].table;
break;
}
}
if (!esi)
return -ENODEV; return -ENODEV;
systab = __va(esi); systab = __va(esi_phys);
if (strncmp(systab->signature, "ESIT", 4) != 0) { if (strncmp(systab->signature, "ESIT", 4) != 0) {
printk(KERN_ERR "bad signature in ESI system table!"); printk(KERN_ERR "bad signature in ESI system table!");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment