Skip to content

Commit

Permalink
Fixed compilation of all packages tracked by CI after rebasing upon e…
Browse files Browse the repository at this point in the history
…dk2-stable202405 tag.
  • Loading branch information
Mikhail Krichanov committed Jul 1, 2024
1 parent 7ba9906 commit d31a94d
Show file tree
Hide file tree
Showing 21 changed files with 53 additions and 67 deletions.
2 changes: 2 additions & 0 deletions CryptoPkg/Library/IntrinsicLib/CopyMem.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Base.h>
#include <Library/BaseMemoryLib.h>

#if !defined (__arm__)
#if defined (__clang__) && !defined (__APPLE__)

/* Copies bytes between buffers */
Expand Down Expand Up @@ -53,3 +54,4 @@ __bzero (
ZeroMem (src, count);
}
#endif
#endif
57 changes: 0 additions & 57 deletions EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,60 +156,3 @@ PhaseFreePool (
{
// Not implemented yet
}

/**
Reallocates a buffer of type EfiBootServicesData.
Allocates and zeros the number bytes specified by NewSize from memory of type
EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and
NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
OldBuffer is freed. A pointer to the newly allocated buffer is returned.
If NewSize is 0, then a valid buffer of 0 size is returned. If there is not
enough memory remaining to satisfy the request, then NULL is returned.
If the allocation of the new buffer is successful and the smaller of NewSize and OldSize
is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT().
@param OldSize The size, in bytes, of OldBuffer.
@param NewSize The size, in bytes, of the buffer to reallocate.
@param OldBuffer The buffer to copy to the allocated buffer. This is an optional
parameter that may be NULL.
@return A pointer to the allocated buffer or NULL if allocation fails.
**/
VOID *
EFIAPI
ReallocatePool (
IN UINTN OldSize,
IN UINTN NewSize,
IN VOID *OldBuffer OPTIONAL
)
{
VOID *NewBuffer;

// Validate the OldBuffer is HobAllocated.
DEBUG_CODE_BEGIN ();
EFI_HOB_HANDOFF_INFO_TABLE *HandOffHob;

if (OldBuffer != NULL) {
HandOffHob = GetHobList ();
ASSERT (((EFI_PHYSICAL_ADDRESS)(UINTN)OldBuffer >= HandOffHob->EfiMemoryBottom));
ASSERT (((EFI_PHYSICAL_ADDRESS)((UINTN)OldBuffer + OldSize) <= HandOffHob->EfiFreeMemoryBottom));
}

DEBUG_CODE_END ();

// If new buffer would be smaller just return old buffer as FreePool isn't supported.
if ((OldBuffer != NULL) && (OldSize >= NewSize)) {
return OldBuffer;
}

NewBuffer = AllocateZeroPool (NewSize);
if ((NewBuffer != NULL) && (OldBuffer != NULL)) {
CopyMem (NewBuffer, OldBuffer, MIN (OldSize, NewSize));
FreePool (OldBuffer);
}

return NewBuffer;
}
1 change: 1 addition & 0 deletions MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ FillWriteBuffer (
UINT8 SfdpAddressBytes;

SfdpAddressBytes = (UINT8)Instance->SfdpBasicFlash->AddressBytes;
AddressSize = 0;

// Copy Opcode into Write Buffer
Instance->SpiTransactionWriteBuffer[0] = Opcode;
Expand Down
6 changes: 6 additions & 0 deletions MdeModulePkg/MdeModulePkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@
SpiHcPlatformLib|MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.inf
IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf

[LibraryClasses.IA32]
AmdSvsmLib|UefiCpuPkg/Library/AmdSvsmLibNull/AmdSvsmLibNull.inf

[LibraryClasses.X64]
AmdSvsmLib|OvmfPkg/Library/AmdSvsmLib/AmdSvsmLib.inf

[LibraryClasses.EBC.PEIM]
IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf

Expand Down
2 changes: 1 addition & 1 deletion MdePkg/Include/Library/DebugLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ UnitTestDebugAssert (
#define DEBUG(Expression) \
do { \
if (FALSE) { \
_DEBUG (Expression); \
_DEBUGLIB_DEBUG (Expression); \
} \
} while (FALSE)
#endif
Expand Down
2 changes: 1 addition & 1 deletion NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ Dhcp6AppendETOption (
return EFI_INVALID_PARAMETER;
}

if ((Elapsed == NULL)) {
if (Elapsed == NULL) {
return EFI_INVALID_PARAMETER;
}

Expand Down
1 change: 0 additions & 1 deletion OvmfPkg/Library/PlatformInitLib/IntelTdx.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <IndustryStandard/IntelTdx.h>
#include <Library/PeiServicesLib.h>
#include <Pi/PiHob.h>
#include <Library/TdxLib.h>
#include <WorkArea.h>
#include <ConfidentialComputingGuestAttr.h>

Expand Down
4 changes: 2 additions & 2 deletions OvmfPkg/OvmfPkgIa32.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvm
0x010000|0x010000
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize

0x020000|0x0E0000
0x020000|0x100000
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
FV = PEIFV

0x100000|0xE80000
0x120000|0xE60000
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
FV = DXEFV

Expand Down
4 changes: 2 additions & 2 deletions OvmfPkg/OvmfPkgX64.fdf
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecApicPageTableBase|gUefiOvmfPkgTokenSpaceGui
0x011000|0x00F000
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfSecPeiTempRamSize

0x020000|0x110000
0x020000|0x120000
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvSize
FV = PEIFV

0x130000|0xE50000
0x140000|0xE40000
gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvBase|gUefiOvmfPkgTokenSpaceGuid.PcdOvmfDxeMemFvSize
FV = DXEFV

Expand Down
9 changes: 7 additions & 2 deletions UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
**/

#include "MpLib.h"
#include <Library/CcExitLib.h>

#include <Library/AmdSvsmLib.h>
#include <Library/CcExitLib.h>
#include <Library/PlatformInitLib.h>

#include <Register/Amd/Fam17Msr.h>
#include <Register/Amd/Ghcb.h>

#define _IS_ALIGNED(x, y) (ALIGN_POINTER((x), (y)) == (x))

extern EFI_HOB_PLATFORM_INFO *mPlatformInfoHob;

/**
Perform the requested AP Creation action.
Expand Down Expand Up @@ -293,7 +298,7 @@ SevSnpCreateAP (
//
GuidHob = GetFirstGuidHob (&gGhcbApicIdsGuid);
GhcbApicIds = (GHCB_APIC_IDS *)(*(UINTN *)GET_GUID_HOB_DATA (GuidHob));
MaxIndex = MIN (GhcbApicIds->NumEntries, PcdGet32 (PcdCpuMaxLogicalProcessorNumber));
MaxIndex = MIN (GhcbApicIds->NumEntries, mPlatformInfoHob->PcdCpuMaxLogicalProcessorNumber);
} else {
//
// APs have been previously started.
Expand Down
2 changes: 1 addition & 1 deletion UefiPayloadPkg/UefiPayloadPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
SUPPORTED_ARCHITECTURES = IA32|X64
BUILD_TARGETS = DEBUG|RELEASE|NOOPT
SKUID_IDENTIFIER = DEFAULT
OUTPUT_DIRECTORY = Build/UefiPayloadPkg$(BUILD_ARCH)
OUTPUT_DIRECTORY = Build/UefiPayloadPkg
FLASH_DEFINITION = UefiPayloadPkg/UefiPayloadPkg.fdf
PCD_DYNAMIC_AS_DYNAMICEX = TRUE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@

[Depex]
TRUE

[BuildOptions]
NOOPT_CLANGPDB_*_DLINK_FLAGS = /force:unresolved
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@

[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask

[BuildOptions]
NOOPT_CLANGPDB_*_DLINK_FLAGS = /force:unresolved
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@

[Depex]
gEfiPeiMemoryDiscoveredPpiGuid

[BuildOptions]
NOOPT_CLANGPDB_*_DLINK_FLAGS = /force:unresolved
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@

[Depex]
gEfiSmmCpuProtocolGuid

[BuildOptions]
NOOPT_CLANGPDB_*_DLINK_FLAGS = /force:unresolved
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@

[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask

[BuildOptions]
NOOPT_CLANGPDB_*_DLINK_FLAGS = /force:unresolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@

[Depex]
TRUE

[BuildOptions]
NOOPT_CLANGPDB_*_DLINK_FLAGS = /force:unresolved
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@

[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask

[BuildOptions]
NOOPT_CLANGPDB_*_DLINK_FLAGS = /force:unresolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,6 @@

[Depex]
gEfiPeiMemoryDiscoveredPpiGuid

[BuildOptions]
NOOPT_CLANGPDB_*_DLINK_FLAGS = /force:unresolved
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@

[Depex]
gEfiSmmCpuProtocolGuid

[BuildOptions]
NOOPT_CLANGPDB_*_DLINK_FLAGS = /force:unresolved
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@

[Pcd]
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask

[BuildOptions]
NOOPT_CLANGPDB_*_DLINK_FLAGS = /force:unresolved

0 comments on commit d31a94d

Please sign in to comment.