3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Utility to create a GUID-to-name listing file that can
19 be used by other utilities. Basic operation is to take the
20 table of name+GUIDs that we have compiled into this utility,
21 and create a text file that can be parsed by other utilities
22 to do replacement of "name" with "GUID".
25 To add a new GUID to this database:
26 1. Add a "#include EFI_GUID_DEFINITION(name)" statement below
27 2. Modify the mGuidList[] array below to add the new GUID name
29 The only issue that may come up is that, if the source GUID file
30 is not in the standard GUID directory, then this utility won't
31 compile because the #include fails. In this case you'd need
32 to define a new macro (if it's in a standard place) or modify
33 this utility's makefile to add the path to your new .h file.
42 #include <Common/UefiBaseTypes.h>
43 #include <Guid/Apriori.h>
44 #include <Guid/AcpiTableStorage.h>
46 #include "EfiUtilityMsgs.h"
49 #define GUID_XREF(varname, guid) { \
50 #varname, #guid, guid \
55 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 \
65 // This is our table of all GUIDs we want to print out to create
66 // a GUID-to-name cross reference.
67 // Use the #defined name from the GUID definition's source .h file.
69 static GUID_LIST mGuidList
[] = {
70 GUID_XREF(gAprioriGuid
, EFI_APRIORI_GUID
),
71 GUID_XREF(gEfiAcpiTableStorageGuid
, EFI_ACPI_TABLE_STORAGE_GUID
),
72 // FIXME The next line was removed in the port to R9.
73 // GUID_XREF(gEfiDefaultBmpLogoGuid, EFI_DEFAULT_BMP_LOGO_GUID),
74 GUID_XREF(gEfiAcpiTableStorageGuid
, EFI_ACPI_TABLE_STORAGE_GUID
),
100 Print our GUID/name list to the specified output file.
103 OutFileName - name of the output file to write our results to.
115 // Open output file for writing. If the name is NULL, then write to stdout
117 if (OutFileName
!= NULL
) {
118 OutFptr
= fopen (OutFileName
, "w");
119 if (OutFptr
== NULL
) {
120 Error (NULL
, 0, 0, OutFileName
, "failed to open output file for writing");
127 for (Index
= 0; mGuidList
[Index
].VariableName
!= NULL
; Index
++) {
128 PrintGuidText (OutFptr
, mGuidList
[Index
].VariableName
, mGuidList
[Index
].DefineName
, &mGuidList
[Index
].Guid
);
131 // Close the output file if they specified one.
133 if (OutFileName
!= NULL
) {
137 return STATUS_SUCCESS
;
150 Print a GUID/name combo in INF-style format
152 guid-guid-guid-guid DEFINE_NAME gName
155 OutFptr - file pointer to which to write the output
156 VariableName - the GUID variable's name
157 DefineName - the name used in the #define
158 Guid - pointer to the GUID value
165 if (OutFptr
== NULL
) {
171 "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X %s %s\n",