4 Step #1 - When a FV protocol is added to the system every driver in the FV
5 is added to the mDiscoveredList. The Before, and After Depex are
6 pre-processed as drivers are added to the mDiscoveredList. If an Apriori
7 file exists in the FV those drivers are addeded to the
8 mScheduledQueue. The mFvHandleList is used to make sure a
9 FV is only processed once.
11 Step #2 - Dispatch. Remove driver from the mScheduledQueue and load and
12 start it. After mScheduledQueue is drained check the
13 mDiscoveredList to see if any item has a Depex that is ready to
14 be placed on the mScheduledQueue.
16 Step #3 - Adding to the mScheduledQueue requires that you process Before
17 and After dependencies. This is done recursively as the call to add
18 to the mScheduledQueue checks for Before and recursively adds
19 all Befores. It then addes the item that was passed in and then
20 processess the After dependecies by recursively calling the routine.
23 The rules for the dispatcher are similar to the DXE dispatcher.
25 The rules for DXE dispatcher are in chapter 10 of the DXE CIS. Figure 10-3
26 is the state diagram for the DXE dispatcher
28 Depex - Dependency Expresion.
30 Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
31 Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>
32 This program and the accompanying materials are licensed and made available
33 under the terms and conditions of the BSD License which accompanies this
34 distribution. The full text of the license may be found at
35 http://opensource.org/licenses/bsd-license.php
37 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
38 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
42 #include "PiSmmCore.h"
45 // SMM Dispatcher Data structures
47 #define KNOWN_HANDLE_SIGNATURE SIGNATURE_32('k','n','o','w')
50 LIST_ENTRY Link
; // mFvHandleList
55 // Function Prototypes
59 Insert InsertedDriverEntry onto the mScheduledQueue. To do this you
60 must add any driver with a before dependency on InsertedDriverEntry first.
61 You do this by recursively calling this routine. After all the Befores are
62 processed you can add InsertedDriverEntry to the mScheduledQueue.
63 Then you can add any driver with an After dependency on InsertedDriverEntry
64 by recursively calling this routine.
66 @param InsertedDriverEntry The driver to insert on the ScheduledLink Queue
70 SmmInsertOnScheduledQueueWhileProcessingBeforeAndAfter (
71 IN EFI_SMM_DRIVER_ENTRY
*InsertedDriverEntry
75 // The Driver List contains one copy of every driver that has been discovered.
76 // Items are never removed from the driver list. List of EFI_SMM_DRIVER_ENTRY
78 LIST_ENTRY mDiscoveredList
= INITIALIZE_LIST_HEAD_VARIABLE (mDiscoveredList
);
81 // Queue of drivers that are ready to dispatch. This queue is a subset of the
82 // mDiscoveredList.list of EFI_SMM_DRIVER_ENTRY.
84 LIST_ENTRY mScheduledQueue
= INITIALIZE_LIST_HEAD_VARIABLE (mScheduledQueue
);
87 // List of handles who's Fv's have been parsed and added to the mFwDriverList.
89 LIST_ENTRY mFvHandleList
= INITIALIZE_LIST_HEAD_VARIABLE (mFvHandleList
);
92 // Flag for the SMM Dispacher. TRUE if dispatcher is execuing.
94 BOOLEAN gDispatcherRunning
= FALSE
;
97 // Flag for the SMM Dispacher. TRUE if there is one or more SMM drivers ready to be dispatched
99 BOOLEAN gRequestDispatch
= FALSE
;
102 // List of file types supported by dispatcher
104 EFI_FV_FILETYPE mSmmFileTypes
[] = {
106 EFI_FV_FILETYPE_COMBINED_SMM_DXE
108 // Note: DXE core will process the FV image file, so skip it in SMM core
109 // EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE
114 MEDIA_FW_VOL_FILEPATH_DEVICE_PATH File
;
115 EFI_DEVICE_PATH_PROTOCOL End
;
116 } FV_FILEPATH_DEVICE_PATH
;
118 FV_FILEPATH_DEVICE_PATH mFvDevicePath
;
121 // DXE Architecture Protocols
123 EFI_SECURITY_ARCH_PROTOCOL
*mSecurity
= NULL
;
124 EFI_SECURITY2_ARCH_PROTOCOL
*mSecurity2
= NULL
;
127 // The global variable is defined for Loading modules at fixed address feature to track the SMM code
128 // memory range usage. It is a bit mapped array in which every bit indicates the correspoding
129 // memory page available or not.
131 GLOBAL_REMOVE_IF_UNREFERENCED UINT64
*mSmmCodeMemoryRangeUsageBitMap
=NULL
;
134 To check memory usage bit map array to figure out if the memory range in which the image will be loaded is available or not. If
135 memory range is avaliable, the function will mark the correponding bits to 1 which indicates the memory range is used.
136 The function is only invoked when load modules at fixed address feature is enabled.
138 @param ImageBase The base addres the image will be loaded at.
139 @param ImageSize The size of the image
141 @retval EFI_SUCCESS The memory range the image will be loaded in is available
142 @retval EFI_NOT_FOUND The memory range the image will be loaded in is not available
145 CheckAndMarkFixLoadingMemoryUsageBitMap (
146 IN EFI_PHYSICAL_ADDRESS ImageBase
,
150 UINT32 SmmCodePageNumber
;
152 EFI_PHYSICAL_ADDRESS SmmCodeBase
;
153 UINTN BaseOffsetPageNumber
;
154 UINTN TopOffsetPageNumber
;
157 // Build tool will calculate the smm code size and then patch the PcdLoadFixAddressSmmCodePageNumber
159 SmmCodePageNumber
= PcdGet32(PcdLoadFixAddressSmmCodePageNumber
);
160 SmmCodeSize
= EFI_PAGES_TO_SIZE (SmmCodePageNumber
);
161 SmmCodeBase
= gLoadModuleAtFixAddressSmramBase
;
164 // If the memory usage bit map is not initialized, do it. Every bit in the array
165 // indicate the status of the corresponding memory page, available or not
167 if (mSmmCodeMemoryRangeUsageBitMap
== NULL
) {
168 mSmmCodeMemoryRangeUsageBitMap
= AllocateZeroPool(((SmmCodePageNumber
/ 64) + 1)*sizeof(UINT64
));
171 // If the Dxe code memory range is not allocated or the bit map array allocation failed, return EFI_NOT_FOUND
173 if (mSmmCodeMemoryRangeUsageBitMap
== NULL
) {
174 return EFI_NOT_FOUND
;
177 // see if the memory range for loading the image is in the SMM code range.
179 if (SmmCodeBase
+ SmmCodeSize
< ImageBase
+ ImageSize
|| SmmCodeBase
> ImageBase
) {
180 return EFI_NOT_FOUND
;
183 // Test if the memory is avalaible or not.
185 BaseOffsetPageNumber
= (UINTN
)EFI_SIZE_TO_PAGES((UINT32
)(ImageBase
- SmmCodeBase
));
186 TopOffsetPageNumber
= (UINTN
)EFI_SIZE_TO_PAGES((UINT32
)(ImageBase
+ ImageSize
- SmmCodeBase
));
187 for (Index
= BaseOffsetPageNumber
; Index
< TopOffsetPageNumber
; Index
++) {
188 if ((mSmmCodeMemoryRangeUsageBitMap
[Index
/ 64] & LShiftU64(1, (Index
% 64))) != 0) {
190 // This page is already used.
192 return EFI_NOT_FOUND
;
197 // Being here means the memory range is available. So mark the bits for the memory range
199 for (Index
= BaseOffsetPageNumber
; Index
< TopOffsetPageNumber
; Index
++) {
200 mSmmCodeMemoryRangeUsageBitMap
[Index
/ 64] |= LShiftU64(1, (Index
% 64));
205 Get the fixed loadding address from image header assigned by build tool. This function only be called
206 when Loading module at Fixed address feature enabled.
208 @param ImageContext Pointer to the image context structure that describes the PE/COFF
209 image that needs to be examined by this function.
210 @retval EFI_SUCCESS An fixed loading address is assigned to this image by build tools .
211 @retval EFI_NOT_FOUND The image has no assigned fixed loadding address.
215 GetPeCoffImageFixLoadingAssignedAddress(
216 IN OUT PE_COFF_LOADER_IMAGE_CONTEXT
*ImageContext
219 UINTN SectionHeaderOffset
;
221 EFI_IMAGE_SECTION_HEADER SectionHeader
;
222 EFI_IMAGE_OPTIONAL_HEADER_UNION
*ImgHdr
;
223 EFI_PHYSICAL_ADDRESS FixLoaddingAddress
;
226 UINT16 NumberOfSections
;
227 UINT64 ValueInSectionHeader
;
229 FixLoaddingAddress
= 0;
230 Status
= EFI_NOT_FOUND
;
233 // Get PeHeader pointer
235 ImgHdr
= (EFI_IMAGE_OPTIONAL_HEADER_UNION
*)((CHAR8
* )ImageContext
->Handle
+ ImageContext
->PeCoffHeaderOffset
);
236 SectionHeaderOffset
= (UINTN
)(
237 ImageContext
->PeCoffHeaderOffset
+
239 sizeof (EFI_IMAGE_FILE_HEADER
) +
240 ImgHdr
->Pe32
.FileHeader
.SizeOfOptionalHeader
242 NumberOfSections
= ImgHdr
->Pe32
.FileHeader
.NumberOfSections
;
245 // Get base address from the first section header that doesn't point to code section.
247 for (Index
= 0; Index
< NumberOfSections
; Index
++) {
249 // Read section header from file
251 Size
= sizeof (EFI_IMAGE_SECTION_HEADER
);
252 Status
= ImageContext
->ImageRead (
253 ImageContext
->Handle
,
258 if (EFI_ERROR (Status
)) {
262 Status
= EFI_NOT_FOUND
;
264 if ((SectionHeader
.Characteristics
& EFI_IMAGE_SCN_CNT_CODE
) == 0) {
266 // Build tool will save the address in PointerToRelocations & PointerToLineNumbers fields in the first section header
267 // that doesn't point to code section in image header.So there is an assumption that when the feature is enabled,
268 // if a module with a loading address assigned by tools, the PointerToRelocations & PointerToLineNumbers fields
269 // should not be Zero, or else, these 2 fileds should be set to Zero
271 ValueInSectionHeader
= ReadUnaligned64((UINT64
*)&SectionHeader
.PointerToRelocations
);
272 if (ValueInSectionHeader
!= 0) {
274 // Found first section header that doesn't point to code section in which uild tool saves the
275 // offset to SMRAM base as image base in PointerToRelocations & PointerToLineNumbers fields
277 FixLoaddingAddress
= (EFI_PHYSICAL_ADDRESS
)(gLoadModuleAtFixAddressSmramBase
+ (INT64
)ValueInSectionHeader
);
279 // Check if the memory range is avaliable.
281 Status
= CheckAndMarkFixLoadingMemoryUsageBitMap (FixLoaddingAddress
, (UINTN
)(ImageContext
->ImageSize
+ ImageContext
->SectionAlignment
));
282 if (!EFI_ERROR(Status
)) {
284 // The assigned address is valid. Return the specified loadding address
286 ImageContext
->ImageAddress
= FixLoaddingAddress
;
291 SectionHeaderOffset
+= sizeof (EFI_IMAGE_SECTION_HEADER
);
293 DEBUG ((EFI_D_INFO
|EFI_D_LOAD
, "LOADING MODULE FIXED INFO: Loading module at fixed address %x, Status = %r\n", FixLoaddingAddress
, Status
));
297 Loads an EFI image into SMRAM.
299 @param DriverEntry EFI_SMM_DRIVER_ENTRY instance
307 IN OUT EFI_SMM_DRIVER_ENTRY
*DriverEntry
310 UINT32 AuthenticationStatus
;
317 EFI_STATUS SecurityStatus
;
318 EFI_HANDLE DeviceHandle
;
319 EFI_PHYSICAL_ADDRESS DstBuffer
;
320 EFI_DEVICE_PATH_PROTOCOL
*FilePath
;
321 EFI_DEVICE_PATH_PROTOCOL
*OriginalFilePath
;
322 EFI_DEVICE_PATH_PROTOCOL
*HandleFilePath
;
323 EFI_FIRMWARE_VOLUME2_PROTOCOL
*Fv
;
324 PE_COFF_LOADER_IMAGE_CONTEXT ImageContext
;
329 Tick
= GetPerformanceCounter ();
334 Fv
= DriverEntry
->Fv
;
335 NameGuid
= &DriverEntry
->FileName
;
336 FilePath
= DriverEntry
->FvFileDevicePath
;
338 OriginalFilePath
= FilePath
;
339 HandleFilePath
= FilePath
;
341 SecurityStatus
= EFI_SUCCESS
;
342 Status
= EFI_SUCCESS
;
343 AuthenticationStatus
= 0;
346 // Try to get the image device handle by checking the match protocol.
348 Status
= gBS
->LocateDevicePath (&gEfiFirmwareVolume2ProtocolGuid
, &HandleFilePath
, &DeviceHandle
);
349 if (EFI_ERROR(Status
)) {
354 // If the Security2 and Security Architectural Protocol has not been located yet, then attempt to locate it
356 if (mSecurity2
== NULL
) {
357 gBS
->LocateProtocol (&gEfiSecurity2ArchProtocolGuid
, NULL
, (VOID
**)&mSecurity2
);
359 if (mSecurity
== NULL
) {
360 gBS
->LocateProtocol (&gEfiSecurityArchProtocolGuid
, NULL
, (VOID
**)&mSecurity
);
363 // When Security2 is installed, Security Architectural Protocol must be published.
365 ASSERT (mSecurity2
== NULL
|| mSecurity
!= NULL
);
368 // Pull out just the file portion of the DevicePath for the LoadedImage FilePath
370 FilePath
= OriginalFilePath
;
371 Status
= gBS
->HandleProtocol (DeviceHandle
, &gEfiDevicePathProtocolGuid
, (VOID
**)&HandleFilePath
);
372 if (!EFI_ERROR (Status
)) {
373 FilePathSize
= GetDevicePathSize (HandleFilePath
) - sizeof(EFI_DEVICE_PATH_PROTOCOL
);
374 FilePath
= (EFI_DEVICE_PATH_PROTOCOL
*) (((UINT8
*)FilePath
) + FilePathSize
);
378 // Try reading PE32 section firstly
380 Status
= Fv
->ReadSection (
387 &AuthenticationStatus
390 if (EFI_ERROR (Status
)) {
392 // Try reading TE section secondly
396 Status
= Fv
->ReadSection (
403 &AuthenticationStatus
407 if (EFI_ERROR (Status
)) {
408 if (Buffer
!= NULL
) {
409 gBS
->FreePool (Buffer
);
415 // Verify File Authentication through the Security2 Architectural Protocol
417 if (mSecurity2
!= NULL
) {
418 SecurityStatus
= mSecurity2
->FileAuthentication (
428 // Verify the Authentication Status through the Security Architectural Protocol
429 // Only on images that have been read using Firmware Volume protocol.
430 // All SMM images are from FV protocol.
432 if (!EFI_ERROR (SecurityStatus
) && (mSecurity
!= NULL
)) {
433 SecurityStatus
= mSecurity
->FileAuthenticationState (
435 AuthenticationStatus
,
440 if (EFI_ERROR (SecurityStatus
) && SecurityStatus
!= EFI_SECURITY_VIOLATION
) {
441 Status
= SecurityStatus
;
446 // Initialize ImageContext
448 ImageContext
.Handle
= Buffer
;
449 ImageContext
.ImageRead
= PeCoffLoaderImageReadFromMemory
;
452 // Get information about the image being loaded
454 Status
= PeCoffLoaderGetImageInfo (&ImageContext
);
455 if (EFI_ERROR (Status
)) {
456 if (Buffer
!= NULL
) {
457 gBS
->FreePool (Buffer
);
462 // if Loading module at Fixed Address feature is enabled, then cut out a memory range started from TESG BASE
463 // to hold the Smm driver code
465 if (PcdGet64(PcdLoadModuleAtFixAddressEnable
) != 0) {
467 // Get the fixed loading address assigned by Build tool
469 Status
= GetPeCoffImageFixLoadingAssignedAddress (&ImageContext
);
470 if (!EFI_ERROR (Status
)) {
472 // Since the memory range to load Smm core alreay been cut out, so no need to allocate and free this range
473 // following statements is to bypass SmmFreePages
476 DstBuffer
= (UINTN
)gLoadModuleAtFixAddressSmramBase
;
478 DEBUG ((EFI_D_INFO
|EFI_D_LOAD
, "LOADING MODULE FIXED ERROR: Failed to load module at fixed address. \n"));
480 // allocate the memory to load the SMM driver
482 PageCount
= (UINTN
)EFI_SIZE_TO_PAGES((UINTN
)ImageContext
.ImageSize
+ ImageContext
.SectionAlignment
);
483 DstBuffer
= (UINTN
)(-1);
485 Status
= SmmAllocatePages (
487 EfiRuntimeServicesCode
,
491 if (EFI_ERROR (Status
)) {
492 if (Buffer
!= NULL
) {
493 gBS
->FreePool (Buffer
);
497 ImageContext
.ImageAddress
= (EFI_PHYSICAL_ADDRESS
)DstBuffer
;
500 PageCount
= (UINTN
)EFI_SIZE_TO_PAGES((UINTN
)ImageContext
.ImageSize
+ ImageContext
.SectionAlignment
);
501 DstBuffer
= (UINTN
)(-1);
503 Status
= SmmAllocatePages (
505 EfiRuntimeServicesCode
,
509 if (EFI_ERROR (Status
)) {
510 if (Buffer
!= NULL
) {
511 gBS
->FreePool (Buffer
);
516 ImageContext
.ImageAddress
= (EFI_PHYSICAL_ADDRESS
)DstBuffer
;
519 // Align buffer on section boundry
521 ImageContext
.ImageAddress
+= ImageContext
.SectionAlignment
- 1;
522 ImageContext
.ImageAddress
&= ~((EFI_PHYSICAL_ADDRESS
)(ImageContext
.SectionAlignment
- 1));
525 // Load the image to our new buffer
527 Status
= PeCoffLoaderLoadImage (&ImageContext
);
528 if (EFI_ERROR (Status
)) {
529 if (Buffer
!= NULL
) {
530 gBS
->FreePool (Buffer
);
532 SmmFreePages (DstBuffer
, PageCount
);
537 // Relocate the image in our new buffer
539 Status
= PeCoffLoaderRelocateImage (&ImageContext
);
540 if (EFI_ERROR (Status
)) {
541 if (Buffer
!= NULL
) {
542 gBS
->FreePool (Buffer
);
544 SmmFreePages (DstBuffer
, PageCount
);
549 // Flush the instruction cache so the image data are written before we execute it
551 InvalidateInstructionCacheRange ((VOID
*)(UINTN
) ImageContext
.ImageAddress
, (UINTN
) ImageContext
.ImageSize
);
554 // Save Image EntryPoint in DriverEntry
556 DriverEntry
->ImageEntryPoint
= ImageContext
.EntryPoint
;
557 DriverEntry
->ImageBuffer
= DstBuffer
;
558 DriverEntry
->NumberOfPage
= PageCount
;
561 // Allocate a Loaded Image Protocol in EfiBootServicesData
563 Status
= gBS
->AllocatePool (EfiBootServicesData
, sizeof (EFI_LOADED_IMAGE_PROTOCOL
), (VOID
**)&DriverEntry
->LoadedImage
);
564 if (EFI_ERROR (Status
)) {
565 if (Buffer
!= NULL
) {
566 gBS
->FreePool (Buffer
);
568 SmmFreePages (DstBuffer
, PageCount
);
572 ZeroMem (DriverEntry
->LoadedImage
, sizeof (EFI_LOADED_IMAGE_PROTOCOL
));
574 // Fill in the remaining fields of the Loaded Image Protocol instance.
575 // Note: ImageBase is an SMRAM address that can not be accessed outside of SMRAM if SMRAM window is closed.
577 DriverEntry
->LoadedImage
->Revision
= EFI_LOADED_IMAGE_PROTOCOL_REVISION
;
578 DriverEntry
->LoadedImage
->ParentHandle
= gSmmCorePrivate
->SmmIplImageHandle
;
579 DriverEntry
->LoadedImage
->SystemTable
= gST
;
580 DriverEntry
->LoadedImage
->DeviceHandle
= DeviceHandle
;
583 // Make an EfiBootServicesData buffer copy of FilePath
585 Status
= gBS
->AllocatePool (EfiBootServicesData
, GetDevicePathSize (FilePath
), (VOID
**)&DriverEntry
->LoadedImage
->FilePath
);
586 if (EFI_ERROR (Status
)) {
587 if (Buffer
!= NULL
) {
588 gBS
->FreePool (Buffer
);
590 SmmFreePages (DstBuffer
, PageCount
);
593 CopyMem (DriverEntry
->LoadedImage
->FilePath
, FilePath
, GetDevicePathSize (FilePath
));
595 DriverEntry
->LoadedImage
->ImageBase
= (VOID
*)(UINTN
)DriverEntry
->ImageBuffer
;
596 DriverEntry
->LoadedImage
->ImageSize
= ImageContext
.ImageSize
;
597 DriverEntry
->LoadedImage
->ImageCodeType
= EfiRuntimeServicesCode
;
598 DriverEntry
->LoadedImage
->ImageDataType
= EfiRuntimeServicesData
;
601 // Create a new image handle in the UEFI handle database for the SMM Driver
603 DriverEntry
->ImageHandle
= NULL
;
604 Status
= gBS
->InstallMultipleProtocolInterfaces (
605 &DriverEntry
->ImageHandle
,
606 &gEfiLoadedImageProtocolGuid
, DriverEntry
->LoadedImage
,
610 PERF_START (DriverEntry
->ImageHandle
, "LoadImage:", NULL
, Tick
);
611 PERF_END (DriverEntry
->ImageHandle
, "LoadImage:", NULL
, 0);
614 // Print the load address and the PDB file name if it is available
621 CHAR8 EfiFileName
[256];
624 DEBUG ((DEBUG_INFO
| DEBUG_LOAD
,
625 "Loading SMM driver at 0x%11p EntryPoint=0x%11p ",
626 (VOID
*)(UINTN
) ImageContext
.ImageAddress
,
627 FUNCTION_ENTRY_POINT (ImageContext
.EntryPoint
)));
631 // Print Module Name by Pdb file path.
632 // Windows and Unix style file path are all trimmed correctly.
634 if (ImageContext
.PdbPointer
!= NULL
) {
636 for (Index
= 0; ImageContext
.PdbPointer
[Index
] != 0; Index
++) {
637 if ((ImageContext
.PdbPointer
[Index
] == '\\') || (ImageContext
.PdbPointer
[Index
] == '/')) {
638 StartIndex
= Index
+ 1;
642 // Copy the PDB file name to our temporary string, and replace .pdb with .efi
643 // The PDB file name is limited in the range of 0~255.
644 // If the length is bigger than 255, trim the redudant characters to avoid overflow in array boundary.
646 for (Index
= 0; Index
< sizeof (EfiFileName
) - 4; Index
++) {
647 EfiFileName
[Index
] = ImageContext
.PdbPointer
[Index
+ StartIndex
];
648 if (EfiFileName
[Index
] == 0) {
649 EfiFileName
[Index
] = '.';
651 if (EfiFileName
[Index
] == '.') {
652 EfiFileName
[Index
+ 1] = 'e';
653 EfiFileName
[Index
+ 2] = 'f';
654 EfiFileName
[Index
+ 3] = 'i';
655 EfiFileName
[Index
+ 4] = 0;
660 if (Index
== sizeof (EfiFileName
) - 4) {
661 EfiFileName
[Index
] = 0;
663 DEBUG ((DEBUG_INFO
| DEBUG_LOAD
, "%a", EfiFileName
)); // &Image->ImageContext.PdbPointer[StartIndex]));
665 DEBUG ((DEBUG_INFO
| DEBUG_LOAD
, "\n"));
670 // Free buffer allocated by Fv->ReadSection.
672 // The UEFI Boot Services FreePool() function must be used because Fv->ReadSection
673 // used the UEFI Boot Services AllocatePool() function
675 Status
= gBS
->FreePool(Buffer
);
676 if (!EFI_ERROR (Status
) && EFI_ERROR (SecurityStatus
)) {
677 Status
= SecurityStatus
;
683 Preprocess dependency expression and update DriverEntry to reflect the
684 state of Before and After dependencies. If DriverEntry->Before
685 or DriverEntry->After is set it will never be cleared.
687 @param DriverEntry DriverEntry element to update .
689 @retval EFI_SUCCESS It always works.
694 IN EFI_SMM_DRIVER_ENTRY
*DriverEntry
699 Iterator
= DriverEntry
->Depex
;
700 DriverEntry
->Dependent
= TRUE
;
702 if (*Iterator
== EFI_DEP_BEFORE
) {
703 DriverEntry
->Before
= TRUE
;
704 } else if (*Iterator
== EFI_DEP_AFTER
) {
705 DriverEntry
->After
= TRUE
;
708 if (DriverEntry
->Before
|| DriverEntry
->After
) {
709 CopyMem (&DriverEntry
->BeforeAfterGuid
, Iterator
+ 1, sizeof (EFI_GUID
));
716 Read Depex and pre-process the Depex for Before and After. If Section Extraction
717 protocol returns an error via ReadSection defer the reading of the Depex.
719 @param DriverEntry Driver to work on.
721 @retval EFI_SUCCESS Depex read and preprossesed
722 @retval EFI_PROTOCOL_ERROR The section extraction protocol returned an error
723 and Depex reading needs to be retried.
724 @retval Error DEPEX not found.
728 SmmGetDepexSectionAndPreProccess (
729 IN EFI_SMM_DRIVER_ENTRY
*DriverEntry
733 EFI_SECTION_TYPE SectionType
;
734 UINT32 AuthenticationStatus
;
735 EFI_FIRMWARE_VOLUME2_PROTOCOL
*Fv
;
737 Fv
= DriverEntry
->Fv
;
740 // Grab Depex info, it will never be free'ed.
741 // (Note: DriverEntry->Depex is in DXE memory)
743 SectionType
= EFI_SECTION_SMM_DEPEX
;
744 Status
= Fv
->ReadSection (
746 &DriverEntry
->FileName
,
750 (UINTN
*)&DriverEntry
->DepexSize
,
751 &AuthenticationStatus
753 if (EFI_ERROR (Status
)) {
754 if (Status
== EFI_PROTOCOL_ERROR
) {
756 // The section extraction protocol failed so set protocol error flag
758 DriverEntry
->DepexProtocolError
= TRUE
;
761 // If no Depex assume depend on all architectural protocols
763 DriverEntry
->Depex
= NULL
;
764 DriverEntry
->Dependent
= TRUE
;
765 DriverEntry
->DepexProtocolError
= FALSE
;
769 // Set Before and After state information based on Depex
770 // Driver will be put in Dependent state
772 SmmPreProcessDepex (DriverEntry
);
773 DriverEntry
->DepexProtocolError
= FALSE
;
780 This is the main Dispatcher for SMM and it exits when there are no more
781 drivers to run. Drain the mScheduledQueue and load and start a PE
782 image for each driver. Search the mDiscoveredList to see if any driver can
783 be placed on the mScheduledQueue. If no drivers are placed on the
784 mScheduledQueue exit the function.
786 @retval EFI_SUCCESS All of the SMM Drivers that could be dispatched
787 have been run and the SMM Entry Point has been
789 @retval EFI_NOT_READY The SMM Driver that registered the SMM Entry Point
791 @retval EFI_NOT_FOUND There are no SMM Drivers available to be dispatched.
792 @retval EFI_ALREADY_STARTED The SMM Dispatcher is already running
802 EFI_SMM_DRIVER_ENTRY
*DriverEntry
;
804 BOOLEAN PreviousSmmEntryPointRegistered
;
806 if (!gRequestDispatch
) {
807 return EFI_NOT_FOUND
;
810 if (gDispatcherRunning
) {
812 // If the dispatcher is running don't let it be restarted.
814 return EFI_ALREADY_STARTED
;
817 gDispatcherRunning
= TRUE
;
821 // Drain the Scheduled Queue
823 while (!IsListEmpty (&mScheduledQueue
)) {
825 mScheduledQueue
.ForwardLink
,
826 EFI_SMM_DRIVER_ENTRY
,
828 EFI_SMM_DRIVER_ENTRY_SIGNATURE
832 // Load the SMM Driver image into memory. If the Driver was transitioned from
833 // Untrused to Scheduled it would have already been loaded so we may need to
834 // skip the LoadImage
836 if (DriverEntry
->ImageHandle
== NULL
) {
837 Status
= SmmLoadImage (DriverEntry
);
840 // Update the driver state to reflect that it's been loaded
842 if (EFI_ERROR (Status
)) {
844 // The SMM Driver could not be loaded, and do not attempt to load or start it again.
845 // Take driver from Scheduled to Initialized.
847 DriverEntry
->Initialized
= TRUE
;
848 DriverEntry
->Scheduled
= FALSE
;
849 RemoveEntryList (&DriverEntry
->ScheduledLink
);
852 // If it's an error don't try the StartImage
858 DriverEntry
->Scheduled
= FALSE
;
859 DriverEntry
->Initialized
= TRUE
;
860 RemoveEntryList (&DriverEntry
->ScheduledLink
);
862 REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
864 EFI_SOFTWARE_SMM_DRIVER
| EFI_SW_PC_INIT_BEGIN
,
865 &DriverEntry
->ImageHandle
,
866 sizeof (DriverEntry
->ImageHandle
)
870 // Cache state of SmmEntryPointRegistered before calling entry point
872 PreviousSmmEntryPointRegistered
= gSmmCorePrivate
->SmmEntryPointRegistered
;
875 // For each SMM driver, pass NULL as ImageHandle
877 RegisterSmramProfileImage (DriverEntry
, TRUE
);
878 PERF_START (DriverEntry
->ImageHandle
, "StartImage:", NULL
, 0);
879 Status
= ((EFI_IMAGE_ENTRY_POINT
)(UINTN
)DriverEntry
->ImageEntryPoint
)(DriverEntry
->ImageHandle
, gST
);
880 PERF_END (DriverEntry
->ImageHandle
, "StartImage:", NULL
, 0);
881 if (EFI_ERROR(Status
)){
882 UnregisterSmramProfileImage (DriverEntry
, TRUE
);
883 SmmFreePages(DriverEntry
->ImageBuffer
, DriverEntry
->NumberOfPage
);
886 REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
888 EFI_SOFTWARE_SMM_DRIVER
| EFI_SW_PC_INIT_END
,
889 &DriverEntry
->ImageHandle
,
890 sizeof (DriverEntry
->ImageHandle
)
893 if (!PreviousSmmEntryPointRegistered
&& gSmmCorePrivate
->SmmEntryPointRegistered
) {
895 // Return immediately if the SMM Entry Point was registered by the SMM
896 // Driver that was just dispatched. The SMM IPL will reinvoke the SMM
897 // Core Dispatcher. This is required so SMM Mode may be enabled as soon
898 // as all the dependent SMM Drivers for SMM Mode have been dispatched.
899 // Once the SMM Entry Point has been registered, then SMM Mode will be
902 gRequestDispatch
= TRUE
;
903 gDispatcherRunning
= FALSE
;
904 return EFI_NOT_READY
;
909 // Search DriverList for items to place on Scheduled Queue
912 for (Link
= mDiscoveredList
.ForwardLink
; Link
!= &mDiscoveredList
; Link
= Link
->ForwardLink
) {
913 DriverEntry
= CR (Link
, EFI_SMM_DRIVER_ENTRY
, Link
, EFI_SMM_DRIVER_ENTRY_SIGNATURE
);
915 if (DriverEntry
->DepexProtocolError
){
917 // If Section Extraction Protocol did not let the Depex be read before retry the read
919 Status
= SmmGetDepexSectionAndPreProccess (DriverEntry
);
922 if (DriverEntry
->Dependent
) {
923 if (SmmIsSchedulable (DriverEntry
)) {
924 SmmInsertOnScheduledQueueWhileProcessingBeforeAndAfter (DriverEntry
);
929 } while (ReadyToRun
);
932 // If there is no more SMM driver to dispatch, stop the dispatch request
934 gRequestDispatch
= FALSE
;
935 for (Link
= mDiscoveredList
.ForwardLink
; Link
!= &mDiscoveredList
; Link
= Link
->ForwardLink
) {
936 DriverEntry
= CR (Link
, EFI_SMM_DRIVER_ENTRY
, Link
, EFI_SMM_DRIVER_ENTRY_SIGNATURE
);
938 if (!DriverEntry
->Initialized
){
940 // We have SMM driver pending to dispatch
942 gRequestDispatch
= TRUE
;
947 gDispatcherRunning
= FALSE
;
953 Insert InsertedDriverEntry onto the mScheduledQueue. To do this you
954 must add any driver with a before dependency on InsertedDriverEntry first.
955 You do this by recursively calling this routine. After all the Befores are
956 processed you can add InsertedDriverEntry to the mScheduledQueue.
957 Then you can add any driver with an After dependency on InsertedDriverEntry
958 by recursively calling this routine.
960 @param InsertedDriverEntry The driver to insert on the ScheduledLink Queue
964 SmmInsertOnScheduledQueueWhileProcessingBeforeAndAfter (
965 IN EFI_SMM_DRIVER_ENTRY
*InsertedDriverEntry
969 EFI_SMM_DRIVER_ENTRY
*DriverEntry
;
972 // Process Before Dependency
974 for (Link
= mDiscoveredList
.ForwardLink
; Link
!= &mDiscoveredList
; Link
= Link
->ForwardLink
) {
975 DriverEntry
= CR(Link
, EFI_SMM_DRIVER_ENTRY
, Link
, EFI_SMM_DRIVER_ENTRY_SIGNATURE
);
976 if (DriverEntry
->Before
&& DriverEntry
->Dependent
&& DriverEntry
!= InsertedDriverEntry
) {
977 DEBUG ((DEBUG_DISPATCH
, "Evaluate SMM DEPEX for FFS(%g)\n", &DriverEntry
->FileName
));
978 DEBUG ((DEBUG_DISPATCH
, " BEFORE FFS(%g) = ", &DriverEntry
->BeforeAfterGuid
));
979 if (CompareGuid (&InsertedDriverEntry
->FileName
, &DriverEntry
->BeforeAfterGuid
)) {
981 // Recursively process BEFORE
983 DEBUG ((DEBUG_DISPATCH
, "TRUE\n END\n RESULT = TRUE\n"));
984 SmmInsertOnScheduledQueueWhileProcessingBeforeAndAfter (DriverEntry
);
986 DEBUG ((DEBUG_DISPATCH
, "FALSE\n END\n RESULT = FALSE\n"));
992 // Convert driver from Dependent to Scheduled state
995 InsertedDriverEntry
->Dependent
= FALSE
;
996 InsertedDriverEntry
->Scheduled
= TRUE
;
997 InsertTailList (&mScheduledQueue
, &InsertedDriverEntry
->ScheduledLink
);
1001 // Process After Dependency
1003 for (Link
= mDiscoveredList
.ForwardLink
; Link
!= &mDiscoveredList
; Link
= Link
->ForwardLink
) {
1004 DriverEntry
= CR(Link
, EFI_SMM_DRIVER_ENTRY
, Link
, EFI_SMM_DRIVER_ENTRY_SIGNATURE
);
1005 if (DriverEntry
->After
&& DriverEntry
->Dependent
&& DriverEntry
!= InsertedDriverEntry
) {
1006 DEBUG ((DEBUG_DISPATCH
, "Evaluate SMM DEPEX for FFS(%g)\n", &DriverEntry
->FileName
));
1007 DEBUG ((DEBUG_DISPATCH
, " AFTER FFS(%g) = ", &DriverEntry
->BeforeAfterGuid
));
1008 if (CompareGuid (&InsertedDriverEntry
->FileName
, &DriverEntry
->BeforeAfterGuid
)) {
1010 // Recursively process AFTER
1012 DEBUG ((DEBUG_DISPATCH
, "TRUE\n END\n RESULT = TRUE\n"));
1013 SmmInsertOnScheduledQueueWhileProcessingBeforeAndAfter (DriverEntry
);
1015 DEBUG ((DEBUG_DISPATCH
, "FALSE\n END\n RESULT = FALSE\n"));
1022 Return TRUE if the Fv has been processed, FALSE if not.
1024 @param FvHandle The handle of a FV that's being tested
1026 @retval TRUE Fv protocol on FvHandle has been processed
1027 @retval FALSE Fv protocol on FvHandle has not yet been
1032 FvHasBeenProcessed (
1033 IN EFI_HANDLE FvHandle
1037 KNOWN_HANDLE
*KnownHandle
;
1039 for (Link
= mFvHandleList
.ForwardLink
; Link
!= &mFvHandleList
; Link
= Link
->ForwardLink
) {
1040 KnownHandle
= CR(Link
, KNOWN_HANDLE
, Link
, KNOWN_HANDLE_SIGNATURE
);
1041 if (KnownHandle
->Handle
== FvHandle
) {
1049 Remember that Fv protocol on FvHandle has had it's drivers placed on the
1050 mDiscoveredList. This fucntion adds entries on the mFvHandleList. Items are
1051 never removed/freed from the mFvHandleList.
1053 @param FvHandle The handle of a FV that has been processed
1057 FvIsBeingProcesssed (
1058 IN EFI_HANDLE FvHandle
1061 KNOWN_HANDLE
*KnownHandle
;
1063 KnownHandle
= AllocatePool (sizeof (KNOWN_HANDLE
));
1064 ASSERT (KnownHandle
!= NULL
);
1066 KnownHandle
->Signature
= KNOWN_HANDLE_SIGNATURE
;
1067 KnownHandle
->Handle
= FvHandle
;
1068 InsertTailList (&mFvHandleList
, &KnownHandle
->Link
);
1072 Convert FvHandle and DriverName into an EFI device path
1074 @param Fv Fv protocol, needed to read Depex info out of
1076 @param FvHandle Handle for Fv, needed in the
1077 EFI_SMM_DRIVER_ENTRY so that the PE image can be
1078 read out of the FV at a later time.
1079 @param DriverName Name of driver to add to mDiscoveredList.
1081 @return Pointer to device path constructed from FvHandle and DriverName
1084 EFI_DEVICE_PATH_PROTOCOL
*
1086 IN EFI_FIRMWARE_VOLUME2_PROTOCOL
*Fv
,
1087 IN EFI_HANDLE FvHandle
,
1088 IN EFI_GUID
*DriverName
1092 EFI_DEVICE_PATH_PROTOCOL
*FvDevicePath
;
1093 EFI_DEVICE_PATH_PROTOCOL
*FileNameDevicePath
;
1096 // Remember the device path of the FV
1098 Status
= gBS
->HandleProtocol (FvHandle
, &gEfiDevicePathProtocolGuid
, (VOID
**)&FvDevicePath
);
1099 if (EFI_ERROR (Status
)) {
1100 FileNameDevicePath
= NULL
;
1103 // Build a device path to the file in the FV to pass into gBS->LoadImage
1105 EfiInitializeFwVolDevicepathNode (&mFvDevicePath
.File
, DriverName
);
1106 SetDevicePathEndNode (&mFvDevicePath
.End
);
1109 // Note: FileNameDevicePath is in DXE memory
1111 FileNameDevicePath
= AppendDevicePath (
1113 (EFI_DEVICE_PATH_PROTOCOL
*)&mFvDevicePath
1116 return FileNameDevicePath
;
1120 Add an entry to the mDiscoveredList. Allocate memory to store the DriverEntry,
1121 and initilize any state variables. Read the Depex from the FV and store it
1122 in DriverEntry. Pre-process the Depex to set the Before and After state.
1123 The Discovered list is never free'ed and contains booleans that represent the
1124 other possible SMM driver states.
1126 @param Fv Fv protocol, needed to read Depex info out of
1128 @param FvHandle Handle for Fv, needed in the
1129 EFI_SMM_DRIVER_ENTRY so that the PE image can be
1130 read out of the FV at a later time.
1131 @param DriverName Name of driver to add to mDiscoveredList.
1133 @retval EFI_SUCCESS If driver was added to the mDiscoveredList.
1134 @retval EFI_ALREADY_STARTED The driver has already been started. Only one
1135 DriverName may be active in the system at any one
1140 SmmAddToDriverList (
1141 IN EFI_FIRMWARE_VOLUME2_PROTOCOL
*Fv
,
1142 IN EFI_HANDLE FvHandle
,
1143 IN EFI_GUID
*DriverName
1146 EFI_SMM_DRIVER_ENTRY
*DriverEntry
;
1149 // Create the Driver Entry for the list. ZeroPool initializes lots of variables to
1152 DriverEntry
= AllocateZeroPool (sizeof (EFI_SMM_DRIVER_ENTRY
));
1153 ASSERT (DriverEntry
!= NULL
);
1155 DriverEntry
->Signature
= EFI_SMM_DRIVER_ENTRY_SIGNATURE
;
1156 CopyGuid (&DriverEntry
->FileName
, DriverName
);
1157 DriverEntry
->FvHandle
= FvHandle
;
1158 DriverEntry
->Fv
= Fv
;
1159 DriverEntry
->FvFileDevicePath
= SmmFvToDevicePath (Fv
, FvHandle
, DriverName
);
1161 SmmGetDepexSectionAndPreProccess (DriverEntry
);
1163 InsertTailList (&mDiscoveredList
, &DriverEntry
->Link
);
1164 gRequestDispatch
= TRUE
;
1170 This function is the main entry point for an SMM handler dispatch
1171 or communicate-based callback.
1173 Event notification that is fired every time a FV dispatch protocol is added.
1174 More than one protocol may have been added when this event is fired, so you
1175 must loop on SmmLocateHandle () to see how many protocols were added and
1176 do the following to each FV:
1177 If the Fv has already been processed, skip it. If the Fv has not been
1178 processed then mark it as being processed, as we are about to process it.
1179 Read the Fv and add any driver in the Fv to the mDiscoveredList.The
1180 mDiscoveredList is never free'ed and contains variables that define
1181 the other states the SMM driver transitions to..
1182 While you are at it read the A Priori file into memory.
1183 Place drivers in the A Priori list onto the mScheduledQueue.
1185 @param DispatchHandle The unique handle assigned to this handler by SmiHandlerRegister().
1186 @param Context Points to an optional handler context which was specified when the handler was registered.
1187 @param CommBuffer A pointer to a collection of data in memory that will
1188 be conveyed from a non-SMM environment into an SMM environment.
1189 @param CommBufferSize The size of the CommBuffer.
1196 SmmDriverDispatchHandler (
1197 IN EFI_HANDLE DispatchHandle
,
1198 IN CONST VOID
*Context
, OPTIONAL
1199 IN OUT VOID
*CommBuffer
, OPTIONAL
1200 IN OUT UINTN
*CommBufferSize OPTIONAL
1205 EFI_HANDLE
*HandleBuffer
;
1206 EFI_STATUS GetNextFileStatus
;
1207 EFI_FIRMWARE_VOLUME2_PROTOCOL
*Fv
;
1208 EFI_DEVICE_PATH_PROTOCOL
*FvDevicePath
;
1209 EFI_HANDLE FvHandle
;
1212 EFI_FV_FILETYPE Type
;
1213 EFI_FV_FILE_ATTRIBUTES Attributes
;
1215 EFI_SMM_DRIVER_ENTRY
*DriverEntry
;
1216 EFI_GUID
*AprioriFile
;
1217 UINTN AprioriEntryCount
;
1220 UINT32 AuthenticationStatus
;
1223 HandleBuffer
= NULL
;
1224 Status
= gBS
->LocateHandleBuffer (
1226 &gEfiFirmwareVolume2ProtocolGuid
,
1231 if (EFI_ERROR (Status
)) {
1232 return EFI_NOT_FOUND
;
1235 for (Index
= 0; Index
< HandleCount
; Index
++) {
1236 FvHandle
= HandleBuffer
[Index
];
1238 if (FvHasBeenProcessed (FvHandle
)) {
1240 // This Fv has already been processed so lets skip it!
1246 // Since we are about to process this Fv mark it as processed.
1248 FvIsBeingProcesssed (FvHandle
);
1250 Status
= gBS
->HandleProtocol (FvHandle
, &gEfiFirmwareVolume2ProtocolGuid
, (VOID
**)&Fv
);
1251 if (EFI_ERROR (Status
)) {
1253 // FvHandle must have a Firmware Volume2 Protocol thus we should never get here.
1259 Status
= gBS
->HandleProtocol (FvHandle
, &gEfiDevicePathProtocolGuid
, (VOID
**)&FvDevicePath
);
1260 if (EFI_ERROR (Status
)) {
1262 // The Firmware volume doesn't have device path, can't be dispatched.
1268 // Discover Drivers in FV and add them to the Discovered Driver List.
1269 // Process EFI_FV_FILETYPE_SMM type and then EFI_FV_FILETYPE_COMBINED_SMM_DXE
1271 for (Index
= 0; Index
< sizeof (mSmmFileTypes
)/sizeof (EFI_FV_FILETYPE
); Index
++) {
1273 // Initialize the search key
1277 Type
= mSmmFileTypes
[Index
];
1278 GetNextFileStatus
= Fv
->GetNextFile (
1286 if (!EFI_ERROR (GetNextFileStatus
)) {
1287 SmmAddToDriverList (Fv
, FvHandle
, &NameGuid
);
1289 } while (!EFI_ERROR (GetNextFileStatus
));
1293 // Read the array of GUIDs from the Apriori file if it is present in the firmware volume
1294 // (Note: AprioriFile is in DXE memory)
1297 Status
= Fv
->ReadSection (
1302 (VOID
**)&AprioriFile
,
1304 &AuthenticationStatus
1306 if (!EFI_ERROR (Status
)) {
1307 AprioriEntryCount
= SizeOfBuffer
/ sizeof (EFI_GUID
);
1309 AprioriEntryCount
= 0;
1313 // Put drivers on Apriori List on the Scheduled queue. The Discovered List includes
1314 // drivers not in the current FV and these must be skipped since the a priori list
1315 // is only valid for the FV that it resided in.
1318 for (Index
= 0; Index
< AprioriEntryCount
; Index
++) {
1319 for (Link
= mDiscoveredList
.ForwardLink
; Link
!= &mDiscoveredList
; Link
= Link
->ForwardLink
) {
1320 DriverEntry
= CR(Link
, EFI_SMM_DRIVER_ENTRY
, Link
, EFI_SMM_DRIVER_ENTRY_SIGNATURE
);
1321 if (CompareGuid (&DriverEntry
->FileName
, &AprioriFile
[Index
]) &&
1322 (FvHandle
== DriverEntry
->FvHandle
)) {
1323 DriverEntry
->Dependent
= FALSE
;
1324 DriverEntry
->Scheduled
= TRUE
;
1325 InsertTailList (&mScheduledQueue
, &DriverEntry
->ScheduledLink
);
1326 DEBUG ((DEBUG_DISPATCH
, "Evaluate SMM DEPEX for FFS(%g)\n", &DriverEntry
->FileName
));
1327 DEBUG ((DEBUG_DISPATCH
, " RESULT = TRUE (Apriori)\n"));
1334 // Free data allocated by Fv->ReadSection ()
1336 // The UEFI Boot Services FreePool() function must be used because Fv->ReadSection
1337 // used the UEFI Boot Services AllocatePool() function
1339 gBS
->FreePool (AprioriFile
);
1343 // Execute the SMM Dispatcher on any newly discovered FVs and previously
1344 // discovered SMM drivers that have been discovered but not dispatched.
1346 Status
= SmmDispatcher ();
1349 // Check to see if CommBuffer and CommBufferSize are valid
1351 if (CommBuffer
!= NULL
&& CommBufferSize
!= NULL
) {
1352 if (*CommBufferSize
> 0) {
1353 if (Status
== EFI_NOT_READY
) {
1355 // If a the SMM Core Entry Point was just registered, then set flag to
1356 // request the SMM Dispatcher to be restarted.
1358 *(UINT8
*)CommBuffer
= COMM_BUFFER_SMM_DISPATCH_RESTART
;
1359 } else if (!EFI_ERROR (Status
)) {
1361 // Set the flag to show that the SMM Dispatcher executed without errors
1363 *(UINT8
*)CommBuffer
= COMM_BUFFER_SMM_DISPATCH_SUCCESS
;
1366 // Set the flag to show that the SMM Dispatcher encountered an error
1368 *(UINT8
*)CommBuffer
= COMM_BUFFER_SMM_DISPATCH_ERROR
;
1377 Traverse the discovered list for any drivers that were discovered but not loaded
1378 because the dependency experessions evaluated to false.
1382 SmmDisplayDiscoveredNotDispatched (
1387 EFI_SMM_DRIVER_ENTRY
*DriverEntry
;
1389 for (Link
= mDiscoveredList
.ForwardLink
;Link
!=&mDiscoveredList
; Link
= Link
->ForwardLink
) {
1390 DriverEntry
= CR(Link
, EFI_SMM_DRIVER_ENTRY
, Link
, EFI_SMM_DRIVER_ENTRY_SIGNATURE
);
1391 if (DriverEntry
->Dependent
) {
1392 DEBUG ((DEBUG_LOAD
, "SMM Driver %g was discovered but not loaded!!\n", &DriverEntry
->FileName
));