Date   

[PATCH v2 12/19] Vlv2TbltDevicePkg/FvbRuntimeDxe: Remove unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c: In function ‘FvbWriteBlock’:
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c:368:44: error: variable ‘FwhInstance’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c: In function ‘FvbEraseBlock’:
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c:448:44: error: variable ‘FwhInstance’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c: In function ‘FvbInitialize’:
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c:1028:41: error: variable ‘FvHeaderValid’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
---
Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c | 11 -----------
1 file changed, 11 deletions(-)

diff --git a/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c b/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c
index 5c3d6dc..1cb5e9b 100644
--- a/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c
+++ b/Vlv2TbltDevicePkg/FvbRuntimeDxe/FvbService.c
@@ -356,12 +356,9 @@ FvbWriteBlock (
EFI_FVB_ATTRIBUTES_2 Attributes;
UINTN LbaAddress;
UINTN LbaLength;
- EFI_FW_VOL_INSTANCE *FwhInstance;
EFI_STATUS Status;
EFI_STATUS Status1;

- FwhInstance = GetFvbInstance (Instance);
-
if ( (NumBytes == NULL) || (Buffer == NULL)) {
return (EFI_INVALID_PARAMETER);
}
@@ -436,16 +433,10 @@ FvbEraseBlock (
{
EFI_FVB_ATTRIBUTES_2 Attributes;
UINTN LbaAddress;
- EFI_FW_VOL_INSTANCE *FwhInstance;
UINTN LbaLength;
EFI_STATUS Status;

//
- // Find the right instance of the FVB private data.
- //
- FwhInstance = GetFvbInstance (Instance);
-
- //
// Check if the FV is write enabled.
//
Attributes = FvbGetVolumeAttributes (Instance);
@@ -1016,7 +1007,6 @@ FvbInitialize (
UINTN TmpHeaderLength;
UINTN Idx;
UINT32 MaxLbaSize;
- BOOLEAN FvHeaderValid;
EFI_BOOT_MODE BootMode;
UINT32 PlatformFvBaseAddress[3];
UINT32 PlatformFvBaseAddressCount;
@@ -1072,7 +1062,6 @@ FvbInitialize (
FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *) (UINTN) BaseAddress;

if (!IsFvHeaderValid (BaseAddress, FwVolHeader)) {
- FvHeaderValid = FALSE;
//
// If not valid, get FvbInfo from the information carried in
// FVB driver.
--
2.9.2


[PATCH v2 13/19] Vlv2TbltDevicePkg/PlatformSetupDxe: Remove the unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘PrepareSetupInformation’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:540:31: error: variable ‘EeState’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:532:31: error: variable ‘SrcDataSize’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘UpdateAdditionalInformation’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:818:35: error: variable ‘Size’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:817:36: error: variable ‘SystemManufacturer’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘JudgeHandleIsPCIDevice’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:1094:22: error: variable ‘DevicePath’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c: In function ‘GetChipsetSataPortSpeed’:
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:1470:31: error: variable ‘DwordReg’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c:1469:31: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
---
.../PlatformSetupDxe/SetupInfoRecords.c | 41 +++++++---------------
1 file changed, 13 insertions(+), 28 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c b/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c
index c7f85b9..8979b41 100644
--- a/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c
+++ b/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c
@@ -521,7 +521,6 @@ PrepareSetupInformation (
EFI_DATA_HUB_PROTOCOL *DataHub;
EFI_DATA_RECORD_HEADER *Record;
UINT8 *SrcData;
- UINT32 SrcDataSize;
EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
CHAR16 *NewString;
CHAR16 *NewString2;
@@ -529,7 +528,6 @@ PrepareSetupInformation (
STRING_REF TokenToUpdate;
EFI_PROCESSOR_VERSION_DATA *ProcessorVersion;
UINTN Index;
- UINT16 EeState;
UINTN DataOutput;

EFI_PROCESSOR_MICROCODE_REVISION_DATA *CpuUcodeRevisionData;
@@ -548,11 +546,6 @@ PrepareSetupInformation (
SetMem(ReleaseTime, sizeof(ReleaseTime), 0);

//
- // Initialize EE state for not to show EE related setup options
- //
- EeState = 0;
-
- //
// Get the Data Hub Protocol. Assume only one instance
//
Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, (void **)&DataHub);
@@ -570,7 +563,6 @@ PrepareSetupInformation (
if (Record->DataRecordClass == EFI_DATA_RECORD_CLASS_DATA) {
DataHeader = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1);
SrcData = (UINT8 *)(DataHeader + 1);
- SrcDataSize = Record->RecordSize - Record->HeaderSize - sizeof (EFI_SUBCLASS_TYPE1_HEADER);

//
// Processor
@@ -806,8 +798,6 @@ UpdateAdditionalInformation (
EFI_DATA_HUB_PROTOCOL *DataHub;
EFI_DATA_RECORD_HEADER *Record;
EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
- EFI_MISC_SYSTEM_MANUFACTURER *SystemManufacturer;
- UINTN Size;
EFI_SMBIOS_PROTOCOL *Smbios;
EFI_SMBIOS_HANDLE SmbiosHandle;
EFI_SMBIOS_TABLE_HEADER *SmbiosRecord;
@@ -817,6 +807,9 @@ UpdateAdditionalInformation (
CHAR16 *IfwiVersion = NULL;
UINT16 SearchIndex;
EFI_STRING_ID TokenToUpdate;
+#if defined( RVP_SUPPORT ) && RVP_SUPPORT
+ EFI_MISC_SYSTEM_MANUFACTURER *SystemManufacturer;
+#endif

Status = gBS->LocateProtocol (
&gEfiDataHubProtocolGuid,
@@ -826,8 +819,6 @@ UpdateAdditionalInformation (

ASSERT_EFI_ERROR(Status);

- Size = 3;
-
MonotonicCount = 0;
Record = NULL;
do {
@@ -842,12 +833,12 @@ UpdateAdditionalInformation (

if (CompareGuid(&Record->DataRecordGuid, &gEfiMiscSubClassGuid) &&
(DataHeader->RecordType == EFI_MISC_SYSTEM_MANUFACTURER_RECORD_NUMBER)) {
+#if defined( RVP_SUPPORT ) && RVP_SUPPORT
//
// System Information
//
SystemManufacturer = (EFI_MISC_SYSTEM_MANUFACTURER *)(DataHeader + 1);

-#if defined( RVP_SUPPORT ) && RVP_SUPPORT
//
// UUID (System Information)
//
@@ -1083,7 +1074,6 @@ JudgeHandleIsPCIDevice(
{
EFI_STATUS Status;
EFI_DEVICE_PATH *DPath;
- EFI_DEVICE_PATH *DevicePath;

Status = gBS->HandleProtocol (
Handle,
@@ -1092,7 +1082,6 @@ JudgeHandleIsPCIDevice(
);
if(!EFI_ERROR(Status))
{
- DevicePath = DPath;
while(!IsDevicePathEnd(DPath))
{
if((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP))
@@ -1458,9 +1447,6 @@ GetChipsetSataPortSpeed (
UINT32 IdeAhciBar;
EFI_PHYSICAL_ADDRESS MemBaseAddress = 0;
UINT8 FunNum;
- EFI_STATUS Status;
- UINT32 DwordReg;
-

DeviceSpeed = 0x01; // generation 1

@@ -1470,15 +1456,15 @@ GetChipsetSataPortSpeed (
//
FunNum = PCI_FUNCTION_NUMBER_PCH_SATA;
MemBaseAddress = 0x0ffffffff;
- Status = gDS->AllocateMemorySpace (
- EfiGcdAllocateMaxAddressSearchBottomUp,
- EfiGcdMemoryTypeMemoryMappedIo,
- N_PCH_SATA_ABAR_ALIGNMENT, // 2^11: 2K Alignment
- V_PCH_SATA_ABAR_LENGTH, // 2K Length
- &MemBaseAddress,
- mImageHandle,
- NULL
- );
+ gDS->AllocateMemorySpace (
+ EfiGcdAllocateMaxAddressSearchBottomUp,
+ EfiGcdMemoryTypeMemoryMappedIo,
+ N_PCH_SATA_ABAR_ALIGNMENT, // 2^11: 2K Alignment
+ V_PCH_SATA_ABAR_LENGTH, // 2K Length
+ &MemBaseAddress,
+ mImageHandle,
+ NULL
+ );
IdeAhciBar = MmioRead32 (
MmPciAddress (
0,
@@ -1508,7 +1494,6 @@ GetChipsetSataPortSpeed (
// Program the "Ports Implemented Register"
//
MmioAndThenOr32 (IdeAhciBar + R_PCH_SATA_AHCI_PI, (UINT32)~(B_PCH_SATA_PORT0_IMPLEMENTED + B_PCH_SATA_PORT1_IMPLEMENTED), (UINT32)(B_PCH_SATA_PORT0_IMPLEMENTED + B_PCH_SATA_PORT1_IMPLEMENTED));
- DwordReg = MmioRead32 (IdeAhciBar + R_PCH_SATA_AHCI_PI);
}

switch (PortNum)
--
2.9.2


[PATCH v2 14/19] Vlv2TbltDevicePkg/VlvPlatformInitDxe: Remove unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c: In function ‘GetIntegratedIntelVbtPtr’:
Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c:145:33: error: variable ‘VbtSize’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c: In function ‘JudgeHandleIsPCIDevice’:
Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c:418:22: error: variable ‘DevicePath’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@...>
Cc: "Wu, Hao A" <hao.a.wu@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
Reviewed-by: David Wei <david.wei@...>
---
Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c b/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
index 2200e6c..f8dc3f1 100644
--- a/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
+++ b/Vlv2TbltDevicePkg/VlvPlatformInitDxe/IgdOpRegion.c
@@ -133,7 +133,6 @@ GetIntegratedIntelVbtPtr (
{
EFI_STATUS Status;
EFI_PHYSICAL_ADDRESS VbtAddress = 0;
- UINT32 VbtSize = 0;
UINTN FvProtocolCount;
EFI_HANDLE *FvHandles;
EFI_FIRMWARE_VOLUME_PROTOCOL *Fv;
@@ -174,7 +173,6 @@ GetIntegratedIntelVbtPtr (

if (!EFI_ERROR (Status)) {
VbtAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)Buffer;
- VbtSize = (UINT32)VbtBufferSize;
Status = EFI_SUCCESS;
break;
}
@@ -406,7 +404,6 @@ JudgeHandleIsPCIDevice(
{
EFI_STATUS Status;
EFI_DEVICE_PATH *DPath;
- EFI_DEVICE_PATH *DevicePath;

Status = gBS->HandleProtocol (
Handle,
@@ -414,7 +411,6 @@ JudgeHandleIsPCIDevice(
(VOID **) &DPath
);
if(!EFI_ERROR(Status)) {
- DevicePath = DPath;
while(!IsDevicePathEnd(DPath)) {
if((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP)) {
PCI_DEVICE_PATH *PCIPath;
--
2.9.2


[PATCH v2 15/19] Vlv2TbltDevicePkg/PlatformDxe: Remove the unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/PlatformDxe/Platform.c: In function ‘InitPciDevPME’:
Vlv2TbltDevicePkg/PlatformDxe/Platform.c:516:26: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/Platform.c: In function ‘InitThermalZone’:
Vlv2TbltDevicePkg/PlatformDxe/Platform.c:575:26: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c: In function ‘InitializeSubsystemIds’:
Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c:111:10: error: variable ‘SubsystemAudioVidDid’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c: In function ‘InitBadBars’:
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c:115:40: error: variable ‘PciIoDevice’ set but not used [-Werror=unused-but-set-variable]
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c:114:39: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c: In function ‘ProgramPciLatency’:
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c:320:39: error: variable ‘Status’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
Reviewed-by: David Wei <david.wei@...>
---
Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c | 2 -
Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c | 214 ++++++++++++++--------------
Vlv2TbltDevicePkg/PlatformDxe/Platform.c | 40 +++---
3 files changed, 123 insertions(+), 133 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c b/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c
index 06d325c..4569ce5 100644
--- a/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c
+++ b/Vlv2TbltDevicePkg/PlatformDxe/IchRegTable.c
@@ -99,10 +99,8 @@ InitializeSubsystemIds (

EFI_REG_TABLE *RegTablePtr;
UINT32 SubsystemVidDid;
- UINT32 SubsystemAudioVidDid;

SubsystemVidDid = mPlatformInfo.SsidSvid;
- SubsystemAudioVidDid = mPlatformInfo.SsidSvid;

RegTablePtr = mSubsystemIdRegs;

diff --git a/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c b/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c
index 16aaa18..8c2bfff 100644
--- a/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c
+++ b/Vlv2TbltDevicePkg/PlatformDxe/PciDevice.c
@@ -102,8 +102,6 @@ InitBadBars(
)
{

- EFI_STATUS Status;
- PCI_IO_DEVICE *PciIoDevice;
UINT64 BaseAddress = 0;
UINT64 TempBaseAddress = 0;
UINT8 RevId = 0;
@@ -112,8 +110,6 @@ InitBadBars(
UINT64 MemSize;
UINTN MemSizeBits;

-
- PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (PciIo);
switch ( VendorId) {
case ATI_VENDOR_ID:
//
@@ -124,31 +120,31 @@ InitBadBars(
//
// Get original BAR address
//
- Status = PciIo->Pci.Read (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &BaseAddress
- );
+ PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &BaseAddress
+ );
//
// Find BAR size
//
TempBaseAddress = 0xffffffff;
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &TempBaseAddress
- );
- Status = PciIo->Pci.Read (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &TempBaseAddress
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
+ PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
TempBaseAddress &= 0xfffffffe;
MemSize = 1;
while ((TempBaseAddress & 0x01) == 0) {
@@ -159,32 +155,32 @@ InitBadBars(
//
// Free up allocated memory memory and re-allocate with increased size.
//
- Status = gDS->FreeMemorySpace (
- BaseAddress,
- MemSize
- );
+ gDS->FreeMemorySpace (
+ BaseAddress,
+ MemSize
+ );
//
// Force new alignment
//
MemSize = 0x8000000;
MemSizeBits = 28;

- Status = gDS->AllocateMemorySpace (
- EfiGcdAllocateAnySearchBottomUp,
- EfiGcdMemoryTypeMemoryMappedIo,
- MemSizeBits, // Alignment
- MemSize,
- &BaseAddress,
- mImageHandle,
- NULL
- );
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &BaseAddress
- );
+ gDS->AllocateMemorySpace (
+ EfiGcdAllocateAnySearchBottomUp,
+ EfiGcdMemoryTypeMemoryMappedIo,
+ MemSizeBits, // Alignment
+ MemSize,
+ &BaseAddress,
+ mImageHandle,
+ NULL
+ );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &BaseAddress
+ );

break;
case NCR_VENDOR_ID:
@@ -195,22 +191,22 @@ InitBadBars(
//
for (Bar = 0x10; Bar < 0x28; Bar+= 4) {

- Status = PciIo->Pci.Read (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &BaseAddress
- );
+ PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &BaseAddress
+ );
if (BaseAddress && 0x01) {
TempBaseAddress = 0xffffffff;
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &TempBaseAddress
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
TempBaseAddress &= 0xfffffffc;
IoSize = 1;
while ((TempBaseAddress & 0x01) == 0) {
@@ -218,28 +214,28 @@ InitBadBars(
IoSize = IoSize << 1;
}
if (IoSize < MIN_NCR_IO_SIZE) {
- Status = gDS->FreeIoSpace (
- BaseAddress,
- IoSize
- );
-
- Status = gDS->AllocateIoSpace (
- EfiGcdAllocateAnySearchTopDown,
- EfiGcdIoTypeIo,
- NCR_GRAN, // Alignment
- MIN_NCR_IO_SIZE,
- &BaseAddress,
- mImageHandle,
- NULL
- );
+ gDS->FreeIoSpace (
+ BaseAddress,
+ IoSize
+ );
+
+ gDS->AllocateIoSpace (
+ EfiGcdAllocateAnySearchTopDown,
+ EfiGcdIoTypeIo,
+ NCR_GRAN, // Alignment
+ MIN_NCR_IO_SIZE,
+ &BaseAddress,
+ mImageHandle,
+ NULL
+ );
TempBaseAddress = BaseAddress + 1;
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &TempBaseAddress
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
}
}
}
@@ -255,13 +251,13 @@ InitBadBars(
// Controller.
// All Tekoa A2 or earlier step chips for now.
//
- Status = PciIo->Pci.Read (
- PciIo,
- EfiPciIoWidthUint8,
- PCI_REVISION_ID_OFFSET,
- 1,
- &RevId
- );
+ PciIo->Pci.Read (
+ PciIo,
+ EfiPciIoWidthUint8,
+ PCI_REVISION_ID_OFFSET,
+ 1,
+ &RevId
+ );
if (RevId <= 0x02) {
for (Bar = 0x14; Bar < 0x24; Bar+= 4) {
//
@@ -269,13 +265,13 @@ InitBadBars(
// Bars don't worry aboyut freeing up thge allocs.
//
TempBaseAddress = 0x0;
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- Bar,
- 1,
- (VOID *) &TempBaseAddress
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ Bar,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
} // end for
}
else
@@ -286,13 +282,13 @@ InitBadBars(
//since Tekoa does not fully support IDE Bus Mastering
//
TempBaseAddress = 0x0;
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint32,
- 0x20,
- 1,
- (VOID *) &TempBaseAddress
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint32,
+ 0x20,
+ 1,
+ (VOID *) &TempBaseAddress
+ );
}
}
break;
@@ -308,19 +304,17 @@ ProgramPciLatency(
IN EFI_PCI_IO_PROTOCOL *PciIo
)
{
- EFI_STATUS Status;
-
//
// Program Master Latency Timer
//
if (mSystemConfiguration.PciLatency != 0) {
- Status = PciIo->Pci.Write (
- PciIo,
- EfiPciIoWidthUint8,
- PCI_LATENCY_TIMER_OFFSET,
- 1,
- &mSystemConfiguration.PciLatency
- );
+ PciIo->Pci.Write (
+ PciIo,
+ EfiPciIoWidthUint8,
+ PCI_LATENCY_TIMER_OFFSET,
+ 1,
+ &mSystemConfiguration.PciLatency
+ );
}
return;
}
diff --git a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
index 439b6d9..3d8cbe0 100644
--- a/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
+++ b/Vlv2TbltDevicePkg/PlatformDxe/Platform.c
@@ -518,16 +518,15 @@ InitPciDevPME (
)
{
UINTN VarSize;
- EFI_STATUS Status;

VarSize = sizeof(SYSTEM_CONFIGURATION);
- Status = gRT->GetVariable(
- NORMAL_SETUP_NAME,
- &gEfiNormalSetupGuid,
- NULL,
- &VarSize,
- &mSystemConfiguration
- );
+ gRT->GetVariable(
+ NORMAL_SETUP_NAME,
+ &gEfiNormalSetupGuid,
+ NULL,
+ &VarSize,
+ &mSystemConfiguration
+ );

//
//Program HDA PME_EN
@@ -577,21 +576,20 @@ InitThermalZone (
)
{
UINTN VarSize;
- EFI_STATUS Status;
EFI_GLOBAL_NVS_AREA_PROTOCOL *GlobalNvsArea;
VarSize = sizeof(SYSTEM_CONFIGURATION);
- Status = gRT->GetVariable(
- NORMAL_SETUP_NAME,
- &gEfiNormalSetupGuid,
- NULL,
- &VarSize,
- &mSystemConfiguration
- );
- Status = gBS->LocateProtocol (
- &gEfiGlobalNvsAreaProtocolGuid,
- NULL,
- (void **)&GlobalNvsArea
- );
+ gRT->GetVariable(
+ NORMAL_SETUP_NAME,
+ &gEfiNormalSetupGuid,
+ NULL,
+ &VarSize,
+ &mSystemConfiguration
+ );
+ gBS->LocateProtocol (
+ &gEfiGlobalNvsAreaProtocolGuid,
+ NULL,
+ (void **)&GlobalNvsArea
+ );
GlobalNvsArea->Area->CriticalThermalTripPoint = mSystemConfiguration.CriticalThermalTripPoint;
GlobalNvsArea->Area->PassiveThermalTripPoint = mSystemConfiguration.PassiveThermalTripPoint;
}
--
2.9.2


[PATCH v2 16/19] Vlv2TbltDevicePkg/Wpce791: Remove the unused variable

Gary Lin
 

Fix the following error from gcc:

Vlv2TbltDevicePkg/Wpce791/LpcDriver.c: In function ‘LpcDriverStart’:
Vlv2TbltDevicePkg/Wpce791/LpcDriver.c:239:27: error: variable ‘LpcDev’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
---
Vlv2TbltDevicePkg/Wpce791/LpcDriver.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c b/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c
index be99b4c..5b0c25c 100644
--- a/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c
+++ b/Vlv2TbltDevicePkg/Wpce791/LpcDriver.c
@@ -227,10 +227,6 @@ LpcDriverStart (
{
EFI_STATUS Status;
EFI_PCI_IO_PROTOCOL *PciIo;
- LPC_DEV *LpcDev;
-
-
- LpcDev = NULL;

//
// Get Pci IO
--
2.9.2


[PATCH v2 17/19] Vlv2TbltDevicePkg/SmBiosMiscDxe: Remove unused variables

Gary Lin
 

Fix the following errors from gcc:

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c: In function ‘JudgeHandleIsPCIDevice’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c:164:22: error: variable ‘DevicePath’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c: In function ‘AddSmbiosT0x90Callback’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c:292:28: error: variable ‘ForType90InputData’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c: In function ‘MiscProcessorInformationFunction’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c:191:37: error: variable ‘SrcDataSize’ set but not used [-Werror=unused-but-set-variable]

Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c: In function ‘MiscProcessorCacheFunction’:
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c:78:34: error: variable ‘SrcDataSize’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
Reviewed-by: David Wei <david.wei@...>
---
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c | 5 -----
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c | 2 --
Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c | 2 --
3 files changed, 9 deletions(-)

diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
index 2d0bf8b..9e04907 100644
--- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
+++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscOemType0x90Function.c
@@ -152,7 +152,6 @@ JudgeHandleIsPCIDevice(
{
EFI_STATUS Status;
EFI_DEVICE_PATH *DPath;
- EFI_DEVICE_PATH *DevicePath;

Status = gBS->HandleProtocol (
Handle,
@@ -160,7 +159,6 @@ JudgeHandleIsPCIDevice(
(VOID **) &DPath
);
if(!EFI_ERROR(Status)) {
- DevicePath = DPath;
while(!IsDevicePathEnd(DPath)) {
if((DPath->Type == HARDWARE_DEVICE_PATH) && (DPath->SubType == HW_PCI_DP)) {
PCI_DEVICE_PATH *PCIPath;
@@ -280,7 +278,6 @@ AddSmbiosT0x90Callback (
UINTN SteppingStrLen = 0;
SMBIOS_TABLE_TYPE90 *SmbiosRecord;
EFI_SMBIOS_HANDLE SmbiosHandle;
- EFI_MISC_OEM_TYPE_0x90 *ForType90InputData;
CHAR16 *SECVer;
CHAR16 *uCodeVer;
CHAR16 *GOPVer;
@@ -289,8 +286,6 @@ AddSmbiosT0x90Callback (
CHAR8 *OptionalStrStart;
EFI_SMBIOS_PROTOCOL *SmbiosProtocol;

- ForType90InputData = (EFI_MISC_OEM_TYPE_0x90 *)Context;
-
DEBUG ((EFI_D_INFO, "Executing SMBIOS T0x90 callback.\n"));

gBS->CloseEvent (Event); // Unload this event.
diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
index cbed988..b18a6aa 100644
--- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
+++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorCacheFunction.c
@@ -66,7 +66,6 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscProcessorCache)
EFI_DATA_RECORD_HEADER *Record;
EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
UINT8 *SrcData;
- UINT32 SrcDataSize;
EFI_STATUS Status;

//
@@ -113,7 +112,6 @@ MISC_SMBIOS_TABLE_FUNCTION(MiscProcessorCache)
if (Record->DataRecordClass == EFI_DATA_RECORD_CLASS_DATA) {
DataHeader = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1);
SrcData = (UINT8 *)(DataHeader + 1);
- SrcDataSize = Record->RecordSize - Record->HeaderSize - sizeof (EFI_SUBCLASS_TYPE1_HEADER);
if (CompareGuid(&Record->DataRecordGuid, &gEfiCacheSubClassGuid) && (DataHeader->RecordType == CacheSizeRecordType)) {
if (DataHeader->SubInstance == EFI_CACHE_L1) {
SmbiosRecordL1->InstalledSize += (UINT16) (ConvertBase2ToRaw((EFI_EXP_BASE2_DATA *)SrcData) >> 10);
diff --git a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c
index 005b43c..bd988db 100644
--- a/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c
+++ b/Vlv2TbltDevicePkg/SmBiosMiscDxe/MiscProcessorInformationFunction.c
@@ -179,7 +179,6 @@ MISC_SMBIOS_TABLE_FUNCTION (MiscProcessorInformation)
EFI_DATA_RECORD_HEADER *Record;
EFI_SUBCLASS_TYPE1_HEADER *DataHeader;
UINT8 *SrcData;
- UINT32 SrcDataSize;
EFI_PROCESSOR_VERSION_DATA *ProcessorVersion;
CHAR16 *NewStringToken;
STRING_REF TokenToUpdate;
@@ -225,7 +224,6 @@ MISC_SMBIOS_TABLE_FUNCTION (MiscProcessorInformation)

DataHeader = (EFI_SUBCLASS_TYPE1_HEADER *)(Record + 1);
SrcData = (UINT8 *)(DataHeader + 1);
- SrcDataSize = Record->RecordSize - Record->HeaderSize - sizeof (EFI_SUBCLASS_TYPE1_HEADER);

//
// Processor
--
2.9.2


[PATCH v2 18/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the usage of global variables

Gary Lin
 

gcc issued the error of "multiple deifintion" since gBS was also defined
in MdePkg/Library/UefiBootServicesTableLib. Actually those global variables,
gBS, pBS, and pRS, in PpmPolicy.h were only used in one function. Besides,
gBS and pRS were not really used. Remove gBS and pRS and declare pBS in
PpmPolicyEntry() to satisfy gcc.

Cc: David Wei <david.wei@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
Reviewed-by: David Wei <david.wei@...>
---
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c | 10 +++-------
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h | 6 +-----
2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
index 2f8996b..fb4e7fc 100644
--- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
+++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
@@ -33,8 +33,6 @@ Abstract:
#define EFI_CPUID_MODEL 0x00F0
#define EFI_CPUID_STEPPING 0x000F

-
-
EFI_STATUS
EFIAPI
PpmPolicyEntry(
@@ -42,6 +40,7 @@ PpmPolicyEntry(
IN EFI_SYSTEM_TABLE *SystemTable
)
{
+ EFI_BOOT_SERVICES *pBS;
EFI_MP_SERVICES_PROTOCOL *MpService;
EFI_CPUID_REGISTER Cpuid01 = { 0, 0, 0, 0};
EFI_HANDLE Handle;
@@ -52,15 +51,12 @@ PpmPolicyEntry(

PCH_STEPPING Stepping;

-
- gBS = SystemTable->BootServices;
pBS = SystemTable->BootServices;
- pRS = SystemTable->RuntimeServices;

//
// Set PPM policy structure to known value
//
- gBS->SetMem (&mDxePlatformPpmPolicy, sizeof(PPM_PLATFORM_POLICY_PROTOCOL), 0);
+ pBS->SetMem (&mDxePlatformPpmPolicy, sizeof(PPM_PLATFORM_POLICY_PROTOCOL), 0);

//
// Find the MpService Protocol
@@ -147,7 +143,7 @@ PpmPolicyEntry(
mDxePlatformPpmPolicy.S3RestoreMsrSwSmiNumber = S3_RESTORE_MSR_SW_SMI;

Handle = NULL;
- Status = gBS->InstallMultipleProtocolInterfaces (
+ Status = pBS->InstallMultipleProtocolInterfaces (
&Handle,
&gPpmPlatformPolicyProtocolGuid,
&mDxePlatformPpmPolicy,
diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h
index cd3676b..cc7bed7 100644
--- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h
+++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.h
@@ -31,10 +31,6 @@ PPM_PLATFORM_POLICY_PROTOCOL mDxePlatformPpmPolicy;
#define ICH_DEVICE_ENABLE 1
#define ICH_DEVICE_DISABLE 0

-EFI_BOOT_SERVICES *gBS;
-EFI_BOOT_SERVICES *pBS;
-EFI_RUNTIME_SERVICES *pRS;
-
#define POWER_STATE_SWITCH_SMI 43
#define ENABLE_C_STATE_IO_REDIRECTION_SMI 70
#define DISABLE_C_STATE_IO_REDIRECTION_SMI 71
@@ -43,4 +39,4 @@ EFI_RUNTIME_SERVICES *pRS;
#define ENABLE_P_STATE_HARDWARE_COORDINATION_SMI 74
#define DISABLE_P_STATE_HARDWARE_COORDINATION_SMI 75
#define S3_RESTORE_MSR_SW_SMI 48
-#define ENABLE_C6_RESIDENCY_SMI 76
\ No newline at end of file
+#define ENABLE_C6_RESIDENCY_SMI 76
--
2.9.2


[PATCH v2 19/19] Vlv2TbltDevicePkg/PpmPolicy: Remove the unused variable

Gary Lin
 

Fix the following error from gcc:

Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c: In function ‘PpmPolicyEntry’:
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c:50:29: error: variable ‘MaxRatio’ set but not used [-Werror=unused-but-set-variable]

Cc: David Wei <david.wei@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
Reviewed-by: David Wei <david.wei@...>
---
Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
index fb4e7fc..ec0c0f5 100644
--- a/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
+++ b/Vlv2TbltDevicePkg/PpmPolicy/PpmPolicy.c
@@ -46,7 +46,6 @@ PpmPolicyEntry(
EFI_HANDLE Handle;
EFI_STATUS Status;
UINTN CpuCount;
- UINT64 MaxRatio;
UINT8 CPUMobileFeature;

PCH_STEPPING Stepping;
@@ -77,8 +76,6 @@ PpmPolicyEntry(
// Store the CPUID for use by SETUP items.
//
AsmCpuid (EFI_CPUID_VERSION_INFO, &Cpuid01.RegEax, &Cpuid01.RegEbx, &Cpuid01.RegEcx, &Cpuid01.RegEdx);
- MaxRatio = ((RShiftU64 (AsmReadMsr64(EFI_MSR_IA32_PLATFORM_ID), 8)) & 0x1F);
-

mDxePlatformPpmPolicy.Revision = PPM_PLATFORM_POLICY_PROTOCOL_REVISION_4;

--
2.9.2


Re: Ingebrigtsen: The End of Gmane?

Bruce Cran <bruce@...>
 

On 7/28/16 6:46 PM, Kinney, Michael D wrote:

Built-in archives for edk2-devel and edk2-bugs and now enabled.
Thanks!

--
Bruce


Re: [PATCH v4 0/7] BaseTools: add support for GCC5 in LTO mode

Liming Gao
 

Ard:
Thanks for your update. I have some comments for them.
1) It uses GCC as Link for GCC44-GCC49. Have you done verification on them? I verify GCC49 in OVMFIa32X64 platform. It works.
2) After this change, how to append new link option in platform DSC? Use style -Wl, ?
3) I see GCC5 uses gcc-ar as its SLINK, and GCC49 uses ar as its SLINK. Is gcc-ar required only by LTO?
4) Before GCC49 optimization, GCC49 means GCC49 or later, GCC5 can work with GCC49 tool chain configuration. But now, I configure gcc to point to GCC5, and build OVMF with GCC49 tool chain, it reports GenFw failure. I expect GCC5 work with GCC49 and GCC5 tool chain both. GCC49 for no lto, GCC5 for lto. I know Steven has provided the patch to fix this GenFw issue.

GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid

Thanks
Liming

-----Original Message-----
From: Ard Biesheuvel [mailto:ard.biesheuvel@...]
Sent: Wednesday, July 27, 2016 7:14 PM
To: edk2-devel@...; lersek@...; Gao, Liming
<liming.gao@...>; Shi, Steven <steven.shi@...>; Zhu,
Yonghong <yonghong.zhu@...>; Justen, Jordan L
<jordan.l.justen@...>
Cc: leif.lindholm@...; Ard Biesheuvel <ard.biesheuvel@...>
Subject: [PATCH v4 0/7] BaseTools: add support for GCC5 in LTO mode

This v4 to introduce GCC5 is now a 7 piece series, including some
preparatory cleanup patches that allow all GCC4x and CLANG35 toolchains
to switch to using 'gcc' as the linker. This allows us to get rid of
the wrapper script to marshall ld arguments in order to make them
understandable by gcc, which is fragile and likely to cause problems in
the future.

Since there appears to be a natural split between the 'legacy' GCC
toolchains UNIXGCC, ELFGCC, and CYGGCC[xASL], both in term of supported
architectures [IA32, X64, IPF] vs [IA32, X64, ARM, AARCH64], and in
terms of maintenance, these toolchains are not moved to using 'gcc' as
the linker, and instead, a new BUILDRULEFAMILY is introduced called GCCLD
that will retain the old behavior.

The result is that GCC5 can align much more closely with its predecessors,
making the expected maintenance burden of supporting GCC back to v4.4
much lower.

Changes since v3:
- like Steven does in his GCC5LTO patch, add -fno-builtin to IA32 and X64
CC_FLAGS; this addresses a build issue reported by Liming
- add -Os the the linker flags as well, for AARCH64 this does not seem to
make
a difference, but it is arguably correct since the LTO processing at link
time involves code generation as well
- add Laszlo's ack to #2
- new patch #6 to omit the autogenerated build-id from the PE/COFF binary

Changes since v2:
- add license headers to LTO glue files for ARM and AARCH64 (#5)
- get rid of lto-ld-wrapper script

Ard Biesheuvel (7):
BaseTools CLANG35: drop problematic use-movt and save-temps options
ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: ignore .hash and .note
sections
BaseTools UNIXGCC ELFGCC CYGGCC: clone GCC build rule family into
GCCLD
BaseTools GCC: use 'gcc' as the linker command for GCC44 and later
ArmPkg: add prebuilt glue binaries for GCC5 LTO support
BaseTools GCC: drop GNU notes section from EFI image
BaseTools GCC: add support for GCC v5.x in LTO mode

ArmPkg/GccLto/liblto-aarch64.a | Bin 0 -> 1016 bytes
ArmPkg/GccLto/liblto-aarch64.s | 27 ++
ArmPkg/GccLto/liblto-arm.a | Bin 0 -> 2096 bytes
ArmPkg/GccLto/liblto-arm.s | 61 ++++
ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 2 +-
ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds | 3 +
BaseTools/Conf/build_rule.template | 31 +-
BaseTools/Conf/tools_def.template | 344 ++++++++++++++------
BaseTools/Scripts/GccBase.lds | 6 +
EmulatorPkg/Unix/Host/Host.inf | 6 +-
10 files changed, 372 insertions(+), 108 deletions(-)
create mode 100644 ArmPkg/GccLto/liblto-aarch64.a
create mode 100644 ArmPkg/GccLto/liblto-aarch64.s
create mode 100644 ArmPkg/GccLto/liblto-arm.a
create mode 100644 ArmPkg/GccLto/liblto-arm.s

--
2.7.4


Re: [Patch 1/3] BaseTools: Correct ReadMe.txt file with CRLF line ending

Zhu, Yonghong <yonghong.zhu@...>
 

Reviewed-by: Yonghong Zhu <yonghong.zhu@...>

Best Regards,
Zhu Yonghong

-----Original Message-----
From: Gao, Liming
Sent: Thursday, July 28, 2016 4:46 PM
To: edk2-devel@...
Cc: Zhu, Yonghong <yonghong.zhu@...>
Subject: [Patch 1/3] BaseTools: Correct ReadMe.txt file with CRLF line ending

Cc: Yonghong Zhu <yonghong.zhu@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@...>
---
BaseTools/ReadMe.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/BaseTools/ReadMe.txt b/BaseTools/ReadMe.txt index 6330b14..be9ff2a 100644
--- a/BaseTools/ReadMe.txt
+++ b/BaseTools/ReadMe.txt
@@ -7,9 +7,9 @@ directory contatins tools source.

=== Windows/Visual Studio Notes ===

-To build the BaseTools, you should run the standard vsvars32.bat script -from your preferred Visual Studio installation or you can run get_vsvars.bat -to use latest automatically detected version.
+To build the BaseTools, you should run the standard vsvars32.bat script
+from your preferred Visual Studio installation or you can run
+get_vsvars.bat to use latest automatically detected version.

In addition to this, you should set the following environment variables:

--
2.8.0.windows.1


[patch] BaseTool/Upt: Avoid UNI file name conflict

hesschen <hesheng.chen@...>
 

When creating a UNI file if there is a name conflict, add an index from 0 to the file name

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: hesschen <hesheng.chen@...>
---
.../Source/Python/UPT/GenMetaFile/GenDecFile.py | 5 +++--
.../Source/Python/UPT/GenMetaFile/GenInfFile.py | 7 +++---
BaseTools/Source/Python/UPT/Library/String.py | 26 +++++++++++++++++++++-
3 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
index 31abd23..d39c182 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenDecFile.py
@@ -65,6 +65,7 @@ from Library.DataType import TAB_SECTION_END
from Library.DataType import TAB_SPLIT
import Library.DataType as DT
from Library.UniClassObject import FormatUniEntry
+from Library.String import GetUniFileName

def GenPcd(Package, Content):
#
@@ -586,9 +587,9 @@ def GenPackageUNIEncodeFile(PackageObject, UniFileHeader = '', Encoding=TAB_ENCO

if not os.path.exists(os.path.dirname(PackageObject.GetFullPath())):
os.makedirs(os.path.dirname(PackageObject.GetFullPath()))
- ContainerFile = os.path.normpath(os.path.join(os.path.dirname(PackageObject.GetFullPath()),
- (PackageObject.GetBaseName() + '.uni')))

+ ContainerFile = GetUniFileName(os.path.dirname(PackageObject.GetFullPath()), PackageObject.GetBaseName())
+
Content = UniFileHeader + '\r\n'
Content += '\r\n'

diff --git a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
index a131f98..c1362e6 100644
--- a/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
+++ b/BaseTools/Source/Python/UPT/GenMetaFile/GenInfFile.py
@@ -2,7 +2,7 @@
#
# This file contained the logical of transfer package object to INF files.
#
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -41,6 +41,7 @@ import Logger.Log as Logger
from Library import DataType as DT
from GenMetaFile import GenMetaFileMisc
from Library.UniClassObject import FormatUniEntry
+from Library.String import GetUniFileName


## Transfer Module Object to Inf files
@@ -225,8 +226,8 @@ def GenModuleUNIEncodeFile(ModuleObject, UniFileHeader='', Encoding=DT.TAB_ENCOD
return
else:
ModuleObject.UNIFlag = True
- ContainerFile = os.path.normpath(os.path.join(os.path.dirname(ModuleObject.GetFullPath()),
- (ModuleObject.GetBaseName() + '.uni')))
+ ContainerFile = GetUniFileName(os.path.dirname(ModuleObject.GetFullPath()), ModuleObject.GetBaseName())
+
if not os.path.exists(os.path.dirname(ModuleObject.GetFullPath())):
os.makedirs(os.path.dirname(ModuleObject.GetFullPath()))

diff --git a/BaseTools/Source/Python/UPT/Library/String.py b/BaseTools/Source/Python/UPT/Library/String.py
index 37ce141..05b5fb1 100644
--- a/BaseTools/Source/Python/UPT/Library/String.py
+++ b/BaseTools/Source/Python/UPT/Library/String.py
@@ -2,7 +2,7 @@
# This file is used to define common string related functions used in parsing
# process
#
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -957,3 +957,27 @@ def IsMatchArch(Arch1, Arch2):
return True

return False
+
+# Search all files in FilePath to find the FileName with the largest index
+# Return the FileName with index +1 under the FilePath
+#
+def GetUniFileName(FilePath, FileName):
+ Files = os.listdir(FilePath)
+ LargestIndex = -1
+ for File in Files:
+ if File.upper().startswith(FileName.upper()) and File.upper().endswith('.UNI'):
+ Index = File.upper().replace(FileName.upper(), '').replace('.UNI', '')
+ if Index:
+ try:
+ Index = int(Index)
+ except Exception:
+ Index = -1
+ else:
+ Index = 0
+ if Index > LargestIndex:
+ LargestIndex = Index + 1
+
+ if LargestIndex > -1:
+ return os.path.normpath(os.path.join(FilePath, FileName + str(LargestIndex) + '.uni'))
+ else:
+ return os.path.normpath(os.path.join(FilePath, FileName + '.uni'))
--
2.7.2.windows.1


Re: [PATCH v4 0/7] BaseTools: add support for GCC5 in LTO mode

Ard Biesheuvel
 

On 29 July 2016 at 06:47, Gao, Liming <liming.gao@...> wrote:
Ard:
Thanks for your update. I have some comments for them.
1) It uses GCC as Link for GCC44-GCC49. Have you done verification on them? I verify GCC49 in OVMFIa32X64 platform. It works.
Yes, I tested all of them.

2) After this change, how to append new link option in platform DSC? Use style -Wl, ?
It depends. Some options (like -z) don't need it, but others do.

3) I see GCC5 uses gcc-ar as its SLINK, and GCC49 uses ar as its SLINK. Is gcc-ar required only by LTO?
Yes

4) Before GCC49 optimization, GCC49 means GCC49 or later, GCC5 can work with GCC49 tool chain configuration. But now, I configure gcc to point to GCC5, and build OVMF with GCC49 tool chain, it reports GenFw failure. I expect GCC5 work with GCC49 and GCC5 tool chain both. GCC49 for no lto, GCC5 for lto. I know Steven has provided the patch to fix this GenFw issue.

GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid
Which GCC version are you using?


-----Original Message-----
From: Ard Biesheuvel [mailto:ard.biesheuvel@...]
Sent: Wednesday, July 27, 2016 7:14 PM
To: edk2-devel@...; lersek@...; Gao, Liming
<liming.gao@...>; Shi, Steven <steven.shi@...>; Zhu,
Yonghong <yonghong.zhu@...>; Justen, Jordan L
<jordan.l.justen@...>
Cc: leif.lindholm@...; Ard Biesheuvel <ard.biesheuvel@...>
Subject: [PATCH v4 0/7] BaseTools: add support for GCC5 in LTO mode

This v4 to introduce GCC5 is now a 7 piece series, including some
preparatory cleanup patches that allow all GCC4x and CLANG35 toolchains
to switch to using 'gcc' as the linker. This allows us to get rid of
the wrapper script to marshall ld arguments in order to make them
understandable by gcc, which is fragile and likely to cause problems in
the future.

Since there appears to be a natural split between the 'legacy' GCC
toolchains UNIXGCC, ELFGCC, and CYGGCC[xASL], both in term of supported
architectures [IA32, X64, IPF] vs [IA32, X64, ARM, AARCH64], and in
terms of maintenance, these toolchains are not moved to using 'gcc' as
the linker, and instead, a new BUILDRULEFAMILY is introduced called GCCLD
that will retain the old behavior.

The result is that GCC5 can align much more closely with its predecessors,
making the expected maintenance burden of supporting GCC back to v4.4
much lower.

Changes since v3:
- like Steven does in his GCC5LTO patch, add -fno-builtin to IA32 and X64
CC_FLAGS; this addresses a build issue reported by Liming
- add -Os the the linker flags as well, for AARCH64 this does not seem to
make
a difference, but it is arguably correct since the LTO processing at link
time involves code generation as well
- add Laszlo's ack to #2
- new patch #6 to omit the autogenerated build-id from the PE/COFF binary

Changes since v2:
- add license headers to LTO glue files for ARM and AARCH64 (#5)
- get rid of lto-ld-wrapper script

Ard Biesheuvel (7):
BaseTools CLANG35: drop problematic use-movt and save-temps options
ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: ignore .hash and .note
sections
BaseTools UNIXGCC ELFGCC CYGGCC: clone GCC build rule family into
GCCLD
BaseTools GCC: use 'gcc' as the linker command for GCC44 and later
ArmPkg: add prebuilt glue binaries for GCC5 LTO support
BaseTools GCC: drop GNU notes section from EFI image
BaseTools GCC: add support for GCC v5.x in LTO mode

ArmPkg/GccLto/liblto-aarch64.a | Bin 0 -> 1016 bytes
ArmPkg/GccLto/liblto-aarch64.s | 27 ++
ArmPkg/GccLto/liblto-arm.a | Bin 0 -> 2096 bytes
ArmPkg/GccLto/liblto-arm.s | 61 ++++
ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf | 2 +-
ArmVirtPkg/PrePi/Scripts/PrePi-PIE.lds | 3 +
BaseTools/Conf/build_rule.template | 31 +-
BaseTools/Conf/tools_def.template | 344 ++++++++++++++------
BaseTools/Scripts/GccBase.lds | 6 +
EmulatorPkg/Unix/Host/Host.inf | 6 +-
10 files changed, 372 insertions(+), 108 deletions(-)
create mode 100644 ArmPkg/GccLto/liblto-aarch64.a
create mode 100644 ArmPkg/GccLto/liblto-aarch64.s
create mode 100644 ArmPkg/GccLto/liblto-arm.a
create mode 100644 ArmPkg/GccLto/liblto-arm.s

--
2.7.4


Re: [PATCH v4 0/7] BaseTools: add support for GCC5 in LTO mode

Ard Biesheuvel
 

On 29 July 2016 at 08:09, Ard Biesheuvel <ard.biesheuvel@...> wrote:
On 29 July 2016 at 06:47, Gao, Liming <liming.gao@...> wrote:
Ard:
Thanks for your update. I have some comments for them.
1) It uses GCC as Link for GCC44-GCC49. Have you done verification on them? I verify GCC49 in OVMFIa32X64 platform. It works.
Yes, I tested all of them.

2) After this change, how to append new link option in platform DSC? Use style -Wl, ?
It depends. Some options (like -z) don't need it, but others do.

3) I see GCC5 uses gcc-ar as its SLINK, and GCC49 uses ar as its SLINK. Is gcc-ar required only by LTO?
Yes

4) Before GCC49 optimization, GCC49 means GCC49 or later, GCC5 can work with GCC49 tool chain configuration. But now, I configure gcc to point to GCC5, and build OVMF with GCC49 tool chain, it reports GenFw failure. I expect GCC5 work with GCC49 and GCC5 tool chain both. GCC49 for no lto, GCC5 for lto. I know Steven has provided the patch to fix this GenFw issue.

GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid
/home/hwu/work/lgao4/AllPkg/Build/Ovmf3264/DEBUG_GCC49/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll unsupported ELF EM_X86_64 relocation 0x9.
GenFw: ERROR 3000: Invalid
Which GCC version are you using?
I cannot reproduce this with gcc version 5.4.0 20160609 (Ubuntu
5.4.0-6ubuntu1~16.04.1)

In any case, I think we should merge Steven's patch that adds handling
to the relocation types to GenFw. The issue is only that having a GOT
does not make a lot of sense for UEFI executables, since it forces a
symbol reference to be absolute, which uses more space in the code,
but also in the .reloc section. The visibility pragma I introduced for
GCC4x was intended to prevent GOT based relocations from being
emitted.


bugzilla whining

Laszlo Ersek
 

Hello Mike,

I got my first ever bugzilla whine today. It says "All of these bugs are
in the CONFIRMED state, and have not been touched in 7 days or more."

I'm not amused. :) I keep a very close eye on my BZs and I don't welcome
automated whines.

I checked the Bugzilla 5 documentation about whines:

http://bugzilla.readthedocs.io/en/5.0/administering/whining.html#whining
http://bugzilla.readthedocs.io/en/5.0/using/preferences.html?highlight=whine#permissions
http://bugzilla.readthedocs.io/en/5.0/administering/parameters.html?highlight=whine#email

I confirmed on my account (under Preferences | Permissions) that I have
the "bz_canusewhines" permission (--> "User can configure whine reports
for self"). However, when I go to Administration | Whining, it seems
that I can only create new whines -- I don't seem to have any personal
whines set up at the moment.

Which makes me think that this is a central default. Can we please make
it a personal setting instead?

Thank you,
Laszlo


Re: [PATCH v2 02/19] Vlv2TbltDevicePkg: Only define MDEPKG_NDEBUG for gcc release build

Laszlo Ersek
 

On 07/29/16 05:25, Gary Lin wrote:
We only enable "-Wno-unused-but-set-variable" for the release build
and gcc would complain that the varible passed to ASSERT_EFI_ERROR
wasn't used in the debug build. Just don't define MDEPKG_NDEBUG for
the debug build to make gcc happy with ASSERT_EFI_ERROR.

Suggested-by: Laszlo Ersek <lersek@...>
Cc: David Wei <david.wei@...>
CC: Laszlo Ersek <lersek@...>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@...>
---
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
index a3f4c9a..e57d2ad 100644
--- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
+++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc
@@ -1117,7 +1117,7 @@ [Components.X64]
!endif
<BuildOptions>
ICC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
- GCC:*_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
+ GCC:RELEASE_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
}
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf {
<LibraryClasses>
Acked-by: Laszlo Ersek <lersek@...>


Re: Ingebrigtsen: The End of Gmane?

Laszlo Ersek
 

On 07/29/16 06:07, Bruce Cran wrote:
On 7/28/16 6:46 PM, Kinney, Michael D wrote:

Built-in archives for edk2-devel and edk2-bugs and now enabled.
Thanks!
Thanks!
Laszlo


Re: [Patch] Vlv2TbltDevicePkg:Signal EndOfDxe Event.

Laszlo Ersek
 

On 07/29/16 04:31, Wei, David wrote:
Reviewed-by: David Wei <david.wei@...>



Thanks,
David Wei

Intel SSG BIOS Team
I recommend using the new EfiEventGroupSignal() function from UefiLib instead.

Please refer to the following commits:

ca8f50e88e03 MdePkg/UefiLib: move InternalEmptyFunction to UefiLib.c
772fb7cb13de MdePkg/UefiLib: introduce EfiEventGroupSignal
ff55dd3befb4 IntelFrameworkPkg/FrameworkUefiLib: move InternalEmptyFunction to UefiLib.c
6212b9481d82 IntelFrameworkPkg/FrameworkUefiLib: implement EfiEventGroupSignal
dfc9514794fc ArmVirtPkg/PlatformIntelBdsLib: rebase to EfiEventGroupSignal
36e8e6992d0c OvmfPkg/PlatformBdsLib: rebase to EfiEventGroupSignal

Thanks
Laszlo


-----Original Message-----
From: Lu, ShifeiX A
Sent: Friday, July 29, 2016 10:27 AM
To: edk2-devel@...
Cc: Wei; Wei, David <david.wei@...>
Subject: [Patch] Vlv2TbltDevicePkg:Signal EndOfDxe Event.

According to PI spec,EndOfDxe Event should be signaled
before DxeSmmReadyToLock protocol installation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: lushifex <shifeix.a.lu@...>
---
.../Library/PlatformBdsLib/BdsPlatform.c | 37 +++++++++++++++++++++-
.../Library/PlatformBdsLib/PlatformBdsLib.inf | 3 +-
2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
index 195d734..5df3396 100644
--- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
+++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c
@@ -1,8 +1,8 @@
/** @file

- Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>


This program and the accompanying materials are licensed and made available under

the terms and conditions of the BSD License that accompanies this distribution.

The full text of the license may be found at

http://opensource.org/licenses/bsd-license.php.

@@ -203,10 +203,29 @@ ShellImageCallback (
{
BdsSetConsoleMode (TRUE);
DEBUG ((EFI_D_INFO, "BdsEntry ShellImageCallback \n"));
}

+/**
+ An empty function to pass error checking of CreateEventEx ().
+
+ @param Event Event whose notification function is being invoked.
+ @param Context Pointer to the notification function's context,
+ which is implementation-dependent.
+
+**/
+STATIC
+VOID
+EFIAPI
+EmptyCallbackFunction (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ )
+{
+ return;
+}
+
//
// BDS Platform Functions
//
/**
Platform Bds init. Incude the platform firmware vendor, revision
@@ -223,12 +242,28 @@ PlatformBdsInit (
VOID
)
{
EFI_STATUS Status;
EFI_EVENT ShellImageEvent;
+ EFI_EVENT EndOfDxeEvent;
EFI_GUID ShellEnvProtocol = SHELL_ENVIRONMENT_INTERFACE_PROTOCOL;

+ //
+ // Signal EndOfDxe PI Event
+ //
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ EmptyCallbackFunction,
+ NULL,
+ &gEfiEndOfDxeEventGroupGuid,
+ &EndOfDxeEvent
+ );
+ if (!EFI_ERROR (Status)) {
+ gBS->SignalEvent (EndOfDxeEvent);
+ }
+
#ifdef __GNUC__
SerialPortWrite((UINT8 *)">>>>BdsEntry[GCC]\r\n", 19);
#else
SerialPortWrite((UINT8 *)">>>>BdsEntry\r\n", 14);
#endif
diff --git a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf
index 45578e8..c64bab9 100644
--- a/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf
+++ b/Vlv2TbltDevicePkg/Library/PlatformBdsLib/PlatformBdsLib.inf
@@ -1,9 +1,9 @@
#/** @file
# Component name for module PlatformBootManagerLib
#
-# Copyright (c) 2008 - 2015, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2008 - 2016, Intel Corporation. All rights reserved.<BR>
#

# This program and the accompanying materials are licensed and made available under

# the terms and conditions of the BSD License that accompanies this distribution.

# The full text of the license may be found at

# http://opensource.org/licenses/bsd-license.php.

@@ -95,10 +95,11 @@
gEfiMemoryTypeInformationGuid
gEfiCapsuleVendorGuid
gEfiGlobalVariableGuid
gEfiNormalSetupGuid
gEfiPartTypeSystemPartGuid
+ gEfiEndOfDxeEventGroupGuid

[Pcd]
gPlatformModuleTokenSpaceGuid.PcdFlashFvRecovery2Base
gPlatformModuleTokenSpaceGuid.PcdFlashFvMainBase
gPlatformModuleTokenSpaceGuid.PcdFlashFvRecoveryBase


[patch] BaseTool/UPT: Add Test Install

hesschen <hesheng.chen@...>
 

Add a new function to test if a DIST file list
one by one to see if they can meet the requirement
of Dependency.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: hesschen <hesheng.chen@...>
---
.../Source/Python/UPT/Core/DependencyRules.py | 21 ++++-
BaseTools/Source/Python/UPT/Logger/StringTable.py | 5 ++
BaseTools/Source/Python/UPT/TestInstall.py | 100 +++++++++++++++++++++
BaseTools/Source/Python/UPT/UPT.py | 16 ++++
4 files changed, 141 insertions(+), 1 deletion(-)
create mode 100644 BaseTools/Source/Python/UPT/TestInstall.py

diff --git a/BaseTools/Source/Python/UPT/Core/DependencyRules.py b/BaseTools/Source/Python/UPT/Core/DependencyRules.py
index 4608ed6..ee06c53 100644
--- a/BaseTools/Source/Python/UPT/Core/DependencyRules.py
+++ b/BaseTools/Source/Python/UPT/Core/DependencyRules.py
@@ -1,7 +1,7 @@
## @file
# This file is for installed package information database operations
#
-# Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of the BSD License which accompanies this
@@ -183,6 +183,25 @@ class DependencyRules(object):
def CheckInstallDpDepexSatisfied(self, DpObj):
self.PkgsToBeDepend = [(PkgInfo[1], PkgInfo[2]) for PkgInfo in self.WsPkgList]
return self.CheckDpDepexSatisfied(DpObj)
+
+ # # Check whether multiple DP depex satisfied by current workspace for Install
+ #
+ # @param DpObjList: A distribution object list
+ # @return: True if distribution depex satisfied
+ # False else
+ #
+ def CheckTestInstallPdDepexSatisfied(self, DpObjList):
+ self.PkgsToBeDepend = [(PkgInfo[1], PkgInfo[2]) for PkgInfo in self.WsPkgList]
+ for DpObj in DpObjList:
+ if self.CheckDpDepexSatisfied(DpObj):
+ for PkgKey in DpObj.PackageSurfaceArea.keys():
+ PkgObj = DpObj.PackageSurfaceArea[PkgKey]
+ self.PkgsToBeDepend.append((PkgObj.Guid, PkgObj.Version))
+ else:
+ return False, DpObj
+
+ return True, DpObj
+

## Check whether a DP depex satisfied by current workspace
# (excluding the original distribution's packages to be replaced) for Replace
diff --git a/BaseTools/Source/Python/UPT/Logger/StringTable.py b/BaseTools/Source/Python/UPT/Logger/StringTable.py
index 96f0e1c..4c42661 100644
--- a/BaseTools/Source/Python/UPT/Logger/StringTable.py
+++ b/BaseTools/Source/Python/UPT/Logger/StringTable.py
@@ -858,3 +858,8 @@ HLP_SPECIFY_PACKAGE_NAME_TO_BE_REPLACED = _(
"Specify the UEFI Distribution Package file name to be replaced")
HLP_USE_GUIDED_PATHS = _(
"Install packages to the following directory path by default: <PackageName>_<PACKAGE_GUID>_<PACKAGE_VERSION>")
+HLP_TEST_INSTALL = _(
+ "Specify the UEFI Distribution Package filenames to install")
+
+MSG_TEST_INSTALL_PASS = _("All distribution package file are satisfied for dependence check.")
+MSG_TEST_INSTALL_FAIL = _("NOT all distribution package file are satisfied for dependence check.")
diff --git a/BaseTools/Source/Python/UPT/TestInstall.py b/BaseTools/Source/Python/UPT/TestInstall.py
new file mode 100644
index 0000000..71fe928
--- /dev/null
+++ b/BaseTools/Source/Python/UPT/TestInstall.py
@@ -0,0 +1,100 @@
+# # @file
+# Test Install distribution package
+#
+# Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
+#
+# This program and the accompanying materials are licensed and made available
+# under the terms and conditions of the BSD License which accompanies this
+# distribution. The full text of the license may be found at
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+"""
+Test Install multiple distribution package
+"""
+# #
+# Import Modules
+#
+from Library import GlobalData
+import Logger.Log as Logger
+from Logger import StringTable as ST
+import Logger.ToolError as TE
+from Core.DependencyRules import DependencyRules
+from InstallPkg import UnZipDp
+
+import shutil
+from traceback import format_exc
+from platform import python_version
+from sys import platform
+
+# # Tool entrance method
+#
+# This method mainly dispatch specific methods per the command line options.
+# If no error found, return zero value so the caller of this tool can know
+# if it's executed successfully or not.
+#
+# @param Options: command Options
+#
+def Main(Options=None):
+ ContentZipFile, DistFile = None, None
+ ReturnCode = 0
+
+ try:
+ DataBase = GlobalData.gDB
+ WorkspaceDir = GlobalData.gWORKSPACE
+ if not Options.DistFiles:
+ Logger.Error("TestInstallPkg", TE.OPTION_MISSING, ExtraData=ST.ERR_SPECIFY_PACKAGE)
+
+ DistPkgList = []
+ for DistFile in Options.DistFiles:
+ DistPkg, ContentZipFile, __, DistFile = UnZipDp(WorkspaceDir, DistFile)
+ DistPkgList.append(DistPkg)
+
+ #
+ # check dependency
+ #
+ Dep = DependencyRules(DataBase)
+ Result = True
+ DpObj = None
+ try:
+ Result, DpObj = Dep.CheckTestInstallPdDepexSatisfied(DistPkgList)
+ except:
+ Result = False
+
+ if Result:
+ Logger.Quiet(ST.MSG_TEST_INSTALL_PASS)
+ else:
+ Logger.Quiet(ST.MSG_TEST_INSTALL_FAIL)
+
+ except TE.FatalError, XExcept:
+ ReturnCode = XExcept.args[0]
+ if Logger.GetLevel() <= Logger.DEBUG_9:
+ Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + format_exc())
+
+ except Exception, x:
+ ReturnCode = TE.CODE_ERROR
+ Logger.Error(
+ "\nTestInstallPkg",
+ TE.CODE_ERROR,
+ ST.ERR_UNKNOWN_FATAL_INSTALL_ERR % Options.DistFiles,
+ ExtraData=ST.MSG_SEARCH_FOR_HELP,
+ RaiseError=False
+ )
+ Logger.Quiet(ST.MSG_PYTHON_ON % (python_version(), platform) + format_exc())
+
+ finally:
+ Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_STARTED)
+ if DistFile:
+ DistFile.Close()
+ if ContentZipFile:
+ ContentZipFile.Close()
+ if GlobalData.gUNPACK_DIR:
+ shutil.rmtree(GlobalData.gUNPACK_DIR)
+ GlobalData.gUNPACK_DIR = None
+ Logger.Quiet(ST.MSG_REMOVE_TEMP_FILE_DONE)
+ if ReturnCode == 0:
+ Logger.Quiet(ST.MSG_FINISH)
+ return ReturnCode
+
diff --git a/BaseTools/Source/Python/UPT/UPT.py b/BaseTools/Source/Python/UPT/UPT.py
index 59c4a88..8dd949a 100644
--- a/BaseTools/Source/Python/UPT/UPT.py
+++ b/BaseTools/Source/Python/UPT/UPT.py
@@ -46,6 +46,7 @@ import InstallPkg
import RmPkg
import InventoryWs
import ReplacePkg
+import TestInstall
from Library.Misc import GetWorkspace
from Library import GlobalData
from Core.IpiDb import IpiDatabase
@@ -69,6 +70,9 @@ def CheckConflictOption(Opt):
Logger.Error("UPT", OPTION_CONFLICT, ExtraData=ST.ERR_I_R_EXCLUSIVE)
elif Opt.PackFileToCreate and Opt.PackFileToRemove:
Logger.Error("UPT", OPTION_CONFLICT, ExtraData=ST.ERR_C_R_EXCLUSIVE)
+ elif Opt.TestDistFiles and (Opt.PackFileToCreate or Opt.PackFileToInstall \
+ or Opt.PackFileToRemove or Opt.PackFileToReplace):
+ Logger.Error("UPT", OPTION_CONFLICT, ExtraData=ST.ERR_C_R_EXCLUSIVE)

if Opt.CustomPath and Opt.UseGuidedPkgPath:
Logger.Warn("UPT", ST.WARN_CUSTOMPATH_OVERRIDE_USEGUIDEDPATH)
@@ -146,6 +150,9 @@ def Main():

Parser.add_option("--use-guided-paths", action="store_true", dest="Use_Guided_Paths", help=ST.HLP_USE_GUIDED_PATHS)

+ Parser.add_option("-j", "--test-install", action="append", type="string",
+ dest="Test_Install_Distribution_Package_Files", help=ST.HLP_TEST_INSTALL)
+
Opt = Parser.parse_args()[0]

Var2Var = [
@@ -159,6 +166,7 @@ def Main():
("PackFileToReplace", Opt.Replace_Distribution_Package_File),
("PackFileToBeReplaced", Opt.Original_Distribution_Package_File),
("UseGuidedPkgPath", Opt.Use_Guided_Paths),
+ ("TestDistFiles", Opt.Test_Install_Distribution_Package_Files)
]

for Var in Var2Var:
@@ -265,6 +273,14 @@ def Main():
Opt.PackFileToReplace = AbsPath
RunModule = ReplacePkg.Main

+ elif Opt.Test_Install_Distribution_Package_Files:
+ for Dist in Opt.Test_Install_Distribution_Package_Files:
+ if not Dist.endswith('.dist'):
+ Logger.Error("TestInstall", FILE_TYPE_MISMATCH, ExtraData=ST.ERR_DIST_EXT_ERROR % Dist)
+
+ setattr(Opt, 'DistFiles', Opt.Test_Install_Distribution_Package_Files)
+ RunModule = TestInstall.Main
+
else:
Parser.print_usage()
return OPTION_MISSING
--
2.7.2.windows.1


Re: OVMF and passed usb 3. controller

Eugene Chekanskiy <echekanskiy@...>
 

Thanks a lot for reply, guys. Bios form https://www.kraxel.org rly helped
and my keyboard working fine.

Thanks,
Eugene.

2016-07-26 4:36 GMT+03:00 Tian, Feng <feng.tian@...>:

If the renesas usb 3.0 host controller follows XHCI spec, then EDKII XHCI
driver could be used to manage it.

Thanks
Feng

-----Original Message-----
From: Laszlo Ersek [mailto:lersek@...]
Sent: Monday, July 25, 2016 5:07 PM
To: Eugene Chekanskiy <echekanskiy@...>; edk2-devel@...
Cc: Gerd Hoffmann <kraxel@...>; Tian, Feng <feng.tian@...>;
Alex Williamson <alex.williamson@...>
Subject: Re: [edk2] OVMF and passed usb 3. controller

On 07/22/16 15:25, Eugene Chekanskiy wrote:
Hello everyone. Just wondering if default builds of ovmf form
http://www.tianocore.org/ovmf/ has support of renesas usb 3.0
controller and if we can enable it in custom build.
First, please don't use the binary from <http://www.tianocore.org/ovmf>.
It is incredibly old (Feb 9 2014). Instead, I recommend <
http://www.kraxel.org/repos/> for anything "bleeding edge".

(Unless you are willing to build your own OVMF, of course, in which case I
recommend that instead).

Second, OVMF includes the "MdeModulePkg/Bus/Pci/XhciDxe" driver. I assume
you assign your Renesas host controller to the virtual machine; is that
right? If your host controller is supported by XhciDxe otherwise (IOW it
would work in a purely physical setup), then I think it should work with
device assignment as well.

CC: Gerd for owning kraxel.org and for USB knowledge
CC: Feng for maintaining XhciDxe
CC: Alex for any possible quirks with USB host controller assignment

Thanks
Laszlo