Changeset 58466 in vbox for trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi
- Timestamp:
- Oct 29, 2015 4:30:44 AM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 103777
- Location:
- trunk/src/VBox/Devices/EFI/Firmware
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware
- Property svn:mergeinfo changed
/vendor/edk2/current merged: 103769-103776
- Property svn:mergeinfo changed
-
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.S
r58464 r58466 21 21 22 22 #------------------------------------------------------------------------------ 23 # 23 # 24 24 # VOID 25 25 # EFIAPI … … 35 35 movw %ax, %es 36 36 movw %ax, %fs 37 movw %ax, %gs 37 movw %ax, %gs 38 38 ret -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/Ia32/AsmFuncs.asm
r58464 r58466 39 39 mov fs, ax 40 40 mov gs, ax 41 mov ss, ax 41 mov ss, ax 42 42 ret 43 43 AsmSetDataSelectors ENDP -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume.c
r58459 r58466 113 113 UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU) 114 114 UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page 115 UINT64 MustBe1:1; // Must be 1 115 UINT64 MustBe1:1; // Must be 1 116 116 UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write 117 117 UINT64 Available:3; // Available for use by system software … … 137 137 UINT64 Accessed:1; // 0 = Not accessed, 1 = Accessed (set by CPU) 138 138 UINT64 Dirty:1; // 0 = Not Dirty, 1 = written by processor on access to page 139 UINT64 MustBe1:1; // Must be 1 139 UINT64 MustBe1:1; // Must be 1 140 140 UINT64 Global:1; // 0 = Not global page, 1 = global page TLB not cleared on CR3 write 141 141 UINT64 Available:3; // Available for use by system software … … 156 156 /** 157 157 a ASM function to transfer control to OS. 158 158 159 159 @param S3WakingVector The S3 waking up vector saved in ACPI Facs table 160 @param AcpiLowMemoryBase a buffer under 1M which could be used during the transfer 160 @param AcpiLowMemoryBase a buffer under 1M which could be used during the transfer 161 161 **/ 162 162 typedef … … 464 464 465 465 // 466 // NOTE: Because Debug Timer interrupt and system interrupts will be disabled 466 // NOTE: Because Debug Timer interrupt and system interrupts will be disabled 467 467 // in BootScriptExecuteDxe, the rest code in S3ResumeBootOs() cannot be halted 468 468 // by soft debugger. … … 581 581 /** 582 582 Restore S3 page table because we do not trust ACPINvs content. 583 If BootScriptExector driver will not run in 64-bit mode, this function will do nothing. 583 If BootScriptExector driver will not run in 64-bit mode, this function will do nothing. 584 584 585 585 @param S3NvsPageTableAddress PageTableAddress in ACPINvs … … 623 623 PageMap = (PAGE_MAP_AND_DIRECTORY_POINTER *)S3NvsPageTableAddress; 624 624 S3NvsPageTableAddress += SIZE_4KB; 625 625 626 626 Page1GSupport = FALSE; 627 627 if (PcdGetBool(PcdUse1GPageTable)) { … … 634 634 } 635 635 } 636 636 637 637 // 638 638 // Get physical address bits supported. … … 650 650 } 651 651 } 652 652 653 653 // 654 654 // IA-32e paging translates 48-bit linear addresses to 52-bit physical addresses. … … 677 677 NumberOfPdpEntriesNeeded = 512; 678 678 } 679 679 680 680 PageMapLevel4Entry = PageMap; 681 681 PageAddress = 0; … … 687 687 PageDirectoryPointerEntry = (PAGE_MAP_AND_DIRECTORY_POINTER *)S3NvsPageTableAddress; 688 688 S3NvsPageTableAddress += SIZE_4KB; 689 689 690 690 // 691 691 // Make a PML4 Entry … … 697 697 if (Page1GSupport) { 698 698 PageDirectory1GEntry = (VOID *) PageDirectoryPointerEntry; 699 699 700 700 for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectory1GEntry++, PageAddress += SIZE_1GB) { 701 701 // … … 712 712 // Each Directory Pointer entries points to a page of Page Directory entires. 713 713 // So allocate space for them and fill them in in the IndexOfPageDirectoryEntries loop. 714 // 714 // 715 715 PageDirectoryEntry = (PAGE_TABLE_ENTRY *)S3NvsPageTableAddress; 716 716 S3NvsPageTableAddress += SIZE_4KB; 717 717 718 718 // 719 719 // Fill in a Page Directory Pointer Entries … … 722 722 PageDirectoryPointerEntry->Bits.ReadWrite = 1; 723 723 PageDirectoryPointerEntry->Bits.Present = 1; 724 724 725 725 for (IndexOfPageDirectoryEntries = 0; IndexOfPageDirectoryEntries < 512; IndexOfPageDirectoryEntries++, PageDirectoryEntry++, PageAddress += SIZE_2MB) { 726 726 // … … 782 782 // 783 783 // Send SMI to APs 784 // 784 // 785 785 SendSmiIpiAllExcludingSelf (); 786 786 // … … 797 797 if (!EFI_ERROR (Status)) { 798 798 DEBUG ((EFI_D_ERROR, "Close all SMRAM regions before executing boot script\n")); 799 799 800 800 for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { 801 801 Status = SmmAccess->Close ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); … … 803 803 804 804 DEBUG ((EFI_D_ERROR, "Lock all SMRAM regions before executing boot script\n")); 805 805 806 806 for (Index = 0, Status = EFI_SUCCESS; !EFI_ERROR (Status); Index++) { 807 807 Status = SmmAccess->Lock ((EFI_PEI_SERVICES **)GetPeiServicesTablePointer (), SmmAccess, Index); … … 817 817 // 818 818 // On some platform, such as ECP, a dispatch node in boot script table may execute a 32-bit PEIM which may need PeiServices 819 // pointer. So PeiServices need preserve in (IDTBase- sizeof (UINTN)). 819 // pointer. So PeiServices need preserve in (IDTBase- sizeof (UINTN)). 820 820 // 821 821 IdtDescriptor = (IA32_DESCRIPTOR *) (UINTN) (AcpiS3Context->IdtrProfile); 822 822 // 823 823 // Make sure the newly allcated IDT align with 16-bytes 824 // 824 // 825 825 IdtBuffer = AllocatePages (EFI_SIZE_TO_PAGES((IdtDescriptor->Limit + 1) + 16)); 826 826 ASSERT (IdtBuffer != NULL); … … 828 828 // Additional 16 bytes allocated to save IA32 IDT descriptor and Pei Service Table Pointer 829 829 // IA32 IDT descriptor will be used to setup IA32 IDT table for 32-bit Framework Boot Script code 830 // 830 // 831 831 ZeroMem (IdtBuffer, 16); 832 832 AsmReadIdtr ((IA32_DESCRIPTOR *)IdtBuffer); … … 863 863 // 864 864 AsmReadIdtr (&PeiS3ResumeState->Idtr); 865 865 866 866 // 867 867 // Report Status Code to indicate S3 boot script execution … … 1000 1000 DEBUG (( EFI_D_ERROR, "Waking Vector = %x\n", ((EFI_ACPI_2_0_FIRMWARE_ACPI_CONTROL_STRUCTURE *) ((UINTN) (AcpiS3Context->AcpiFacsTable)))->FirmwareWakingVector)); 1001 1001 DEBUG (( EFI_D_ERROR, "AcpiS3Context->AcpiFacsTable = %x\n", AcpiS3Context->AcpiFacsTable)); 1002 DEBUG (( EFI_D_ERROR, "AcpiS3Context->IdtrProfile = %x\n", AcpiS3Context->IdtrProfile)); 1002 DEBUG (( EFI_D_ERROR, "AcpiS3Context->IdtrProfile = %x\n", AcpiS3Context->IdtrProfile)); 1003 1003 DEBUG (( EFI_D_ERROR, "AcpiS3Context->S3NvsPageTableAddress = %x\n", AcpiS3Context->S3NvsPageTableAddress)); 1004 1004 DEBUG (( EFI_D_ERROR, "AcpiS3Context->S3DebugBufferAddress = %x\n", AcpiS3Context->S3DebugBufferAddress)); … … 1089 1089 // 1090 1090 // update segment selectors per the new GDT. 1091 // 1091 // 1092 1092 AsmSetDataSelectors (DATA_SEGEMENT_SELECTOR); 1093 1093 // … … 1123 1123 1124 1124 This routine is to install EFI_PEI_S3_RESUME2_PPI. 1125 1125 1126 1126 @param FileHandle Handle of the file being invoked. 1127 1127 @param PeiServices Pointer to PEI Services table. -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.S
r58464 r58466 21 21 22 22 #------------------------------------------------------------------------------ 23 # 23 # 24 24 # VOID 25 25 # EFIAPI … … 34 34 movw %cx, %es 35 35 movw %cx, %fs 36 movw %cx, %gs 36 movw %cx, %gs 37 37 ret -
trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Universal/Acpi/S3Resume2Pei/X64/AsmFuncs.asm
r58464 r58466 35 35 mov fs, cx 36 36 mov gs, cx 37 mov ss, cx 37 mov ss, cx 38 38 ret 39 39 AsmSetDataSelectors ENDP
Note:
See TracChangeset
for help on using the changeset viewer.