Changeset 77669 in vbox for trunk/src/VBox
- Timestamp:
- Mar 12, 2019 4:34:13 PM (6 years ago)
- Location:
- trunk/src/VBox/Devices/EFI/FirmwareNew
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/FirmwareNew/Config.kmk
r77662 r77669 45 45 # VBox Yasm command 46 46 VBOX_YASMCMD ?= $(firstword $(wildcard $(KBUILD_DEVTOOLS_HST)/bin/yasm$(HOSTSUFF_EXE)) yasm$(HOSTSUFF_EXE)) 47 48 # VBox nasm command 49 include $(KBUILD_PATH)/tools/NASM.kmk 50 TOOL_VBoxNasm = Our version of the NASM tool 51 ifndef TOOL_VBoxNasm_PATH 52 TOOL_VBoxNasm_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/nasm/v*.*))) 53 if "$(TOOL_VBoxNasm_PATH)" == "" && "$(KBUILD_DEVTOOLS_HST_ALT)" != "" 54 TOOL_VBoxNasm_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/nasm/v*.*))) 55 endif 56 endif 57 ifneq ($(TOOL_VBoxNasm_PATH),) 58 VBOX_NASMCMD ?= $(TOOL_VBoxNasm_PATH)/nasm$(HOSTSUFF_EXE) 59 else 60 VBOX_NASMCMD ?= nasm$(HOSTSUFF_EXE) 61 endif 47 62 48 63 # EFI requires python v2.x, so provide a way to select that while using 3.x for the rest of VBox. -
trunk/src/VBox/Devices/EFI/FirmwareNew/Makefile.kmk
r77662 r77669 213 213 -E 'PYTHONDONTWRITEBYTECODE=1' \ 214 214 -E 'IASL_BIN=$(VBOX_IASLCMD)' \ 215 -E 'NASM_BIN=$(VBOX_ YASMCMD)' \215 -E 'NASM_BIN=$(VBOX_NASMCMD)' \ 216 216 -E 'CONF_PATH=$(abspath $(@D)/../../Conf)' \ 217 217 -E 'WORKSPACE=$(VBOX_PATH_EFI_FIRMWARE)' \ … … 258 258 -e 's,@VBOX_IASLCMD@,$(VBOX_IASLCMD),' \ 259 259 -e 's,@VBOX_YASMCMD@,$(VBOX_YASMCMD),' \ 260 -e 's,@VBOX_NASMCMD@,$(VBOX_NASMCMD),' \ 260 261 -e 's,@KMK@,$(MAKE),' \ 261 262 \ … … 280 281 -e 's,@VBOX_IASLCMD@,$(VBOX_IASLCMD),' \ 281 282 -e 's,@VBOX_YASMCMD@,$(VBOX_YASMCMD),' \ 283 -e 's,@VBOX_NASMCMD@,$(VBOX_NASMCMD),' \ 282 284 -e 's,@KMK@,$(MAKE),' \ 283 285 \ -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Core/Dxe/Misc/Stall.c
r77662 r77669 69 69 // 70 70 if ((UINT64) Microseconds > 0x1999999999999999ULL) { 71 #else72 if (0) {73 #endif74 71 // 75 72 // Microseconds is too large to multiple by 10 first. Perform the divide -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Logo/LogoDxe.inf
r77662 r77669 26 26 # This flag specifies whether HII resource section is generated into PE image. 27 27 # 28 UEFI_HII_RESOURCE_SECTION = TRUE 28 # VBOX -- 'true' requires a resource compiler (@todo). 29 # UEFI_HII_RESOURCE_SECTION = TRUE 29 30 30 31 # -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/Disk/PartitionDxe/Apple.c
r76553 r77669 106 106 UINT32 SubBlockSize; 107 107 UINT32 BlkPerSec; 108 EFI_PARTITION_INFO_PROTOCOL PartitionInfo; 108 109 109 110 VBoxLogFlowFuncMarkDP(DevicePath); … … 213 214 DevicePath, 214 215 (EFI_DEVICE_PATH_PROTOCOL *) &CdDev, 216 &PartitionInfo, 215 217 CdDev.PartitionStart, 216 218 CdDev.PartitionStart + CdDev.PartitionSize - 1, 217 SubBlockSize, 218 FALSE); 219 SubBlockSize); 219 220 220 221 if (!EFI_ERROR (Status)) { -
trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
r77662 r77669 232 232 ZeroMem (&PartitionInfo, sizeof (EFI_PARTITION_INFO_PROTOCOL)); 233 233 PartitionInfo.Revision = EFI_PARTITION_INFO_PROTOCOL_REVISION; 234 PartitionInfo.Type = PARTITION_TYPE_MBR; 235 if (Mbr->Partition[Index].OSIndicator == EFI_PARTITION) { 236 PartitionInfo.System = 1; 237 } 238 CopyMem (&PartitionInfo.Info.Mbr, &Mbr->Partition[Index], sizeof (MBR_PARTITION_RECORD)); 234 PartitionInfo.Type = PARTITION_TYPE_OTHER; 239 235 240 236 Status = PartitionInstallChildHandle ( -
trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/Library/AcpiTimerLib/AcpiTimerLib.c
r77662 r77669 26 26 #define ACPI_TIMER_COUNT_SIZE BIT24 27 27 28 #ifdef VBOX 29 UINT32 mPmba = 0x4000; 30 31 #define PCI_BAR_IO 0x1 32 #endif 33 34 /** 35 The constructor function enables ACPI IO space. 36 37 If ACPI I/O space not enabled, this function will enable it. 38 It will always return RETURN_SUCCESS. 39 40 @retval EFI_SUCCESS The constructor always returns RETURN_SUCCESS. 41 42 **/ 43 #ifndef VBOX 44 RETURN_STATUS 45 EFIAPI 46 AcpiTimerLibConstructor ( 47 VOID 48 ) 49 { 50 // 51 // Check to see if the Power Management Base Address is already enabled 52 // 53 if ((PciRead8 (PMREGMISC) & PMIOSE) == 0) { 54 // 55 // If the Power Management Base Address is not programmed, 56 // then program the Power Management Base Address from a PCD. 57 // 58 PciAndThenOr32 (PMBA, (UINT32)(~0x0000FFC0), PcdGet16 (PcdAcpiPmBaseAddress)); 59 60 // 61 // Enable PMBA I/O port decodes in PMREGMISC 62 // 63 PciOr8 (PMREGMISC, PMIOSE); 64 } 65 66 return RETURN_SUCCESS; 67 } 68 #else 69 RETURN_STATUS 70 EFIAPI 71 AcpiTimerLibConstructor ( 72 VOID 73 ) 74 { 75 UINT8 u8Device = 7; 76 UINT16 u16VendorID = 0; 77 UINT16 u16DeviceID = 0; 78 u16VendorID = PciRead16(PCI_LIB_ADDRESS(0, u8Device, 0, 0)); 79 u16DeviceID = PciRead16(PCI_LIB_ADDRESS(0, u8Device, 0, 2)); 80 if ( u16VendorID != 0x8086 81 || u16DeviceID != 0x7113) 82 return RETURN_ABORTED; 83 84 if (PciRead8 (PCI_LIB_ADDRESS (0,u8Device,0,0x80)) & 1) { 85 mPmba = PciRead32 (PCI_LIB_ADDRESS (0, u8Device, 0, 0x40)); 86 ASSERT (mPmba & PCI_BAR_IO); 87 DEBUG((DEBUG_INFO, "%a:%d mPmba:%x\n", __FUNCTION__, __LINE__, mPmba)); 88 mPmba &= ~PCI_BAR_IO; 89 DEBUG((DEBUG_INFO, "%a:%d mPmba:%x\n", __FUNCTION__, __LINE__, mPmba)); 90 } else { 91 PciAndThenOr32 (PCI_LIB_ADDRESS (0,u8Device,0,0x40), 92 (UINT32) ~0xfc0, mPmba); 93 PciOr8 (PCI_LIB_ADDRESS (0,u8Device,0,0x04), 0x01); 94 DEBUG((DEBUG_INFO, "%a:%d mPmba:%x\n", __FUNCTION__, __LINE__, mPmba)); 95 } 96 97 // 98 // ACPI Timer enable is in Bus 0, Device ?, Function 3 99 // 100 PciOr8 (PCI_LIB_ADDRESS (0,u8Device,0,0x80), 0x01); 101 return RETURN_SUCCESS; 102 } 103 #endif 104 105 /** 106 Internal function to read the current tick counter of ACPI. 107 108 Internal function to read the current tick counter of ACPI. 109 110 @return The tick counter read. 111 112 **/ 113 UINT32 114 InternalAcpiGetTimerTick ( 115 VOID 116 ) 117 { 118 // 119 // Read PMBA to read and return the current ACPI timer value. 120 // 121 #ifndef VBOX 122 return IoRead32 ((PciRead32 (PMBA) & ~PMBA_RTE) + ACPI_TIMER_OFFSET); 123 #else 124 return IoRead32 (mPmba + ACPI_TIMER_OFFSET); 125 #endif 126 } 127 128 /** 129 Stalls the CPU for at least the given number of ticks. 28 /** 130 29 Stalls the CPU for at least the given number of ticks. 131 30 -
trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/PlatformPei/MemDetect.c
r77662 r77669 725 725 726 726 if (mBootMode == BOOT_ON_S3_RESUME) { 727 MemoryBase = PcdGet32 (PcdS3AcpiReservedMemoryBase); 728 MemorySize = PcdGet32 (PcdS3AcpiReservedMemorySize); 727 // 728 // Create the following memory HOB as an exception on the S3 boot path. 729 // 730 // Normally we'd create memory HOBs only on the normal boot path. However, 731 // CpuMpPei specifically needs such a low-memory HOB on the S3 path as 732 // well, for "borrowing" a subset of it temporarily, for the AP startup 733 // vector. 734 // 735 // CpuMpPei saves the original contents of the borrowed area in permanent 736 // PEI RAM, in a backup buffer allocated with the normal PEI services. 737 // CpuMpPei restores the original contents ("returns" the borrowed area) at 738 // End-of-PEI. End-of-PEI in turn is emitted by S3Resume2Pei before 739 // transferring control to the OS's wakeup vector in the FACS. 740 // 741 // We expect any other PEIMs that "borrow" memory similarly to CpuMpPei to 742 // restore the original contents. Furthermore, we expect all such PEIMs 743 // (CpuMpPei included) to claim the borrowed areas by producing memory 744 // allocation HOBs, and to honor preexistent memory allocation HOBs when 745 // looking for an area to borrow. 746 // 747 AddMemoryRangeHob (0, BASE_512KB + BASE_128KB); 748 MemoryBase = 0; 749 MemorySize = BASE_512KB + BASE_128KB; 729 750 } else { 730 751 LowerMemorySize = GetSystemMemorySizeBelow4gb (); … … 752 773 753 774 if (UpperMemorySize != 0) { 754 Add UntestedMemoryBaseSizeHob (BASE_4GB, UpperMemorySize);775 AddMemoryBaseSizeHob (BASE_4GB, UpperMemorySize); 755 776 756 777 MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack); -
trunk/src/VBox/Devices/EFI/FirmwareNew/OvmfPkg/PlatformPei/Platform.c
r77662 r77669 232 232 RETURN_STATUS PcdStatus; 233 233 234 PciIoBase = 0xC000;235 PciIoSize = 0x4000;236 237 234 #ifdef VBOX 238 235 EFI_PHYSICAL_ADDRESS RsdPtr; … … 241 238 UINT64 McfgSize = 0; 242 239 #endif 240 PciIoBase = 0xC000; 241 PciIoSize = 0x4000; 242 243 243 // 244 244 // Create Memory Type Information HOB -
trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf
r77662 r77669 26 26 # This flag specifies whether HII resource section is generated into PE image. 27 27 # 28 UEFI_HII_RESOURCE_SECTION = TRUE 28 # VBOX -- 'true' requires a resource compiler (@todo). 29 # UEFI_HII_RESOURCE_SECTION = TRUE 29 30 30 31 [Sources.common] -
trunk/src/VBox/Devices/EFI/FirmwareNew/VBoxPkg/VBoxVgaDxe/VBoxVgaGraphicsOutput.c
r76900 r77669 501 501 ); 502 502 503 PcdSet32 (PcdVideoHorizontalResolution, Private->ModeData[Private->GraphicsOutput.Mode->Mode].HorizontalResolution);504 PcdSet32 (PcdVideoVerticalResolution, Private->ModeData[Private->GraphicsOutput.Mode->Mode].VerticalResolution);503 PcdSet32S(PcdVideoHorizontalResolution, Private->ModeData[Private->GraphicsOutput.Mode->Mode].HorizontalResolution); 504 PcdSet32S(PcdVideoVerticalResolution, Private->ModeData[Private->GraphicsOutput.Mode->Mode].VerticalResolution); 505 505 506 506 return EFI_SUCCESS; -
trunk/src/VBox/Devices/EFI/FirmwareNew/VBoxPkg/VBoxVgaDxe/VBoxVgaUgaDraw.c
r76900 r77669 400 400 ); 401 401 402 PcdSet32 (PcdVideoHorizontalResolution, HorizontalResolution);403 PcdSet32 (PcdVideoVerticalResolution, VerticalResolution);402 PcdSet32S(PcdVideoHorizontalResolution, HorizontalResolution); 403 PcdSet32S(PcdVideoVerticalResolution, VerticalResolution); 404 404 405 405 return EFI_SUCCESS; -
trunk/src/VBox/Devices/EFI/FirmwareNew/vbox-tools_def.txt
r77662 r77669 27 27 DEFINE IASL_OUTFLAGS = -p 28 28 29 DEFINE NASM_BIN = @VBOX_ YASMCMD@29 DEFINE NASM_BIN = @VBOX_NASMCMD@ 30 30 31 31 DEFINE MSFT_ASLPP_FLAGS = /nologo /E /C /FIAutoGen.h … … 156 156 NOOPT_VS2010_IA32_ASM_FLAGS = /nologo /c /WX /W3 /Cx /coff /Zd /Zi 157 157 158 # yasm does not like plain -g option, needs format type 159 DEBUG_VS2010_IA32_NASM_FLAGS = -Ox -f win32 -g cv8 158 DEBUG_VS2010_IA32_NASM_FLAGS = -Ox -f win32 -g 160 159 RELEASE_VS2010_IA32_NASM_FLAGS = -Ox -f win32 161 NOOPT_VS2010_IA32_NASM_FLAGS = -O0 -f win32 -g cv8160 NOOPT_VS2010_IA32_NASM_FLAGS = -O0 -f win32 -g 162 161 163 162 DEBUG_VS2010_IA32_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /MACHINE:X86 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG … … 190 189 NOOPT_VS2010_X64_ASM_FLAGS = /nologo /c /WX /W3 /Cx /Zd /Zi 191 190 192 # yasm does not like plain -g option, needs format type 193 DEBUG_VS2010_X64_NASM_FLAGS = -Ox -f win64 -g cv8 191 DEBUG_VS2010_X64_NASM_FLAGS = -Ox -f win64 -g 194 192 RELEASE_VS2010_X64_NASM_FLAGS = -Ox -f win64 195 NOOPT_VS2010_X64_NASM_FLAGS = -O0 -f win64 -g cv8193 NOOPT_VS2010_X64_NASM_FLAGS = -O0 -f win64 -g 196 194 197 195 DEBUG_VS2010_X64_DLINK_FLAGS = /NOLOGO /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT:ICF=10 /MAP /ALIGN:32 /SECTION:.xdata,D /SECTION:.pdata,D /Machine:X64 /LTCG /DLL /ENTRY:$(IMAGE_ENTRY_POINT) /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /SAFESEH:NO /BASE:0 /DRIVER /DEBUG … … 366 364 *_*_*_NASM_PATH = DEF(NASM_BIN) 367 365 # NASMB uses NASM produce a .bin from a .nasmb NASM source file 368 *_*_*_NASMB_FLAGS = -f bin -D__YASM__ -DASM_FORMAT_BIN -DVBOX 366 #*_*_*_NASMB_FLAGS = -f bin -D__YASM__ -DASM_FORMAT_BIN -DVBOX 367 *_*_*_NASMB_FLAGS = -f bin -DASM_FORMAT_BIN -DVBOX 369 368 370 369 #################
Note:
See TracChangeset
for help on using the changeset viewer.