|
@@ -32,17 +32,82 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
32
|
32
|
#include <ipxe/uuid.h>
|
33
|
33
|
#include <ipxe/efi/efi.h>
|
34
|
34
|
#include <ipxe/efi/efi_driver.h>
|
|
35
|
+#include <ipxe/efi/Protocol/BlockIo.h>
|
|
36
|
+#include <ipxe/efi/Protocol/BusSpecificDriverOverride.h>
|
|
37
|
+#include <ipxe/efi/Protocol/ComponentName.h>
|
|
38
|
+#include <ipxe/efi/Protocol/ComponentName2.h>
|
35
|
39
|
#include <ipxe/efi/Protocol/DevicePath.h>
|
36
|
40
|
#include <ipxe/efi/Protocol/DevicePathToText.h>
|
37
|
|
-#include <ipxe/efi/Protocol/BlockIo.h>
|
38
|
41
|
#include <ipxe/efi/Protocol/DiskIo.h>
|
|
42
|
+#include <ipxe/efi/Protocol/DriverBinding.h>
|
|
43
|
+#include <ipxe/efi/Protocol/LoadFile.h>
|
|
44
|
+#include <ipxe/efi/Protocol/LoadFile2.h>
|
|
45
|
+#include <ipxe/efi/Protocol/LoadedImage.h>
|
|
46
|
+#include <ipxe/efi/Protocol/PciIo.h>
|
|
47
|
+#include <ipxe/efi/Protocol/PciRootBridgeIo.h>
|
39
|
48
|
#include <ipxe/efi/Protocol/SimpleFileSystem.h>
|
40
|
49
|
#include <ipxe/efi/Protocol/SimpleNetwork.h>
|
41
|
50
|
|
|
51
|
+/** Block I/O protocol GUID */
|
|
52
|
+static EFI_GUID efi_block_io_protocol_guid
|
|
53
|
+ = EFI_BLOCK_IO_PROTOCOL_GUID;
|
|
54
|
+
|
|
55
|
+/** Bus specific driver override protocol GUID */
|
|
56
|
+static EFI_GUID efi_bus_specific_driver_override_protocol_guid
|
|
57
|
+ = EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID;
|
|
58
|
+
|
|
59
|
+/** Component name protocol GUID */
|
|
60
|
+static EFI_GUID efi_component_name_protocol_guid
|
|
61
|
+ = EFI_COMPONENT_NAME_PROTOCOL_GUID;
|
|
62
|
+
|
|
63
|
+/** Component name 2 protocol GUID */
|
|
64
|
+static EFI_GUID efi_component_name2_protocol_guid
|
|
65
|
+ = EFI_COMPONENT_NAME2_PROTOCOL_GUID;
|
|
66
|
+
|
42
|
67
|
/** Device path protocol GUID */
|
43
|
68
|
static EFI_GUID efi_device_path_protocol_guid
|
44
|
69
|
= EFI_DEVICE_PATH_PROTOCOL_GUID;
|
45
|
70
|
|
|
71
|
+/** Disk I/O protocol GUID */
|
|
72
|
+static EFI_GUID efi_disk_io_protocol_guid
|
|
73
|
+ = EFI_DISK_IO_PROTOCOL_GUID;
|
|
74
|
+
|
|
75
|
+/** Driver binding protocol GUID */
|
|
76
|
+static EFI_GUID efi_driver_binding_protocol_guid
|
|
77
|
+ = EFI_DRIVER_BINDING_PROTOCOL_GUID;
|
|
78
|
+
|
|
79
|
+/** Load file protocol GUID */
|
|
80
|
+static EFI_GUID efi_load_file_protocol_guid
|
|
81
|
+ = EFI_LOAD_FILE_PROTOCOL_GUID;
|
|
82
|
+
|
|
83
|
+/** Load file 2 protocol GUID */
|
|
84
|
+static EFI_GUID efi_load_file2_protocol_guid
|
|
85
|
+ = EFI_LOAD_FILE2_PROTOCOL_GUID;
|
|
86
|
+
|
|
87
|
+/** Loaded image protocol GUID */
|
|
88
|
+static EFI_GUID efi_loaded_image_protocol_guid
|
|
89
|
+ = EFI_LOADED_IMAGE_PROTOCOL_GUID;
|
|
90
|
+
|
|
91
|
+/** Loaded image device path protocol GUID */
|
|
92
|
+static EFI_GUID efi_loaded_image_device_path_protocol_guid
|
|
93
|
+ = EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID;
|
|
94
|
+
|
|
95
|
+/** PCI I/O protocol GUID */
|
|
96
|
+static EFI_GUID efi_pci_io_protocol_guid
|
|
97
|
+ = EFI_PCI_IO_PROTOCOL_GUID;
|
|
98
|
+
|
|
99
|
+/** PCI root bridge I/O protocol GUID */
|
|
100
|
+static EFI_GUID efi_pci_root_bridge_io_protocol_guid
|
|
101
|
+ = EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID;
|
|
102
|
+
|
|
103
|
+/** Simple file system protocol GUID */
|
|
104
|
+static EFI_GUID efi_simple_file_system_protocol_guid
|
|
105
|
+ = EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
|
|
106
|
+
|
|
107
|
+/** Simple network protocol guid */
|
|
108
|
+static EFI_GUID efi_simple_network_protocol_guid
|
|
109
|
+ = EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
|
|
110
|
+
|
46
|
111
|
/** Device path to text protocol */
|
47
|
112
|
static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *efidpt;
|
48
|
113
|
EFI_REQUEST_PROTOCOL ( EFI_DEVICE_PATH_TO_TEXT_PROTOCOL, &efidpt );
|
|
@@ -50,20 +115,43 @@ EFI_REQUEST_PROTOCOL ( EFI_DEVICE_PATH_TO_TEXT_PROTOCOL, &efidpt );
|
50
|
115
|
/** A well-known GUID */
|
51
|
116
|
struct efi_well_known_guid {
|
52
|
117
|
/** GUID */
|
53
|
|
- EFI_GUID guid;
|
|
118
|
+ EFI_GUID *guid;
|
54
|
119
|
/** Name */
|
55
|
120
|
const char *name;
|
56
|
121
|
};
|
57
|
122
|
|
58
|
123
|
/** Well-known GUIDs */
|
59
|
124
|
static struct efi_well_known_guid efi_well_known_guids[] = {
|
60
|
|
- { EFI_BLOCK_IO_PROTOCOL_GUID, "BlockIo" },
|
61
|
|
- { EFI_DISK_IO_PROTOCOL_GUID, "DiskIo" },
|
62
|
|
- { EFI_DEVICE_PATH_PROTOCOL_GUID, "DevicePath" },
|
63
|
|
- { EFI_LOADED_IMAGE_PROTOCOL_GUID, "LoadedImage" },
|
64
|
|
- { EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID, "LoadedImageDevicePath" },
|
65
|
|
- { EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID, "SimpleFileSystem" },
|
66
|
|
- { EFI_SIMPLE_NETWORK_PROTOCOL_GUID, "SimpleNetwork" },
|
|
125
|
+ { &efi_block_io_protocol_guid,
|
|
126
|
+ "BlockIo" },
|
|
127
|
+ { &efi_bus_specific_driver_override_protocol_guid,
|
|
128
|
+ "BusSpecificDriverOverride" },
|
|
129
|
+ { &efi_component_name2_protocol_guid,
|
|
130
|
+ "ComponentName2" },
|
|
131
|
+ { &efi_component_name_protocol_guid,
|
|
132
|
+ "ComponentName" },
|
|
133
|
+ { &efi_device_path_protocol_guid,
|
|
134
|
+ "DevicePath" },
|
|
135
|
+ { &efi_driver_binding_protocol_guid,
|
|
136
|
+ "DriverBinding" },
|
|
137
|
+ { &efi_disk_io_protocol_guid,
|
|
138
|
+ "DiskIo" },
|
|
139
|
+ { &efi_load_file_protocol_guid,
|
|
140
|
+ "LoadFile" },
|
|
141
|
+ { &efi_load_file2_protocol_guid,
|
|
142
|
+ "LoadFile2" },
|
|
143
|
+ { &efi_loaded_image_protocol_guid,
|
|
144
|
+ "LoadedImage" },
|
|
145
|
+ { &efi_loaded_image_device_path_protocol_guid,
|
|
146
|
+ "LoadedImageDevicePath"},
|
|
147
|
+ { &efi_pci_io_protocol_guid,
|
|
148
|
+ "PciIo" },
|
|
149
|
+ { &efi_pci_root_bridge_io_protocol_guid,
|
|
150
|
+ "PciRootBridgeIo" },
|
|
151
|
+ { &efi_simple_file_system_protocol_guid,
|
|
152
|
+ "SimpleFileSystem" },
|
|
153
|
+ { &efi_simple_network_protocol_guid,
|
|
154
|
+ "SimpleNetwork" },
|
67
|
155
|
};
|
68
|
156
|
|
69
|
157
|
/**
|
|
@@ -82,7 +170,7 @@ const char * efi_guid_ntoa ( EFI_GUID *guid ) {
|
82
|
170
|
/* Check for a match against well-known GUIDs */
|
83
|
171
|
for ( i = 0 ; i < ( sizeof ( efi_well_known_guids ) /
|
84
|
172
|
sizeof ( efi_well_known_guids[0] ) ) ; i++ ) {
|
85
|
|
- if ( memcmp ( guid, &efi_well_known_guids[i].guid,
|
|
173
|
+ if ( memcmp ( guid, efi_well_known_guids[i].guid,
|
86
|
174
|
sizeof ( *guid ) ) == 0 ) {
|
87
|
175
|
return efi_well_known_guids[i].name;
|
88
|
176
|
}
|