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.
43 #include <UefiBaseTypes.h>
45 #include "EfiUtilityMsgs.h"
48 #include <AcpiTableStorage.h>
51 #define GUID_XREF(varname, guid) { \
52 #varname, #guid, guid \
57 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 \
67 // This is our table of all GUIDs we want to print out to create
68 // a GUID-to-name cross reference.
69 // Use the #defined name from the GUID definition's source .h file.
71 static GUID_LIST mGuidList
[] = {
72 GUID_XREF(gAprioriGuid
, EFI_APRIORI_GUID
),
73 GUID_XREF(gEfiAcpiTableStorageGuid
, EFI_ACPI_TABLE_STORAGE_GUID
),
74 // FIXME The next line was removed in the port to R9.
75 // GUID_XREF(gEfiDefaultBmpLogoGuid, EFI_DEFAULT_BMP_LOGO_GUID),
76 GUID_XREF(gEfiAcpiTableStorageGuid
, EFI_ACPI_TABLE_STORAGE_GUID
),
102 Print our GUID/name list to the specified output file.
105 OutFileName - name of the output file to write our results to.
117 // Open output file for writing. If the name is NULL, then write to stdout
119 if (OutFileName
!= NULL
) {
120 OutFptr
= fopen (OutFileName
, "w");
121 if (OutFptr
== NULL
) {
122 Error (NULL
, 0, 0, OutFileName
, "failed to open output file for writing");
129 for (Index
= 0; mGuidList
[Index
].VariableName
!= NULL
; Index
++) {
130 PrintGuidText (OutFptr
, mGuidList
[Index
].VariableName
, mGuidList
[Index
].DefineName
, &mGuidList
[Index
].Guid
);
133 // Close the output file if they specified one.
135 if (OutFileName
!= NULL
) {
139 return STATUS_SUCCESS
;
152 Print a GUID/name combo in INF-style format
154 guid-guid-guid-guid DEFINE_NAME gName
157 OutFptr - file pointer to which to write the output
158 VariableName - the GUID variable's name
159 DefineName - the name used in the #define
160 Guid - pointer to the GUID value
167 if (OutFptr
== NULL
) {
173 "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X %s %s\n",