mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-22 11:25:42 +01:00
eliminate some warnings by gcc10
Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
parent
6241b27185
commit
7af605b0b6
@ -683,5 +683,7 @@ DEFINE BUILD_OPTIONS=-DMDEPKG_NDEBUG -DCLOVER_BUILD $(VBIOS_PATCH_CLOVEREFI_FLAG
|
||||
XCODE:*_*_*_CC_FLAGS = -fno-unwind-tables -Wno-msvc-include -Os $(BUILD_OPTIONS) $(DISABLE_LTO_FLAG) -D DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
GCC:*_*_*_CC_FLAGS = $(BUILD_OPTIONS) $(DISABLE_LTO_FLAG) -D DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
GCC:*_*_*_CXX_FLAGS = $(BUILD_OPTIONS) $(DISABLE_LTO_FLAG) -D DISABLE_NEW_DEPRECATED_INTERFACES
|
||||
#-fanalyzer -Wmismatched-tags
|
||||
#-Weffc++
|
||||
#-Wunused-but-set-variable
|
||||
# -Os -fno-omit-frame-pointer -maccumulate-outgoing-args
|
||||
|
@ -1451,7 +1451,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName)
|
||||
*/
|
||||
VOID SaveOemTables()
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
// EFI_STATUS Status;
|
||||
VOID *RsdPtr;
|
||||
CHAR16 *AcpiOriginPath = PoolPrint(L"%s\\ACPI\\origin", OEMPath);
|
||||
BOOLEAN Saved = FALSE;
|
||||
@ -1482,8 +1482,8 @@ VOID SaveOemTables()
|
||||
// Search Acpi 2.0 or newer in UEFI Sys.Tables
|
||||
//
|
||||
RsdPtr = NULL;
|
||||
Status = EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &RsdPtr);
|
||||
if (RsdPtr != NULL) {
|
||||
/*Status = */EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &RsdPtr);
|
||||
if (RsdPtr != NULL) { //it may be EFI_SUCCESS but null pointer
|
||||
DBG("Found UEFI Acpi 2.0 RSDP at %p\n", RsdPtr);
|
||||
// if tables already saved, then just print to log
|
||||
DumpTables(RsdPtr, Saved ? NULL : AcpiOriginPath);
|
||||
@ -2449,7 +2449,7 @@ EFI_STATUS PatchACPI_OtherOS(CONST CHAR16* OsSubdir, BOOLEAN DropSSDT)
|
||||
}
|
||||
// if RSDP not found - quit
|
||||
if (!RsdPointer) {
|
||||
return EFI_UNSUPPORTED;
|
||||
return Status;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -617,7 +617,7 @@ VOID CheckHardware()
|
||||
UINTN display=0;
|
||||
|
||||
|
||||
pci_dt_t PCIdevice;
|
||||
// pci_dt_t PCIdevice;
|
||||
EFI_DEVICE_PATH_PROTOCOL *DevicePath = NULL;
|
||||
|
||||
usb=0;
|
||||
@ -653,7 +653,7 @@ VOID CheckHardware()
|
||||
deviceid = Pci.Hdr.DeviceId | (Pci.Hdr.VendorId << 16);
|
||||
|
||||
// add for auto patch dsdt get DSDT Device _ADR
|
||||
PCIdevice.DeviceHandle = Handle;
|
||||
// PCIdevice.DeviceHandle = Handle;
|
||||
DevicePath = DevicePathFromHandle (Handle);
|
||||
if (DevicePath) {
|
||||
// DBG("Device patch = %ls \n", DevicePathToStr(DevicePath));
|
||||
|
@ -266,11 +266,12 @@ HdaCodecDumpPrintWidgets(
|
||||
}
|
||||
}
|
||||
|
||||
EFI_STATUS SaveHdaDumpTxt() {
|
||||
EFI_STATUS SaveHdaDumpTxt()
|
||||
{
|
||||
EFI_STATUS Status = EFI_NOT_FOUND;
|
||||
AUDIO_IO_PRIVATE_DATA *AudioIoPrivateData;
|
||||
HDA_CODEC_DEV *HdaCodecDev;
|
||||
EFI_HDA_CODEC_INFO_PROTOCOL *HdaCodecInfo;
|
||||
// EFI_HDA_CODEC_INFO_PROTOCOL *HdaCodecInfo;
|
||||
HDA_FUNC_GROUP *AudioFuncGroup;
|
||||
EFI_HDA_IO_PROTOCOL *HdaIo;
|
||||
CHAR16 *MiscPath = PoolPrint(L"%s\\misc", OEMPath);
|
||||
@ -296,7 +297,7 @@ EFI_STATUS SaveHdaDumpTxt() {
|
||||
continue;
|
||||
|
||||
HdaCodecDev = AudioIoPrivateData->HdaCodecDev;
|
||||
HdaCodecInfo = &HdaCodecDev->HdaCodecInfoData->HdaCodecInfo;
|
||||
// HdaCodecInfo = &HdaCodecDev->HdaCodecInfoData->HdaCodecInfo;
|
||||
AudioFuncGroup = HdaCodecDev->AudioFuncGroup;
|
||||
HdaIo = HdaCodecDev->HdaIo;
|
||||
|
||||
@ -349,11 +350,12 @@ EFI_STATUS SaveHdaDumpTxt() {
|
||||
return Status;
|
||||
}
|
||||
|
||||
EFI_STATUS SaveHdaDumpBin() {
|
||||
EFI_STATUS SaveHdaDumpBin()
|
||||
{
|
||||
EFI_STATUS Status = EFI_NOT_FOUND;
|
||||
AUDIO_IO_PRIVATE_DATA *AudioIoPrivateData;
|
||||
HDA_CODEC_DEV *HdaCodecDev;
|
||||
EFI_HDA_CODEC_INFO_PROTOCOL *HdaCodecInfo;
|
||||
// EFI_HDA_CODEC_INFO_PROTOCOL *HdaCodecInfo;
|
||||
HDA_FUNC_GROUP *AudioFuncGroup;
|
||||
EFI_HDA_IO_PROTOCOL *HdaIo;
|
||||
CHAR16 *MiscPath = PoolPrint(L"%s\\misc", OEMPath);
|
||||
@ -385,7 +387,7 @@ EFI_STATUS SaveHdaDumpBin() {
|
||||
if(!HdaCodecDev || !HdaCodecDev->AudioFuncGroup)
|
||||
continue;
|
||||
|
||||
HdaCodecInfo = &HdaCodecDev->HdaCodecInfoData->HdaCodecInfo;
|
||||
// HdaCodecInfo = &HdaCodecDev->HdaCodecInfoData->HdaCodecInfo;
|
||||
AudioFuncGroup = HdaCodecDev->AudioFuncGroup;
|
||||
HdaIo = HdaCodecDev->HdaIo;
|
||||
|
||||
|
@ -607,8 +607,8 @@ relocation entries */
|
||||
* minor version number. The address of where the headers are loaded is in
|
||||
* header_addr. (THIS IS OBSOLETE and no longer supported).
|
||||
*/
|
||||
struct fvmlib {
|
||||
union lc_str name; /* library's target pathname */
|
||||
struct fvmshlib {
|
||||
/*union*/ lc_str name; /* library's target pathname */
|
||||
uint32_t minor_version; /* library's minor version number */
|
||||
uint32_t header_addr; /* library's header address */
|
||||
};
|
||||
@ -623,7 +623,7 @@ struct fvmlib {
|
||||
struct fvmlib_command {
|
||||
uint32_t cmd; /* LC_IDFVMLIB or LC_LOADFVMLIB */
|
||||
uint32_t cmdsize; /* includes pathname string */
|
||||
struct fvmlib fvmlib; /* the library identification */
|
||||
/*struct*/ fvmshlib fvmlib; /* the library identification */
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -815,7 +815,7 @@ GetEfiBootDeviceFromNvram ()
|
||||
|
||||
/** Loads and parses nvram.plist into gNvramDict. */
|
||||
EFI_STATUS
|
||||
LoadNvramPlist (
|
||||
LoadNvramPlist(
|
||||
IN EFI_FILE *RootDir,
|
||||
IN CONST CHAR16* NVRAMPlistPath
|
||||
)
|
||||
@ -835,7 +835,7 @@ LoadNvramPlist (
|
||||
//
|
||||
// load nvram.plist
|
||||
//
|
||||
Status = egLoadFile (RootDir, NVRAMPlistPath, (UINT8**)&NvramPtr, &Size);
|
||||
Status = egLoadFile(RootDir, NVRAMPlistPath, (UINT8**)&NvramPtr, &Size);
|
||||
if(EFI_ERROR(Status)) {
|
||||
DBG(" not present\n");
|
||||
return Status;
|
||||
@ -846,7 +846,7 @@ LoadNvramPlist (
|
||||
//
|
||||
// parse it into gNvramDict
|
||||
//
|
||||
Status = ParseXML ((const CHAR8*)NvramPtr, &gNvramDict, (UINT32)Size);
|
||||
Status = ParseXML((const CHAR8*)NvramPtr, &gNvramDict, (UINT32)Size);
|
||||
// if(Status != EFI_SUCCESS) {
|
||||
// DBG(" parsing error\n");
|
||||
// }
|
||||
@ -861,7 +861,7 @@ LoadNvramPlist (
|
||||
|
||||
/** Searches all volumes for the most recent nvram.plist and loads it into gNvramDict. */
|
||||
EFI_STATUS
|
||||
LoadLatestNvramPlist ()
|
||||
LoadLatestNvramPlist()
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
// UINTN Index;
|
||||
@ -942,9 +942,10 @@ LoadLatestNvramPlist ()
|
||||
// DBG(" - newer - will use this one\n");
|
||||
VolumeWithLatestNvramPlist = Volume;
|
||||
LastModifTimeMs = ModifTimeMs;
|
||||
} else {
|
||||
// DBG(" - older - skipping!\n");
|
||||
}
|
||||
// else {
|
||||
// DBG(" - older - skipping!\n");
|
||||
// }
|
||||
}
|
||||
|
||||
Status = EFI_NOT_FOUND;
|
||||
@ -954,11 +955,11 @@ LoadLatestNvramPlist ()
|
||||
//
|
||||
if (VolumeWithLatestNvramPlist != NULL) {
|
||||
DBG("Loading nvram.plist from Vol '%ls' -", VolumeWithLatestNvramPlist->VolName);
|
||||
Status = LoadNvramPlist (VolumeWithLatestNvramPlist->RootDir, L"nvram.plist");
|
||||
|
||||
} else {
|
||||
// DBG(" nvram.plist not found!\n");
|
||||
Status = LoadNvramPlist(VolumeWithLatestNvramPlist->RootDir, L"nvram.plist");
|
||||
}
|
||||
// else {
|
||||
// DBG(" nvram.plist not found!\n");
|
||||
// }
|
||||
DBG("loaded Status=%s\n", strerror(Status));
|
||||
return Status;
|
||||
}
|
||||
@ -970,7 +971,7 @@ LoadLatestNvramPlist ()
|
||||
VOID
|
||||
PutNvramPlistToRtVars ()
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
// EFI_STATUS Status;
|
||||
TagPtr Tag;
|
||||
TagPtr ValTag;
|
||||
INTN Size, i;
|
||||
@ -978,7 +979,7 @@ PutNvramPlistToRtVars ()
|
||||
VOID *Value;
|
||||
|
||||
if (gNvramDict == NULL) {
|
||||
Status = LoadLatestNvramPlist ();
|
||||
/*Status = */LoadLatestNvramPlist();
|
||||
if (gNvramDict == NULL) {
|
||||
DBG("PutNvramPlistToRtVars: nvram.plist not found\n");
|
||||
return;
|
||||
|
@ -340,7 +340,7 @@ ParseLoadOptions (
|
||||
if (PlistStringsLen < TailSize) {
|
||||
if (AsciiStriNCmp(PlistStrings[i], Start, PlistStringsLen)) {
|
||||
DBG(" - found plist string = %s, parse XML in LoadOptions\n", PlistStrings[i]);
|
||||
if (ParseXML (Start, Dict, (UINT32)TailSize) != EFI_SUCCESS) {
|
||||
if (ParseXML(Start, Dict, (UINT32)TailSize) != EFI_SUCCESS) {
|
||||
*Dict = NULL;
|
||||
DBG(" - [!] xml in load options is bad\n");
|
||||
return;
|
||||
@ -592,16 +592,16 @@ LoadUserSettings (
|
||||
ConfigPlistPath = PoolPrint(L"EFI\\CLOVER\\%s.plist", ConfName);
|
||||
ConfigOemPath = PoolPrint(L"%s\\%s.plist", OEMPath, ConfName);
|
||||
if (FileExists (SelfRootDir, ConfigOemPath)) {
|
||||
Status = egLoadFile (SelfRootDir, ConfigOemPath, (UINT8**)&gConfigPtr, &Size);
|
||||
Status = egLoadFile(SelfRootDir, ConfigOemPath, (UINT8**)&gConfigPtr, &Size);
|
||||
}
|
||||
if (EFI_ERROR(Status)) {
|
||||
if ((RootDir != NULL) && FileExists (RootDir, ConfigPlistPath)) {
|
||||
Status = egLoadFile (RootDir, ConfigPlistPath, (UINT8**)&gConfigPtr, &Size);
|
||||
Status = egLoadFile(RootDir, ConfigPlistPath, (UINT8**)&gConfigPtr, &Size);
|
||||
}
|
||||
if (!EFI_ERROR(Status)) {
|
||||
DBG("Using %ls.plist at RootDir at path: %ls\n", ConfName, ConfigPlistPath);
|
||||
} else {
|
||||
Status = egLoadFile (SelfRootDir, ConfigPlistPath, (UINT8**)&gConfigPtr, &Size);
|
||||
Status = egLoadFile(SelfRootDir, ConfigPlistPath, (UINT8**)&gConfigPtr, &Size);
|
||||
if (!EFI_ERROR(Status)) {
|
||||
DBG("Using %ls.plist at SelfRootDir at path: %ls\n", ConfName, ConfigPlistPath);
|
||||
}
|
||||
@ -609,7 +609,7 @@ LoadUserSettings (
|
||||
}
|
||||
|
||||
if (!EFI_ERROR(Status) && gConfigPtr != NULL) {
|
||||
Status = ParseXML ((const CHAR8*)gConfigPtr, Dict, (UINT32)Size);
|
||||
Status = ParseXML((const CHAR8*)gConfigPtr, Dict, (UINT32)Size);
|
||||
if (EFI_ERROR(Status)) {
|
||||
// Dict = NULL;
|
||||
DBG("config.plist parse error Status=%s\n", strerror(Status));
|
||||
@ -3360,14 +3360,14 @@ CHAR16* GetBundleVersion(CHAR16 *FullName)
|
||||
UINTN Size;
|
||||
|
||||
InfoPlistPath = PoolPrint(L"%s\\%s", FullName, L"Contents\\Info.plist");
|
||||
Status = egLoadFile (SelfRootDir, InfoPlistPath, (UINT8**)&InfoPlistPtr, &Size);
|
||||
Status = egLoadFile(SelfRootDir, InfoPlistPath, (UINT8**)&InfoPlistPtr, &Size);
|
||||
if (EFI_ERROR(Status)) {
|
||||
FreePool(InfoPlistPath);
|
||||
InfoPlistPath = PoolPrint(L"%s", FullName, L"Info.plist"); //special kexts like IOGraphics
|
||||
Status = egLoadFile (SelfRootDir, InfoPlistPath, (UINT8**)&InfoPlistPtr, &Size);
|
||||
Status = egLoadFile(SelfRootDir, InfoPlistPath, (UINT8**)&InfoPlistPtr, &Size);
|
||||
}
|
||||
if(!EFI_ERROR(Status)) {
|
||||
Status = ParseXML ((const CHAR8*)InfoPlistPtr, &InfoPlistDict, (UINT32)Size);
|
||||
Status = ParseXML((const CHAR8*)InfoPlistPtr, &InfoPlistDict, (UINT32)Size);
|
||||
if(!EFI_ERROR(Status)) {
|
||||
Prop = GetProperty(InfoPlistDict, "CFBundleVersion");
|
||||
if (Prop != NULL && Prop->string != NULL) {
|
||||
@ -6307,8 +6307,8 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry)
|
||||
}
|
||||
|
||||
if (SystemPlists[i] != NULL) { // found macOS System
|
||||
Status = egLoadFile (Entry->Volume->RootDir, SystemPlists[i], (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Status = egLoadFile(Entry->Volume->RootDir, SystemPlists[i], (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Prop = GetProperty(Dict, "ProductVersion");
|
||||
if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') {
|
||||
OSVersion = (__typeof__(OSVersion))AllocateCopyPool(AsciiStrSize (Prop->string), Prop->string);
|
||||
@ -6338,8 +6338,8 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry)
|
||||
InstallerPlist = L"\\System\\Library\\CoreServices\\SystemVersion.plist";
|
||||
}
|
||||
if (FileExists (Entry->Volume->RootDir, InstallerPlist)) {
|
||||
Status = egLoadFile (Entry->Volume->RootDir, InstallerPlist, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Status = egLoadFile(Entry->Volume->RootDir, InstallerPlist, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Prop = GetProperty(Dict, "ProductVersion");
|
||||
if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') {
|
||||
OSVersion = (__typeof__(OSVersion))AllocateCopyPool(AsciiStrSize (Prop->string), Prop->string);
|
||||
@ -6356,8 +6356,8 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry)
|
||||
if (OSVersion == NULL) {
|
||||
InstallerPlist = L"\\.IABootFiles\\com.apple.Boot.plist"; // 10.9 - 10.13.3
|
||||
if (FileExists (Entry->Volume->RootDir, InstallerPlist)) {
|
||||
Status = egLoadFile (Entry->Volume->RootDir, InstallerPlist, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Status = egLoadFile(Entry->Volume->RootDir, InstallerPlist, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Prop = GetProperty(Dict, "Kernel Flags");
|
||||
if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') {
|
||||
if (AsciiStrStr (Prop->string, "Install%20OS%20hhX%20Mavericks.app")) {
|
||||
@ -6407,8 +6407,8 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry)
|
||||
}
|
||||
}
|
||||
if (FileExists (Entry->Volume->RootDir, InstallerPlist)) {
|
||||
Status = egLoadFile (Entry->Volume->RootDir, InstallerPlist, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Status = egLoadFile(Entry->Volume->RootDir, InstallerPlist, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Prop = GetProperty(Dict, "ProductVersion");
|
||||
if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') {
|
||||
OSVersion = (__typeof__(OSVersion))AllocateCopyPool(AsciiStrSize (Prop->string), Prop->string);
|
||||
@ -6516,8 +6516,8 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry)
|
||||
}
|
||||
|
||||
if (InstallPlists[i] != NULL) {
|
||||
Status = egLoadFile (Entry->Volume->RootDir, InstallPlists[i], (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Status = egLoadFile(Entry->Volume->RootDir, InstallPlists[i], (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Prop = GetProperty(Dict, "ProductVersion");
|
||||
if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') {
|
||||
OSVersion = (__typeof__(OSVersion))AllocateCopyPool(AsciiStrSize (Prop->string), Prop->string);
|
||||
@ -6539,8 +6539,8 @@ CHAR8 *GetOSVersion(IN LOADER_ENTRY *Entry)
|
||||
// Detect exact version for OS X Recovery
|
||||
|
||||
if (RecoveryPlists[j] != NULL) {
|
||||
Status = egLoadFile (Entry->Volume->RootDir, RecoveryPlists[j], (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML (PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Status = egLoadFile(Entry->Volume->RootDir, RecoveryPlists[j], (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
if (!EFI_ERROR(Status) && PlistBuffer != NULL && ParseXML(PlistBuffer, &Dict, 0) == EFI_SUCCESS) {
|
||||
Prop = GetProperty(Dict, "ProductVersion");
|
||||
if (Prop != NULL && Prop->string != NULL && Prop->string[0] != '\0') {
|
||||
OSVersion = (__typeof__(OSVersion))AllocateCopyPool(AsciiStrSize (Prop->string), Prop->string);
|
||||
@ -6667,30 +6667,30 @@ GetRootUUID (IN REFIT_VOLUME *Volume)
|
||||
// Playing Rock, Paper, Scissors to chose which settings to load.
|
||||
if (HasRock && HasPaper && HasScissors) {
|
||||
// Rock wins when all three are around
|
||||
Status = egLoadFile (Volume->RootDir, SystemPlistR, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
Status = egLoadFile(Volume->RootDir, SystemPlistR, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
} else if (HasRock && HasPaper) {
|
||||
// Paper beats rock
|
||||
Status = egLoadFile (Volume->RootDir, SystemPlistP, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
Status = egLoadFile(Volume->RootDir, SystemPlistP, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
} else if (HasRock && HasScissors) {
|
||||
// Rock beats scissors
|
||||
Status = egLoadFile (Volume->RootDir, SystemPlistR, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
Status = egLoadFile(Volume->RootDir, SystemPlistR, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
} else if (HasPaper && HasScissors) {
|
||||
// Scissors beat paper
|
||||
Status = egLoadFile (Volume->RootDir, SystemPlistS, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
Status = egLoadFile(Volume->RootDir, SystemPlistS, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
} else if (HasPaper) {
|
||||
// No match
|
||||
Status = egLoadFile (Volume->RootDir, SystemPlistP, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
Status = egLoadFile(Volume->RootDir, SystemPlistP, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
} else if (HasScissors) {
|
||||
// No match
|
||||
Status = egLoadFile (Volume->RootDir, SystemPlistS, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
Status = egLoadFile(Volume->RootDir, SystemPlistS, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
} else {
|
||||
// Rock wins by default
|
||||
Status = egLoadFile (Volume->RootDir, SystemPlistR, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
Status = egLoadFile(Volume->RootDir, SystemPlistR, (UINT8 **)&PlistBuffer, &PlistLen);
|
||||
}
|
||||
|
||||
if (!EFI_ERROR(Status)) {
|
||||
Dict = NULL;
|
||||
if (ParseXML (PlistBuffer, &Dict, 0) != EFI_SUCCESS) {
|
||||
if (ParseXML(PlistBuffer, &Dict, 0) != EFI_SUCCESS) {
|
||||
FreePool(PlistBuffer);
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
@ -676,7 +676,7 @@ VOID GetCPUProperties (VOID)
|
||||
INTN currdiv = 0;
|
||||
UINT64 busFCvtt2n;
|
||||
UINT64 tscFCvtt2n;
|
||||
UINT64 busFCvtn2t = 0;
|
||||
// UINT64 busFCvtn2t = 0;
|
||||
UINT64 busFrequency = 0;
|
||||
UINT64 cpuFrequency = 0;
|
||||
|
||||
@ -986,7 +986,7 @@ VOID GetCPUProperties (VOID)
|
||||
|
||||
busFrequency = DivU64((gCPUStructure.TSCFrequency * 2), ((currcoef * 2) + 1));
|
||||
busFCvtt2n = DivU64(((1 * Giga) << 32), busFrequency);
|
||||
busFCvtn2t = DivU64(0xFFFFFFFFFFFFFFFFULL, busFCvtt2n);
|
||||
// busFCvtn2t = DivU64(0xFFFFFFFFFFFFFFFFULL, busFCvtt2n);
|
||||
tscFCvtt2n = DivU64(busFCvtt2n * 2, (1 + (2 * currcoef)));
|
||||
cpuFrequency = DivU64(((1 * Giga) << 32), tscFCvtt2n);
|
||||
|
||||
@ -1006,7 +1006,7 @@ VOID GetCPUProperties (VOID)
|
||||
|
||||
busFrequency = DivU64(gCPUStructure.TSCFrequency, currcoef);
|
||||
busFCvtt2n = DivU64(((1 * Giga) << 32), busFrequency);
|
||||
busFCvtn2t = DivU64(0xFFFFFFFFFFFFFFFFULL, busFCvtt2n);
|
||||
// busFCvtn2t = DivU64(0xFFFFFFFFFFFFFFFFULL, busFCvtt2n);
|
||||
tscFCvtt2n = DivU64(busFCvtt2n, currcoef);
|
||||
cpuFrequency = DivU64(((1 * Giga) << 32), tscFCvtt2n);
|
||||
|
||||
|
@ -352,7 +352,7 @@ VOID devprop_free_string(DevPropString *StringBuf)
|
||||
BOOLEAN set_eth_props(pci_dt_t *eth_dev)
|
||||
{
|
||||
#if DEBUG_INJECT
|
||||
CHAR8 *devicepath;
|
||||
// CHAR8 *devicepath;
|
||||
#endif
|
||||
DevPropDevice *device = NULL;
|
||||
UINT8 builtin = 0x0;
|
||||
@ -368,7 +368,7 @@ BOOLEAN set_eth_props(pci_dt_t *eth_dev)
|
||||
device_inject_string = devprop_create_string();
|
||||
}
|
||||
#if DEBUG_INJECT
|
||||
devicepath = get_pci_dev_path(eth_dev);
|
||||
// devicepath = get_pci_dev_path(eth_dev);
|
||||
#endif
|
||||
if (eth_dev && !eth_dev->used) {
|
||||
device = devprop_add_device_pci(device_inject_string, eth_dev, NULL);
|
||||
@ -442,7 +442,7 @@ static UINT16 current_extra_high = 3200;
|
||||
BOOLEAN set_usb_props(pci_dt_t *usb_dev)
|
||||
{
|
||||
#if DEBUG_INJECT
|
||||
CHAR8 *devicepath;
|
||||
// CHAR8 *devicepath;
|
||||
#endif
|
||||
DevPropDevice *device = NULL;
|
||||
UINT32 fake_devid;
|
||||
@ -452,7 +452,7 @@ BOOLEAN set_usb_props(pci_dt_t *usb_dev)
|
||||
if (!device_inject_string)
|
||||
device_inject_string = devprop_create_string();
|
||||
#if DEBUG_INJECT
|
||||
devicepath = get_pci_dev_path(usb_dev);
|
||||
// devicepath = get_pci_dev_path(usb_dev);
|
||||
#endif
|
||||
|
||||
if (usb_dev && !usb_dev->used) {
|
||||
@ -463,9 +463,9 @@ BOOLEAN set_usb_props(pci_dt_t *usb_dev)
|
||||
if (!device) {
|
||||
return FALSE;
|
||||
}
|
||||
// -------------------------------------------------
|
||||
// -------------------------------------------------
|
||||
// DBG("USB Controller [%04X:%04X] :: %s\n", usb_dev->vendor_id, usb_dev->device_id, devicepath);
|
||||
// DBG("Setting dev.prop built-in=0x%X\n", builtin);
|
||||
// DBG("Setting dev.prop built-in=0x%X\n", builtin);
|
||||
|
||||
if (gSettings.NrAddProperties != 0xFFFE) {
|
||||
for (i = 0; i < gSettings.NrAddProperties; i++) {
|
||||
|
@ -915,7 +915,7 @@ const UINT8 KBELionReplaceEXT_X64[] = { 0xE8, 0x0C, 0xFD, 0xFF, 0xFF, 0x90, 0
|
||||
|
||||
VOID EFIAPI LOADER_ENTRY::KernelBooterExtensionsPatch()
|
||||
{
|
||||
UINTN Num = 0;
|
||||
// UINTN Num = 0;
|
||||
UINTN NumSnow_i386_EXT = 0;
|
||||
UINTN NumSnow_X64_EXT = 0;
|
||||
UINTN NumLion_i386_EXT = 0;
|
||||
@ -937,17 +937,17 @@ VOID EFIAPI LOADER_ENTRY::KernelBooterExtensionsPatch()
|
||||
// more then one pattern found - we do not know what to do with it
|
||||
// and we'll skipp it
|
||||
// DBG_RT("\nERROR patching kernel for injected kexts:\nmultiple patterns found (Snowi386: %llu, SnowX64: %llu, Lioni386: %llu, LionX64: %llu) - skipping patching!\n", NumSnow_i386_EXT, NumSnow_X64_EXT, NumLion_i386_EXT, NumLion_X64_EXT);
|
||||
Stall(10000000);
|
||||
// Stall(10000000);
|
||||
return;
|
||||
}
|
||||
|
||||
// X64
|
||||
if (is64BitKernel) {
|
||||
if (NumSnow_X64_EXT == 1) {
|
||||
Num = SearchAndReplace(KernelData, KERNEL_MAX_SIZE, KBESnowSearchEXT_X64, sizeof(KBESnowSearchEXT_X64), KBESnowReplaceEXT_X64, 1);
|
||||
/*Num=*/ SearchAndReplace(KernelData, KERNEL_MAX_SIZE, KBESnowSearchEXT_X64, sizeof(KBESnowSearchEXT_X64), KBESnowReplaceEXT_X64, 1);
|
||||
// DBG_RT("==> kernel Snow Leopard X64: %llu replaces done.\n", Num);
|
||||
} else if (NumLion_X64_EXT == 1) {
|
||||
Num = SearchAndReplace(KernelData, KERNEL_MAX_SIZE, KBELionSearchEXT_X64, sizeof(KBELionSearchEXT_X64), KBELionReplaceEXT_X64, 1);
|
||||
/*Num=*/ SearchAndReplace(KernelData, KERNEL_MAX_SIZE, KBELionSearchEXT_X64, sizeof(KBELionSearchEXT_X64), KBELionReplaceEXT_X64, 1);
|
||||
// DBG_RT("==> kernel Lion X64: %llu replaces done.\n", Num);
|
||||
} else {
|
||||
// EXT - load extra kexts besides kernelcache.
|
||||
@ -1192,10 +1192,10 @@ VOID EFIAPI LOADER_ENTRY::KernelBooterExtensionsPatch()
|
||||
} else {
|
||||
// i386
|
||||
if (NumSnow_i386_EXT == 1) {
|
||||
Num = SearchAndReplace(KernelData, KERNEL_MAX_SIZE, KBESnowSearchEXT_i386, sizeof(KBESnowSearchEXT_i386), KBESnowReplaceEXT_i386, 1);
|
||||
/*Num=*/ SearchAndReplace(KernelData, KERNEL_MAX_SIZE, KBESnowSearchEXT_i386, sizeof(KBESnowSearchEXT_i386), KBESnowReplaceEXT_i386, 1);
|
||||
// DBG_RT("==> kernel Snow Leopard i386: %llu replaces done.\n", Num);
|
||||
} else if (NumLion_i386_EXT == 1) {
|
||||
Num = SearchAndReplace(KernelData, KERNEL_MAX_SIZE, KBELionSearchEXT_i386, sizeof(KBELionSearchEXT_i386), KBELionReplaceEXT_i386, 1);
|
||||
/*Num=*/ SearchAndReplace(KernelData, KERNEL_MAX_SIZE, KBELionSearchEXT_i386, sizeof(KBELionSearchEXT_i386), KBELionReplaceEXT_i386, 1);
|
||||
// DBG_RT("==> kernel Lion i386: %llu replaces done.\n", Num);
|
||||
} else {
|
||||
DBG_RT("==> ERROR: NOT patched - unknown kernel.\n");
|
||||
|
@ -61,7 +61,7 @@ XMLDecode (
|
||||
);
|
||||
|
||||
EFI_STATUS
|
||||
ParseXML (
|
||||
ParseXML(
|
||||
CONST CHAR8 *buffer,
|
||||
TagPtr *dict,
|
||||
UINT32 bufSize
|
||||
|
@ -1114,15 +1114,13 @@ VOID PatchTableType11()
|
||||
return;
|
||||
}
|
||||
|
||||
//some unused but interesting tables. Just log as is
|
||||
#define NUM_OTHER_TYPES 14
|
||||
const UINT8 tableTypes[] = {8, 10, 13, 18, 21, 22, 27, 28, 32, 33, 41, 129, 217, 219};
|
||||
|
||||
VOID PatchTableTypeSome()
|
||||
{
|
||||
//some unused but interesting tables. Just log as is
|
||||
#define NUM_OTHER_TYPES 14
|
||||
UINT8 tableTypes[NUM_OTHER_TYPES] = {8, 10, 13, 18, 21, 22, 27, 28, 32, 33, 41, 129, 217, 219};
|
||||
UINTN IndexType;
|
||||
//
|
||||
// Different types
|
||||
for (IndexType = 0; IndexType < NUM_OTHER_TYPES; IndexType++) {
|
||||
for (UINTN IndexType = 0; IndexType < sizeof(tableTypes); IndexType++) {
|
||||
for (Index = 0; Index < 32; Index++) {
|
||||
SmbiosTable = GetSmbiosTableFromType(EntryPoint, tableTypes[IndexType], Index);
|
||||
if (SmbiosTable.Raw == NULL) {
|
||||
@ -1188,7 +1186,6 @@ VOID GetTableType17()
|
||||
{
|
||||
// Memory Device
|
||||
//
|
||||
INTN Index2;
|
||||
BOOLEAN Found;
|
||||
|
||||
// Get Table Type17 and count Size
|
||||
@ -1209,7 +1206,7 @@ VOID GetTableType17()
|
||||
// to just skip all entries that have an error - apianti
|
||||
// will try
|
||||
Found = FALSE;
|
||||
for (Index2 = 0; Index2 < 24; Index2++) {
|
||||
for (INTN Index2 = 0; Index2 < 24; Index2++) {
|
||||
newSmbiosTable = GetSmbiosTableFromType (EntryPoint, EFI_SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION, Index2);
|
||||
if (newSmbiosTable.Raw == NULL) {
|
||||
continue;
|
||||
@ -2115,7 +2112,7 @@ VOID FinalizeSmbios() //continue
|
||||
EFI_PEI_HOB_POINTERS HobStart;
|
||||
EFI_PHYSICAL_ADDRESS *Table = NULL;
|
||||
//UINTN TableLength = 0;
|
||||
BOOLEAN FoundTable3 = FALSE;
|
||||
// BOOLEAN FoundTable3 = FALSE;
|
||||
|
||||
// Get Hob List
|
||||
HobStart.Raw = (__typeof_am__(HobStart.Raw))GetHobList();
|
||||
@ -2129,7 +2126,7 @@ VOID FinalizeSmbios() //continue
|
||||
//TableLength = GET_GUID_HOB_DATA_SIZE (GuidHob);
|
||||
if (Table != NULL) {
|
||||
if (Index != 0) {
|
||||
FoundTable3 = TRUE;
|
||||
// FoundTable3 = TRUE; //don't know how to use it. Real Mac have table3 in the format of table2
|
||||
DBG("Found SMBIOS3 Table\n");
|
||||
}
|
||||
break;
|
||||
|
@ -395,8 +395,8 @@ UINT16 getDDRspeedMhz(UINT8 * spd)
|
||||
{
|
||||
UINT16 frequency = 0; // default freq for unknown types //shit! DDR1 = 533
|
||||
UINT16 xmpFrequency1 = 0, xmpFrequency2 = 0;
|
||||
UINT8 xmpVersion = 0;
|
||||
UINT8 xmpProfiles = 0;
|
||||
UINT8 xmpVersion = 0;
|
||||
UINT8 xmpProfiles = 0;
|
||||
|
||||
if (spd[SPD_MEMORY_TYPE] == SPD_MEMORY_TYPE_SDRAM_DDR4) {
|
||||
UINT16 mincycle = spd[18];
|
||||
@ -475,7 +475,7 @@ UINT16 getDDRspeedMhz(UINT8 * spd)
|
||||
}
|
||||
|
||||
if (xmpProfiles) {
|
||||
DBG("Found module with XMP version %d.%d\n", (xmpVersion >> 4) & 0xF, xmpVersion & 0xF);
|
||||
MsgLog("Found module with XMP version %d.%d\n", (xmpVersion >> 4) & 0xF, xmpVersion & 0xF);
|
||||
|
||||
switch (gSettings.XMPDetection) {
|
||||
case 0:
|
||||
|
@ -205,7 +205,7 @@ FixOwnership(VOID)
|
||||
usbcmd = *((UINT32*)(UINTN)(opaddr)); // Command Register
|
||||
usbsts = *((UINT32*)(UINTN)(opaddr + 4)); // Status Register
|
||||
usbintr = *((UINT32*)(UINTN)(opaddr + 8)); // Interrupt Enable Register
|
||||
DBG("usbcmd=%08X usbsts=%08X usbintr=%08X\n", usbcmd, usbsts, usbintr);
|
||||
MsgLog("usbcmd=%08X usbsts=%08X usbintr=%08X\n", usbcmd, usbsts, usbintr);
|
||||
|
||||
// read 32bit USBLEGSUP (eecp+0)
|
||||
PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, ExtendCap, 1, &usblegsup);
|
||||
|
@ -163,10 +163,10 @@ void XObjArrayNC<TYPE>::Init()
|
||||
_Len = 0;
|
||||
// THis was useful for realtime debugging with a debugger that do not recognise references.
|
||||
// #ifdef _DEBUG_iufasdfsfk
|
||||
{
|
||||
const TYPE *tmp;
|
||||
tmp = DbgAt(0);
|
||||
}
|
||||
// {
|
||||
// const TYPE *tmp;
|
||||
// tmp = DbgAt(0);
|
||||
// }
|
||||
// #endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user