Browse Source

[efi] Provide centralised definitions of commonly-used GUIDs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
3b42ed477f

+ 0
- 5
src/drivers/net/efi/snp.c View File

@@ -21,7 +21,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
21 21
 
22 22
 #include <errno.h>
23 23
 #include <ipxe/efi/efi.h>
24
-#include <ipxe/efi/Protocol/SimpleNetwork.h>
25 24
 #include <ipxe/efi/efi_driver.h>
26 25
 #include <ipxe/efi/efi_snp.h>
27 26
 #include "snpnet.h"
@@ -32,10 +31,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
32 31
  *
33 32
  */
34 33
 
35
-/** EFI simple network protocol GUID */
36
-static EFI_GUID efi_simple_network_protocol_guid
37
-	= EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
38
-
39 34
 /**
40 35
  * Check to see if driver supports a device
41 36
  *

+ 0
- 8
src/drivers/net/efi/snpnet.c View File

@@ -64,14 +64,6 @@ struct snp_nic {
64 64
 /** Maximum number of received packets per poll */
65 65
 #define SNP_RX_QUOTA 4
66 66
 
67
-/** EFI simple network protocol GUID */
68
-static EFI_GUID efi_simple_network_protocol_guid
69
-	= EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
70
-
71
-/** EFI PCI I/O protocol GUID */
72
-static EFI_GUID efi_pci_io_protocol_guid
73
-	= EFI_PCI_IO_PROTOCOL_GUID;
74
-
75 67
 /**
76 68
  * Format SNP MAC address (for debugging)
77 69
  *

+ 0
- 4
src/image/efi_image.c View File

@@ -52,10 +52,6 @@ FEATURE ( FEATURE_IMAGE, "EFI", DHCP_EB_FEATURE_EFI, 1 );
52 52
 			  "Could not start image" )
53 53
 #define EEFI_START( efirc ) EPLATFORM ( EINFO_EEFI_START, efirc )
54 54
 
55
-/** EFI loaded image protocol GUID */
56
-static EFI_GUID efi_loaded_image_protocol_guid =
57
-	EFI_LOADED_IMAGE_PROTOCOL_GUID;
58
-
59 55
 /**
60 56
  * Create device path for image
61 57
  *

+ 16
- 0
src/include/ipxe/efi/efi.h View File

@@ -153,6 +153,22 @@ struct efi_config_table {
153 153
  */
154 154
 #define EEFI( efirc ) EPLATFORM ( EINFO_EPLATFORM, efirc )
155 155
 
156
+extern EFI_GUID efi_block_io_protocol_guid;
157
+extern EFI_GUID efi_bus_specific_driver_override_protocol_guid;
158
+extern EFI_GUID efi_component_name_protocol_guid;
159
+extern EFI_GUID efi_component_name2_protocol_guid;
160
+extern EFI_GUID efi_device_path_protocol_guid;
161
+extern EFI_GUID efi_disk_io_protocol_guid;
162
+extern EFI_GUID efi_driver_binding_protocol_guid;
163
+extern EFI_GUID efi_load_file_protocol_guid;
164
+extern EFI_GUID efi_load_file2_protocol_guid;
165
+extern EFI_GUID efi_loaded_image_protocol_guid;
166
+extern EFI_GUID efi_loaded_image_device_path_protocol_guid;
167
+extern EFI_GUID efi_pci_io_protocol_guid;
168
+extern EFI_GUID efi_pci_root_bridge_io_protocol_guid;
169
+extern EFI_GUID efi_simple_file_system_protocol_guid;
170
+extern EFI_GUID efi_simple_network_protocol_guid;
171
+
156 172
 extern EFI_HANDLE efi_image_handle;
157 173
 extern EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;
158 174
 extern EFI_DEVICE_PATH_PROTOCOL *efi_loaded_image_path;

+ 0
- 4
src/interface/efi/efi_autoboot.c View File

@@ -30,10 +30,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
30 30
  *
31 31
  */
32 32
 
33
-/** EFI simple network protocol GUID */
34
-static EFI_GUID efi_simple_network_protocol_guid
35
-	= EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
36
-
37 33
 /**
38 34
  * Identify autoboot device
39 35
  *

+ 0
- 72
src/interface/efi/efi_debug.c View File

@@ -33,83 +33,11 @@ FILE_LICENCE ( GPL2_OR_LATER );
33 33
 #include <ipxe/base16.h>
34 34
 #include <ipxe/efi/efi.h>
35 35
 #include <ipxe/efi/efi_driver.h>
36
-#include <ipxe/efi/Protocol/BlockIo.h>
37
-#include <ipxe/efi/Protocol/BusSpecificDriverOverride.h>
38 36
 #include <ipxe/efi/Protocol/ComponentName.h>
39 37
 #include <ipxe/efi/Protocol/ComponentName2.h>
40
-#include <ipxe/efi/Protocol/DevicePath.h>
41 38
 #include <ipxe/efi/Protocol/DevicePathToText.h>
42
-#include <ipxe/efi/Protocol/DiskIo.h>
43
-#include <ipxe/efi/Protocol/DriverBinding.h>
44
-#include <ipxe/efi/Protocol/LoadFile.h>
45
-#include <ipxe/efi/Protocol/LoadFile2.h>
46
-#include <ipxe/efi/Protocol/LoadedImage.h>
47
-#include <ipxe/efi/Protocol/PciIo.h>
48
-#include <ipxe/efi/Protocol/PciRootBridgeIo.h>
49
-#include <ipxe/efi/Protocol/SimpleFileSystem.h>
50
-#include <ipxe/efi/Protocol/SimpleNetwork.h>
51 39
 #include <ipxe/efi/IndustryStandard/PeImage.h>
52 40
 
53
-/** Block I/O protocol GUID */
54
-static EFI_GUID efi_block_io_protocol_guid
55
-	= EFI_BLOCK_IO_PROTOCOL_GUID;
56
-
57
-/** Bus specific driver override protocol GUID */
58
-static EFI_GUID efi_bus_specific_driver_override_protocol_guid
59
-	= EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID;
60
-
61
-/** Component name protocol GUID */
62
-static EFI_GUID efi_component_name_protocol_guid
63
-	= EFI_COMPONENT_NAME_PROTOCOL_GUID;
64
-
65
-/** Component name 2 protocol GUID */
66
-static EFI_GUID efi_component_name2_protocol_guid
67
-	= EFI_COMPONENT_NAME2_PROTOCOL_GUID;
68
-
69
-/** Device path protocol GUID */
70
-static EFI_GUID efi_device_path_protocol_guid
71
-	= EFI_DEVICE_PATH_PROTOCOL_GUID;
72
-
73
-/** Disk I/O protocol GUID */
74
-static EFI_GUID efi_disk_io_protocol_guid
75
-	= EFI_DISK_IO_PROTOCOL_GUID;
76
-
77
-/** Driver binding protocol GUID */
78
-static EFI_GUID efi_driver_binding_protocol_guid
79
-	= EFI_DRIVER_BINDING_PROTOCOL_GUID;
80
-
81
-/** Load file protocol GUID */
82
-static EFI_GUID efi_load_file_protocol_guid
83
-	= EFI_LOAD_FILE_PROTOCOL_GUID;
84
-
85
-/** Load file 2 protocol GUID */
86
-static EFI_GUID efi_load_file2_protocol_guid
87
-	= EFI_LOAD_FILE2_PROTOCOL_GUID;
88
-
89
-/** Loaded image protocol GUID */
90
-static EFI_GUID efi_loaded_image_protocol_guid
91
-	= EFI_LOADED_IMAGE_PROTOCOL_GUID;
92
-
93
-/** Loaded image device path protocol GUID */
94
-static EFI_GUID efi_loaded_image_device_path_protocol_guid
95
-	= EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID;
96
-
97
-/** PCI I/O protocol GUID */
98
-static EFI_GUID efi_pci_io_protocol_guid
99
-	= EFI_PCI_IO_PROTOCOL_GUID;
100
-
101
-/** PCI root bridge I/O protocol GUID */
102
-static EFI_GUID efi_pci_root_bridge_io_protocol_guid
103
-	= EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID;
104
-
105
-/** Simple file system protocol GUID */
106
-static EFI_GUID efi_simple_file_system_protocol_guid
107
-	= EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
108
-
109
-/** Simple network protocol guid */
110
-static EFI_GUID efi_simple_network_protocol_guid
111
-	= EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
112
-
113 41
 /** Device path to text protocol */
114 42
 static EFI_DEVICE_PATH_TO_TEXT_PROTOCOL *efidpt;
115 43
 EFI_REQUEST_PROTOCOL ( EFI_DEVICE_PATH_TO_TEXT_PROTOCOL, &efidpt );

+ 0
- 12
src/interface/efi/efi_driver.c View File

@@ -40,18 +40,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
40 40
 
41 41
 static EFI_DRIVER_BINDING_PROTOCOL efi_driver_binding;
42 42
 
43
-/** EFI driver binding protocol GUID */
44
-static EFI_GUID efi_driver_binding_protocol_guid
45
-	= EFI_DRIVER_BINDING_PROTOCOL_GUID;
46
-
47
-/** EFI component name protocol GUID */
48
-static EFI_GUID efi_component_name2_protocol_guid
49
-	= EFI_COMPONENT_NAME2_PROTOCOL_GUID;
50
-
51
-/** EFI device path protocol GUID */
52
-static EFI_GUID efi_device_path_protocol_guid
53
-	= EFI_DEVICE_PATH_PROTOCOL_GUID;
54
-
55 43
 /** List of controlled EFI devices */
56 44
 static LIST_HEAD ( efi_devices );
57 45
 

+ 0
- 12
src/interface/efi/efi_file.c View File

@@ -42,24 +42,12 @@ FILE_LICENCE ( GPL2_OR_LATER );
42 42
 #include <ipxe/efi/efi_strings.h>
43 43
 #include <ipxe/efi/efi_file.h>
44 44
 
45
-/** EFI simple file system protocol GUID */
46
-static EFI_GUID efi_simple_file_system_protocol_guid
47
-	= EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
48
-
49 45
 /** EFI file information GUID */
50 46
 static EFI_GUID efi_file_info_id = EFI_FILE_INFO_ID;
51 47
 
52 48
 /** EFI file system information GUID */
53 49
 static EFI_GUID efi_file_system_info_id = EFI_FILE_SYSTEM_INFO_ID;
54 50
 
55
-/** EFI block I/O protocol GUID */
56
-static EFI_GUID efi_block_io_protocol_guid
57
-	= EFI_BLOCK_IO_PROTOCOL_GUID;
58
-
59
-/** EFI disk I/O protocol GUID */
60
-static EFI_GUID efi_disk_io_protocol_guid
61
-	= EFI_DISK_IO_PROTOCOL_GUID;
62
-
63 51
 /** EFI media ID */
64 52
 #define EFI_MEDIA_ID_MAGIC 0x69505845
65 53
 

+ 103
- 0
src/interface/efi/efi_guid.c View File

@@ -0,0 +1,103 @@
1
+/*
2
+ * Copyright (C) 2014 Michael Brown <mbrown@fensystems.co.uk>.
3
+ *
4
+ * This program is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU General Public License as
6
+ * published by the Free Software Foundation; either version 2 of the
7
+ * License, or any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful, but
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+ * General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17
+ * 02110-1301, USA.
18
+ */
19
+
20
+FILE_LICENCE ( GPL2_OR_LATER );
21
+
22
+#include <ipxe/efi/efi.h>
23
+#include <ipxe/efi/Protocol/BlockIo.h>
24
+#include <ipxe/efi/Protocol/BusSpecificDriverOverride.h>
25
+#include <ipxe/efi/Protocol/ComponentName.h>
26
+#include <ipxe/efi/Protocol/ComponentName2.h>
27
+#include <ipxe/efi/Protocol/DevicePath.h>
28
+#include <ipxe/efi/Protocol/DevicePathToText.h>
29
+#include <ipxe/efi/Protocol/DiskIo.h>
30
+#include <ipxe/efi/Protocol/DriverBinding.h>
31
+#include <ipxe/efi/Protocol/LoadFile.h>
32
+#include <ipxe/efi/Protocol/LoadFile2.h>
33
+#include <ipxe/efi/Protocol/LoadedImage.h>
34
+#include <ipxe/efi/Protocol/PciIo.h>
35
+#include <ipxe/efi/Protocol/PciRootBridgeIo.h>
36
+#include <ipxe/efi/Protocol/SimpleFileSystem.h>
37
+#include <ipxe/efi/Protocol/SimpleNetwork.h>
38
+
39
+/** @file
40
+ *
41
+ * EFI GUIDs
42
+ *
43
+ */
44
+
45
+/** Block I/O protocol GUID */
46
+EFI_GUID efi_block_io_protocol_guid
47
+	= EFI_BLOCK_IO_PROTOCOL_GUID;
48
+
49
+/** Bus specific driver override protocol GUID */
50
+EFI_GUID efi_bus_specific_driver_override_protocol_guid
51
+	= EFI_BUS_SPECIFIC_DRIVER_OVERRIDE_PROTOCOL_GUID;
52
+
53
+/** Component name protocol GUID */
54
+EFI_GUID efi_component_name_protocol_guid
55
+	= EFI_COMPONENT_NAME_PROTOCOL_GUID;
56
+
57
+/** Component name 2 protocol GUID */
58
+EFI_GUID efi_component_name2_protocol_guid
59
+	= EFI_COMPONENT_NAME2_PROTOCOL_GUID;
60
+
61
+/** Device path protocol GUID */
62
+EFI_GUID efi_device_path_protocol_guid
63
+	= EFI_DEVICE_PATH_PROTOCOL_GUID;
64
+
65
+/** Disk I/O protocol GUID */
66
+EFI_GUID efi_disk_io_protocol_guid
67
+	= EFI_DISK_IO_PROTOCOL_GUID;
68
+
69
+/** Driver binding protocol GUID */
70
+EFI_GUID efi_driver_binding_protocol_guid
71
+	= EFI_DRIVER_BINDING_PROTOCOL_GUID;
72
+
73
+/** Load file protocol GUID */
74
+EFI_GUID efi_load_file_protocol_guid
75
+	= EFI_LOAD_FILE_PROTOCOL_GUID;
76
+
77
+/** Load file 2 protocol GUID */
78
+EFI_GUID efi_load_file2_protocol_guid
79
+	= EFI_LOAD_FILE2_PROTOCOL_GUID;
80
+
81
+/** Loaded image protocol GUID */
82
+EFI_GUID efi_loaded_image_protocol_guid
83
+	= EFI_LOADED_IMAGE_PROTOCOL_GUID;
84
+
85
+/** Loaded image device path protocol GUID */
86
+EFI_GUID efi_loaded_image_device_path_protocol_guid
87
+	= EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID;
88
+
89
+/** PCI I/O protocol GUID */
90
+EFI_GUID efi_pci_io_protocol_guid
91
+	= EFI_PCI_IO_PROTOCOL_GUID;
92
+
93
+/** PCI root bridge I/O protocol GUID */
94
+EFI_GUID efi_pci_root_bridge_io_protocol_guid
95
+	= EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_GUID;
96
+
97
+/** Simple file system protocol GUID */
98
+EFI_GUID efi_simple_file_system_protocol_guid
99
+	= EFI_SIMPLE_FILE_SYSTEM_PROTOCOL_GUID;
100
+
101
+/** Simple network protocol guid */
102
+EFI_GUID efi_simple_network_protocol_guid
103
+	= EFI_SIMPLE_NETWORK_PROTOCOL_GUID;

+ 0
- 4
src/interface/efi/efi_init.c View File

@@ -35,10 +35,6 @@ EFI_LOADED_IMAGE_PROTOCOL *efi_loaded_image;
35 35
 /** System table passed to entry point */
36 36
 EFI_SYSTEM_TABLE *efi_systab;
37 37
 
38
-/** EFI loaded image protocol GUID */
39
-static EFI_GUID efi_loaded_image_protocol_guid
40
-	= EFI_LOADED_IMAGE_PROTOCOL_GUID;
41
-
42 38
 /** Event used to signal shutdown */
43 39
 static EFI_EVENT efi_shutdown_event;
44 40
 

+ 0
- 4
src/interface/efi/efi_pci.c View File

@@ -120,10 +120,6 @@ PROVIDE_PCIAPI_INLINE ( efi, pci_write_config_dword );
120 120
  ******************************************************************************
121 121
  */
122 122
 
123
-/** EFI PCI I/O protocol GUID */
124
-static EFI_GUID efi_pci_io_protocol_guid
125
-	= EFI_PCI_IO_PROTOCOL_GUID;
126
-
127 123
 /**
128 124
  * Open EFI PCI device
129 125
  *

+ 0
- 16
src/interface/efi/efi_snp.c View File

@@ -34,14 +34,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
34 34
 #include <ipxe/efi/efi_snp.h>
35 35
 #include <usr/autoboot.h>
36 36
 
37
-/** EFI simple network protocol GUID */
38
-static EFI_GUID efi_simple_network_protocol_guid
39
-	= EFI_SIMPLE_NETWORK_PROTOCOL_GUID;
40
-
41
-/** EFI device path protocol GUID */
42
-static EFI_GUID efi_device_path_protocol_guid
43
-	= EFI_DEVICE_PATH_PROTOCOL_GUID;
44
-
45 37
 /** EFI network interface identifier GUID */
46 38
 static EFI_GUID efi_nii_protocol_guid
47 39
 	= EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL_GUID;
@@ -56,14 +48,6 @@ static EFI_GUID efi_nii31_protocol_guid = {
56 48
 	{ 0xBC, 0x81, 0x76, 0x7F, 0x1F, 0x97, 0x7A, 0x89 }
57 49
 };
58 50
 
59
-/** EFI component name protocol GUID */
60
-static EFI_GUID efi_component_name2_protocol_guid
61
-	= EFI_COMPONENT_NAME2_PROTOCOL_GUID;
62
-
63
-/** EFI load file protocol GUID */
64
-static EFI_GUID efi_load_file_protocol_guid
65
-	= EFI_LOAD_FILE_PROTOCOL_GUID;
66
-
67 51
 /** List of SNP devices */
68 52
 static LIST_HEAD ( efi_snp_devices );
69 53
 

Loading…
Cancel
Save