Changeset 108794 in vbox for trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
- Timestamp:
- Mar 31, 2025 11:31:09 AM (2 weeks ago)
- svn:sync-xref-src-repo-rev:
- 168237
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew
-
Property svn:mergeinfo
changed from (toggle deleted branches)
to (toggle deleted branches)/vendor/edk2/current 103735-103757,103769-103776,129194-164365 /vendor/edk2/current 103735-103757,103769-103776,129194-168232
-
Property svn:mergeinfo
changed from (toggle deleted branches)
-
trunk/src/VBox/Devices/EFI/FirmwareNew/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c
r105670 r108794 16 16 #pragma pack(1) 17 17 18 //19 // API Parameter +0x3420 // API return address +0x3021 //22 // push FspInfoHeader +0x2C23 // pushfd +0x2824 // cli25 // pushad +0x2426 // sub esp, 8 +0x0027 // sidt fword ptr [esp]28 //29 18 typedef struct { 30 19 UINT16 IdtrLimit; 31 20 UINT32 IdtrBase; 32 21 UINT16 Reserved; 22 UINT32 Cr0; 23 UINT32 Cr3; 24 UINT32 Cr4; 25 UINT32 Efer; // lower 32-bit of EFER since only NXE bit (BIT11) need to be restored. 33 26 UINT32 Registers[8]; // General Purpose Registers: Edi, Esi, Ebp, Esp, Ebx, Edx, Ecx and Eax 34 27 UINT16 Flags[2]; … … 38 31 } CONTEXT_STACK; 39 32 40 //41 // API return address +0xB842 // Reserved +0xB043 // push API Parameter2 +0xA844 // push API Parameter1 +0xA045 // push FspInfoHeader +0x9846 // pushfq +0x9047 // cli48 // PUSHA_64 +0x1049 // sub rsp, 16 +0x0050 // sidt [rsp]51 //52 33 typedef struct { 53 34 UINT64 Idtr[2]; // IDTR Limit - bit0:bi15, IDTR Base - bit16:bit79 35 UINT64 Cr0; 36 UINT64 Cr3; 37 UINT64 Cr4; 38 UINT64 Efer; 54 39 UINT64 Registers[16]; // General Purpose Registers: RDI, RSI, RBP, RSP, RBX, RDX, RCX, RAX, and R15 to R8 55 40 UINT32 Flags[2]; … … 90 75 ) 91 76 { 92 FSP_GLOBAL_DATA *FspData;93 94 FspData = *(FSP_GLOBAL_DATA **)(UINTN)PcdGet32 (PcdGlobalDataPointerAddress);95 return FspData;77 UINT32 FspDataAddress; 78 79 FspDataAddress = *(UINT32 *)(UINTN)PcdGet32 (PcdGlobalDataPointerAddress); 80 return (FSP_GLOBAL_DATA *)(UINTN)FspDataAddress; 96 81 } 97 82 … … 567 552 FspData->StatusCode = StatusCode; 568 553 } 569 570 /**571 This function updates the return status of the FSP API with requested reset type and returns to Boot Loader.572 573 @param[in] FspResetType Reset type that needs to returned as API return status574 575 **/576 VOID577 EFIAPI578 FspApiReturnStatusReset (579 IN EFI_STATUS FspResetType580 )581 {582 volatile BOOLEAN LoopUntilReset;583 584 LoopUntilReset = TRUE;585 DEBUG ((DEBUG_INFO, "FSP returning control to Bootloader with reset required return status %x\n", FspResetType));586 if (GetFspGlobalDataPointer ()->FspMode == FSP_IN_API_MODE) {587 ///588 /// Below code is not an infinite loop.The control will go back to API calling function in BootLoader each time BootLoader589 /// calls the FSP API without honoring the reset request by FSP590 ///591 do {592 SetFspApiReturnStatus (FspResetType);593 Pei2LoaderSwitchStack ();594 DEBUG ((DEBUG_ERROR, "!!!ERROR: FSP has requested BootLoader for reset. But BootLoader has not honored the reset\n"));595 DEBUG ((DEBUG_ERROR, "!!!ERROR: Please add support in BootLoader to honor the reset request from FSP\n"));596 } while (LoopUntilReset);597 }598 }
Note:
See TracChangeset
for help on using the changeset viewer.