|
45 | 45 |
|
46 | 46 | #define EFI_DEBUG 0 |
47 | 47 |
|
| 48 | +#define ESI_TABLE_GUID \ |
| 49 | + EFI_GUID(0x43EA58DC, 0xCF28, 0x4b06, 0xB3, \ |
| 50 | + 0x91, 0xB7, 0x50, 0x59, 0x34, 0x2B, 0xD4) |
| 51 | + |
| 52 | +static unsigned long mps_phys = EFI_INVALID_TABLE_ADDR; |
48 | 53 | static __initdata unsigned long palo_phys; |
49 | 54 |
|
| 55 | +unsigned long __initdata esi_phys = EFI_INVALID_TABLE_ADDR; |
| 56 | +unsigned long hcdp_phys = EFI_INVALID_TABLE_ADDR; |
50 | 57 | unsigned long sal_systab_phys = EFI_INVALID_TABLE_ADDR; |
51 | 58 |
|
52 | | -static __initdata efi_config_table_type_t arch_tables[] = { |
| 59 | +static const efi_config_table_type_t arch_tables[] __initconst = { |
| 60 | + {ESI_TABLE_GUID, "ESI", &esi_phys}, |
| 61 | + {HCDP_TABLE_GUID, "HCDP", &hcdp_phys}, |
| 62 | + {MPS_TABLE_GUID, "MPS", &mps_phys}, |
53 | 63 | {PROCESSOR_ABSTRACTION_LAYER_OVERWRITE_GUID, "PALO", &palo_phys}, |
54 | 64 | {SAL_SYSTEM_TABLE_GUID, "SALsystab", &sal_systab_phys}, |
55 | 65 | {NULL_GUID, NULL, 0}, |
@@ -474,11 +484,10 @@ efi_map_pal_code (void) |
474 | 484 | void __init |
475 | 485 | efi_init (void) |
476 | 486 | { |
| 487 | + const efi_system_table_t *efi_systab; |
477 | 488 | void *efi_map_start, *efi_map_end; |
478 | | - efi_char16_t *c16; |
479 | 489 | u64 efi_desc_size; |
480 | | - char *cp, vendor[100] = "unknown"; |
481 | | - int i; |
| 490 | + char *cp; |
482 | 491 |
|
483 | 492 | set_bit(EFI_BOOT, &efi.flags); |
484 | 493 | set_bit(EFI_64BIT, &efi.flags); |
@@ -508,42 +517,29 @@ efi_init (void) |
508 | 517 | printk(KERN_INFO "Ignoring memory above %lluMB\n", |
509 | 518 | max_addr >> 20); |
510 | 519 |
|
511 | | - efi.systab = __va(ia64_boot_param->efi_systab); |
| 520 | + efi_systab = __va(ia64_boot_param->efi_systab); |
512 | 521 |
|
513 | 522 | /* |
514 | 523 | * Verify the EFI Table |
515 | 524 | */ |
516 | | - if (efi.systab == NULL) |
| 525 | + if (efi_systab == NULL) |
517 | 526 | panic("Whoa! Can't find EFI system table.\n"); |
518 | | - if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) |
| 527 | + if (efi_systab_check_header(&efi_systab->hdr, 1)) |
519 | 528 | panic("Whoa! EFI system table signature incorrect\n"); |
520 | | - if ((efi.systab->hdr.revision >> 16) == 0) |
521 | | - printk(KERN_WARNING "Warning: EFI system table version " |
522 | | - "%d.%02d, expected 1.00 or greater\n", |
523 | | - efi.systab->hdr.revision >> 16, |
524 | | - efi.systab->hdr.revision & 0xffff); |
525 | | - |
526 | | - /* Show what we know for posterity */ |
527 | | - c16 = __va(efi.systab->fw_vendor); |
528 | | - if (c16) { |
529 | | - for (i = 0;i < (int) sizeof(vendor) - 1 && *c16; ++i) |
530 | | - vendor[i] = *c16++; |
531 | | - vendor[i] = '\0'; |
532 | | - } |
533 | 529 |
|
534 | | - printk(KERN_INFO "EFI v%u.%.02u by %s:", |
535 | | - efi.systab->hdr.revision >> 16, |
536 | | - efi.systab->hdr.revision & 0xffff, vendor); |
| 530 | + efi_systab_report_header(&efi_systab->hdr, efi_systab->fw_vendor); |
537 | 531 |
|
538 | 532 | palo_phys = EFI_INVALID_TABLE_ADDR; |
539 | 533 |
|
540 | | - if (efi_config_init(arch_tables) != 0) |
| 534 | + if (efi_config_parse_tables(__va(efi_systab->tables), |
| 535 | + efi_systab->nr_tables, |
| 536 | + arch_tables) != 0) |
541 | 537 | return; |
542 | 538 |
|
543 | 539 | if (palo_phys != EFI_INVALID_TABLE_ADDR) |
544 | 540 | handle_palo(palo_phys); |
545 | 541 |
|
546 | | - runtime = __va(efi.systab->runtime); |
| 542 | + runtime = __va(efi_systab->runtime); |
547 | 543 | efi.get_time = phys_get_time; |
548 | 544 | efi.set_time = phys_set_time; |
549 | 545 | efi.get_wakeup_time = phys_get_wakeup_time; |
@@ -1351,3 +1347,12 @@ vmcore_find_descriptor_size (unsigned long address) |
1351 | 1347 | return ret; |
1352 | 1348 | } |
1353 | 1349 | #endif |
| 1350 | + |
| 1351 | +char *efi_systab_show_arch(char *str) |
| 1352 | +{ |
| 1353 | + if (mps_phys != EFI_INVALID_TABLE_ADDR) |
| 1354 | + str += sprintf(str, "MPS=0x%lx\n", mps_phys); |
| 1355 | + if (hcdp_phys != EFI_INVALID_TABLE_ADDR) |
| 1356 | + str += sprintf(str, "HCDP=0x%lx\n", hcdp_phys); |
| 1357 | + return str; |
| 1358 | +} |
0 commit comments