aboutsummaryrefslogtreecommitdiffstats
path: root/gpxe/src/interface/efi/efi_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'gpxe/src/interface/efi/efi_init.c')
-rw-r--r--gpxe/src/interface/efi/efi_init.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/gpxe/src/interface/efi/efi_init.c b/gpxe/src/interface/efi/efi_init.c
index 6e54cf7e..ad550375 100644
--- a/gpxe/src/interface/efi/efi_init.c
+++ b/gpxe/src/interface/efi/efi_init.c
@@ -16,6 +16,8 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+FILE_LICENCE ( GPL2_OR_LATER );
+
#include <string.h>
#include <gpxe/efi/efi.h>
#include <gpxe/uuid.h>
@@ -26,18 +28,6 @@ EFI_HANDLE efi_image_handle;
/** System table passed to entry point */
EFI_SYSTEM_TABLE *efi_systab;
-/** Declared used EFI protocols */
-static struct efi_protocol efi_protocols[0] \
- __table_start ( struct efi_protocol, efi_protocols );
-static struct efi_protocol efi_protocols_end[0] \
- __table_end ( struct efi_protocol, efi_protocols );
-
-/** Declared used EFI configuration tables */
-static struct efi_config_table efi_config_tables[0] \
- __table_start ( struct efi_config_table, efi_config_tables );
-static struct efi_config_table efi_config_tables_end[0] \
- __table_end ( struct efi_config_table, efi_config_tables );
-
/**
* Look up EFI configuration table
*
@@ -92,7 +82,7 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle,
/* Look up used protocols */
bs = systab->BootServices;
- for ( prot = efi_protocols ; prot < efi_protocols_end ; prot++ ) {
+ for_each_table_entry ( prot, EFI_PROTOCOLS ) {
if ( ( efirc = bs->LocateProtocol ( &prot->u.guid, NULL,
prot->protocol ) ) == 0 ) {
DBGC ( systab, "EFI protocol %s is at %p\n",
@@ -106,7 +96,7 @@ EFI_STATUS efi_init ( EFI_HANDLE image_handle,
}
/* Look up used configuration tables */
- for ( tab = efi_config_tables ; tab < efi_config_tables_end ; tab++ ) {
+ for_each_table_entry ( tab, EFI_CONFIG_TABLES ) {
if ( ( *(tab->table) = efi_find_table ( &tab->u.guid ) ) ) {
DBGC ( systab, "EFI configuration table %s is at %p\n",
uuid_ntoa ( &tab->u.uuid ), *(tab->table) );