12.07.2015 Views

EDK II Module Writer's Guide - Intel

EDK II Module Writer's Guide - Intel

EDK II Module Writer's Guide - Intel

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

• The header file for a Protocol is in \Include\Protocol.• The header file for a Guid is in \Include\Guid.Header files must be explicitly included in the module source code. For example:#include #include #include 3.2.8 Adding a Dependency to a <strong>Module</strong>The dependency expression gives the conditions for executing or dispatching a driver’sentry point. This helps determine the dispatch order for PEIM and DXE modules.An expression consists of one or more Protocol, PPI, or GUID with operators such as“AND”, “OR”, “TRUE”, “FALSE”, “NOT” etc.The Platform Initialization Specification gives detailed syntax for PEIM’s dependencyexpression in the “Dependency Expressions” chapter, and details for the DXE module’sdependency expression in the “Dependency Expression Grammar” chapter.The expression should be put in the INF’s depex section as follows:[depex]gEfiSampleGuid AND gEfiSamplePpiGuid3.3 Additional Steps for Library Instances3.3.1 Define Produced Library ClassA library instance is always related to a single library class and implements allinterfaces defined in the library class. Therefore, the library class name must bespecified in the [Defines] section of the library instance INF file as follows:[Defines]LIBRARY_CLASS = UefiDriverEntryPoint|DXE_DRIVER DXE_RUNTIME_DRIVERIn above sample, UefiDriverEntryPoint is the library class name produced by thelibrary instance. And following “DXE_DRIVER DXE_RUNTIME_DRIVER” are the type ofmodules to the library instance supports.3.3.2 Define a Library Constructor (Optional)The library instance module can define a library constructor function that is invokedby the entry point of each linked module. In a library constructor function, someinitialization work can be done before any library interface is used:25

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!