diff --git a/Application/Bootstrap/Bootstrap.c b/Application/Bootstrap/Bootstrap.c index 6c8c9593..a2417b57 100644 --- a/Application/Bootstrap/Bootstrap.c +++ b/Application/Bootstrap/Bootstrap.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #include #include diff --git a/Include/Acidanthera/OpenCore.h b/Include/Acidanthera/Library/OcMainLib.h similarity index 98% rename from Include/Acidanthera/OpenCore.h rename to Include/Acidanthera/Library/OcMainLib.h index dc5f40af..17ae49a2 100644 --- a/Include/Acidanthera/OpenCore.h +++ b/Include/Acidanthera/Library/OcMainLib.h @@ -1,7 +1,5 @@ /** @file - Copyright (C) 2018, vit9696. All rights reserved. - - All rights reserved. + Copyright (C) 2021, vit9696. All rights reserved. This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -10,10 +8,12 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + **/ -#ifndef OPEN_CORE_H -#define OPEN_CORE_H +#ifndef OC_MAIN_LIB +#define OC_MAIN_LIB + #include #include @@ -363,4 +363,4 @@ OcPlatformIs64BitSupported ( IN UINT32 KernelVersion ); -#endif // OPEN_CORE_H +#endif // OC_MAIN_LIB diff --git a/Library/OcBootManagementLib/DefaultEntryChoice.c b/Library/OcBootManagementLib/DefaultEntryChoice.c index 9553eb81..c15a58d2 100644 --- a/Library/OcBootManagementLib/DefaultEntryChoice.c +++ b/Library/OcBootManagementLib/DefaultEntryChoice.c @@ -13,7 +13,7 @@ **/ #include -#include +#include #include "BootManagementInternal.h" #include diff --git a/Library/OcMainLib/OcMainLib.inf b/Library/OcMainLib/OcMainLib.inf new file mode 100644 index 00000000..c1be2cf4 --- /dev/null +++ b/Library/OcMainLib/OcMainLib.inf @@ -0,0 +1,95 @@ +## @file +# OpenCore primary coordination library +# +# Copyright (c) 2019, vit9696. All rights reserved.
+# +# 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. +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = OcMainLib + FILE_GUID = 1210D2A2-FA16-49DF-A7AA-E8C72DB7F2B5 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = OcMainLib|PEIM DXE_DRIVER DXE_RUNTIME_DRIVER UEFI_DRIVER UEFI_APPLICATION DXE_SMM_DRIVER + +[Sources] + OpenCoreAcpi.c + OpenCoreDevProps.c + OpenCoreKernel.c + OpenCoreKernelPatch.c + OpenCoreMisc.c + OpenCoreNvram.c + OpenCorePlatform.c + OpenCoreUefi.c + OpenCoreUefiAudio.c + OpenCoreUefiInOut.c + OpenCoreVault.c + +[Packages] + OpenCorePkg/OpenCorePkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + UefiCpuPkg/UefiCpuPkg.dec + +[Guids] + gOcVendorVariableGuid + +[Protocols] + gEfiAudioDecodeProtocolGuid ## SOMETIMES_CONSUMES + gEfiDevicePathProtocolGuid ## CONSUMES + gEfiDevicePathProtocolGuid ## CONSUMES + gEfiLoadedImageProtocolGuid ## CONSUMES + gEfiSimpleFileSystemProtocolGuid ## CONSUMES + gOcBootstrapProtocolGuid ## CONSUMES + gOcInterfaceProtocolGuid ## SOMETIMES_CONSUMES + +[LibraryClasses] + DevicePathLib + IoLib + OcAcpiLib + OcAfterBootCompatLib + OcApfsLib + OcAppleBootPolicyLib + OcAppleEventLib + OcAppleImageConversionLib + OcAudioLib + OcInputLib + OcAppleImg4Lib + OcAppleKernelLib + OcAppleKeyMapLib + OcAppleSecureBootLib + OcAppleUserInterfaceThemeLib + OcBootManagementLib + OcConfigurationLib + OcConsoleLib + OcDataHubLib + OcDevicePathLib + OcDevicePropertyLib + OcDriverConnectionLib + OcFirmwareVolumeLib + OcGuardLib + OcHashServicesLib + OcMachoLib + OcMiscLib + OcOSInfoLib + OcSmbiosLib + OcSmcLib + OcStorageLib + OcUnicodeCollationEngGenericLib + OcVirtualFsLib + OcMacInfoLib + PcdLib + PrintLib + SerialPortLib + UefiBootServicesTableLib + UefiDriverEntryPoint + UefiLib + UefiRuntimeServicesTableLib diff --git a/Platform/OpenCore/OpenCoreAcpi.c b/Library/OcMainLib/OpenCoreAcpi.c similarity index 99% rename from Platform/OpenCore/OpenCoreAcpi.c rename to Library/OcMainLib/OpenCoreAcpi.c index 5a9114ba..f55c7ed4 100644 --- a/Platform/OpenCore/OpenCoreAcpi.c +++ b/Library/OcMainLib/OpenCoreAcpi.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #include #include diff --git a/Platform/OpenCore/OpenCoreDevProps.c b/Library/OcMainLib/OpenCoreDevProps.c similarity index 99% rename from Platform/OpenCore/OpenCoreDevProps.c rename to Library/OcMainLib/OpenCoreDevProps.c index c05b5373..5681453f 100644 --- a/Platform/OpenCore/OpenCoreDevProps.c +++ b/Library/OcMainLib/OpenCoreDevProps.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #include #include diff --git a/Platform/OpenCore/OpenCoreKernel.c b/Library/OcMainLib/OpenCoreKernel.c similarity index 99% rename from Platform/OpenCore/OpenCoreKernel.c rename to Library/OcMainLib/OpenCoreKernel.c index 11a41af1..0a93b2e4 100644 --- a/Platform/OpenCore/OpenCoreKernel.c +++ b/Library/OcMainLib/OpenCoreKernel.c @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include "ProcessorBind.h" -#include +#include #include #include diff --git a/Platform/OpenCore/OpenCoreKernelPatch.c b/Library/OcMainLib/OpenCoreKernelPatch.c similarity index 99% rename from Platform/OpenCore/OpenCoreKernelPatch.c rename to Library/OcMainLib/OpenCoreKernelPatch.c index 4db928be..698775ee 100644 --- a/Platform/OpenCore/OpenCoreKernelPatch.c +++ b/Library/OcMainLib/OpenCoreKernelPatch.c @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include "ProcessorBind.h" -#include +#include #include #include diff --git a/Platform/OpenCore/OpenCoreMisc.c b/Library/OcMainLib/OpenCoreMisc.c similarity index 99% rename from Platform/OpenCore/OpenCoreMisc.c rename to Library/OcMainLib/OpenCoreMisc.c index a653996c..89b70494 100644 --- a/Platform/OpenCore/OpenCoreMisc.c +++ b/Library/OcMainLib/OpenCoreMisc.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #include #include diff --git a/Platform/OpenCore/OpenCoreNvram.c b/Library/OcMainLib/OpenCoreNvram.c similarity index 99% rename from Platform/OpenCore/OpenCoreNvram.c rename to Library/OcMainLib/OpenCoreNvram.c index b17ac9f9..b4027ea6 100644 --- a/Platform/OpenCore/OpenCoreNvram.c +++ b/Library/OcMainLib/OpenCoreNvram.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #include diff --git a/Platform/OpenCore/OpenCorePlatform.c b/Library/OcMainLib/OpenCorePlatform.c similarity index 99% rename from Platform/OpenCore/OpenCorePlatform.c rename to Library/OcMainLib/OpenCorePlatform.c index 308f14b1..79015d0c 100644 --- a/Platform/OpenCore/OpenCorePlatform.c +++ b/Library/OcMainLib/OpenCorePlatform.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #include diff --git a/Platform/OpenCore/OpenCoreUefi.c b/Library/OcMainLib/OpenCoreUefi.c similarity index 99% rename from Platform/OpenCore/OpenCoreUefi.c rename to Library/OcMainLib/OpenCoreUefi.c index 3d2c73aa..5b06d66e 100644 --- a/Platform/OpenCore/OpenCoreUefi.c +++ b/Library/OcMainLib/OpenCoreUefi.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #include #include diff --git a/Platform/OpenCore/OpenCoreUefiAudio.c b/Library/OcMainLib/OpenCoreUefiAudio.c similarity index 99% rename from Platform/OpenCore/OpenCoreUefiAudio.c rename to Library/OcMainLib/OpenCoreUefiAudio.c index 41af3b40..884f46c6 100644 --- a/Platform/OpenCore/OpenCoreUefiAudio.c +++ b/Library/OcMainLib/OpenCoreUefiAudio.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #include #include diff --git a/Platform/OpenCore/OpenCoreUefiInOut.c b/Library/OcMainLib/OpenCoreUefiInOut.c similarity index 99% rename from Platform/OpenCore/OpenCoreUefiInOut.c rename to Library/OcMainLib/OpenCoreUefiInOut.c index bc0ea304..689dc0aa 100644 --- a/Platform/OpenCore/OpenCoreUefiInOut.c +++ b/Library/OcMainLib/OpenCoreUefiInOut.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #include #include diff --git a/Platform/OpenCore/OpenCoreVault.c b/Library/OcMainLib/OpenCoreVault.c similarity index 98% rename from Platform/OpenCore/OpenCoreVault.c rename to Library/OcMainLib/OpenCoreVault.c index 72bb9322..311d43c7 100644 --- a/Platform/OpenCore/OpenCoreVault.c +++ b/Library/OcMainLib/OpenCoreVault.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #pragma pack(push, 1) diff --git a/OpenCorePkg.dec b/OpenCorePkg.dec index e9cac047..7daa6ada 100755 --- a/OpenCorePkg.dec +++ b/OpenCorePkg.dec @@ -835,6 +835,9 @@ ## @libraryclass OcInputLib|Include/Acidanthera/Library/OcInputLib.h + ## @libraryclass + OcMainLib|Include/Acidanthera/Library/OcMainLib.h + ## @libraryclass OcMachoLib|Include/Acidanthera/Library/OcMachoLib.h diff --git a/OpenCorePkg.dsc b/OpenCorePkg.dsc index bd2fc56c..bc52fe82 100755 --- a/OpenCorePkg.dsc +++ b/OpenCorePkg.dsc @@ -91,6 +91,7 @@ OcInputLib|OpenCorePkg/Library/OcInputLib/OcInputLib.inf OcMachoLib|OpenCorePkg/Library/OcMachoLib/OcMachoLib.inf OcMacInfoLib|OpenCorePkg/Library/OcMacInfoLib/OcMacInfoLib.inf + OcMainLib|OpenCorePkg/Library/OcMainLib/OcMainLib.inf OcMemoryLib|OpenCorePkg/Library/OcMemoryLib/OcMemoryLib.inf OcMiscLib|OpenCorePkg/Library/OcMiscLib/OcMiscLib.inf OcMp3Lib|OpenCorePkg/Library/OcMp3Lib/OcMp3Lib.inf @@ -211,6 +212,7 @@ OpenCorePkg/Library/OcHiiDatabaseLib/OcHiiDatabaseLocalLib.inf OpenCorePkg/Library/OcInputLib/OcInputLib.inf OpenCorePkg/Library/OcMachoLib/OcMachoLib.inf + OpenCorePkg/Library/OcMainLib/OcMainLib.inf OpenCorePkg/Library/OcMemoryLib/OcMemoryLib.inf OpenCorePkg/Library/OcMiscLib/OcMiscLib.inf OpenCorePkg/Library/OcMp3Lib/OcMp3Lib.inf diff --git a/Platform/OpenCanopy/OcBootstrap.c b/Platform/OpenCanopy/OcBootstrap.c index 41f60d7e..bb125a0c 100644 --- a/Platform/OpenCanopy/OcBootstrap.c +++ b/Platform/OpenCanopy/OcBootstrap.c @@ -5,7 +5,7 @@ SPDX-License-Identifier: BSD-3-Clause **/ -#include +#include #include #include diff --git a/Platform/OpenCore/OpenCore.c b/Platform/OpenCore/OpenCore.c index 47facdd9..2a94fb80 100644 --- a/Platform/OpenCore/OpenCore.c +++ b/Platform/OpenCore/OpenCore.c @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include +#include #include #include diff --git a/Platform/OpenCore/OpenCore.inf b/Platform/OpenCore/OpenCore.inf index 72c9bc0c..0ebe9100 100644 --- a/Platform/OpenCore/OpenCore.inf +++ b/Platform/OpenCore/OpenCore.inf @@ -36,20 +36,8 @@ [Sources] OpenCore.c - OpenCoreAcpi.c - OpenCoreDevProps.c - OpenCoreKernel.c - OpenCoreKernelPatch.c - OpenCoreMisc.c - OpenCoreNvram.c - OpenCorePlatform.c - OpenCoreUefi.c - OpenCoreUefiAudio.c - OpenCoreUefiInOut.c - OpenCoreVault.c [Packages] - OpenCorePkg/OpenCorePkg.dec OpenCorePkg/OpenCorePkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec @@ -68,44 +56,4 @@ gOcInterfaceProtocolGuid ## SOMETIMES_CONSUMES [LibraryClasses] - DevicePathLib - IoLib - OcAcpiLib - OcAfterBootCompatLib - OcApfsLib - OcAppleBootPolicyLib - OcAppleEventLib - OcAppleImageConversionLib - OcAudioLib - OcInputLib - OcAppleImg4Lib - OcAppleKernelLib - OcAppleKeyMapLib - OcAppleSecureBootLib - OcAppleUserInterfaceThemeLib - OcBootManagementLib - OcConfigurationLib - OcConsoleLib - OcDataHubLib - OcDevicePathLib - OcDevicePropertyLib - OcDriverConnectionLib - OcFirmwareVolumeLib - OcGuardLib - OcHashServicesLib - OcMachoLib - OcMiscLib - OcOSInfoLib - OcSmbiosLib - OcSmcLib - OcStorageLib - OcUnicodeCollationEngGenericLib - OcVirtualFsLib - OcMacInfoLib - PcdLib - PrintLib - SerialPortLib - UefiBootServicesTableLib - UefiDriverEntryPoint - UefiLib - UefiRuntimeServicesTableLib + OcMainLib diff --git a/Utilities/ocvalidate/ocvalidate.c b/Utilities/ocvalidate/ocvalidate.c index d4ad8e0a..7de22675 100644 --- a/Utilities/ocvalidate/ocvalidate.c +++ b/Utilities/ocvalidate/ocvalidate.c @@ -16,7 +16,7 @@ #include "ocvalidate.h" #include "OcValidateLib.h" -#include +#include #include diff --git a/build_oc.tool b/build_oc.tool index d0705bcd..9a395c58 100755 --- a/build_oc.tool +++ b/build_oc.tool @@ -58,7 +58,7 @@ package() { fi local ver - ver=$(grep OPEN_CORE_VERSION ./Include/Acidanthera/OpenCore.h | sed 's/.*"\(.*\)".*/\1/' | grep -E '^[0-9.]+$') + ver=$(grep OPEN_CORE_VERSION ./Include/Acidanthera/Library/OcMainLib.h | sed 's/.*"\(.*\)".*/\1/' | grep -E '^[0-9.]+$') if [ "$ver" = "" ]; then echo "Invalid version $ver" ver="UNKNOWN"