2020-04-04 14:27:02 +02:00
# ifndef __SETTINGS_H__
# define __SETTINGS_H__
2021-02-06 18:16:46 +01:00
# include <Efi.h>
2020-04-16 11:09:22 +02:00
# include "../gui/menu_items/menu_items.h"
2021-02-06 18:16:46 +01:00
2020-08-25 17:35:19 +02:00
# include "../Platform/plist/plist.h"
2020-11-18 22:49:02 +01:00
# include "../Platform/guid.h"
2020-11-12 22:25:56 +01:00
# include "MacOsVersion.h"
2021-02-06 18:16:46 +01:00
# include "KERNEL_AND_KEXT_PATCHES.h"
# include "../libeg/XIcon.h"
# define CLOVER_SIGN SIGNATURE_32('C','l','v','r')
# define QUIRK_DEFRAG bit(0)
# define QUIRK_MMIO bit(1)
# define QUIRK_SU bit(2)
# define QUIRK_VAR bit(3)
# define QUIRK_HIBER bit(4)
# define QUIRK_SAFE bit(5)
# define QUIRK_UNPROT bit(6)
# define QUIRK_EXIT bit(7)
# define QUIRK_REGION bit(8)
# define QUIRK_SECURE bit(9)
# define QUIRK_UEFI bit(10)
# define QUIRK_CUSTOM bit(11)
# define QUIRK_MAP bit(12)
# define QUIRK_VIRT bit(13)
# define QUIRK_OS bit(14)
# define QUIRK_PERM bit(15)
2020-04-16 09:48:13 +02:00
//// SysVariables
//typedef struct SYSVARIABLES SYSVARIABLES;
//struct SYSVARIABLES
//{
// SYSVARIABLES *Next;
// CHAR16 *Key;
// INPUT_ITEM MenuItem;
//};
2021-02-06 18:16:46 +01:00
extern CONST CHAR8 * AudioOutputNames [ ] ;
2020-08-31 09:07:36 +02:00
class HDA_OUTPUTS
{
public :
XStringW Name ;
2020-04-16 09:15:26 +02:00
// CHAR8 *LineName;
2020-08-31 09:07:36 +02:00
UINT8 Index ;
2021-02-06 18:16:46 +01:00
EFI_HANDLE Handle = NULL ;
EFI_AUDIO_IO_PROTOCOL_DEVICE Device = EfiAudioIoDeviceOther ;
2020-08-31 09:07:36 +02:00
2021-02-06 18:16:46 +01:00
HDA_OUTPUTS ( ) : Name ( ) , Index ( 0 ) { }
2020-08-31 09:07:36 +02:00
HDA_OUTPUTS ( const HDA_OUTPUTS & other ) = delete ; // Can be defined if needed
const HDA_OUTPUTS & operator = ( const HDA_OUTPUTS & ) = delete ; // Can be defined if needed
~ HDA_OUTPUTS ( ) { }
} ;
2020-04-16 09:15:26 +02:00
typedef enum {
Unknown ,
Ati , /* 0x1002 */
Intel , /* 0x8086 */
Nvidia , /* 0x10de */
RDC , /* 0x17f3 */
VIA , /* 0x1106 */
SiS , /* 0x1039 */
ULI /* 0x10b9 */
} HRDW_MANUFACTERER ;
typedef struct {
HRDW_MANUFACTERER Vendor ;
UINT8 Ports ;
UINT16 DeviceID ;
UINT16 Family ;
//UINT16 Width;
//UINT16 Height;
CHAR8 Model [ 64 ] ;
CHAR8 Config [ 64 ] ;
BOOLEAN LoadVBios ;
//BOOLEAN PatchVBios;
UINTN Segment ;
UINTN Bus ;
UINTN Device ;
UINTN Function ;
EFI_HANDLE Handle ;
UINT8 * Mmio ;
UINT32 Connectors ;
BOOLEAN ConnChanged ;
} GFX_PROPERTIES ;
typedef struct {
HRDW_MANUFACTERER Vendor ;
UINT16 controller_vendor_id ;
UINT16 controller_device_id ;
CHAR16 * controller_name ;
// -- Codec Info -- //
UINT16 codec_vendor_id ;
UINT16 codec_device_id ;
UINT8 codec_revision_id ;
UINT8 codec_stepping_id ;
UINT8 codec_maj_rev ;
UINT8 codec_min_rev ;
UINT8 codec_num_function_groups ;
CHAR16 * codec_name ;
} HDA_PROPERTIES ;
typedef struct ACPI_NAME_LIST ACPI_NAME_LIST ;
struct ACPI_NAME_LIST {
ACPI_NAME_LIST * Next ;
CHAR8 * Name ;
} ;
2020-08-09 17:55:30 +02:00
class ACPI_DROP_TABLE
2020-04-16 09:15:26 +02:00
{
2020-08-09 17:55:30 +02:00
public :
2020-04-16 09:15:26 +02:00
ACPI_DROP_TABLE * Next ;
UINT32 Signature ;
UINT32 Length ;
UINT64 TableId ;
2021-02-06 18:16:46 +01:00
INPUT_ITEM MenuItem = INPUT_ITEM ( ) ;
2020-04-20 18:33:42 +02:00
BOOLEAN OtherOS ;
2020-08-09 17:55:30 +02:00
2021-02-06 18:16:46 +01:00
ACPI_DROP_TABLE ( ) : Next ( 0 ) , Signature ( 0 ) , Length ( 0 ) , TableId ( 0 ) , OtherOS ( 0 ) { }
2020-08-09 17:55:30 +02:00
ACPI_DROP_TABLE ( const ACPI_DROP_TABLE & other ) = delete ; // Can be defined if needed
const ACPI_DROP_TABLE & operator = ( const ACPI_DROP_TABLE & ) = delete ; // Can be defined if needed
~ ACPI_DROP_TABLE ( ) { }
2020-04-16 09:15:26 +02:00
} ;
2020-08-15 22:39:25 +02:00
class CUSTOM_LOADER_ENTRY
{
public :
2020-04-16 09:15:26 +02:00
CUSTOM_LOADER_ENTRY * Next ;
CUSTOM_LOADER_ENTRY * SubEntries ;
2021-02-06 18:16:46 +01:00
XIcon Image = XIcon ( ) ;
XIcon DriveImage = XIcon ( ) ;
2020-08-09 17:55:30 +02:00
XStringW ImagePath ;
XStringW DriveImagePath ;
XStringW Volume ;
XStringW Path ;
2020-08-11 08:00:19 +02:00
XString8Array LoadOptions ;
2020-04-16 09:15:26 +02:00
XStringW FullTitle ;
XStringW Title ;
2020-08-09 17:55:30 +02:00
XStringW Settings ;
2020-04-16 09:15:26 +02:00
CHAR16 Hotkey ;
BOOLEAN CommonSettings ;
UINT8 Flags ;
2020-08-15 22:39:25 +02:00
bool Hidden ;
2020-04-16 09:15:26 +02:00
UINT8 Type ;
UINT8 VolumeType ;
UINT8 KernelScan ;
UINT8 CustomBoot ;
2021-02-06 18:16:46 +01:00
XImage CustomLogo = XImage ( ) ;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL BootBgColor = EFI_GRAPHICS_OUTPUT_BLT_PIXEL ( { 0 , 0 , 0 , 0 } ) ;
2020-04-16 09:15:26 +02:00
KERNEL_AND_KEXT_PATCHES KernelAndKextPatches ;
2021-02-06 18:16:46 +01:00
CUSTOM_LOADER_ENTRY ( ) : Next ( 0 ) , SubEntries ( 0 ) , ImagePath ( ) , DriveImagePath ( ) , Volume ( ) , Path ( ) , LoadOptions ( ) ,
2020-08-15 22:39:25 +02:00
FullTitle ( ) , Title ( ) , Settings ( ) , Hotkey ( 0 ) , CommonSettings ( 0 ) , Flags ( 0 ) , Hidden ( 0 ) , Type ( 0 ) , VolumeType ( 0 ) ,
2021-02-06 18:16:46 +01:00
KernelScan ( 0 ) , CustomBoot ( 0 ) , KernelAndKextPatches ( )
2020-08-11 14:43:53 +02:00
{ }
2020-04-16 09:15:26 +02:00
// Not sure if default are valid. Delete them. If needed, proper ones can be created
CUSTOM_LOADER_ENTRY ( const CUSTOM_LOADER_ENTRY & ) = delete ;
CUSTOM_LOADER_ENTRY & operator = ( const CUSTOM_LOADER_ENTRY & ) = delete ;
} ;
2020-08-09 17:55:30 +02:00
class CUSTOM_LEGACY_ENTRY
{
public :
CUSTOM_LEGACY_ENTRY * Next ;
2021-02-06 18:16:46 +01:00
XIcon Image = XIcon ( ) ;
XIcon DriveImage = XIcon ( ) ;
2020-08-09 17:55:30 +02:00
XStringW ImagePath ;
XStringW DriveImagePath ;
XStringW Volume ;
XStringW FullTitle ;
XStringW Title ;
CHAR16 Hotkey ;
UINT8 Flags ;
2020-08-15 22:39:25 +02:00
bool Hidden ;
2020-08-09 17:55:30 +02:00
UINT8 Type ;
UINT8 VolumeType ;
2021-02-06 18:16:46 +01:00
CUSTOM_LEGACY_ENTRY ( ) : Next ( 0 ) , ImagePath ( ) , DriveImagePath ( ) , Volume ( ) , FullTitle ( ) , Title ( ) , Hotkey ( 0 ) , Flags ( 0 ) , Hidden ( 0 ) , Type ( 0 ) , VolumeType ( 0 ) { }
2020-08-09 17:55:30 +02:00
// Not sure if default are valid. Delete them. If needed, proper ones can be created
CUSTOM_LEGACY_ENTRY ( const CUSTOM_LEGACY_ENTRY & ) = delete ;
CUSTOM_LEGACY_ENTRY & operator = ( const CUSTOM_LEGACY_ENTRY & ) = delete ;
2020-04-16 09:15:26 +02:00
} ;
2020-08-09 17:55:30 +02:00
class CUSTOM_TOOL_ENTRY
{
public :
2020-04-16 09:15:26 +02:00
CUSTOM_TOOL_ENTRY * Next ;
2021-02-06 18:16:46 +01:00
XIcon Image = XIcon ( ) ;
2020-08-09 17:55:30 +02:00
XStringW ImagePath ;
XStringW Volume ;
XStringW Path ;
2020-08-11 08:00:19 +02:00
XString8Array LoadOptions ;
2020-08-09 17:55:30 +02:00
XStringW FullTitle ;
XStringW Title ;
CHAR16 Hotkey ;
UINT8 Flags ;
2020-08-15 22:39:25 +02:00
bool Hidden ;
2020-08-09 17:55:30 +02:00
UINT8 VolumeType ;
2021-02-06 18:16:46 +01:00
CUSTOM_TOOL_ENTRY ( ) : Next ( 0 ) , ImagePath ( ) , Volume ( ) , Path ( ) , LoadOptions ( ) , FullTitle ( ) , Title ( ) , Hotkey ( 0 ) , Flags ( 0 ) , Hidden ( 0 ) , VolumeType ( 0 ) { }
2020-08-09 17:55:30 +02:00
// Not sure if default are valid. Delete them. If needed, proper ones can be created
CUSTOM_TOOL_ENTRY ( const CUSTOM_TOOL_ENTRY & ) = delete ;
CUSTOM_TOOL_ENTRY & operator = ( const CUSTOM_TOOL_ENTRY & ) = delete ;
2020-04-16 09:15:26 +02:00
} ;
2020-08-09 17:55:30 +02:00
class DEV_PROPERTY
{
public :
2020-04-16 09:15:26 +02:00
UINT32 Device ;
2021-02-06 18:16:46 +01:00
EFI_DEVICE_PATH_PROTOCOL * DevicePath = NULL ;
2020-04-16 09:15:26 +02:00
CHAR8 * Key ;
UINT8 * Value ;
UINTN ValueLen ;
DEV_PROPERTY * Next ; //next device or next property
DEV_PROPERTY * Child ; // property list of the device
CHAR8 * Label ;
2021-02-06 18:16:46 +01:00
INPUT_ITEM MenuItem = INPUT_ITEM ( ) ;
TAG_TYPE ValueType = kTagTypeNone ;
2020-08-09 17:55:30 +02:00
2021-02-06 18:16:46 +01:00
DEV_PROPERTY ( ) : Device ( 0 ) , Key ( 0 ) , Value ( 0 ) , ValueLen ( 0 ) , Next ( 0 ) , Child ( 0 ) , Label ( 0 ) { }
2020-08-09 17:55:30 +02:00
// Not sure if default are valid. Delete them. If needed, proper ones can be created
DEV_PROPERTY ( const DEV_PROPERTY & ) = delete ;
DEV_PROPERTY & operator = ( const DEV_PROPERTY & ) = delete ;
2020-04-16 09:15:26 +02:00
} ;
2020-08-15 15:47:56 +02:00
//#pragma GCC diagnostic error "-Wpadded"
2020-08-13 14:07:40 +02:00
2020-08-27 20:47:56 +02:00
class DSDT_Patch
{
public :
2021-02-11 12:41:59 +01:00
XBuffer < UINT8 > PatchDsdtFind = XBuffer < UINT8 > ( ) ;
XBuffer < UINT8 > PatchDsdtReplace = XBuffer < UINT8 > ( ) ;
XString8 PatchDsdtLabel = XString8 ( ) ;
XBuffer < UINT8 > PatchDsdtTgt = XBuffer < UINT8 > ( ) ;
2021-02-06 18:16:46 +01:00
INPUT_ITEM PatchDsdtMenuItem = INPUT_ITEM ( ) ;
2020-08-27 20:47:56 +02:00
2021-02-11 12:41:59 +01:00
DSDT_Patch ( ) = default ; // default is fine if there is only native type and objects that have copy ctor
DSDT_Patch ( const DSDT_Patch & other ) = default ; // default is fine if there is only native type and objects that have copy ctor
DSDT_Patch & operator = ( const DSDT_Patch & ) = default ; // default is fine if there is only native type and objects that have copy ctor
2020-09-09 19:06:34 +02:00
} ;
class MMIOWhiteList
{
public :
UINTN address ;
XString8 comment ;
bool enabled ;
MMIOWhiteList ( ) : address ( 0 ) , comment ( ) , enabled ( false ) { }
// Not sure if default are valid. Delete them. If needed, proper ones can be created
MMIOWhiteList ( const MMIOWhiteList & ) = delete ;
MMIOWhiteList & operator = ( const MMIOWhiteList & ) = delete ;
2020-08-27 20:47:56 +02:00
} ;
2020-08-11 14:43:53 +02:00
class SETTINGS_DATA {
public :
2021-02-02 10:02:21 +01:00
class BootClass {
public :
INTN Timeout = - 1 ;
bool SkipHibernateTimeout = false ;
bool DisableCloverHotkeys = false ;
XString8 BootArgs = XString8 ( ) ;
2021-03-15 10:02:34 +01:00
bool NeverDoRecovery = 0 ;
2021-02-02 10:02:21 +01:00
bool LastBootedVolume = false ;
XStringW DefaultVolume = XStringW ( ) ;
XStringW DefaultLoader = XStringW ( ) ;
bool DebugLog = false ;
bool FastBoot = false ;
bool NoEarlyProgress = false ;
bool NeverHibernate = false ;
bool StrictHibernate = false ;
bool RtcHibernateAware = false ;
bool HibernationFixup = false ;
bool SignatureFixup = false ;
2021-03-15 10:02:34 +01:00
INT8 SecureSetting = 0 ; // 0 == false, 1 == true, -1 == undefined
// UINT8 SecureBoot = 0;
// UINT8 SecureBootSetupMode = 0;
2021-02-02 10:02:21 +01:00
UINT8 SecureBootPolicy = 0 ;
// Secure boot white/black list
2021-02-11 12:41:59 +01:00
XStringWArray SecureBootWhiteList = XStringWArray ( ) ;
XStringWArray SecureBootBlackList = XStringWArray ( ) ;
2021-02-02 10:02:21 +01:00
INT8 XMPDetection = 0 ;
// LegacyBoot
XStringW LegacyBoot = XStringW ( ) ;
UINT16 LegacyBiosDefaultEntry = 0 ;
2021-03-15 10:02:34 +01:00
UINT8 CustomBootSetting = 0 ;
XString8 CustomLogoAsXString8 = XString8 ( ) ;
XBuffer < UINT8 > CustomLogoAsData = XBuffer < UINT8 > ( ) ;
2021-02-02 10:02:21 +01:00
} Boot = BootClass ( ) ;
2021-02-11 12:41:59 +01:00
class ACPIClass
{
public :
class ACPIDropTablesClass
{
public :
UINT32 Signature = 0 ;
UINT64 TableId = 0 ;
UINT32 TabLength = 0 ;
bool OtherOS = 0 ;
} ;
XObjArray < ACPIDropTablesClass > ACPIDropTablesArray = XObjArray < ACPIDropTablesClass > ( ) ;
class DSDTClass
{
public :
XStringW DsdtName = XStringW ( ) ;
BOOLEAN DebugDSDT = 0 ;
BOOLEAN Rtc8Allowed = 0 ;
UINT8 PNLF_UID = 0 ;
UINT32 FixDsdt = 0 ;
XObjArray < DSDT_Patch > DSDTPatchArray = XObjArray < DSDT_Patch > ( ) ;
BOOLEAN ReuseFFFF = 0 ;
BOOLEAN SuspendOverride = 0 ;
} DSDT = DSDTClass ( ) ;
class SSDTClass
{
public :
class GenerateClass
{
public :
BOOLEAN GeneratePStates = 0 ;
BOOLEAN GenerateCStates = 0 ;
BOOLEAN GenerateAPSN = 0 ;
BOOLEAN GenerateAPLF = 0 ;
BOOLEAN GeneratePluginType = 0 ;
} Generate = GenerateClass ( ) ;
2021-03-15 10:02:34 +01:00
BOOLEAN DropSSDTSetting = 0 ;
2021-02-11 12:41:59 +01:00
BOOLEAN NoOemTableId = 0 ;
BOOLEAN NoDynamicExtract = 0 ;
BOOLEAN EnableISS = 0 ;
BOOLEAN EnableC7 = 0 ;
BOOLEAN EnableC6 = 0 ;
BOOLEAN EnableC4 = 0 ;
BOOLEAN EnableC2 = 0 ;
UINT16 C3Latency = 0 ;
UINT8 PLimitDict = 0 ;
UINT8 UnderVoltStep = 0 ;
BOOLEAN DoubleFirstState = 0 ;
UINT8 MinMultiplier = 0 ;
UINT8 MaxMultiplier = 0 ;
UINT8 PluginType = 0 ;
} SSDT = SSDTClass ( ) ;
UINT64 ResetAddr = 0 ;
UINT8 ResetVal = 0 ;
BOOLEAN SlpSmiEnable = 0 ;
BOOLEAN FixHeaders = 0 ;
BOOLEAN FixMCFG = 0 ;
BOOLEAN NoASPM = 0 ;
BOOLEAN smartUPS = 0 ;
BOOLEAN PatchNMI = 0 ;
XStringWArray SortedACPI = XStringWArray ( ) ;
BOOLEAN AutoMerge = 0 ;
XStringWArray DisabledAML = XStringWArray ( ) ;
XObjArray < ACPI_NAME_LIST > DeviceRename = XObjArray < ACPI_NAME_LIST > ( ) ;
} ACPI = ACPIClass ( ) ;
2021-02-02 10:02:21 +01:00
class GUIClass {
public :
INT32 Timezone = 0xFF ;
XStringW Theme = XStringW ( ) ;
bool CustomIcons = false ;
bool TextOnly = false ;
bool ShowOptimus = false ;
XStringW ScreenResolution = XStringW ( ) ;
INTN ConsoleMode = 0 ;
INTN Codepage = 0xC0 ;
INTN CodepageSize = 0xC0 ;
bool LegacyFirst = false ;
bool NoLegacy = false ;
} GUI = GUIClass ( ) ;
2020-04-16 09:15:26 +02:00
// SMBIOS TYPE0
2020-08-15 15:47:56 +02:00
XString8 VendorName ;
XString8 RomVersion ;
2020-08-12 17:15:47 +02:00
XString8 EfiVersion ;
2020-08-15 15:47:56 +02:00
XString8 ReleaseDate ;
2020-04-16 09:15:26 +02:00
// SMBIOS TYPE1
2020-08-15 15:47:56 +02:00
XString8 ManufactureName ;
XString8 ProductName ;
XString8 VersionNr ;
XString8 SerialNr ;
2020-09-23 15:47:47 +02:00
XString8 SmUUID ;
2020-04-16 09:15:26 +02:00
CHAR8 pad0 [ 7 ] ;
2020-08-15 15:47:56 +02:00
//CHAR8 Uuid;
//CHAR8 SKUNumber;
XString8 FamilyName ;
XString8 OEMProduct ;
XString8 OEMVendor ;
2020-04-16 09:15:26 +02:00
// SMBIOS TYPE2
2020-08-15 15:47:56 +02:00
XString8 BoardManufactureName ;
XString8 BoardSerialNumber ;
XString8 BoardNumber ; //Board-ID
XString8 LocationInChassis ;
XString8 BoardVersion ;
XString8 OEMBoard ;
2020-04-16 09:15:26 +02:00
UINT8 BoardType ;
2020-08-13 14:07:40 +02:00
UINT8 pad1 ;
2020-04-16 09:15:26 +02:00
// SMBIOS TYPE3
BOOLEAN Mobile ;
UINT8 ChassisType ;
2020-08-15 15:47:56 +02:00
XString8 ChassisManufacturer ;
XString8 ChassisAssetTag ;
2020-04-16 09:15:26 +02:00
// SMBIOS TYPE4
UINT32 CpuFreqMHz ;
UINT32 BusSpeed ; //in kHz
BOOLEAN Turbo ;
UINT8 EnabledCores ;
BOOLEAN UserChange ;
BOOLEAN QEMU ;
// SMBIOS TYPE17
UINT16 SmbiosVersion ;
INT8 Attribute ;
2020-08-13 14:07:40 +02:00
INT8 pad17 [ 1 ] ;
2020-08-15 15:47:56 +02:00
XString8 MemoryManufacturer ;
XString8 MemorySerialNumber ;
XString8 MemoryPartNumber ;
XString8 MemorySpeed ;
2020-04-16 09:15:26 +02:00
// SMBIOS TYPE131
UINT16 CpuType ;
// SMBIOS TYPE132
UINT16 QPI ;
BOOLEAN TrustSMBIOS ;
BOOLEAN InjectMemoryTables ;
BOOLEAN UseARTFreq ;
2020-08-13 14:07:40 +02:00
INT8 pad18 [ 3 ] ;
2020-04-16 09:15:26 +02:00
// SMBIOS TYPE133
UINT64 PlatformFeature ;
// PatchTableType11
BOOLEAN NoRomInfo ;
// OS parameters
2020-08-15 15:47:56 +02:00
INT8 pad181 [ 7 ] ;
XString8 Language ;
INT8 pad19 [ 2 ] ;
2020-09-23 15:47:47 +02:00
XString8 CustomUuid ;
2020-04-16 09:15:26 +02:00
2020-08-13 14:07:40 +02:00
INT8 pad20 [ 6 ] ;
2021-02-02 10:02:21 +01:00
2020-04-16 09:15:26 +02:00
//Monitor
BOOLEAN IntelMaxBacklight ;
2020-08-13 14:07:40 +02:00
UINT8 pad21 [ 1 ] ;
2020-04-16 09:15:26 +02:00
UINT16 VendorEDID ;
UINT16 ProductEDID ;
UINT16 BacklightLevel ;
BOOLEAN BacklightLevelConfig ;
BOOLEAN IntelBacklight ;
//Boot options
BOOLEAN MemoryFix ;
BOOLEAN WithKexts ;
BOOLEAN WithKextsIfNoFakeSMC ;
BOOLEAN FakeSMCFound ;
BOOLEAN NoCaches ;
// GUI parameters
BOOLEAN Debug ;
// BOOLEAN Proportional; //never used
2020-08-13 14:07:40 +02:00
UINT8 pad22 [ 2 ] ;
2020-04-16 09:15:26 +02:00
UINT32 DefaultBackgroundColor ;
//ACPI
2020-08-13 14:07:40 +02:00
UINT8 pad23 [ 1 ] ;
2020-04-16 09:15:26 +02:00
UINT8 SavingMode ;
// BOOLEAN DropMCFG;
//Injections
BOOLEAN StringInjector ;
2020-09-23 15:47:47 +02:00
UINT8 InjectSystemID_ ; // 0=false, 1=true, other value = default.
2020-04-16 09:15:26 +02:00
BOOLEAN NoDefaultProperties ;
//PCI devices
UINT32 FakeATI ; //97
UINT32 FakeNVidia ;
UINT32 FakeIntel ;
UINT32 FakeLAN ; //100
UINT32 FakeWIFI ;
UINT32 FakeSATA ;
UINT32 FakeXHCI ; //103
UINT32 FakeIMEI ; //106
//Graphics
// UINT16 PCIRootUID;
BOOLEAN GraphicsInjector ;
BOOLEAN InjectIntel ;
BOOLEAN InjectATI ;
BOOLEAN InjectNVidia ;
BOOLEAN DeInit ;
BOOLEAN LoadVBios ;
BOOLEAN PatchVBios ;
2020-08-13 14:07:40 +02:00
UINT8 pad24 [ 5 ] ;
2020-04-16 09:15:26 +02:00
VBIOS_PATCH_BYTES * PatchVBiosBytes ;
UINTN PatchVBiosBytesCount ;
BOOLEAN InjectEDID ;
BOOLEAN LpcTune ;
2020-05-09 11:15:03 +02:00
UINT16 DropOEM_DSM ; //vacant
2020-08-13 14:07:40 +02:00
UINT8 pad25 [ 4 ] ;
2020-04-16 09:15:26 +02:00
UINT8 * CustomEDID ;
UINT16 CustomEDIDsize ;
UINT16 EdidFixHorizontalSyncPulseWidth ;
UINT8 EdidFixVideoInputSignal ;
2020-08-13 14:07:40 +02:00
UINT8 pad26 [ 1 ] ;
2020-08-15 15:47:56 +02:00
XStringW FBName ;
2020-04-16 09:15:26 +02:00
UINT16 VideoPorts ;
BOOLEAN NvidiaGeneric ;
BOOLEAN NvidiaNoEFI ;
BOOLEAN NvidiaSingle ;
2020-08-13 14:07:40 +02:00
UINT8 pad27 [ 5 ] ;
2020-04-16 09:15:26 +02:00
UINT64 VRAM ;
UINT8 Dcfg [ 8 ] ;
UINT8 NVCAP [ 20 ] ;
INT8 BootDisplay ;
BOOLEAN NvidiaWeb ;
UINT8 pad41 [ 2 ] ;
UINT32 DualLink ;
UINT32 IgPlatform ;
// HDA
BOOLEAN HDAInjection ;
INT32 HDALayoutId ;
// USB DeviceTree injection
BOOLEAN USBInjection ;
BOOLEAN USBFixOwnership ;
BOOLEAN InjectClockID ;
BOOLEAN HighCurrent ;
BOOLEAN NameEH00 ;
BOOLEAN NameXH00 ;
BOOLEAN LANInjection ;
BOOLEAN HDMIInjection ;
// UINT8 pad61[2];
//SkyLake
BOOLEAN HWP ;
UINT8 TDP ;
UINT32 HWPValue ;
//Volumes hiding
2020-08-15 22:39:25 +02:00
XString8Array HVHideStrings ;
2020-04-16 09:15:26 +02:00
// KernelAndKextPatches
2020-09-07 19:33:38 +02:00
KERNEL_AND_KEXT_PATCHES KernelAndKextPatches ;
2020-04-16 09:15:26 +02:00
BOOLEAN KextPatchesAllowed ;
BOOLEAN KernelPatchesAllowed ; //From GUI: Only for user patches, not internal Clover
2020-08-15 15:47:56 +02:00
XString8 AirportBridgeDeviceName ;
2020-04-16 09:15:26 +02:00
// Pre-language
BOOLEAN KbdPrevLang ;
//Pointer
BOOLEAN PointerEnabled ;
2020-08-13 14:07:40 +02:00
UINT8 pad28 [ 7 ] ;
2020-04-16 09:15:26 +02:00
INTN PointerSpeed ;
UINT64 DoubleClickTime ;
BOOLEAN PointerMirror ;
// UINT8 pad7[6];
2020-08-13 14:07:40 +02:00
UINT8 pad29 [ 6 ] ;
2020-04-16 09:15:26 +02:00
UINT32 RefCLK ;
// SysVariables
2020-08-13 14:07:40 +02:00
UINT8 pad30 [ 4 ] ;
2020-08-15 15:47:56 +02:00
XString8 RtMLB ;
2020-09-23 15:47:47 +02:00
XBuffer < UINT8 > RtROM ;
2020-04-16 09:15:26 +02:00
UINT32 CsrActiveConfig ;
UINT16 BooterConfig ;
2020-08-15 15:47:56 +02:00
XString8 BooterCfgStr ;
2020-04-16 09:15:26 +02:00
// Multi-config
CHAR16 ConfigName [ 30 ] ;
2020-08-13 14:07:40 +02:00
UINT8 pad31 [ 4 ] ;
2020-08-13 14:57:05 +02:00
// XString8 MainConfigName;
2020-04-16 09:15:26 +02:00
//Drivers
2020-08-31 11:00:52 +02:00
XStringWArray DisabledDriverArray ;
2020-04-16 09:15:26 +02:00
//SMC keys
CHAR8 RPlt [ 8 ] ;
CHAR8 RBr [ 8 ] ;
UINT8 EPCI [ 4 ] ;
UINT8 REV [ 6 ] ;
//other devices
BOOLEAN ForceHPET ;
BOOLEAN ResetHDA ;
BOOLEAN PlayAsync ;
2020-08-13 14:07:40 +02:00
UINT8 pad32 [ 2 ] ;
2020-04-16 09:15:26 +02:00
UINT32 DisableFunctions ;
//Patch DSDT arbitrary
2020-08-27 20:47:56 +02:00
// UINT32 PatchDsdtNum;
// UINT8 **PatchDsdtFind;
// UINT32 *LenToFind;
// UINT8 **PatchDsdtReplace;
// UINT32 *LenToReplace;
// CHAR8 **PatchDsdtLabel;
// CHAR8 **PatchDsdtTgt;
// INPUT_ITEM *PatchDsdtMenuItem;
2020-04-16 09:15:26 +02:00
BOOLEAN SlpWak ;
BOOLEAN UseIntelHDMI ;
UINT8 AFGLowPowerState ;
// UINT8 pad83[4];
// Table dropping
2020-08-13 14:07:40 +02:00
UINT8 pad34 [ 3 ] ;
2020-04-16 09:15:26 +02:00
// Custom entries
BOOLEAN DisableEntryScan ;
BOOLEAN DisableToolScan ;
UINT8 KernelScan ;
BOOLEAN LinuxScan ;
2020-08-13 14:07:40 +02:00
UINT8 pad35 [ 3 ] ;
2020-04-16 09:15:26 +02:00
CUSTOM_LOADER_ENTRY * CustomEntries ;
CUSTOM_LEGACY_ENTRY * CustomLegacy ;
CUSTOM_TOOL_ENTRY * CustomTool ;
//Add custom properties
UINTN NrAddProperties ;
DEV_PROPERTY * AddProperties ;
//BlackListed kexts
CHAR16 BlockKexts [ 64 ] ;
// Disable inject kexts
// UINT32 DisableInjectKextCount;
// CHAR16 **DisabledInjectKext;
// INPUT_ITEM *InjectKextMenuItem;
//ACPI tables
// ACPI/PATCHED/AML
2020-08-13 14:07:40 +02:00
UINT8 pad36 [ 4 ] ;
2020-04-16 09:15:26 +02:00
//other
UINT32 IntelMaxValue ;
// UINT32 AudioVolume;
// boot.efi
UINT32 OptionsBits ;
UINT32 FlagsBits ;
UINT32 UIScale ;
UINT32 EFILoginHiDPI ;
UINT8 flagstate [ 32 ] ;
2020-08-13 14:07:40 +02:00
UINT8 pad37 [ 4 ] ;
2020-04-16 09:15:26 +02:00
DEV_PROPERTY * ArbProperties ;
2020-07-15 19:29:27 +02:00
2020-08-09 17:55:30 +02:00
UINT32 QuirksMask ;
2020-08-13 14:07:40 +02:00
UINT8 pad38 [ 4 ] ;
2020-07-15 19:29:27 +02:00
UINTN MaxSlide ;
2020-04-16 09:15:26 +02:00
2020-09-09 19:06:34 +02:00
OC_BOOTER_QUIRKS ocBooterQuirks ;
XObjArray < MMIOWhiteList > mmioWhiteListArray ;
2020-09-29 14:15:11 +02:00
BOOLEAN ProvideConsoleGop ;
2020-08-11 14:43:53 +02:00
2020-09-23 15:47:47 +02:00
SETTINGS_DATA ( ) : VendorName ( ) , RomVersion ( ) , EfiVersion ( ) , ReleaseDate ( ) , ManufactureName ( ) , ProductName ( ) , VersionNr ( ) , SerialNr ( ) , SmUUID ( ) ,
pad0 { 0 } , FamilyName ( ) , OEMProduct ( ) , OEMVendor ( ) , BoardManufactureName ( ) , BoardSerialNumber ( ) , BoardNumber ( ) , LocationInChassis ( ) ,
2020-08-27 15:02:25 +02:00
BoardVersion ( ) , OEMBoard ( ) , BoardType ( 0 ) , pad1 ( 0 ) , Mobile ( 0 ) , ChassisType ( 0 ) , ChassisManufacturer ( ) , ChassisAssetTag ( ) , CpuFreqMHz ( 0 ) ,
BusSpeed ( 0 ) , Turbo ( 0 ) , EnabledCores ( 0 ) , UserChange ( 0 ) , QEMU ( 0 ) , SmbiosVersion ( 0 ) , Attribute ( 0 ) , pad17 { 0 } , MemoryManufacturer ( ) ,
2021-03-19 14:04:19 +01:00
MemorySerialNumber ( ) , MemoryPartNumber ( ) , MemorySpeed ( ) , CpuType ( 0 ) , QPI ( 0 ) , TrustSMBIOS ( 0 ) , InjectMemoryTables ( 0 ) ,
2021-02-02 10:02:21 +01:00
UseARTFreq ( 0 ) , PlatformFeature ( 0 ) , NoRomInfo ( 0 ) , Language ( ) , CustomUuid ( ) ,
IntelMaxBacklight ( 0 ) , VendorEDID ( 0 ) , ProductEDID ( 0 ) , BacklightLevel ( 0 ) , BacklightLevelConfig ( 0 ) , IntelBacklight ( 0 ) , MemoryFix ( 0 ) , WithKexts ( 0 ) ,
2021-02-11 12:41:59 +01:00
WithKextsIfNoFakeSMC ( 0 ) , FakeSMCFound ( 0 ) , NoCaches ( 0 ) , Debug ( 0 ) , pad22 { 0 } , DefaultBackgroundColor ( 0 ) , SavingMode ( 0 ) , StringInjector ( 0 ) , InjectSystemID_ ( 0 ) , NoDefaultProperties ( 0 ) ,
2020-08-11 14:43:53 +02:00
FakeATI ( 0 ) , FakeNVidia ( 0 ) , FakeIntel ( 0 ) , FakeLAN ( 0 ) , FakeWIFI ( 0 ) , FakeSATA ( 0 ) , FakeXHCI ( 0 ) , FakeIMEI ( 0 ) , GraphicsInjector ( 0 ) ,
InjectIntel ( 0 ) , InjectATI ( 0 ) , InjectNVidia ( 0 ) , DeInit ( 0 ) , LoadVBios ( 0 ) , PatchVBios ( 0 ) , PatchVBiosBytes ( 0 ) , PatchVBiosBytesCount ( 0 ) , InjectEDID ( 0 ) ,
2020-08-27 15:02:25 +02:00
LpcTune ( 0 ) , DropOEM_DSM ( 0 ) , CustomEDID ( 0 ) , CustomEDIDsize ( 0 ) , EdidFixHorizontalSyncPulseWidth ( 0 ) , EdidFixVideoInputSignal ( 0 ) , FBName ( ) , VideoPorts ( 0 ) , NvidiaGeneric ( 0 ) ,
2020-08-11 14:43:53 +02:00
NvidiaNoEFI ( 0 ) , NvidiaSingle ( 0 ) , VRAM ( 0 ) , Dcfg { 0 } , NVCAP { 0 } , BootDisplay ( 0 ) , NvidiaWeb ( 0 ) , pad41 { 0 } , DualLink ( 0 ) ,
2021-02-02 10:02:21 +01:00
IgPlatform ( 0 ) , HDAInjection ( 0 ) ,
2020-08-11 14:43:53 +02:00
HDALayoutId ( 0 ) , USBInjection ( 0 ) , USBFixOwnership ( 0 ) , InjectClockID ( 0 ) , HighCurrent ( 0 ) , NameEH00 ( 0 ) , NameXH00 ( 0 ) , LANInjection ( 0 ) , HDMIInjection ( 0 ) ,
2021-02-02 10:02:21 +01:00
HWP ( 0 ) , TDP ( 0 ) , HWPValue ( 0 ) , HVHideStrings ( ) , KernelAndKextPatches ( ) , KextPatchesAllowed ( 0 ) ,
KernelPatchesAllowed ( 0 ) , AirportBridgeDeviceName ( ) , KbdPrevLang ( 0 ) , PointerEnabled ( 0 ) , PointerSpeed ( 0 ) , DoubleClickTime ( 0 ) , PointerMirror ( 0 ) ,
2021-03-15 10:02:34 +01:00
RefCLK ( 0 ) , RtMLB ( ) , RtROM ( ) , CsrActiveConfig ( 0 ) , BooterConfig ( 0 ) , BooterCfgStr ( ) ,
2021-02-11 12:41:59 +01:00
ConfigName { 0 } , /*MainConfigName(0),*/ /*BlackListCount(0),*/ DisabledDriverArray ( ) , RPlt { 0 } , RBr { 0 } , EPCI { 0 } , REV { 0 } , ForceHPET ( 0 ) , ResetHDA ( 0 ) , PlayAsync ( 0 ) , DisableFunctions ( 0 ) , SlpWak ( 0 ) , UseIntelHDMI ( 0 ) ,
AFGLowPowerState ( 0 ) , DisableEntryScan ( 0 ) , DisableToolScan ( 0 ) , KernelScan ( 0 ) , LinuxScan ( 0 ) , CustomEntries ( 0 ) ,
CustomLegacy ( 0 ) , CustomTool ( 0 ) , NrAddProperties ( 0 ) , AddProperties ( 0 ) , BlockKexts { 0 } ,
2020-08-27 20:47:56 +02:00
IntelMaxValue ( 0 ) , OptionsBits ( 0 ) , FlagsBits ( 0 ) , UIScale ( 0 ) , EFILoginHiDPI ( 0 ) , flagstate { 0 } ,
2021-02-06 18:16:46 +01:00
ArbProperties ( 0 ) , QuirksMask ( 0 ) , MaxSlide ( 0 ) , ocBooterQuirks { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } , mmioWhiteListArray ( ) , ProvideConsoleGop ( 0 )
2020-08-11 14:43:53 +02:00
{ } ;
SETTINGS_DATA ( const SETTINGS_DATA & other ) = delete ; // Can be defined if needed
const SETTINGS_DATA & operator = ( const SETTINGS_DATA & ) = delete ; // Can be defined if needed
2020-08-13 14:07:40 +02:00
2021-02-11 12:41:59 +01:00
// XBuffer<UINT8> serialize() const;
2020-08-13 14:07:40 +02:00
2020-08-11 14:43:53 +02:00
~ SETTINGS_DATA ( ) { }
2020-09-23 15:47:47 +02:00
const XString8 & getUUID ( ) ;
const XString8 & getUUID ( EFI_GUID * efiGuid ) ;
2020-11-18 22:49:02 +01:00
// If CustomUuid is defined, return false by default
// If SmUUID is defined, return true by default.
2020-09-23 15:47:47 +02:00
bool ShouldInjectSystemID ( ) {
2020-11-18 22:49:02 +01:00
if ( CustomUuid . notEmpty ( ) & & CustomUuid ! = nullGuid ) {
2020-09-23 15:47:47 +02:00
if ( InjectSystemID_ = = 2 ) return false ;
else return InjectSystemID_ ;
}
2020-11-18 22:49:02 +01:00
if ( SmUUID . isEmpty ( ) | | SmUUID = = nullGuid ) return false ;
if ( InjectSystemID_ = = 2 ) return true ;
2020-09-23 15:47:47 +02:00
return InjectSystemID_ ;
}
2020-08-11 14:43:53 +02:00
} ;
2020-04-16 09:15:26 +02:00
2020-08-15 15:47:56 +02:00
//#pragma GCC diagnostic ignored "-Wpadded"
2020-08-13 14:07:40 +02:00
2020-04-16 09:15:26 +02:00
typedef enum {
english = 0 , //en
russian , //ru
french , //fr
german , //de
dutch , //nl
italian , //it
spanish , //es
portuguese , //pt
brasil , //br
polish , //pl
ukrainian , //ua
croatian , //hr
czech , //cs
indonesian , //id
korean , //ko
chinese , //cn
romanian //ro
//something else? add, please
} LANGUAGES ;
typedef struct _DRIVERS_FLAGS {
BOOLEAN EmuVariableLoaded ;
BOOLEAN VideoLoaded ;
BOOLEAN PartitionLoaded ;
BOOLEAN MemFixLoaded ;
BOOLEAN AptioFixLoaded ;
BOOLEAN AptioFix2Loaded ;
BOOLEAN AptioFix3Loaded ;
BOOLEAN AptioMemFixLoaded ;
BOOLEAN HFSLoaded ;
BOOLEAN APFSLoaded ;
} DRIVERS_FLAGS ;
typedef struct {
UINT16 SegmentGroupNum ;
UINT8 BusNum ;
UINT8 DevFuncNum ;
BOOLEAN Valid ;
//UINT8 DeviceN;
UINT8 SlotID ;
UINT8 SlotType ;
CHAR8 SlotName [ 31 ] ;
} SLOT_DEVICE ;
// ACPI/PATCHED/AML
2020-08-09 17:55:30 +02:00
class ACPI_PATCHED_AML
2020-04-16 09:15:26 +02:00
{
2020-08-09 17:55:30 +02:00
public :
2020-04-16 09:15:26 +02:00
ACPI_PATCHED_AML * Next ;
CHAR16 * FileName ;
2021-02-06 18:16:46 +01:00
INPUT_ITEM MenuItem = INPUT_ITEM ( ) ;
2020-08-09 17:55:30 +02:00
2021-02-06 18:16:46 +01:00
ACPI_PATCHED_AML ( ) : Next ( 0 ) , FileName ( 0 ) { } ;
2020-08-09 17:55:30 +02:00
ACPI_PATCHED_AML ( const ACPI_PATCHED_AML & other ) = delete ; // Can be defined if needed
const ACPI_PATCHED_AML & operator = ( const ACPI_PATCHED_AML & ) = delete ; // Can be defined if needed
~ ACPI_PATCHED_AML ( ) { }
2020-04-16 09:15:26 +02:00
} ;
// syscl - Side load kext
2020-08-09 17:55:30 +02:00
class SIDELOAD_KEXT
{
public :
2020-09-16 01:01:53 +02:00
XObjArray < SIDELOAD_KEXT > PlugInList ;
2021-02-11 12:41:59 +01:00
XStringW FileName = XStringW ( ) ;
XStringW KextDirNameUnderOEMPath = XStringW ( ) ;
XStringW Version = XStringW ( ) ;
2021-02-06 18:16:46 +01:00
INPUT_ITEM MenuItem = INPUT_ITEM ( ) ;
2020-08-09 17:55:30 +02:00
2021-02-11 12:41:59 +01:00
SIDELOAD_KEXT ( ) : PlugInList ( ) { } ;
2020-08-09 17:55:30 +02:00
SIDELOAD_KEXT ( const SIDELOAD_KEXT & other ) = delete ; // Can be defined if needed
const SIDELOAD_KEXT & operator = ( const SIDELOAD_KEXT & ) = delete ; // Can be defined if needed
2020-09-16 01:01:53 +02:00
~ SIDELOAD_KEXT ( ) { }
2020-04-16 09:15:26 +02:00
} ;
2020-08-31 08:22:21 +02:00
class RT_VARIABLES
{
public :
XStringW Name ;
2020-04-16 09:48:13 +02:00
EFI_GUID VarGuid ;
2020-08-31 08:22:21 +02:00
2021-02-06 18:16:46 +01:00
RT_VARIABLES ( ) : Name ( ) , VarGuid { 0 , 0 , 0 , { 0 } } { } ;
2020-08-31 08:22:21 +02:00
RT_VARIABLES ( const RT_VARIABLES & other ) = delete ; // Can be defined if needed
const RT_VARIABLES & operator = ( const RT_VARIABLES & ) = delete ; // Can be defined if needed
~ RT_VARIABLES ( ) { }
2020-04-16 09:48:13 +02:00
} ;
2020-08-31 08:22:21 +02:00
extern XObjArray < RT_VARIABLES > BlockRtVariableArray ;
2020-08-31 09:07:36 +02:00
extern XObjArray < HDA_OUTPUTS > AudioList ;
2020-04-04 14:27:02 +02:00
2020-08-31 09:22:11 +02:00
extern XStringWArray ThemeNameArray ;
2020-04-04 14:27:02 +02:00
extern CHAR16 * ConfigsList [ 20 ] ;
extern CHAR16 * DsdtsList [ 20 ] ;
extern UINTN DsdtsNum ;
extern UINTN ConfigsNum ;
2020-05-26 19:12:54 +02:00
//extern INTN ScrollButtonsHeight;
//extern INTN ScrollBarDecorationsHeight;
//extern INTN ScrollScrollDecorationsHeight;
//extern INTN LayoutBannerOffset;
//extern INTN LayoutButtonOffset;
//extern INTN LayoutTextOffset;
2020-04-04 14:27:02 +02:00
// this should go in a globals, not in settings
extern INTN OldChosenTheme ;
extern INTN OldChosenConfig ;
extern INTN OldChosenDsdt ;
extern UINTN OldChosenAudio ;
extern BOOLEAN SavePreBootLog ;
extern UINT8 DefaultAudioVolume ;
2020-02-29 08:30:21 +01:00
2020-04-16 09:15:26 +02:00
extern GFX_PROPERTIES gGraphics [ ] ;
extern HDA_PROPERTIES gAudios [ ] ;
extern UINTN NGFX ;
extern UINTN NHDA ;
//extern UINT16 gCPUtype;
extern SETTINGS_DATA gSettings ;
extern LANGUAGES gLanguage ;
extern BOOLEAN gFirmwareClover ;
extern DRIVERS_FLAGS gDriversFlags ;
extern SLOT_DEVICE SlotDevices [ ] ;
extern EFI_EDID_DISCOVERED_PROTOCOL * EdidDiscovered ;
//extern UINT8 *gEDID;
extern UINTN gEvent ;
extern UINT16 gBacklightLevel ;
2020-05-11 08:30:45 +02:00
//extern BOOLEAN defDSM;
//extern UINT16 dropDSM;
2020-04-16 09:15:26 +02:00
2020-08-25 17:35:19 +02:00
extern TagDict * gConfigDict [ ] ;
2020-04-16 09:15:26 +02:00
// ACPI/PATCHED/AML
extern ACPI_PATCHED_AML * ACPIPatchedAML ;
// SysVariables
//extern SYSVARIABLES *SysVariables;
// Hold theme fixed IconFormat / extension
extern CHAR16 * IconFormat ;
2020-04-16 13:19:37 +02:00
2020-04-16 09:15:26 +02:00
extern CONST CHAR16 * gFirmwareRevision ;
2020-04-16 13:19:37 +02:00
extern CONST CHAR8 * gRevisionStr ;
2020-04-16 14:24:21 +02:00
extern CONST CHAR8 * gFirmwareBuildDate ;
extern CONST CHAR8 * gBuildInfo ;
2020-10-28 18:11:50 +01:00
extern const LString8 gBuildId ;
extern const LString8 path_independant ;
extern const LString8 gBuildIdGrepTag ;
2020-04-16 09:15:26 +02:00
extern BOOLEAN ResumeFromCoreStorage ;
extern BOOLEAN gRemapSmBiosIsRequire ; // syscl: pass argument for Dell SMBIOS here
extern EMU_VARIABLE_CONTROL_PROTOCOL * gEmuVariableControl ;
2020-04-26 11:39:41 +02:00
//
// config module
//
2020-08-09 17:55:30 +02:00
class REFIT_CONFIG
{
public :
2021-02-02 10:02:21 +01:00
// INTN Timeout;
2020-04-26 11:39:41 +02:00
UINTN DisableFlags ; //to disable some volume types (optical, firewire etc)
2021-02-02 10:02:21 +01:00
// BOOLEAN TextOnly;
2020-04-26 11:39:41 +02:00
BOOLEAN Quiet ;
2021-02-02 10:02:21 +01:00
// BOOLEAN LegacyFirst;
// BOOLEAN NoLegacy;
// BOOLEAN DebugLog;
BOOLEAN SpecialBootMode ; // content of nvram var "aptiofixflag"
// BOOLEAN NeverHibernate;
// BOOLEAN StrictHibernate;
// BOOLEAN RtcHibernateAware;
// BOOLEAN HibernationFixup;
// BOOLEAN SignatureFixup;
// XStringW Theme;
// XStringW ScreenResolution;
// INTN ConsoleMode;
// BOOLEAN CustomIcons;
2021-02-06 18:16:46 +01:00
// INTN IconFormat = ICON_FORMAT_DEF; // not used anymore
2021-02-02 10:02:21 +01:00
// BOOLEAN NoEarlyProgress;
// INT32 Timezone;
// BOOLEAN ShowOptimus;
// INTN Codepage;
// INTN CodepageSize;
2020-08-09 17:55:30 +02:00
2021-02-06 18:16:46 +01:00
BOOLEAN gBootChanged = FALSE ;
BOOLEAN gThemeChanged = FALSE ;
BOOLEAN NeedPMfix = FALSE ;
2021-02-11 12:41:59 +01:00
ACPI_DROP_TABLE * ACPIDropTables = NULL ;
2021-02-06 18:16:46 +01:00
2021-03-15 10:02:34 +01:00
UINT8 CustomBoot = 0 ; // this will be initialized with gSettings.Boot.CustomBoot and set back to CUSTOM_BOOT_DISABLED if CustomLogo could not be loaded or decoded (see afterGetUserSettings)
XImage * CustomLogo = 0 ;
2021-02-06 18:16:46 +01:00
2021-03-15 10:02:34 +01:00
bool DropSSDT = 0 ; // init with gSettings.Boot.DropSSDTSetting. Put back to false is one table is dropped (see afterGetUserSettings)
UINT8 SecureBoot = 0 ;
UINT8 SecureBootSetupMode = 0 ;
2021-02-06 18:16:46 +01:00
2021-03-19 14:04:19 +01:00
BOOLEAN SetTable132 = 0 ;
2020-08-09 17:55:30 +02:00
/*
* Defqult ctor :
* - 1 , // INTN Timeout;
* 0 , // UINTN DisableFlags;
* FALSE , // BOOLEAN TextOnly;
* TRUE , // BOOLEAN Quiet;
* FALSE , // BOOLEAN LegacyFirst;
* FALSE , // BOOLEAN NoLegacy;
* FALSE , // BOOLEAN DebugLog;
* FALSE , // BOOLEAN FastBoot;
* FALSE , // BOOLEAN NeverHibernate;
* FALSE , // BOOLEAN StrictHibernate;
* FALSE , // BOOLEAN RtcHibernateAware;
* FALSE , // BOOLEAN HibernationFixup;
* FALSE , // BOOLEAN SignatureFixup;
* L " " _XSW , // XStringW Theme;
* L " " _XSW , // XStringW ScreenResolution;
* 0 , // INTN ConsoleMode;
* FALSE , // BOOLEAN CustomIcons;
* ICON_FORMAT_DEF , // INTN IconFormat;
* FALSE , // BOOLEAN NoEarlyProgress;
* 0xFF , // INT32 Timezone; / 0xFF - not set
* FALSE , // BOOLEAN ShowOptimus;
* 0xC0 , // INTN Codepage;
* 0xC0 , // INTN CodepageSize; //extended latin
} ;
*
*/
2021-02-02 10:02:21 +01:00
REFIT_CONFIG ( ) : DisableFlags ( 0 ) , Quiet ( TRUE ) ,
2021-02-06 18:16:46 +01:00
SpecialBootMode ( FALSE )
2021-02-02 10:02:21 +01:00
{ } ;
2020-09-27 13:52:38 +02:00
REFIT_CONFIG ( const REFIT_CONFIG & other ) = delete ; // Can be defined if needed
2020-08-09 17:55:30 +02:00
const REFIT_CONFIG & operator = ( const REFIT_CONFIG & ) = delete ; // Can be defined if needed
~ REFIT_CONFIG ( ) { }
2021-02-02 10:02:21 +01:00
bool isFastBoot ( ) { return SpecialBootMode | | gSettings . Boot . FastBoot ; }
2020-08-09 17:55:30 +02:00
} ;
2020-04-26 11:39:41 +02:00
extern REFIT_CONFIG GlobalConfig ;
2020-04-16 09:15:26 +02:00
2020-02-29 08:30:21 +01:00
EFI_STATUS
SetFSInjection (
IN LOADER_ENTRY * Entry
) ;
2020-10-03 19:02:31 +02:00
void
2020-02-29 08:30:21 +01:00
SetDevices (
LOADER_ENTRY * Entry
) ;
//
// check if this entry corresponds to Boot# variable and then set BootCurrent
//
2020-10-03 19:02:31 +02:00
void
2020-03-10 10:45:17 +01:00
SetBootCurrent ( REFIT_MENU_ITEM_BOOTNUM * LoadedEntry ) ;
2020-02-29 08:30:21 +01:00
2021-02-04 15:04:31 +01:00
XString8 GetAuthRootDmg ( const EFI_FILE & dir , const XStringW & path ) ;
2020-02-29 08:30:21 +01:00
2021-02-04 15:04:31 +01:00
MacOsVersion GetMacOSVersionFromFolder ( const EFI_FILE & dir , const XStringW & path ) ;
2021-01-31 10:50:23 +01:00
MacOsVersion GetOSVersion ( int LoaderType , const XStringW & APFSTargetUUID , const REFIT_VOLUME * Volume , XString8 * BuildVersionPtr ) ;
inline MacOsVersion GetOSVersion ( IN LOADER_ENTRY * Entry ) { return GetOSVersion ( Entry - > LoaderType , Entry - > APFSTargetUUID , Entry - > Volume , & Entry - > BuildVersion ) ; } ;
2020-04-04 14:27:02 +02:00
2020-04-16 09:15:26 +02:00
UINT32
GetCrc32 (
UINT8 * Buffer ,
UINTN Size
) ;
2020-10-03 19:02:31 +02:00
void
GetDevices ( void ) ;
2020-04-16 09:15:26 +02:00
2020-04-27 11:50:49 +02:00
CONST XStringW
GetOSIconName (
2020-11-12 22:25:56 +01:00
const MacOsVersion & OSVersion
2020-04-16 09:15:26 +02:00
) ;
EFI_STATUS
GetRootUUID (
IN OUT REFIT_VOLUME * Volume
) ;
EFI_STATUS
GetEarlyUserSettings (
2021-02-06 18:16:46 +01:00
const TagDict * CfgDict ,
SETTINGS_DATA & gSettings
2020-04-16 09:15:26 +02:00
) ;
EFI_STATUS
2021-02-06 18:16:46 +01:00
GetUserSettings ( const TagDict * CfgDict , SETTINGS_DATA & gSettings ) ;
2020-04-16 09:15:26 +02:00
2020-08-09 17:55:30 +02:00
XStringW
2020-04-16 09:15:26 +02:00
GetOtherKextsDir ( BOOLEAN On ) ;
2020-11-12 22:25:56 +01:00
XStringW GetOSVersionKextsDir ( const MacOsVersion & OSVersion ) ;
2020-04-16 09:15:26 +02:00
EFI_STATUS
InjectKextsFromDir (
EFI_STATUS Status ,
CHAR16 * SrcDir
) ;
2020-10-03 19:02:31 +02:00
void
2020-04-16 09:15:26 +02:00
ParseLoadOptions (
2020-08-09 17:55:30 +02:00
OUT XStringW * ConfName ,
2020-08-25 17:35:19 +02:00
OUT TagDict * * Dict
2020-04-16 09:15:26 +02:00
) ;
EFI_STATUS
2020-10-03 19:02:31 +02:00
SaveSettings ( void ) ;
2020-04-16 09:15:26 +02:00
/** return true if a given os contains '.' as separator,
and then match components of the current booted OS . Also allow 10.10 . x format meaning all revisions
of the 10.10 OS */
2020-11-12 22:25:56 +01:00
//BOOLEAN IsOSValid(const XString8& MatchOS, const MacOsVersion& CurrOS);
2020-04-16 09:15:26 +02:00
//get default boot
2020-10-03 19:02:31 +02:00
void GetBootFromOption ( void ) ;
2020-04-16 09:15:26 +02:00
EFI_STATUS
LoadUserSettings (
2020-08-09 17:55:30 +02:00
const XStringW & ConfName ,
2020-08-25 17:35:19 +02:00
TagDict * * dict
2020-04-16 09:15:26 +02:00
) ;
2020-10-03 19:02:31 +02:00
void
2020-04-16 09:15:26 +02:00
ParseSMBIOSSettings (
2020-08-25 17:35:19 +02:00
const TagDict * dictPointer
2020-04-16 09:15:26 +02:00
) ;
2020-04-04 14:27:02 +02:00
2020-08-25 17:35:19 +02:00
void testConfigPlist ( ) ;
2020-04-04 14:27:02 +02:00
# endif