mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcMainLib: Move startup code to a separate library
This commit is contained in:
parent
d26aa6c43d
commit
dc1a0d8a22
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
#include <Uefi.h>
|
||||
|
||||
#include <Protocol/DevicePath.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 <Library/OcAppleKernelLib.h>
|
||||
#include <Library/OcBootManagementLib.h>
|
||||
@ -363,4 +363,4 @@ OcPlatformIs64BitSupported (
|
||||
IN UINT32 KernelVersion
|
||||
);
|
||||
|
||||
#endif // OPEN_CORE_H
|
||||
#endif // OC_MAIN_LIB
|
||||
@ -13,7 +13,7 @@
|
||||
**/
|
||||
|
||||
#include <Uefi.h>
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
#include "BootManagementInternal.h"
|
||||
|
||||
#include <Guid/AppleFile.h>
|
||||
|
||||
95
Library/OcMainLib/OcMainLib.inf
Normal file
95
Library/OcMainLib/OcMainLib.inf
Normal file
@ -0,0 +1,95 @@
|
||||
## @file
|
||||
# OpenCore primary coordination library
|
||||
#
|
||||
# Copyright (c) 2019, vit9696. 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.
|
||||
#
|
||||
##
|
||||
|
||||
[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
|
||||
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
**/
|
||||
|
||||
#include "ProcessorBind.h"
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
**/
|
||||
|
||||
#include "ProcessorBind.h"
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <Guid/AppleVariable.h>
|
||||
#include <Guid/OcVariable.h>
|
||||
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <Guid/OcVariable.h>
|
||||
|
||||
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <Protocol/DataHub.h>
|
||||
|
||||
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <Guid/AppleVariable.h>
|
||||
#include <Guid/OcVariable.h>
|
||||
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <Guid/AppleVariable.h>
|
||||
#include <Guid/OcVariable.h>
|
||||
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <Guid/OcVariable.h>
|
||||
#include <Guid/GlobalVariable.h>
|
||||
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
SPDX-License-Identifier: BSD-3-Clause
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
#include <Uefi.h>
|
||||
|
||||
#include <Protocol/DevicePath.h>
|
||||
|
||||
@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
**/
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
#include <Uefi.h>
|
||||
|
||||
#include <Guid/OcVariable.h>
|
||||
|
||||
@ -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
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
#include "ocvalidate.h"
|
||||
#include "OcValidateLib.h"
|
||||
|
||||
#include <OpenCore.h>
|
||||
#include <Library/OcMainLib.h>
|
||||
|
||||
#include <UserFile.h>
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user