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-stable202311 tag.
  • Loading branch information
Mikhail Krichanov committed Dec 18, 2023
1 parent f7d5b64 commit 883c78f
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: acidanthera/ocbuild
ref: master
ref: new-master
path: ./

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_nolto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: acidanthera/ocbuild
ref: master
ref: new-master
path: ./

- name: Install dependencies
Expand Down
1 change: 0 additions & 1 deletion BaseTools/Conf/tools_def.template
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,6 @@ DEFINE CLANGDWARF_RISCV64_DLINK_FLAGS = DEF(CLANGDWARF_RISCV64_TARGET) DEF
*_CLANGDWARF_RISCV64_DLINK2_FLAGS = DEF(GCC_DLINK2_FLAGS_COMMON) -Wl,--defsym=PECOFF_HEADER_SIZE=0x240
*_CLANGDWARF_RISCV64_PLATFORM_FLAGS =
*_CLANGDWARF_RISCV64_PP_FLAGS = DEF(GCC_PP_FLAGS) DEF(CLANGDWARF_RISCV64_TARGET) $(PLATFORM_FLAGS)
*_CLANGDWARF_RISCV64_RC_FLAGS = DEF(GCC_RISCV64_RC_FLAGS)
*_CLANGDWARF_RISCV64_VFRPP_FLAGS = DEF(GCC_VFRPP_FLAGS) DEF(CLANGDWARF_RISCV64_TARGET) $(PLATFORM_FLAGS)
*_CLANGDWARF_RISCV64_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) DEF(CLANGDWARF_RISCV64_TARGET)
*_CLANGDWARF_RISCV64_CC_SECPEIFLAGS = DEF(GCC_RISCV64_CC_SECPEIFLAGS)
Expand Down
3 changes: 0 additions & 3 deletions BaseTools/Source/C/Common/Decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
//
// Decompression algorithm begins here
//
#define UINT8_MAX 0xff
#define BITBUFSIZ 32
#define MAXMATCH 256
#define THRESHOLD 3
Expand Down Expand Up @@ -899,5 +898,3 @@ Extract (

return Status;
}


76 changes: 76 additions & 0 deletions BaseTools/Source/C/Common/WinNtInclude.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/** @file
Include file for the WinNt Library
Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#ifndef __WIN_NT_INCLUDE_H__
#define __WIN_NT_INCLUDE_H__

#define GUID _WINNT_DUP_GUID_____
#define _LIST_ENTRY _WINNT_DUP_LIST_ENTRY_FORWARD
#define LIST_ENTRY _WINNT_DUP_LIST_ENTRY

#if (_MSC_VER < 1800)
#define InterlockedIncrement _WINNT_DUP_InterlockedIncrement
#define InterlockedDecrement _WINNT_DUP_InterlockedDecrement
#define InterlockedCompareExchange64 _WINNT_DUP_InterlockedCompareExchange64
#endif

#undef UNALIGNED
#undef CONST
#undef VOID

#ifndef __GNUC__
#include "windows.h"

//
// Win32 include files do not compile clean with /W4, so we use the warning
// pragma to suppress the warnings for Win32 only. This way our code can still
// compile at /W4 (highest warning level) with /WX (warnings cause build
// errors).
//
#pragma warning(disable : 4115)
#pragma warning(disable : 4201)
#pragma warning(disable : 4214)
#pragma warning(disable : 4028)
#pragma warning(disable : 4133)

//
// Set the warnings back on as the EFI code must be /W4.
//
#pragma warning(default : 4115)
#pragma warning(default : 4201)

#endif

#undef GUID
#undef _LIST_ENTRY
#undef LIST_ENTRY
#undef InterlockedIncrement
#undef InterlockedDecrement
#undef InterlockedCompareExchange64
#undef InterlockedCompareExchangePointer

#define VOID void

//
// Prevent collisions with Windows API name macros that deal with Unicode/Not issues
//
#undef LoadImage
#undef CreateEvent

//
// FAR is used as a struct member name by DebugSupport.h.
//
#undef FAR

//
// These two macros collide with re-definitions and case labels.
//
#undef ERROR
#undef MAX_PATH

#endif
1 change: 0 additions & 1 deletion BaseTools/Source/C/GenFfs/GenFfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include "WinNtInclude.h"

#ifndef __GNUC__
#include <windows.h>
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
Expand Down
2 changes: 1 addition & 1 deletion BaseTools/Source/C/GenFv/GenFvInternalLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3595,7 +3595,7 @@ Routine Description:
Machine = UefiImageGetMachine (&ImageContext);

if ( (Machine == IMAGE_FILE_MACHINE_ARMTHUMB_MIXED) ||
(Machine == IMAGE_FILE_MACHINE_AARCH64) ) {
(Machine == IMAGE_FILE_MACHINE_ARM64) ) {
mArm = TRUE;
}

Expand Down
2 changes: 1 addition & 1 deletion BaseTools/Source/C/GenSec/GenSec.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include "WinNtInclude.h"

#ifndef __GNUC__
#include <windows.h>
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
Expand Down
4 changes: 0 additions & 4 deletions BaseTools/Source/C/Include/Common/BaseTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
#ifndef __BT_BASE_TYPES_H__
#define __BT_BASE_TYPES_H__

//
// To be able to safely include Windows headers, we need to include
// WinNtInclude.h first.
//
#include "WinNtInclude.h"

#include <stdarg.h>
Expand Down
8 changes: 8 additions & 0 deletions CryptoPkg/Library/IntrinsicLib/CopyMem.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,12 @@ memcpy (
return CopyMem (dest, src, (UINTN)count);
}

void
__bzero (
void *src,
unsigned int count
)
{
ZeroMem (src, count);
}
#endif
8 changes: 1 addition & 7 deletions CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@

[Sources]
MemoryIntrinsics.c

[Sources.IA32]
CopyMem.c

[Sources.IA32]
Ia32/MathDivU64xU64Rem.c | MSFT
Ia32/MathLShiftS64.c | MSFT
Ia32/MathRShiftU64.c | MSFT
Expand All @@ -36,7 +35,6 @@
Ia32/MathUlldiv.asm | MSFT
Ia32/MathUlldvrm.asm | MSFT
Ia32/MathLldiv.asm | MSFT
Ia32/MathUllrem.asm | MSFT

Ia32/MathDivU64xU64Rem.c | INTEL
Ia32/MathLShiftS64.c | INTEL
Expand All @@ -49,10 +47,6 @@
Ia32/MathDivS64x64.c | GCC
Ia32/MathDivU64x64.c | GCC
Ia32/MathModU64x64.c | GCC
[Sources.X64]
CopyMem.c
[Sources.RISCV64]
CopyMem.c

[Packages]
MdePkg/MdePkg.dec
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ UndiReceiveFilter (
Cdb->StatFlags = PXE_STATFLAGS_COMMAND_FAILED;
}

if ((Cdb->CPBsize == 0)) {
if (Cdb->CPBsize == 0) {
Cdb->StatFlags = PXE_STATFLAGS_COMMAND_FAILED;
}
}
Expand Down
2 changes: 1 addition & 1 deletion MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ GetLockOnVariableStateVariablePolicyInfo (
LocalLockOnVarStatePolicy = (VARIABLE_LOCK_ON_VAR_STATE_POLICY *)(MatchPolicy + 1);
CopyMem (VariablePolicy, LocalLockOnVarStatePolicy, sizeof (*LocalLockOnVarStatePolicy));

if ((VariableLockPolicyVariableNameBufferSize == NULL)) {
if (VariableLockPolicyVariableNameBufferSize == NULL) {
if (VariableLockPolicyVariableName != NULL) {
return EFI_INVALID_PARAMETER;
}
Expand Down
2 changes: 2 additions & 0 deletions MdePkg/Include/IndustryStandard/PeImage2.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#define IMAGE_FILE_MACHINE_RISCV32 0x5032
#define IMAGE_FILE_MACHINE_RISCV64 0x5064
#define IMAGE_FILE_MACHINE_RISCV128 0x5128
#define IMAGE_FILE_MACHINE_LOONGARCH32 0x6232
#define IMAGE_FILE_MACHINE_LOONGARCH64 0x6264

//
// EXE file formats
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,32 +859,15 @@ InitializeHiiPackage (
IN EFI_HANDLE ImageHandle
)
{
EFI_STATUS Status;
EFI_HII_PACKAGE_LIST_HEADER *PackageList;
EFI_HII_HANDLE HiiHandle;

//
// Retrieve HII package list from ImageHandle
//
Status = gBS->OpenProtocol (
ImageHandle,
&gEfiHiiPackageListProtocolGuid,
(VOID **)&PackageList,
ImageHandle,
NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
return NULL;
}
EFI_STATUS Status;
EFI_HII_HANDLE HiiHandle;

//
// Publish HII package list to HII Database.
//
Status = gHiiDatabase->NewPackageList (
gHiiDatabase,
PackageList,
&gModuleHiiPackageList->Header,
NULL,
&HiiHandle
);
Expand Down

0 comments on commit 883c78f

Please sign in to comment.