From d6dce385777ec3fa9cb7700fc7b0f4131072142c Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Tue, 15 Mar 2022 22:21:32 +0300 Subject: [PATCH 01/10] sync subproject Signed-off-by: SergeySlice --- OpenCorePkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenCorePkg b/OpenCorePkg index c5925d54c5..9986fac808 160000 --- a/OpenCorePkg +++ b/OpenCorePkg @@ -1 +1 @@ -Subproject commit c5925d54c5eb7057c3d4f4cd015e95a37091ff91 +Subproject commit 9986fac808929b06af6db8888aab08cf34946871 From 9f24acb5d9f0bc44c43c68755b1adf8cfab790f7 Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Fri, 18 Mar 2022 19:11:55 +0300 Subject: [PATCH 02/10] exclude unused-but-set variable Signed-off-by: SergeySlice --- CloverPackage/package/po/clover.pot | 4 ++-- Library/MemLogLibDefault/printf_lite.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CloverPackage/package/po/clover.pot b/CloverPackage/package/po/clover.pot index 5c492bce0e..d5feb0fff4 100644 --- a/CloverPackage/package/po/clover.pot +++ b/CloverPackage/package/po/clover.pot @@ -6,8 +6,8 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Clover r5142\n" -"POT-Creation-Date: 2021-11-02 19:01+0300\n" +"Project-Id-Version: Clover r5145\n" +"POT-Creation-Date: 2022-03-16 19:08+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/Library/MemLogLibDefault/printf_lite.c b/Library/MemLogLibDefault/printf_lite.c index fbe66ba366..e217b08722 100644 --- a/Library/MemLogLibDefault/printf_lite.c +++ b/Library/MemLogLibDefault/printf_lite.c @@ -512,7 +512,7 @@ __attribute__((noinline, section(".printf_lite"))) #endif static void print_ulonglong(UINT_BIGGEST_TYPE v, unsigned int base, PrintfParams* printfParams, int printfSign) { - int n = 0; + // int n = 0; unsigned INT_BIGGEST_TYPE d = 1; #if PRINTF_LITE_FIELDWIDTH_SUPPORT == 1 int nbDigits = 1 + printfSign; @@ -550,7 +550,7 @@ static void print_ulonglong(UINT_BIGGEST_TYPE v, unsigned int base, PrintfParams #else print_char_macro( (char)(dgt + '0'), printfParams); #endif - n += 1; +// n += 1; } } From 66ff2d04a0bcd641160ac17199605474f980802b Mon Sep 17 00:00:00 2001 From: chris1111 Date: Fri, 18 Mar 2022 13:12:33 -0400 Subject: [PATCH 03/10] CloverPrefpane and CloverUpdater is not build --- CloverPackage/makeiso | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CloverPackage/makeiso b/CloverPackage/makeiso index a37894de07..5f7136334a 100755 --- a/CloverPackage/makeiso +++ b/CloverPackage/makeiso @@ -77,13 +77,13 @@ mkdir -p ${IMGROOT}/usr/bin echo "[MKDIR] ${IMGROOT}/usr/local/bin" mkdir -p "${IMGROOT}"/usr/local/bin cp -p "${SYMROOT}"/utils/* "${IMGROOT}"/usr/local/bin -echo "[MKDIR] ${IMGROOT}/Library/Application Support/Clover" -mkdir -p "${IMGROOT}/Library/Application Support/Clover" -cp -p "${SRCROOT}"/CloverUpdater/CloverUpdaterUtility "${IMGROOT}/Library/Application Support/Clover/" -cp -pr "${SRCROOT}"/CloverUpdater/build/CloverUpdater.app "${IMGROOT}/Library/Application Support/Clover/" -echo "[MKDIR] ${IMGROOT}/Library/PreferencePanes" -mkdir -p "${IMGROOT}/Library/PreferencePanes" -cp -pr "${SRCROOT}"/CloverPrefpane/Build/Clover.prefPane "${IMGROOT}/Library/PreferencePanes/" +#echo "[MKDIR] ${IMGROOT}/Library/Application Support/Clover" +#mkdir -p "${IMGROOT}/Library/Application Support/Clover" +#cp -p "${SRCROOT}"/CloverUpdater/CloverUpdaterUtility "${IMGROOT}/Library/Application Support/Clover/" +#cp -pr "${SRCROOT}"/CloverUpdater/build/CloverUpdater.app "${IMGROOT}/Library/Application Support/Clover/" +#echo "[MKDIR] ${IMGROOT}/Library/PreferencePanes" +#mkdir -p "${IMGROOT}/Library/PreferencePanes" +#cp -pr "${SRCROOT}"/CloverPrefpane/Build/Clover.prefPane "${IMGROOT}/Library/PreferencePanes/" echo "[CP] cdboot" cp -f ${SYMROOT}/i386/cdboot ${CDBOOT} echo "[CP] $THEME" From 89658955fb83d2c134407f7360de8786632ced18 Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Sat, 19 Mar 2022 13:26:00 +0300 Subject: [PATCH 04/10] correct ATI injection Signed-off-by: SergeySlice --- rEFIt_UEFI/Platform/ati.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/rEFIt_UEFI/Platform/ati.cpp b/rEFIt_UEFI/Platform/ati.cpp index 46dd86d2a7..354e04fa9e 100644 --- a/rEFIt_UEFI/Platform/ati.cpp +++ b/rEFIt_UEFI/Platform/ati.cpp @@ -1287,7 +1287,7 @@ AtiDevProp ati_devprop_list[] = { // {FLAGTRUE, false, "ATY,MCLK", get_mclk_val, NULVAL }, // {FLAGTRUE, false, "ATY,SCLK", get_sclk_val, NULVAL }, - {FLAGTRUE, false, "ATY,RefCLK", get_refclk_val, DWRVAL(0x0a8c) }, + //{FLAGTRUE, false, "ATY,RefCLK", get_refclk_val, DWRVAL(0x0a8c) }, {FLAGTRUE, false, "ATY,PlatformInfo", get_platforminfo_val, NULVAL }, {FLAGOLD, false, "compatible", get_name_pci_val, NULVAL }, @@ -1312,7 +1312,7 @@ XBool get_bootdisplay_val(value_t *val, INTN index, XBool Sier) v = 1; val->type = kCst; val->size = 4; - val->data = (__typeof__(val->data))AllocatePool(4); + val->data = (__typeof__(val->data))AllocateZeroPool(4); *(val->data) = (UINT8)v; return true; } @@ -1334,7 +1334,7 @@ XBool get_dual_link_val(value_t *val, INTN index, XBool Sier) val->type = kCst; val->size = 4; - val->data = (__typeof__(val->data))AllocatePool(4); + val->data = (__typeof__(val->data))AllocateZeroPool(4); *(val->data) = (UINT8)v; return true; } @@ -1415,6 +1415,8 @@ XBool get_name_pci_val(value_t *val, INTN index, XBool Sier) return true; } +const char AMDRadeon[] = "AMD Radeon %s"; + XBool get_model_val(value_t *val, INTN index, XBool Sier) { CHAR8 *ModelName = (__typeof__(ModelName))AllocateZeroPool(35); @@ -1428,25 +1430,25 @@ XBool get_model_val(value_t *val, INTN index, XBool Sier) } else { switch (card->pci_dev->revision) { case 0xC4: - snprintf(ModelName, 35, "AMD Radeon %s", "Pro 550"); + snprintf(ModelName, 35, AMDRadeon, "Pro 550"); break; case 0xC7: - snprintf(ModelName, 35, "AMD Radeon %s", "RX 480"); + snprintf(ModelName, 35, AMDRadeon, "RX 480"); break; case 0xC5: case 0xCF: case 0xD7: case 0xE0: - snprintf(ModelName, 35, "AMD Radeon %s", "RX 470"); + snprintf(ModelName, 35, AMDRadeon, "RX 470"); break; case 0xC2: case 0xC6: case 0xEF: - snprintf(ModelName, 35, "AMD Radeon %s", "RX 570"); + snprintf(ModelName, 35, AMDRadeon, "RX 570"); break; default: - snprintf(ModelName, 35, "AMD Radeon %s", "RX 580"); + snprintf(ModelName, 35, AMDRadeon, "RX 580"); break; } val->size = (UINT32)AsciiStrLen(ModelName); @@ -1529,7 +1531,7 @@ XBool get_binimage_owr(value_t *val, INTN index, XBool Sier) } val->type = kCst; val->size = 4; - val->data = (__typeof__(val->data))AllocatePool(4); + val->data = (__typeof__(val->data))AllocateZeroPool(4); *(val->data) = 1; return true; } @@ -1944,7 +1946,7 @@ XBool radeon_card_posted(void) { UINTN reg; // ati_chip_family_t chip_family = card->info->chip_family; -#if 1 +#if 0 //dump radeon registers after BIOS POST reg = (UINTN)REG32(card->mmio, RADEON_BIOS_0_SCRATCH); // DBG("BIOS_0_SCRATCH=0x%08llX, ", reg); From 8221a911a2390771396ff679743df044cef8e6ac Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Sat, 19 Mar 2022 16:48:22 +0300 Subject: [PATCH 05/10] define new framebuffers Signed-off-by: SergeySlice --- rEFIt_UEFI/Platform/ati.cpp | 12 +- rEFIt_UEFI/Platform/ati.h | 6 + rEFIt_UEFI/Platform/ati2.h | 321 ------------------------------------ 3 files changed, 15 insertions(+), 324 deletions(-) delete mode 100644 rEFIt_UEFI/Platform/ati2.h diff --git a/rEFIt_UEFI/Platform/ati.cpp b/rEFIt_UEFI/Platform/ati.cpp index 354e04fa9e..411b45b0d0 100644 --- a/rEFIt_UEFI/Platform/ati.cpp +++ b/rEFIt_UEFI/Platform/ati.cpp @@ -142,6 +142,12 @@ const card_config_t card_configs[] = { {"Elqui", 5}, {"Caroni", 5}, {"Florin", 6}, + {"Python", 3}, + {"Adder", 3}, + {"Henbury",3}, + {"Belknap",3}, + {"Carswell",3}, + {"Radeon",4}, }; @@ -320,7 +326,7 @@ const radeon_card_info_t radeon_cards[] = { { 0x67CA, CHIP_FAMILY_ELLESMERE, "AMD Radeon Polaris 10", kNull }, { 0x67CC, CHIP_FAMILY_ELLESMERE, "AMD Radeon Polaris 10", kNull }, { 0x67CF, CHIP_FAMILY_ELLESMERE, "AMD Radeon Polaris 10", kNull }, - { 0x67DF, CHIP_FAMILY_ELLESMERE, "AMD Radeon RX 480/570/580", kBaladi }, + { 0x67DF, CHIP_FAMILY_ELLESMERE, "AMD Radeon RX 480/570/580", kOrinoco }, // Polaris 11 { 0x67E0, CHIP_FAMILY_BAFFIN, "AMD Radeon RX 460", kAcre }, @@ -330,8 +336,8 @@ const radeon_card_info_t radeon_cards[] = { { 0x67E8, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, { 0x67E9, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, { 0x67EB, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, - { 0x67EF, CHIP_FAMILY_BAFFIN, "AMD Radeon Pro 555", kAcre }, //fb=Caroni in 10.13.6 - { 0x67FF, CHIP_FAMILY_BAFFIN, "AMD Radeon RX 560", kNull }, + { 0x67EF, CHIP_FAMILY_BAFFIN, "AMD Radeon Pro 555", kAcre }, //fb=Caroni in 10.13.6 + { 0x67FF, CHIP_FAMILY_BAFFIN, "AMD Radeon RX 560", kNull }, // PITCAIRN { 0x6800, CHIP_FAMILY_PITCAIRN, "AMD Radeon HD 7970M", kBuri }, // Mobile diff --git a/rEFIt_UEFI/Platform/ati.h b/rEFIt_UEFI/Platform/ati.h index 85a2b96491..98250e5d43 100644 --- a/rEFIt_UEFI/Platform/ati.h +++ b/rEFIt_UEFI/Platform/ati.h @@ -220,8 +220,14 @@ typedef enum { kElqui, kCaroni, kFlorin, + kPython, + kAdder, + kHenbury, + kBelknap, + kCarswell, kRadeon, // this is absent FB if not set kCfgEnd + } config_name_t; typedef struct { diff --git a/rEFIt_UEFI/Platform/ati2.h b/rEFIt_UEFI/Platform/ati2.h deleted file mode 100644 index 07fb000595..0000000000 --- a/rEFIt_UEFI/Platform/ati2.h +++ /dev/null @@ -1,321 +0,0 @@ -/* - * ati.h - * - * Created by Slice on 19.02.12. - * - * the code ported from Chameleon project as well as from RadeonFB by Joblo and RadeonHD by dong - * big thank to Islam M. Ahmed Zaid for the updating the collection - */ - -#include "../include/Pci.h" -#include "device_inject.h" -class LOADER_ENTRY; - -#define OFFSET_TO_GET_ATOMBIOS_STRINGS_START 0x6e -#define DATVAL(x) {kPtr, sizeof(x), (UINT8 *)x} -#define STRVAL(x) {kStr, sizeof(x)-1, (UINT8 *)x} -#define BYTVAL(x) {kCst, 1, (UINT8 *)(UINTN)x} -#define WRDVAL(x) {kCst, 2, (UINT8 *)(UINTN)x} -#define DWRVAL(x) {kCst, 4, (UINT8 *)(UINTN)x} -// QWRVAL would work only in 64 bit -//#define QWRVAL(x) {kCst, 8, (UINT8 *)(UINTN)x} -#define NULVAL {kNul, 0, (UINT8 *)NULL} - - -/*Typedefs ENUMS*/ -typedef enum { - kNul, - kStr, - kPtr, - kCst -} type_t; - -typedef enum { - CHIP_FAMILY_UNKNOW, - /* Old */ - CHIP_FAMILY_R420, - CHIP_FAMILY_R423, - CHIP_FAMILY_RV410, - CHIP_FAMILY_RV515, - CHIP_FAMILY_R520, - CHIP_FAMILY_RV530, - CHIP_FAMILY_RV560, - CHIP_FAMILY_RV570, - CHIP_FAMILY_R580, - /* IGP */ - CHIP_FAMILY_RS600, - CHIP_FAMILY_RS690, - CHIP_FAMILY_RS740, - CHIP_FAMILY_RS780, - CHIP_FAMILY_RS880, - /* R600 */ - CHIP_FAMILY_R600, - CHIP_FAMILY_RV610, - CHIP_FAMILY_RV620, - CHIP_FAMILY_RV630, - CHIP_FAMILY_RV635, - CHIP_FAMILY_RV670, - /* R700 */ - CHIP_FAMILY_RV710, - CHIP_FAMILY_RV730, - CHIP_FAMILY_RV740, - CHIP_FAMILY_RV770, - CHIP_FAMILY_RV772, - CHIP_FAMILY_RV790, - /* Evergreen */ - CHIP_FAMILY_CEDAR, - CHIP_FAMILY_CYPRESS, - CHIP_FAMILY_HEMLOCK, - CHIP_FAMILY_JUNIPER, - CHIP_FAMILY_REDWOOD, - /* Northern Islands */ - CHIP_FAMILY_BARTS, - CHIP_FAMILY_CAICOS, - CHIP_FAMILY_CAYMAN, - CHIP_FAMILY_TURKS, - /* Southern Islands */ - CHIP_FAMILY_PALM, - CHIP_FAMILY_SUMO, - CHIP_FAMILY_SUMO2, - CHIP_FAMILY_ARUBA, - CHIP_FAMILY_TAHITI, - CHIP_FAMILY_PITCAIRN, - CHIP_FAMILY_VERDE, - CHIP_FAMILY_OLAND, - /* Sea Islands */ - CHIP_FAMILY_HAINAN, - CHIP_FAMILY_BONAIRE, - CHIP_FAMILY_KAVERI, - CHIP_FAMILY_KABINI, - CHIP_FAMILY_HAWAII, - CHIP_FAMILY_MULLINS, - /* Volcanic Islands */ - CHIP_FAMILY_TOPAZ, - CHIP_FAMILY_AMETHYST, - CHIP_FAMILY_TONGA, - CHIP_FAMILY_FIJI, - CHIP_FAMILY_CARRIZO, - CHIP_FAMILY_TOBAGO, - CHIP_FAMILY_ELLESMERE, /* Polaris 10 */ - CHIP_FAMILY_BAFFIN, /* Polaris 11 */ - CHIP_FAMILY_GREENLAND, /* Polaris 12 */ - CHIP_FAMILY_VEGA10, /* Vega 10 */ - CHIP_FAMILY_VEGA20, /* Vega 20 */ - CHIP_FAMILY_NAVI10, - CHIP_FAMILY_LAST -} ati_chip_family_t; - -typedef struct { - const CHAR8 *name; - UINT8 ports; -} card_config_t; - -typedef enum { - kNull, - /* OLDController */ - kWormy, - kAlopias, - kCaretta, - kKakapo, - kKipunji, - kPeregrine, - kRaven, - kSphyrna, - /* AMD2400Controller */ - kIago, - /* AMD2600Controller */ - kHypoprion, - kLamna, - /* AMD3800Controller */ - kMegalodon, - kTriakis, - /* AMD4600Controller */ - kFlicker, - kGliff, - kShrike, - /* AMD4800Controller */ - kCardinal, - kMotmot, - kQuail, - /* AMD5000Controller */ - kDouc, - kLangur, - kUakari, - kZonalis, - kAlouatta, - kHoolock, - kVervet, - kBaboon, - kEulemur, - kGalago, - kColobus, - kMangabey, - kNomascus, - kOrangutan, - /* AMD6000Controller */ - kPithecia, - kBulrushes, - kCattail, - kHydrilla, - kDuckweed, - kFanwort, - kElodea, - kKudzu, - kGibba, - kLotus, - kIpomoea, - kMuskgrass, - kJuncus, - kOsmunda, - kPondweed, - kSpikerush, - kTypha, - /* AMD7000Controller */ - kRamen, - kTako, - kNamako, - kAji, - kBuri, - kChutoro, - kDashimaki, - kEbi, - kGari, - kFutomaki, - kHamachi, - kOPM, - kIkura, - kIkuraS, - kJunsai, - kKani, - kKaniS, - kDashimakiS, - kMaguro, - kMaguroS, - /* AMD8000Controller */ - kExmoor, - kBaladi, - /* AMD9000Controller */ - kMalteseS, - kLagotto, - kGreyhoundS, - kMaltese, - kBasset, - kGreyhound, - kLabrador, - /* AMD9300Controller */ - kFleuveSWIP, - /* AMD9500Controller */ - kAcre, - kDayman, - kGuariba, - kHuallaga, - kOrinoco, - /* AMD9510Controller*/ - kBerbice, - /* AMD9515Controller */ - kMazaruni, - kLongavi, - /* AMD9520Controller */ - kElqui, - kCaroni, - kFlorin, - kRadeon, // this is absent FB if not set - kCfgEnd -} config_name_t; - -typedef struct { - UINT16 device_id; - // UINT32 subsys_id; - ati_chip_family_t chip_family; - const CHAR8 *model_name; - config_name_t cfg_name; -} radeon_card_info_t; - -typedef struct { - DevPropDevice *device; - radeon_card_info_t *info; - pci_dt_t *pci_dev; - UINT8 *fb; - UINT8 *mmio; - UINT8 *io; - UINT8 *rom; - UINT32 rom_size; - UINT64 vram_size; - const CHAR8 *cfg_name; - UINT8 ports; - UINT32 flags; - BOOLEAN posted; -} card_t; - -// Chip flags -/* enum radeon_chip_flags { - RADEON_FAMILY_MASK = 0x0000ffffUL, - RADEON_FLAGS_MASK = 0xffff0000UL, - RADEON_IS_MOBILITY = 0x00010000UL, - RADEON_IS_IGP = 0x00020000UL, - RADEON_SINGLE_CRTC = 0x00040000UL, - RADEON_IS_AGP = 0x00080000UL, - RADEON_HAS_HIERZ = 0x00100000UL, - RADEON_IS_PCIE = 0x00200000UL, - RADEON_NEW_MEMMAP = 0x00400000UL, - RADEON_IS_PCI = 0x00800000UL, - RADEON_IS_IGPGART = 0x01000000UL, - };*/ -#define MKFLAG(n) (1 << n) -#define FLAGTRUE MKFLAG(0) -#define EVERGREEN MKFLAG(1) -#define FLAGMOBILE MKFLAG(2) -#define FLAGOLD MKFLAG(3) -#define FLAGNOTFAKE MKFLAG(4) -#define FLAGDYNAMIC MKFLAG(5) - -typedef struct { - type_t type; - UINT32 size; - UINT8 *data; -} value_t; - -typedef struct { - UINT32 flags; - BOOLEAN all_ports; - CONST CHAR8 *name; - BOOLEAN (*get_value)(value_t *val, INTN index, BOOLEAN Sier); - value_t default_val; -} AtiDevProp; - -BOOLEAN get_bootdisplay_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_vrammemory_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_edid_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_display_type(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_name_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_nameparent_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_model_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_conntype_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_vrammemsize_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_binimage_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_binimage_owr(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_romrevision_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_deviceid_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_mclk_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_sclk_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_refclk_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_platforminfo_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_vramtotalsize_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_dual_link_val(value_t *val, INTN index, BOOLEAN Sier); -BOOLEAN get_name_pci_val(value_t *val, INTN index, BOOLEAN Sier); - -// Constants. Can be defined even if DONT_DEFINE_GLOBALS -extern const radeon_card_info_t radeon_cards[]; -extern const card_config_t card_configs[]; - -#ifndef DONT_DEFINE_GLOBALS -extern AtiDevProp ati_devprop_list[]; -extern const CHAR8 *chip_family_name[]; -#endif - -BOOLEAN -setup_ati_devprop ( - LOADER_ENTRY *Entry, - pci_dt_t *ati_dev - ); - From a8d0208452766388a19729589220a7e7a2f0333f Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Mon, 21 Mar 2022 21:20:39 +0300 Subject: [PATCH 06/10] join same devices Signed-off-by: SergeySlice --- rEFIt_UEFI/Platform/Injectors.cpp | 2 +- rEFIt_UEFI/Platform/Settings.cpp | 2 ++ rEFIt_UEFI/Platform/ati.cpp | 5 ++-- rEFIt_UEFI/Platform/device_inject.cpp | 36 ++++++++++++++++++++------- rEFIt_UEFI/Platform/device_inject.h | 1 - 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/rEFIt_UEFI/Platform/Injectors.cpp b/rEFIt_UEFI/Platform/Injectors.cpp index 575ccf50ea..931b760380 100644 --- a/rEFIt_UEFI/Platform/Injectors.cpp +++ b/rEFIt_UEFI/Platform/Injectors.cpp @@ -44,7 +44,7 @@ UINT8* mProperties = NULL; CHAR8* gDeviceProperties = NULL; UINT32 cPropSize = 0; -UINT8* cProperties = NULL; +UINT8* cProperties = NULL; //this is properties as string CHAR8* BootOSName = NULL; UINT16 KeyboardVendor = 0x05ac; //Apple inc. diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index a42e18fadf..ec5b2ae4f8 100755 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -967,6 +967,7 @@ SetDevices (LOADER_ENTRY *Entry) MsgLog("Properties with Label=%ls ignored because getDevicePath() return NULL\n", Prop.DevicePathAsString.wc_str()); continue; } + device = devprop_add_device_pci(device_inject_string, NULL, DevicePath); DBG("add device: %ls\n", Prop.DevicePathAsString.wc_str()); for ( size_t jdx = 0 ; jdx < Prop.propertiesArray.size() ; ++jdx ) { @@ -1799,6 +1800,7 @@ SetDevices (LOADER_ENTRY *Entry) // StringDirty = false; //------- mPropSize = (UINT32)hex2bin(newDeviceProperties, mProperties, EFI_PAGES_TO_SIZE(nbPages)); // cast should be safe as hex2bin return <= MAXUINT32 + // gDeviceProperties is not used gDeviceProperties = newDeviceProperties.forgetDataWithoutFreeing(); // do this AFTER hex2bin // DBG("Final size of mProperties=%d\n", mPropSize); //--------- diff --git a/rEFIt_UEFI/Platform/ati.cpp b/rEFIt_UEFI/Platform/ati.cpp index 411b45b0d0..988e563bb3 100644 --- a/rEFIt_UEFI/Platform/ati.cpp +++ b/rEFIt_UEFI/Platform/ati.cpp @@ -331,7 +331,7 @@ const radeon_card_info_t radeon_cards[] = { // Polaris 11 { 0x67E0, CHIP_FAMILY_BAFFIN, "AMD Radeon RX 460", kAcre }, { 0x67E1, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, - { 0x67E3, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, + { 0x67E3, CHIP_FAMILY_BAFFIN, "AMD Radeon Pro WX4100", kNull }, { 0x67E7, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, { 0x67E8, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, { 0x67E9, CHIP_FAMILY_BAFFIN, "AMD Radeon Polaris 11", kNull }, @@ -510,6 +510,8 @@ const radeon_card_info_t radeon_cards[] = { { 0x7300, CHIP_FAMILY_FIJI, "AMD Radeon R9 Fury", kNull }, // Navi10 { 0x731F, CHIP_FAMILY_NAVI10, "AMD Radeon RX5700", kNull }, + // Navi15 + { 0x7340, CHIP_FAMILY_NAVI10, "AMD Radeon RX5500", kNull }, // Navi21 { 0x73BF, CHIP_FAMILY_NAVI20, "AMD Radeon RX6800XT", kNull }, /* @@ -2241,7 +2243,6 @@ XBool setup_ati_devprop(LOADER_ENTRY *Entry, pci_dt_t *ati_dev) } } - DBG("ATI %s %s %dMB (%s) [%04hX:%04hX] (subsys [%04hX:%04hX]):: %s\n", chip_family_name[card->info->chip_family], card->info->model_name, (UINT32)RShiftU64(card->vram_size, 20), card->cfg_name, diff --git a/rEFIt_UEFI/Platform/device_inject.cpp b/rEFIt_UEFI/Platform/device_inject.cpp index 5339c9b617..abfe046ef1 100644 --- a/rEFIt_UEFI/Platform/device_inject.cpp +++ b/rEFIt_UEFI/Platform/device_inject.cpp @@ -4,7 +4,7 @@ * * Cleaned and merged by iNDi */ -// UEFI adaptation by usr-sse2, then slice, dmazar +// UEFI adaptation by usr-sse2, then slice, dmazar, jief @@ -133,7 +133,7 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt, } if (!DevicePath && (PciDt != 0)) { - DevicePath = DevicePathFromHandle(PciDt->DeviceHandle); + DevicePath = DevicePathFromHandle(PciDt->DeviceHandle); } // DBG("devprop_add_device_pci %ls ", DevicePathToStr(DevicePath)); if (!DevicePath) @@ -280,19 +280,30 @@ XBool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer return devprop_add_value(device, nm.data(), vl.data(), vl.size()); } +bool SameDevice(DevPropDevice* D1, DevPropDevice* D2) +{ + if (D1->num_pci_devpaths != D2->num_pci_devpaths) return false; + for (UINT32 x=0; x < D1->num_pci_devpaths; x++) { + if (D1->pci_dev_path[x].function != D2->pci_dev_path[x].function) return false; + if (D1->pci_dev_path[x].device != D2->pci_dev_path[x].device) return false; + } + return true; +} + XBuffer devprop_generate_string(DevPropString *StringBuf) { UINTN len = StringBuf->length * 2; - INT32 i = 0; - UINT32 x = 0; + XBuffer buffer; buffer.dataSized(len+1); // DBG("devprop_generate_string\n"); + //TODO здесь нужно сделать join одинаковых устройств StringBuf->entries[i] по признаку ->pci_dev_path[x] (отдельный опретаор сравнения) buffer.S8Catf("%08X%08X%04hX%04hX", SwapBytes32(StringBuf->length), StringBuf->WHAT2, SwapBytes16(StringBuf->numentries), StringBuf->WHAT3); - while(i < StringBuf->numentries) { + for (int i = 0; i < StringBuf->numentries; i++) { UINT8 *dataptr = StringBuf->entries[i]->data; + if (!dataptr) continue; buffer.S8Catf("%08X%04hX%04hX", SwapBytes32(StringBuf->entries[i]->length), SwapBytes16(StringBuf->entries[i]->numentries), StringBuf->entries[i]->WHAT2); //FIXME: wrong buffer sizes! @@ -302,8 +313,8 @@ XBuffer devprop_generate_string(DevPropString *StringBuf) SwapBytes32(StringBuf->entries[i]->acpi_dev_path._HID), SwapBytes32(StringBuf->entries[i]->acpi_dev_path._UID)); - for(x = 0; x < StringBuf->entries[i]->num_pci_devpaths; x++) { - buffer.S8Catf("%02hhX%02hhX%04hX%02hhX%02hhX", StringBuf->entries[i]->pci_dev_path[x].type, + for(int x = 0; x < StringBuf->entries[i]->num_pci_devpaths; x++) { + buffer.S8Catf("%02hhX%02hhX%04hX%02hhX%02hhX", StringBuf->entries[i]->pci_dev_path[x].type, StringBuf->entries[i]->pci_dev_path[x].subtype, SwapBytes16(StringBuf->entries[i]->pci_dev_path[x].length), StringBuf->entries[i]->pci_dev_path[x].function, @@ -314,10 +325,17 @@ XBuffer devprop_generate_string(DevPropString *StringBuf) StringBuf->entries[i]->path_end.subtype, SwapBytes16(StringBuf->entries[i]->path_end.length)); - for(x = 0; x < (StringBuf->entries[i]->length) - (24 + (6 * StringBuf->entries[i]->num_pci_devpaths)); x++) { + for(UINT32 x = 0; x < (StringBuf->entries[i]->length) - (24 + (6 * StringBuf->entries[i]->num_pci_devpaths)); x++) { buffer.S8Catf("%02hhX", *dataptr++); } - i++; + //try to find same devices + for (int j=i+1; j < StringBuf->numentries; j++) { + if (!SameDevice(StringBuf->entries[i], StringBuf->entries[j])) continue; + for (UINT32 x = 0; x < (StringBuf->entries[j]->length) - (24 + (6 * StringBuf->entries[j]->num_pci_devpaths)); x++) { + buffer.S8Catf("%02hhX", *dataptr++); + } + StringBuf->entries[j]->data = NULL; + } } return buffer; } diff --git a/rEFIt_UEFI/Platform/device_inject.h b/rEFIt_UEFI/Platform/device_inject.h index a613356c80..2d2eb76f15 100644 --- a/rEFIt_UEFI/Platform/device_inject.h +++ b/rEFIt_UEFI/Platform/device_inject.h @@ -96,7 +96,6 @@ struct DevPropDevice { struct DevPropString *string; // ------------------------ }; - typedef struct DevPropDevice DevPropDevice; struct DevPropString { From 27133ac407f6ef62fbf776540b5b83e62f27e509 Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Tue, 22 Mar 2022 21:21:26 +0300 Subject: [PATCH 07/10] fix unused variable Signed-off-by: SergeySlice --- rEFIt_UEFI/Platform/device_inject.cpp | 12 ++++++++---- rEFIt_UEFI/cpp_foundation/XStringAbstract.h | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/rEFIt_UEFI/Platform/device_inject.cpp b/rEFIt_UEFI/Platform/device_inject.cpp index abfe046ef1..914390c194 100644 --- a/rEFIt_UEFI/Platform/device_inject.cpp +++ b/rEFIt_UEFI/Platform/device_inject.cpp @@ -171,10 +171,10 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt, DevicePath = NextDevicePathNode(DevicePath); if (DevicePath->Type == HARDWARE_DEVICE_PATH && DevicePath->SubType == HW_PCI_DP) { CopyMem(&device->pci_dev_path[NumPaths], DevicePath, sizeof(struct PCIDevPath)); -// DBG("PCI[%d] f=%X, d=%X ", NumPaths, device->pci_dev_path[NumPaths].function, device->pci_dev_path[NumPaths].device); + DBG("PCI[%d] f=%X, d=%X ", NumPaths, device->pci_dev_path[NumPaths].function, device->pci_dev_path[NumPaths].device); } else { // not PCI path - break the loop - // DBG("not PCI "); + DBG(" break\n"); break; } } @@ -282,9 +282,12 @@ XBool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer bool SameDevice(DevPropDevice* D1, DevPropDevice* D2) { +// DBG("paths 1=%u 2=%u\n", D1->num_pci_devpaths, D2->num_pci_devpaths); if (D1->num_pci_devpaths != D2->num_pci_devpaths) return false; for (UINT32 x=0; x < D1->num_pci_devpaths; x++) { +// DBG(" funcs 1=%u 2=%u\n", D1->pci_dev_path[x].function, D2->pci_dev_path[x].function); if (D1->pci_dev_path[x].function != D2->pci_dev_path[x].function) return false; +// DBG(" devs 1=%u 2=%u\n", D1->pci_dev_path[x].device, D2->pci_dev_path[x].device); if (D1->pci_dev_path[x].device != D2->pci_dev_path[x].device) return false; } return true; @@ -297,8 +300,7 @@ XBuffer devprop_generate_string(DevPropString *StringBuf) XBuffer buffer; buffer.dataSized(len+1); - // DBG("devprop_generate_string\n"); - //TODO здесь нужно сделать join одинаковых устройств StringBuf->entries[i] по признаку ->pci_dev_path[x] (отдельный опретаор сравнения) +// DBG("devprop_generate_string\n"); buffer.S8Catf("%08X%08X%04hX%04hX", SwapBytes32(StringBuf->length), StringBuf->WHAT2, SwapBytes16(StringBuf->numentries), StringBuf->WHAT3); for (int i = 0; i < StringBuf->numentries; i++) { @@ -331,12 +333,14 @@ XBuffer devprop_generate_string(DevPropString *StringBuf) //try to find same devices for (int j=i+1; j < StringBuf->numentries; j++) { if (!SameDevice(StringBuf->entries[i], StringBuf->entries[j])) continue; + dataptr = StringBuf->entries[j]->data; for (UINT32 x = 0; x < (StringBuf->entries[j]->length) - (24 + (6 * StringBuf->entries[j]->num_pci_devpaths)); x++) { buffer.S8Catf("%02hhX", *dataptr++); } StringBuf->entries[j]->data = NULL; } } +// DBG("string=%s\n", buffer.data()); return buffer; } diff --git a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h index d2e06eb405..cdc0e69b73 100644 --- a/rEFIt_UEFI/cpp_foundation/XStringAbstract.h +++ b/rEFIt_UEFI/cpp_foundation/XStringAbstract.h @@ -58,7 +58,7 @@ int XStringAbstract__startWith(const S* src, const O* other, bool ignoreCase) template int XStringAbstract__startWithOrEqualTo(const S* src, const O* other, bool ignoreCase) { - size_t nb = 0; +// size_t nb = 0; const S* src2 = src; const O* other2 = other; @@ -75,7 +75,7 @@ int XStringAbstract__startWithOrEqualTo(const S* src, const O* other, bool ignor if ( src_char32 != other_char32 ) return false; src2 = get_char32_from_string(src2, &src_char32); other2 = get_char32_from_string(other2, &other_char32); - nb += 1; +// nb += 1; }; return true; } From b481378c04f44c3cde147f5ee88149c5d6e69cbe Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Tue, 22 Mar 2022 22:07:31 +0300 Subject: [PATCH 08/10] cancel joining Signed-off-by: SergeySlice --- rEFIt_UEFI/Platform/device_inject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rEFIt_UEFI/Platform/device_inject.cpp b/rEFIt_UEFI/Platform/device_inject.cpp index 914390c194..0d933ff929 100644 --- a/rEFIt_UEFI/Platform/device_inject.cpp +++ b/rEFIt_UEFI/Platform/device_inject.cpp @@ -332,7 +332,7 @@ XBuffer devprop_generate_string(DevPropString *StringBuf) } //try to find same devices for (int j=i+1; j < StringBuf->numentries; j++) { - if (!SameDevice(StringBuf->entries[i], StringBuf->entries[j])) continue; + if (1 || !SameDevice(StringBuf->entries[i], StringBuf->entries[j])) continue; dataptr = StringBuf->entries[j]->data; for (UINT32 x = 0; x < (StringBuf->entries[j]->length) - (24 + (6 * StringBuf->entries[j]->num_pci_devpaths)); x++) { buffer.S8Catf("%02hhX", *dataptr++); From d57b9f1e52d1f84d7d5478d0a5072d09046818c6 Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Thu, 24 Mar 2022 20:04:30 +0300 Subject: [PATCH 09/10] join same device properties Signed-off-by: SergeySlice --- rEFIt_UEFI/Platform/device_inject.cpp | 54 +++++++++++++++++---------- rEFIt_UEFI/Platform/device_inject.h | 10 ++--- 2 files changed, 39 insertions(+), 25 deletions(-) diff --git a/rEFIt_UEFI/Platform/device_inject.cpp b/rEFIt_UEFI/Platform/device_inject.cpp index 0d933ff929..565a35abef 100644 --- a/rEFIt_UEFI/Platform/device_inject.cpp +++ b/rEFIt_UEFI/Platform/device_inject.cpp @@ -114,10 +114,25 @@ UINT32 pci_config_read32(pci_dt_t *PciDt, UINT8 reg) return res; } -UINT32 PciAddrFromDevicePath(EFI_DEVICE_PATH_PROTOCOL* DevicePath) +bool SameDevice(DevPropDevice* D1, DevPropDevice* D2) { - return 0; +// DBG("paths 1=%u 2=%u\n", D1->num_pci_devpaths, D2->num_pci_devpaths); + if (D1->num_pci_devpaths != D2->num_pci_devpaths) return false; + for (UINT32 x=0; x < D1->num_pci_devpaths; x++) { +// DBG(" funcs 1=%u 2=%u\n", D1->pci_dev_path[x].function, D2->pci_dev_path[x].function); + if (D1->pci_dev_path[x].function != D2->pci_dev_path[x].function) return false; +// DBG(" devs 1=%u 2=%u\n", D1->pci_dev_path[x].device, D2->pci_dev_path[x].device); + if (D1->pci_dev_path[x].device != D2->pci_dev_path[x].device) return false; + } + DBG("found same device\n"); + return true; } + + +//UINT32 PciAddrFromDevicePath(EFI_DEVICE_PATH_PROTOCOL* DevicePath) +//{ +// return 0; +//} //Size = GetDevicePathSize (DevicePath); //dmazar: replaced by devprop_add_device_pci @@ -132,6 +147,9 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt, return NULL; } + //просмотреть StringBuf->entries[] в поисках такого же девайса + //SameDevice(DevPropDevice* D1, DevPropDevice* D2) + if (!DevicePath && (PciDt != 0)) { DevicePath = DevicePathFromHandle(PciDt->DeviceHandle); } @@ -171,10 +189,9 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt, DevicePath = NextDevicePathNode(DevicePath); if (DevicePath->Type == HARDWARE_DEVICE_PATH && DevicePath->SubType == HW_PCI_DP) { CopyMem(&device->pci_dev_path[NumPaths], DevicePath, sizeof(struct PCIDevPath)); - DBG("PCI[%d] f=%X, d=%X ", NumPaths, device->pci_dev_path[NumPaths].function, device->pci_dev_path[NumPaths].device); + // DBG("PCI[%d] f=%X, d=%X ", NumPaths, device->pci_dev_path[NumPaths].function, device->pci_dev_path[NumPaths].device); } else { // not PCI path - break the loop - DBG(" break\n"); break; } } @@ -195,7 +212,7 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt, device->string = StringBuf; device->data = NULL; - StringBuf->length += device->length; + if(!StringBuf->entries) { StringBuf->entries = (DevPropDevice**)AllocateZeroPool(MAX_NUM_DEVICES * sizeof(device)); @@ -205,6 +222,16 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt, } } + DevPropDevice* D1; + for (int i=0; inumentries; i++) { + D1 = StringBuf->entries[i]; + if (SameDevice(D1, device)) { + FreePool(device); + return D1; + } + } + + StringBuf->length += device->length; StringBuf->entries[StringBuf->numentries++] = device; return device; @@ -280,19 +307,6 @@ XBool devprop_add_value(DevPropDevice *device, const XString8& nm, const XBuffer return devprop_add_value(device, nm.data(), vl.data(), vl.size()); } -bool SameDevice(DevPropDevice* D1, DevPropDevice* D2) -{ -// DBG("paths 1=%u 2=%u\n", D1->num_pci_devpaths, D2->num_pci_devpaths); - if (D1->num_pci_devpaths != D2->num_pci_devpaths) return false; - for (UINT32 x=0; x < D1->num_pci_devpaths; x++) { -// DBG(" funcs 1=%u 2=%u\n", D1->pci_dev_path[x].function, D2->pci_dev_path[x].function); - if (D1->pci_dev_path[x].function != D2->pci_dev_path[x].function) return false; -// DBG(" devs 1=%u 2=%u\n", D1->pci_dev_path[x].device, D2->pci_dev_path[x].device); - if (D1->pci_dev_path[x].device != D2->pci_dev_path[x].device) return false; - } - return true; -} - XBuffer devprop_generate_string(DevPropString *StringBuf) { UINTN len = StringBuf->length * 2; @@ -300,7 +314,7 @@ XBuffer devprop_generate_string(DevPropString *StringBuf) XBuffer buffer; buffer.dataSized(len+1); -// DBG("devprop_generate_string\n"); +// DbgHeader("Devprop Generate String"); buffer.S8Catf("%08X%08X%04hX%04hX", SwapBytes32(StringBuf->length), StringBuf->WHAT2, SwapBytes16(StringBuf->numentries), StringBuf->WHAT3); for (int i = 0; i < StringBuf->numentries; i++) { @@ -332,7 +346,7 @@ XBuffer devprop_generate_string(DevPropString *StringBuf) } //try to find same devices for (int j=i+1; j < StringBuf->numentries; j++) { - if (1 || !SameDevice(StringBuf->entries[i], StringBuf->entries[j])) continue; + if (!SameDevice(StringBuf->entries[i], StringBuf->entries[j])) continue; dataptr = StringBuf->entries[j]->data; for (UINT32 x = 0; x < (StringBuf->entries[j]->length) - (24 + (6 * StringBuf->entries[j]->num_pci_devpaths)); x++) { buffer.S8Catf("%02hhX", *dataptr++); diff --git a/rEFIt_UEFI/Platform/device_inject.h b/rEFIt_UEFI/Platform/device_inject.h index 2d2eb76f15..5860cdddc8 100644 --- a/rEFIt_UEFI/Platform/device_inject.h +++ b/rEFIt_UEFI/Platform/device_inject.h @@ -111,10 +111,10 @@ struct DevPropString { typedef struct DevPropString DevPropString; #ifndef DONT_DEFINE_GLOBALS -extern UINT32 devices_number; -extern DevPropString *device_inject_string; -extern UINT8 *device_inject_stringdata; -extern UINT32 device_inject_stringlength; +extern UINT32 devices_number; +extern DevPropString *device_inject_string; +extern UINT8 *device_inject_stringdata; +extern UINT32 device_inject_stringlength; #endif DevPropString *devprop_create_string(void); @@ -128,6 +128,6 @@ void devprop_free_string(DevPropString *string); XBool set_eth_props(pci_dt_t *eth_dev); XBool set_usb_props(pci_dt_t *usb_dev); -UINT32 PciAddrFromDevicePath(EFI_DEVICE_PATH_PROTOCOL* DevicePath); +//UINT32 PciAddrFromDevicePath(EFI_DEVICE_PATH_PROTOCOL* DevicePath); #endif /* !__LIBSAIO_DEVICE_INJECT_H */ From 9337508928ff1d8271fd5982d6f69609418678bf Mon Sep 17 00:00:00 2001 From: SergeySlice Date: Thu, 24 Mar 2022 20:32:31 +0300 Subject: [PATCH 10/10] exclude debug messages on screen Signed-off-by: SergeySlice --- rEFIt_UEFI/Platform/device_inject.cpp | 10 +--------- rEFIt_UEFI/Settings/ConfigManager.cpp | 16 ++++++++-------- rEFIt_UEFI/refit/main.cpp | 2 +- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/rEFIt_UEFI/Platform/device_inject.cpp b/rEFIt_UEFI/Platform/device_inject.cpp index 565a35abef..0545d2b3c2 100644 --- a/rEFIt_UEFI/Platform/device_inject.cpp +++ b/rEFIt_UEFI/Platform/device_inject.cpp @@ -344,15 +344,7 @@ XBuffer devprop_generate_string(DevPropString *StringBuf) for(UINT32 x = 0; x < (StringBuf->entries[i]->length) - (24 + (6 * StringBuf->entries[i]->num_pci_devpaths)); x++) { buffer.S8Catf("%02hhX", *dataptr++); } - //try to find same devices - for (int j=i+1; j < StringBuf->numentries; j++) { - if (!SameDevice(StringBuf->entries[i], StringBuf->entries[j])) continue; - dataptr = StringBuf->entries[j]->data; - for (UINT32 x = 0; x < (StringBuf->entries[j]->length) - (24 + (6 * StringBuf->entries[j]->num_pci_devpaths)); x++) { - buffer.S8Catf("%02hhX", *dataptr++); - } - StringBuf->entries[j]->data = NULL; - } + } // DBG("string=%s\n", buffer.data()); return buffer; diff --git a/rEFIt_UEFI/Settings/ConfigManager.cpp b/rEFIt_UEFI/Settings/ConfigManager.cpp index 90f67f2fb8..82fc8d3971 100644 --- a/rEFIt_UEFI/Settings/ConfigManager.cpp +++ b/rEFIt_UEFI/Settings/ConfigManager.cpp @@ -527,28 +527,28 @@ EFI_STATUS LoadPlist(const XStringW& ConfName, C* plist) XBool parsingOk = plist->parse((const CHAR8*)ConfigPtr, Size, ""_XS8, &xmlLiteParser); if ( xmlLiteParser.getXmlParserMessageArray().size() - xmlLiteParser.getXmlParserInfoMessageCount() > 0 ) { if ( xmlLiteParser.getXmlParserMessageArray().size() - xmlLiteParser.getXmlParserInfoMessageCount() > 1 ) { - DebugLog(2, "There are problems in plist '%ls'\n", configPlistPath.wc_str()); + DebugLog(1, "There are problems in plist '%ls'\n", configPlistPath.wc_str()); }else{ - DebugLog(2, "There is a problem in plist '%ls'\n", configPlistPath.wc_str()); + DebugLog(1, "There is a problem in plist '%ls'\n", configPlistPath.wc_str()); } for ( size_t idx = 0 ; idx < xmlLiteParser.getXmlParserMessageArray().size() ; idx++ ) { const XmlParserMessage& xmlMsg = xmlLiteParser.getXmlParserMessageArray()[idx]; if ( xmlMsg.type != XmlParserMessageType::info ) { - DebugLog(2, "%s\n", xmlMsg.getFormattedMsg().c_str()); + DebugLog(1, "%s\n", xmlMsg.getFormattedMsg().c_str()); } } - DebugLog(2, "Use CloverConfigPlistValidator"); + DebugLog(1, "Use CloverConfigPlistValidator"); if ( plist->getSMBIOS().dgetModel() < MaxMacModel ) { - if ( xmlLiteParser.productNameNeeded ) DebugLog(2, " (with --productname=%s)", MachineModelName[plist->getSMBIOS().dgetModel()].c_str()); + if ( xmlLiteParser.productNameNeeded ) DebugLog(1, " (with --productname=%s)", MachineModelName[plist->getSMBIOS().dgetModel()].c_str()); }else{ // This is NOT supposed to happen, since CLover set a default mac model // If a default mac model is not set, a crash would probably happen earlier, but who knows - if ( xmlLiteParser.productNameNeeded ) DebugLog(2, "(with --productname=?)"); + if ( xmlLiteParser.productNameNeeded ) DebugLog(1, "(with --productname=?)"); } - DebugLog(2, " or look in the log\n"); + DebugLog(1, " or look in the log\n"); } if ( !parsingOk ) { - DebugLog(2, "Parsing error while parsing '%ls'.\n", configPlistPath.wc_str()); + DebugLog(1, "Parsing error while parsing '%ls'.\n", configPlistPath.wc_str()); Status = EFI_LOAD_ERROR; } diff --git a/rEFIt_UEFI/refit/main.cpp b/rEFIt_UEFI/refit/main.cpp index 1c22bfce94..894fac908e 100644 --- a/rEFIt_UEFI/refit/main.cpp +++ b/rEFIt_UEFI/refit/main.cpp @@ -3037,7 +3037,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, //Now we have to reinit handles Status = ReinitRefitLib(); if (EFI_ERROR(Status)){ - DebugLog(2, " %s", efiStrError(Status)); + // DebugLog(2, " %s", efiStrError(Status)); PauseForKey("Error reinit refit."_XS8); #ifdef ENABLE_SECURE_BOOT UninstallSecureBoot();