| // SPDX-License-Identifier: GPL-2.0+ |
| * Copyright (c) 2015 Google, Inc |
| * Access to the EFI information table |
| #include <asm/global_data.h> |
| int efi_info_get(enum efi_entry_t type, void **datap, int *sizep) |
| struct efi_entry_hdr *entry; |
| struct efi_info_hdr *info; |
| info = map_sysmem(gd->arch.table, 0); |
| if (info->version != EFI_TABLE_VERSION) { |
| entry = (struct efi_entry_hdr *)((ulong)info + info->hdr_size); |
| while (entry->type != EFIET_END) { |
| if (entry->type == type) { |
| *datap = map_sysmem(entry->addr, entry->size); |
| entry = (struct efi_entry_hdr *)((ulong)entry + entry->link); |