2.4 [Defines] Section
This is a required section.
The [Defines]
section of EDK II INF files is used to define variable assignments that can be used in later build steps. The INF_VERSION of existing INF files does not need to be updated unless content in the file has been updated to match new content specified by this revision of the specification.
Architectural modifiers are not permitted in the [Defines] section.
The parsing utilities process any local symbol assignments defined in this section. The
EDK II parsing utilities will use some of this section's information for generating AutoGen.c
and AutoGen.h
files. Note that the sections are processed in the order listed in the INF file, and later assignments of these local symbols override previous assignments.
[Defines]
The format for entries in this section is:
Name = Value
The following is an example of a driver's [Defines]
section.
The following is an example of a library's [Defines]
section.
Drivers may expose library functionality, such as a DXE_CORE
module that may implement functions that satisfy the BaseMemoryAllocation library class. In this instance, the driver module would also specify the LIBRARY_CLASS
in the [Defines]
section. Other DXE drivers that would require a library instance for the BaseMemoryAllocation
class could specify the DXE_CORE
INF file as the recommended instance for satisfying the required library class instance.
Appendix F lists the available MODULE_TYPE
values supported by EDK II INF files.
The EDK II [Defines]
section is common to all architectures and does not permit using architectural modifiers in the section tag name.
The following table shows EDK II unique elements of a defines section that may be required for generating the AutoGen.c
and AutoGen.h
files. Library modules must never specify driver elements.
Note: Any lines not starting with one of the tag names defined in the table below are added to the top of the INF's generated makefile exactly as typed on the line in the INF file.
Note: COMBINED_PEIM_DRIVER
is a driver that may be dispatched by either the PEI Core or the Dxe Core. EDK II only references the first possible dispatch instance.
Table 1 EDK II [Defines] Section Elements
Tag | Required | Value | Notes |
| REQUIRED | 1.27 or 0x0001001B | This identifies the INF spec version. It is decimal value with fraction or two-nibble hexadecimal representation of the same, for example: 1.27. Tools use this value to handle parsing of previous releases of the specification if there are incompatible changes. |
| REQUIRED | A single word | This is a single word identifier that will be used for the component name. |
| Not required | Decimal or special format of hex | The minimum revision value across the module and all its dependent libraries. If a revision value is not declared in the module or any of the dependent libraries, then tools may use the value of 0, which disables checking. |
The | |||
| Not required | Decimal or special format of hex | The minimum revision value across the module and all its dependent libraries. If a revision value is not declared in the module or any of the dependent libraries, then tools may use the value of 0, which disables checking. |
The | |||
| REQUIRED | GUID Value | Registry (8-4-4-4-12) Format. This value is required for all EDK II format INF files. |
| REQUIRED | This is the type of module. One of the EDK II Module Types. For Library Modules, the | |
| Optional | UINT16 Value | This optional element, if present (or set in the DSC file), is used during the creation of the |
| Optional | String | If present, this value will be encoded as USC-2 characters in a Unicode file for the VERSION section of the FFS unless a ver or ver_ui file has been specified in the |
| Optional | Filename | A Unicode file containing UCS-2 character localization strings; the file path (if present) is relative to the directory containing the INF file. The use of #include statements in this file is prohibited. |
| Typically not specified for Driver; REQUIRED for Library only | Word | TypeList | One Library Class that is satisfied by this Library Instance; one or more |
| Not required - Driver Only | PEI_PCD_DRIVER or DXE_PCD_DRIVER | Only required for the two (PEI_PCD_DRIVER or DXE_PCD_DRIVER) PCD Driver modules. |
| Not required - Driver Only | CName | This is the name of the driver's entry point function. |
| Not required - Driver Only | CName | If a driver chooses to be unloadable, then this is the name of the module's function registered in the Loaded Image Protocol. It is called if the UEFI Boot Service UnloadImage() is called for the module, which then executes the Unload function, disconnecting itself from handles in the database as well as uninstalling any protocols that were installed in the driver entry point. |
| Not required - Library Only | CName | This only applies to components that are libraries. It is required for EDK II libraries if the module's INF contains a Constructor element. This value is used to call the specified function before calling into the library itself. |
| Not required - Library Only | CName | This only applies to components that are libraries. This value is used to call the specified function before calling into the library itself. |
| Not required - SEC, PEIM and PEI_CORE Driver modules only | TRUE | FALSE | This boolean operator is used by |
| Not required - Required for UEFI PCI Option ROMs | List of UINT16 Values | The list of PCI Device Ids for this device |
| Not required - Required for UEFI PCI Option ROMs | UINT16 Value | The PCI Vendor Id for this device |
| Not required - Required for UEFI PCI Option ROMs | UINT8 Value | The PCI Class Code for this device |
| Not required - Required for UEFI PCI Option ROMs | UINT8 Value | The PCI revision for this device |
| Not required UEFI PCI Option ROMs | TRUE | FALSE | This flag is used by tools to compress a PCI Option ROM image file, the default (if not specified) is FALSE |
| Not required - Driver Only | TRUE | FALSE | This boolean operator is used to indicate that the module will require a separate HII resource section in the efi image file. |
| Not required | Family | File | A user written makefile that will be used, the INF file will not be parsed. The Family is one of MSFT or GCC followed by a field separator "|" character, then the filename of the makefile in the same directory as the INF file. To keep GCC compatibility, the user must generate two Makefiles, one for MSFT, such as makefile and another for GCC, such as GNUmakefile |
| Not required | CName = Value | A User-specified #define CName Value pair that will be included in the |
| Not Required - Driver Only | Filename | If present, the file must contain all DEPEX statements (as defined in the UEFI PI specification), as the tools will process the file, ignoring any content in |
Last updated