From e8fd94bb8f0c72f8a60d4f931f87c32976c166b5 Mon Sep 17 00:00:00 2001 From: Jief L Date: Wed, 25 Mar 2020 21:32:44 +0300 Subject: [PATCH] Switch to new printf format for DebugLog. --- .../CloverX64.xcodeproj/project.pbxproj | 28 ++ rEFIt_UEFI/Platform/AcpiPatcher.cpp | 166 ++++---- rEFIt_UEFI/Platform/AmlGenerator.cpp | 6 +- rEFIt_UEFI/Platform/BootLog.cpp | 6 +- rEFIt_UEFI/Platform/BootLog.h | 7 +- rEFIt_UEFI/Platform/BootOptions.cpp | 74 ++-- rEFIt_UEFI/Platform/DataHubCpu.cpp | 4 +- rEFIt_UEFI/Platform/DevicePath.cpp | 16 +- rEFIt_UEFI/Platform/Edid.cpp | 22 +- rEFIt_UEFI/Platform/Events.cpp | 4 +- rEFIt_UEFI/Platform/FixBiosDsdt.cpp | 242 +++++------ rEFIt_UEFI/Platform/HdaCodecDump.cpp | 10 +- rEFIt_UEFI/Platform/Hibernate.cpp | 100 ++--- rEFIt_UEFI/Platform/LegacyBiosThunk.cpp | 2 +- rEFIt_UEFI/Platform/LegacyBoot.cpp | 82 ++-- rEFIt_UEFI/Platform/Net.cpp | 10 +- rEFIt_UEFI/Platform/Nvram.cpp | 136 +++--- .../Platform/PlatformDriverOverride.cpp | 6 +- rEFIt_UEFI/Platform/Settings.cpp | 394 +++++++++--------- rEFIt_UEFI/Platform/StartupSound.cpp | 32 +- rEFIt_UEFI/Platform/StateGenerator.cpp | 14 +- rEFIt_UEFI/Platform/ati.cpp | 70 ++-- rEFIt_UEFI/Platform/card_vlist.cpp | 2 +- rEFIt_UEFI/Platform/cpu.cpp | 64 +-- rEFIt_UEFI/Platform/device_inject.cpp | 26 +- rEFIt_UEFI/Platform/gma.cpp | 16 +- rEFIt_UEFI/Platform/hda.cpp | 18 +- rEFIt_UEFI/Platform/kernel_patcher.cpp | 118 +++--- rEFIt_UEFI/Platform/kext_inject.cpp | 34 +- rEFIt_UEFI/Platform/kext_patcher.cpp | 26 +- rEFIt_UEFI/Platform/nvidia.cpp | 54 +-- rEFIt_UEFI/Platform/platformdata.cpp | 2 +- rEFIt_UEFI/Platform/plist.cpp | 14 +- rEFIt_UEFI/Platform/smbios.cpp | 56 +-- rEFIt_UEFI/Platform/spd.cpp | 12 +- rEFIt_UEFI/Platform/usbfix.cpp | 20 +- rEFIt_UEFI/cpp_foundation/XStringW.cpp | 8 +- rEFIt_UEFI/cpp_foundation/XStringWP.cpp | 2 +- rEFIt_UEFI/cpp_foundation/XUINTN.cpp | 6 +- rEFIt_UEFI/cpp_unit_test/XString_test.cpp | 18 +- rEFIt_UEFI/cpp_unit_test/all_tests.cpp | 14 + .../cpp_unit_test/poolprint-test-cpp_conf.h | 13 + rEFIt_UEFI/cpp_unit_test/poolprint-test.cpp | 251 +++++++++++ rEFIt_UEFI/cpp_unit_test/poolprint-test.h | 1 + rEFIt_UEFI/cpp_unit_test/printf_lite-test.cpp | 19 +- .../cpp_unit_test/printlib-test-cpp_conf.h | 13 + rEFIt_UEFI/cpp_unit_test/printlib-test.cpp | 275 ++++++++++++ rEFIt_UEFI/cpp_unit_test/printlib-test.h | 1 + rEFIt_UEFI/cpp_util/globals_ctor.cpp | 38 +- rEFIt_UEFI/cpp_util/operatorNewDelete.cpp | 2 +- rEFIt_UEFI/cpp_util/panic.cpp | 4 +- rEFIt_UEFI/entry_scan/common.cpp | 2 +- rEFIt_UEFI/entry_scan/legacy.cpp | 28 +- rEFIt_UEFI/entry_scan/loader.cpp | 70 ++-- rEFIt_UEFI/entry_scan/lockedgraphics.cpp | 4 +- rEFIt_UEFI/entry_scan/secureboot.cpp | 24 +- rEFIt_UEFI/entry_scan/securehash.cpp | 2 +- rEFIt_UEFI/entry_scan/securemenu.cpp | 4 +- rEFIt_UEFI/entry_scan/securevars.cpp | 18 +- rEFIt_UEFI/entry_scan/tool.cpp | 12 +- rEFIt_UEFI/libeg/VectorGraphics.cpp | 102 ++--- rEFIt_UEFI/libeg/XImage.cpp | 2 +- rEFIt_UEFI/libeg/image.cpp | 32 +- rEFIt_UEFI/libeg/libscreen.cpp | 28 +- rEFIt_UEFI/libeg/nanosvg.cpp | 108 ++--- rEFIt_UEFI/libeg/nanosvgrast.cpp | 10 +- rEFIt_UEFI/libeg/text.cpp | 6 +- rEFIt_UEFI/refit/IO.cpp | 2 +- rEFIt_UEFI/refit/icns.cpp | 6 +- rEFIt_UEFI/refit/lib.cpp | 72 ++-- rEFIt_UEFI/refit/main.cpp | 218 +++++----- rEFIt_UEFI/refit/menu.cpp | 80 ++-- rEFIt_UEFI/refit/screen.cpp | 20 +- 73 files changed, 2005 insertions(+), 1403 deletions(-) create mode 100644 rEFIt_UEFI/cpp_unit_test/poolprint-test-cpp_conf.h create mode 100644 rEFIt_UEFI/cpp_unit_test/poolprint-test.cpp create mode 100644 rEFIt_UEFI/cpp_unit_test/poolprint-test.h create mode 100644 rEFIt_UEFI/cpp_unit_test/printlib-test-cpp_conf.h create mode 100644 rEFIt_UEFI/cpp_unit_test/printlib-test.cpp create mode 100644 rEFIt_UEFI/cpp_unit_test/printlib-test.h diff --git a/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj b/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj index 818159b85..1a0b63890 100644 --- a/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj +++ b/Xcode/CloverX64/CloverX64.xcodeproj/project.pbxproj @@ -207,6 +207,13 @@ 9AC780B52417EE53005CDD5C /* global_test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC780B42417EE53005CDD5C /* global_test.h */; }; 9AC780B82417F359005CDD5C /* XStringWP.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC780B62417F359005CDD5C /* XStringWP.h */; }; 9AC780B92417F359005CDD5C /* XStringWP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC780B72417F359005CDD5C /* XStringWP.cpp */; }; + 9AF4155D242B8FA400D2644C /* poolprint-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF4155B242B8FA300D2644C /* poolprint-test.h */; }; + 9AF4155E242B8FA400D2644C /* poolprint-test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF4155C242B8FA300D2644C /* poolprint-test.cpp */; }; + 9AF41562242BABC700D2644C /* printlib-test-cpp_conf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF4155F242BABC700D2644C /* printlib-test-cpp_conf.h */; }; + 9AF41563242BABC700D2644C /* printlib-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF41560242BABC700D2644C /* printlib-test.h */; }; + 9AF41564242BABC700D2644C /* printlib-test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF41561242BABC700D2644C /* printlib-test.cpp */; }; + 9AF41566242BAD5600D2644C /* printf_lite-test-cpp_conf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF41565242BAD5600D2644C /* printf_lite-test-cpp_conf.h */; }; + 9AF41568242BAD7D00D2644C /* poolprint-test-cpp_conf.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF41567242BAD7D00D2644C /* poolprint-test-cpp_conf.h */; }; A5E326312428F4EE002240E8 /* XTheme.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5E3262F2428F4EE002240E8 /* XTheme.cpp */; }; A5E326322428F4EE002240E8 /* XTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = A5E326302428F4EE002240E8 /* XTheme.h */; }; /* End PBXBuildFile section */ @@ -413,6 +420,13 @@ 9AC780B42417EE53005CDD5C /* global_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = global_test.h; sourceTree = ""; }; 9AC780B62417F359005CDD5C /* XStringWP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XStringWP.h; sourceTree = ""; }; 9AC780B72417F359005CDD5C /* XStringWP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XStringWP.cpp; sourceTree = ""; }; + 9AF4155B242B8FA300D2644C /* poolprint-test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "poolprint-test.h"; sourceTree = ""; }; + 9AF4155C242B8FA300D2644C /* poolprint-test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "poolprint-test.cpp"; sourceTree = ""; }; + 9AF4155F242BABC700D2644C /* printlib-test-cpp_conf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "printlib-test-cpp_conf.h"; sourceTree = ""; }; + 9AF41560242BABC700D2644C /* printlib-test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "printlib-test.h"; sourceTree = ""; }; + 9AF41561242BABC700D2644C /* printlib-test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "printlib-test.cpp"; sourceTree = ""; }; + 9AF41565242BAD5600D2644C /* printf_lite-test-cpp_conf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "printf_lite-test-cpp_conf.h"; sourceTree = ""; }; + 9AF41567242BAD7D00D2644C /* poolprint-test-cpp_conf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "poolprint-test-cpp_conf.h"; sourceTree = ""; }; A5E3262F2428F4EE002240E8 /* XTheme.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XTheme.cpp; sourceTree = ""; }; A5E326302428F4EE002240E8 /* XTheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XTheme.h; sourceTree = ""; }; /* End PBXFileReference section */ @@ -498,8 +512,15 @@ 9AC77ED724176C04005CDD5C /* all_tests.h */, 9AC780B22417EE4A005CDD5C /* global_test.cpp */, 9AC780B42417EE53005CDD5C /* global_test.h */, + 9AF41567242BAD7D00D2644C /* poolprint-test-cpp_conf.h */, + 9AF4155C242B8FA300D2644C /* poolprint-test.cpp */, + 9AF4155B242B8FA300D2644C /* poolprint-test.h */, 9A9D3B2024221562006D8CD9 /* printf_lite_test.h */, + 9AF41565242BAD5600D2644C /* printf_lite-test-cpp_conf.h */, 9A9D3B2124221563006D8CD9 /* printf_lite-test.cpp */, + 9AF4155F242BABC700D2644C /* printlib-test-cpp_conf.h */, + 9AF41561242BABC700D2644C /* printlib-test.cpp */, + 9AF41560242BABC700D2644C /* printlib-test.h */, 9A28CD2C241BC0DF00F3D247 /* strcmp_test.cpp */, 9A28CD2D241BC0DF00F3D247 /* strcmp_test.h */, 9A28CD2B241BC0DF00F3D247 /* strlen_test.cpp */, @@ -784,6 +805,7 @@ 9A28CCA3241B66EA00F3D247 /* stdlib.h in Headers */, 9AC77FC024176C04005CDD5C /* XObjArray_tests.h in Headers */, 9AC7801D24176C04005CDD5C /* Events.h in Headers */, + 9AF41562242BABC700D2644C /* printlib-test-cpp_conf.h in Headers */, 9AC7808D24176C04005CDD5C /* XStringWArray.h in Headers */, 9A57C25824192D650029A39F /* XUINTN.h in Headers */, 9A28CD33241BC0DF00F3D247 /* strcmp_test.h in Headers */, @@ -792,11 +814,13 @@ 9AC780B52417EE53005CDD5C /* global_test.h in Headers */, 9AC7806324176C04005CDD5C /* CanonicalDB.h in Headers */, 9AC7805924176C04005CDD5C /* nanosvg.h in Headers */, + 9AF41566242BAD5600D2644C /* printf_lite-test-cpp_conf.h in Headers */, 9AC7806124176C04005CDD5C /* CloverDB.h in Headers */, 9AC7803424176C04005CDD5C /* LegacyBiosThunk.h in Headers */, 9AC7806A24176C04005CDD5C /* tool.h in Headers */, 9AC7808324176C04005CDD5C /* globals_dtor.h in Headers */, 9AC7808024176C04005CDD5C /* screen.h in Headers */, + 9AF41563242BABC700D2644C /* printlib-test.h in Headers */, 9AC7802224176C04005CDD5C /* DataHubCpu.h in Headers */, 9AC7807A24176C04005CDD5C /* lib.h in Headers */, 9AC7803524176C04005CDD5C /* b64cdecode.h in Headers */, @@ -838,6 +862,7 @@ 9AC7802A24176C04005CDD5C /* HdaCodecDump.h in Headers */, 9AC7803224176C04005CDD5C /* kext_inject.h in Headers */, 9AC7800F24176C04005CDD5C /* Nvram.h in Headers */, + 9AF41568242BAD7D00D2644C /* poolprint-test-cpp_conf.h in Headers */, 9AC7800024176C04005CDD5C /* gma.h in Headers */, 9AC7802424176C04005CDD5C /* sse3_patcher.h in Headers */, 9AC77FFD24176C04005CDD5C /* Version.h in Headers */, @@ -847,6 +872,7 @@ 9AC7804124176C04005CDD5C /* Platform.h in Headers */, 9AC7805824176C04005CDD5C /* XImage.h in Headers */, 9AC7808624176C04005CDD5C /* globals_ctor.h in Headers */, + 9AF4155D242B8FA400D2644C /* poolprint-test.h in Headers */, 9A28CCA5241B66EA00F3D247 /* stddef.h in Headers */, 9AC7806724176C04005CDD5C /* securebootkeys.h in Headers */, 9A9D3B30242215A1006D8CD9 /* string.h in Headers */, @@ -950,6 +976,7 @@ 9AC7805B24176C04005CDD5C /* libscreen.cpp in Sources */, 9A28CD31241BC0DF00F3D247 /* strlen_test.cpp in Sources */, 9AC7808824176C04005CDD5C /* panic.cpp in Sources */, + 9AF41564242BABC700D2644C /* printlib-test.cpp in Sources */, 9AC77FC524176C04005CDD5C /* XStringW_test.cpp in Sources */, 9AC7806F24176C04005CDD5C /* tool.cpp in Sources */, 9AC7807924176C04005CDD5C /* lib.cpp in Sources */, @@ -998,6 +1025,7 @@ 9AC7805F24176C04005CDD5C /* legacy.cpp in Sources */, 9AC7800924176C04005CDD5C /* AcpiPatcher.cpp in Sources */, 9AC7800D24176C04005CDD5C /* BdsConnect.cpp in Sources */, + 9AF4155E242B8FA400D2644C /* poolprint-test.cpp in Sources */, 9AC7802924176C04005CDD5C /* spd.cpp in Sources */, 9A9D3B2324221563006D8CD9 /* printf_lite-test.cpp in Sources */, 9AC7800424176C04005CDD5C /* kext_patcher.cpp in Sources */, diff --git a/rEFIt_UEFI/Platform/AcpiPatcher.cpp b/rEFIt_UEFI/Platform/AcpiPatcher.cpp index e90f0ed16..e1330a0c3 100644 --- a/rEFIt_UEFI/Platform/AcpiPatcher.cpp +++ b/rEFIt_UEFI/Platform/AcpiPatcher.cpp @@ -229,8 +229,8 @@ void AddDropTable(EFI_ACPI_DESCRIPTION_HEADER* Table, UINT32 Index) OTID[8] = 0; CopyMem(&sign[0], &Table->Signature, 4); CopyMem(&OTID[0], &Table->OemTableId, 8); - //DBG(" Found table: %a %a len=%d\n", sign, OTID, (INT32)Table->Length); - DBG(" - [%02d]: %a %a len=%d\n", Index, sign, OTID, (INT32)Table->Length); + //DBG(" Found table: %s %s len=%d\n", sign, OTID, (INT32)Table->Length); + DBG(" - [%02d]: %s %s len=%d\n", Index, sign, OTID, (INT32)Table->Length); ACPI_DROP_TABLE* DropTable = (__typeof__(DropTable))AllocateZeroPool(sizeof(ACPI_DROP_TABLE)); DropTable->Signature = Table->Signature; DropTable->TableId = Table->OemTableId; @@ -291,7 +291,7 @@ void DropTableFromRSDT(UINT32 Signature, UINT64 TableId, UINT32 Length) OTID[8] = 0; CopyMem(sign, &Signature, 4); CopyMem(OTID, &TableId, 8); - DBG("Drop tables from RSDT, SIGN=%a TableID=%a Length=%d\n", sign, OTID, (INT32)Length); + DBG("Drop tables from RSDT, SIGN=%s TableID=%s Length=%d\n", sign, OTID, (INT32)Length); UINT32 Count = RsdtTableCount(); //DBG(" Rsdt has tables count=%d\n", Count); @@ -305,19 +305,19 @@ void DropTableFromRSDT(UINT32 Signature, UINT64 TableId, UINT32 Length) } CopyMem(&sign, &Table->Signature, 4); CopyMem(&OTID, &Table->OemTableId, 8); - //DBG(" Found table: %a %a\n", sign, OTID); + //DBG(" Found table: %s %s\n", sign, OTID); if (!((Signature && Table->Signature == Signature) && (!TableId || Table->OemTableId == TableId) && (!Length || Table->Length == Length))) { continue; } if (IsXsdtEntryMerged(IndexFromXsdtEntryPtr(Ptr))) { - DBG(" attempt to drop already merged table[%d]: %a %a %d ignored\n", IndexFromXsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); + DBG(" attempt to drop already merged table[%d]: %s %s %d ignored\n", IndexFromXsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); continue; } // drop matching table by simply replacing entry with NULL *Ptr = 0; - DBG(" Table[%d]: %a %a %d dropped\n", IndexFromXsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); + DBG(" Table[%d]: %s %s %d dropped\n", IndexFromXsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); } } @@ -332,7 +332,7 @@ void DropTableFromXSDT(UINT32 Signature, UINT64 TableId, UINT32 Length) OTID[8] = 0; CopyMem(sign, &Signature, 4); CopyMem(OTID, &TableId, 8); - DBG("Drop tables from XSDT, SIGN=%a TableID=%a Length=%d\n", sign, OTID, (INT32)Length); + DBG("Drop tables from XSDT, SIGN=%s TableID=%s Length=%d\n", sign, OTID, (INT32)Length); UINT32 Count = XsdtTableCount(); //DBG(" Xsdt has tables count=%d\n", Count); @@ -346,19 +346,19 @@ void DropTableFromXSDT(UINT32 Signature, UINT64 TableId, UINT32 Length) } CopyMem(&sign, &Table->Signature, 4); CopyMem(&OTID, &Table->OemTableId, 8); - //DBG(" Found table: %a %a\n", sign, OTID); + //DBG(" Found table: %s %s\n", sign, OTID); if (!((Signature && Table->Signature == Signature) && (!TableId || Table->OemTableId == TableId) && (!Length || Table->Length == Length))) { continue; } if (IsXsdtEntryMerged(IndexFromXsdtEntryPtr(Ptr))) { - DBG(" attempt to drop already merged table[%d]: %a %a %d ignored\n", IndexFromXsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); + DBG(" attempt to drop already merged table[%d]: %s %s %d ignored\n", IndexFromXsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); continue; } // drop matching table by simply replacing entry with NULL WriteUnaligned64(Ptr, 0); - DBG(" Table[%d]: %a %a %d dropped\n", IndexFromXsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); + DBG(" Table[%d]: %s %s %d dropped\n", IndexFromXsdtEntryPtr(Ptr), sign, OTID, (INT32)Table->Length); } } @@ -438,13 +438,13 @@ VOID PatchAllTables() CHAR8 OTID[9]; OTID[8] = 0; CopyMem(OTID, &NewTable->OemTableId, 8); - DBG("Patching SSDT %a Length=%d\n", OTID, (INT32)Len); + DBG("Patching SSDT %s Length=%d\n", OTID, (INT32)Len); for (i = 0; i < gSettings.PatchDsdtNum; i++) { if (!gSettings.PatchDsdtFind[i] || !gSettings.LenToFind[i]) { continue; } - DBG("%d. [%a]:", i, gSettings.PatchDsdtLabel[i]); + DBG("%d. [%s]:", i, gSettings.PatchDsdtLabel[i]); if (!gSettings.PatchDsdtMenuItem[i].BValue) { DBG(" disabled\n"); continue; @@ -594,7 +594,7 @@ EFI_STATUS ReplaceOrInsertTable(VOID* TableEntry, UINTN Length, UINTN MatchIndex FixChecksum(TableHeader); if (Ptr) { UINT32 Index = IndexFromXsdtEntryPtr(Ptr); - DBG("@%d ", (UINT64)Index); + DBG("@%llu ", (UINT64)Index); // keep track of new table size in case it needs to be freed later SaveMergedXsdtEntrySize(Index, Length); WriteUnaligned64(Ptr, BufferPtr); @@ -899,7 +899,7 @@ VOID DumpChildSsdt(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR16 *DirNam if (pacCount > 0 && pacCount % 3 == 0) { pacCount /= 3; - DBG(" (Found hidden SSDT %d pcs)\n", pacCount); + DBG(" (Found hidden SSDT %lld pcs)\n", pacCount); while (pacCount-- > 0) { // Skip text marker and addr type tag @@ -923,22 +923,22 @@ VOID DumpChildSsdt(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR16 *DirNam CopyMem(&OemTableId, &((EFI_ACPI_DESCRIPTION_HEADER *)adr)->OemTableId, 8); OemTableId[8] = 0; stripTrailingSpaces(OemTableId); - DBG(" * %p: '%a', '%a', Rev: %d, Len: %d ", adr, Signature, OemTableId, + DBG(" * %llu: '%s', '%s', Rev: %d, Len: %d ", adr, Signature, OemTableId, ((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Revision, ((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Length); for (k = 0; k < 16; k++) { - DBG("%02x ", ((UINT8*)adr)[k]); + DBG("%02X ", ((UINT8*)adr)[k]); } if ((AsciiStrCmp(Signature, "SSDT") == 0) && (len < 0x20000) && DirName != NULL && !IsTableSaved((VOID*)adr)) { FileName = GenerateFileName(FileNamePrefix, SsdtCount, ChildCount, OemTableId); len = ((UINT16*)adr)[2]; - DBG("Internal length = %d", len); + DBG("Internal length = %llu", len); Status = SaveBufferToDisk((VOID*)adr, len, DirName, FileName); if (!EFI_ERROR(Status)) { - DBG(" -> %s", FileName); + DBG(" -> %ls", FileName); MarkTableAsSaved((VOID*)adr); ChildCount++; } else { - DBG(" -> %r", Status); + DBG(" -> %s", strerror(Status)); } FreePool(FileName); } @@ -969,20 +969,20 @@ VOID DumpChildSsdt(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR16 *DirNam CopyMem(&OemTableId, &((EFI_ACPI_DESCRIPTION_HEADER *)adr)->OemTableId, 8); OemTableId[8] = 0; stripTrailingSpaces(OemTableId); - DBG(" * %p: '%a', '%a', Rev: %d, Len: %d ", adr, Signature, OemTableId, + DBG(" * %llu: '%s', '%s', Rev: %d, Len: %d ", adr, Signature, OemTableId, ((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Revision, ((EFI_ACPI_DESCRIPTION_HEADER *)adr)->Length); for(k=0; k<16; k++){ - DBG("%02x ", ((UINT8*)adr)[k]); + DBG("%02X ", ((UINT8*)adr)[k]); } if ((AsciiStrCmp(Signature, "SSDT") == 0) && (len < 0x20000) && DirName != NULL && !IsTableSaved((VOID*)adr)) { FileName = GenerateFileName(FileNamePrefix, SsdtCount, ChildCount, OemTableId); Status = SaveBufferToDisk((VOID*)adr, len, DirName, FileName); if (!EFI_ERROR(Status)) { - DBG(" -> %s", FileName); + DBG(" -> %ls", FileName); MarkTableAsSaved((VOID*)adr); ChildCount++; } else { - DBG(" -> %r", Status); + DBG(" -> %s", strerror(Status)); } FreePool(FileName); } @@ -1012,13 +1012,13 @@ EFI_STATUS DumpTable(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR8 *Check OemTableId[8] = 0; stripTrailingSpaces(OemTableId); - DBG(" %p: '%a', '%a', Rev: %d, Len: %d", TableEntry, Signature, OemTableId, TableEntry->Revision, TableEntry->Length); + DBG(" %p: '%s', '%s', Rev: %d, Len: %d", TableEntry, Signature, OemTableId, TableEntry->Revision, TableEntry->Length); // // Additional checks // if (CheckSignature != NULL && AsciiStrCmp(Signature, CheckSignature) != 0) { - DBG(" -> invalid signature, expecting %a\n", CheckSignature); + DBG(" -> invalid signature, expecting %s\n", CheckSignature); return EFI_INVALID_PARAMETER; } // XSDT checks @@ -1079,7 +1079,7 @@ EFI_STATUS DumpTable(EFI_ACPI_DESCRIPTION_HEADER *TableEntry, CONST CHAR8 *Check } ReleaseFileName = TRUE; } - DBG(" -> %s", FileName); + DBG(" -> %ls", FileName); // Save it Status = SaveBufferToDisk(TableEntry, TableEntry->Length, DirName, FileName); @@ -1112,7 +1112,7 @@ EFI_STATUS DumpFadtTables(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt, CONST // if Fadt->Revision < 3 (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION), then it is Acpi 1.0 // and fields after Flags are not available // - DBG(" (Dsdt: %x, Facs: %x", Fadt->Dsdt, Fadt->FirmwareCtrl); + DBG(" (Dsdt: %X, Facs: %X", Fadt->Dsdt, Fadt->FirmwareCtrl); // for Acpi 1.0 DsdtAdr = Fadt->Dsdt; FacsAdr = Fadt->FirmwareCtrl; @@ -1120,7 +1120,7 @@ EFI_STATUS DumpFadtTables(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt, CONST if (Fadt->Header.Revision >= EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE_REVISION) { // Acpi 2.0 or up // may have it in XDsdt or XFirmwareCtrl - DBG(", XDsdt: %lx, XFacs: %lx", Fadt->XDsdt, Fadt->XFirmwareCtrl); + DBG(", XDsdt: %llx, XFacs: %llx", Fadt->XDsdt, Fadt->XFirmwareCtrl); if (Fadt->XDsdt != 0) { DsdtAdr = Fadt->XDsdt; } @@ -1138,7 +1138,7 @@ EFI_STATUS DumpFadtTables(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt, CONST TableEntry = (EFI_ACPI_DESCRIPTION_HEADER*)(UINTN)DsdtAdr; Status = DumpTable(TableEntry, "DSDT", DirName, NULL, FileNamePrefix, NULL); if (EFI_ERROR(Status)) { - DBG(" - %r\n", Status); + DBG(" - %s\n", strerror(Status)); return Status; } DBG("\n"); @@ -1153,7 +1153,7 @@ EFI_STATUS DumpFadtTables(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt, CONST // Take Signature for printing CopyMem(&Signature, &Facs->Signature, 4); Signature[4] = 0; - DBG(" %p: '%a', Ver: %d, Len: %d", Facs, Signature, Facs->Version, Facs->Length); + DBG(" %p: '%s', Ver: %d, Len: %d", Facs, Signature, Facs->Version, Facs->Length); // FACS checks if (Facs->Signature != EFI_ACPI_1_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_SIGNATURE) { @@ -1167,12 +1167,12 @@ EFI_STATUS DumpFadtTables(EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt, CONST if (DirName != NULL && !IsTableSaved(Facs)) { FileName = PoolPrint(L"%sFACS.aml", FileNamePrefix); - DBG(" -> %s", FileName); + DBG(" -> %ls", FileName); Status = SaveBufferToDisk(Facs, Facs->Length, DirName, FileName); MarkTableAsSaved(Facs); FreePool(FileName); if (EFI_ERROR(Status)) { - DBG(" - %r\n", Status); + DBG(" - %s\n", strerror(Status)); return Status; } } @@ -1255,13 +1255,13 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) // EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER* RsdPtr = (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER*)RsdPtrVoid; if (DirName != NULL) { - DBG("Saving ACPI tables from RSDP %p to %s ...\n", RsdPtr, DirName); + DBG("Saving ACPI tables from RSDP %p to %ls ...\n", RsdPtr, DirName); } else { DBG("Printing ACPI tables from RSDP %p ...\n", RsdPtr); } if (RsdPtr->Signature != EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER_SIGNATURE) { - DBG(" RsdPrt at %p has invaid signature 0x%lx - exiting.\n", RsdPtr, RsdPtr->Signature); + DBG(" RsdPrt at %p has invaid signature 0x%llx - exiting.\n", RsdPtr, RsdPtr->Signature); return; } @@ -1274,7 +1274,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) Rsdt = NULL; Xsdt = NULL; - DBG(" %p: '%a', Rev: %d", RsdPtr, Signature, RsdPtr->Revision); + DBG(" %p: '%s', Rev: %d", RsdPtr, Signature, RsdPtr->Revision); if (RsdPtr->Revision == 0) { // Acpi 1.0 Length = sizeof(EFI_ACPI_1_0_ROOT_SYSTEM_DESCRIPTION_POINTER); @@ -1284,7 +1284,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) Length = RsdPtr->Length; DBG(" (Acpi 2.0 or newer)"); } - DBG(", Len: %d", Length); + DBG(", Len: %llu", Length); // // Save RsdPtr @@ -1294,7 +1294,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) Status = SaveBufferToDisk(RsdPtr, Length, DirName, L"RSDP.aml"); MarkTableAsSaved(RsdPtr); if (EFI_ERROR(Status)) { - DBG(" - %r\n", Status); + DBG(" - %s\n", strerror(Status)); return; } } @@ -1324,7 +1324,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) DBG(" "); Status = DumpTable((EFI_ACPI_DESCRIPTION_HEADER *)Xsdt, "XSDT", DirName, L"XSDT.aml", FileNamePrefix, NULL); if (EFI_ERROR(Status)) { - DBG(" - %r", Status); + DBG(" - %s", strerror(Status)); Xsdt = NULL; } DBG("\n"); @@ -1336,7 +1336,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) DBG(" "); Status = DumpTable((EFI_ACPI_DESCRIPTION_HEADER *)Rsdt, "RSDT", DirName, L"RSDT.aml", FileNamePrefix, NULL); if (EFI_ERROR(Status)) { - DBG(" - %r", Status); + DBG(" - %s", strerror(Status)); Rsdt = NULL; } DBG("\n"); @@ -1369,7 +1369,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) // Fadt - save Dsdt and Facs Status = DumpTable(Table, NULL, DirName, NULL, FileNamePrefix, &SsdtCount); if (EFI_ERROR(Status)) { - DBG(" - %r\n", Status); + DBG(" - %s\n", strerror(Status)); return; } DBG("\n"); @@ -1381,7 +1381,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) } else { Status = DumpTable(Table, NULL, DirName, NULL, FileNamePrefix, &SsdtCount); if (EFI_ERROR(Status)) { - DBG(" - %r\n", Status); + DBG(" - %s\n", strerror(Status)); return; } DBG("\n"); @@ -1412,7 +1412,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) // Fadt - save Dsdt and Facs Status = DumpTable(Table, NULL, DirName, NULL, FileNamePrefix, &SsdtCount); if (EFI_ERROR(Status)) { - DBG(" - %r\n", Status); + DBG(" - %s\n", strerror(Status)); return; } DBG("\n"); @@ -1424,7 +1424,7 @@ VOID DumpTables(VOID *RsdPtrVoid, CHAR16 *DirName) } else { Status = DumpTable(Table, NULL, DirName, NULL, FileNamePrefix, &SsdtCount); if (EFI_ERROR(Status)) { - DBG(" - %r\n", Status); + DBG(" - %s\n", strerror(Status)); return; } DBG("\n"); @@ -1516,13 +1516,13 @@ VOID SaveOemDsdt(BOOLEAN FullPatch) PathDsdt = PoolPrint(L"\\%s", gSettings.DsdtName); if (FileExists(SelfRootDir, PoolPrint(L"%s%s", AcpiOemPath, PathDsdt))) { - DBG("DSDT found in Clover volume OEM folder: %s%s\n", AcpiOemPath, PathDsdt); + DBG("DSDT found in Clover volume OEM folder: %ls%ls\n", AcpiOemPath, PathDsdt); Status = egLoadFile(SelfRootDir, PoolPrint(L"%s%s", AcpiOemPath, PathDsdt), &buffer, &DsdtLen); //REVIEW: memory leak...buffer } if (EFI_ERROR(Status) && FileExists(SelfRootDir, PoolPrint(L"%s%s", PathPatched, PathDsdt))) { - DBG("DSDT found in Clover volume common folder: %s%s\n", PathPatched, PathDsdt); + DBG("DSDT found in Clover volume common folder: %ls%ls\n", PathPatched, PathDsdt); Status = egLoadFile(SelfRootDir, PoolPrint(L"%s%s", PathPatched, PathDsdt), &buffer, &DsdtLen); //REVIEW: memory leak...buffer } @@ -1571,9 +1571,9 @@ VOID SaveOemDsdt(BOOLEAN FullPatch) Status = egSaveFile(NULL, OriginDsdt, buffer, DsdtLen); } if (!EFI_ERROR(Status)) { - MsgLog("DSDT saved to %s\n", OriginDsdt); + MsgLog("DSDT saved to %ls\n", OriginDsdt); } else { - MsgLog("Saving DSDT to % s failed - %r\n", OriginDsdt, Status); + MsgLog("Saving DSDT to %ls failed - %s\n", OriginDsdt, strerror(Status)); } gBS->FreePages(dsdt, Pages); } @@ -1619,7 +1619,7 @@ BOOLEAN LoadPatchedAML(CHAR16* AcpiOemPath, CHAR16* PartName, UINTN Pass) } FreePool(buffer); } - DBG("... %r\n", Status); + DBG("... %s\n", strerror(Status)); return !EFI_ERROR(Status); } @@ -1634,7 +1634,7 @@ void LoadAllPatchedAML(CHAR16* AcpiOemPath, UINTN Pass) if (ACPIPatchedAML) { DbgHeader("ACPIPatchedAML"); if (gSettings.AutoMerge) { - DBG("AutoMerge pass %d\n", Pass); + DBG("AutoMerge pass %llu\n", Pass); } //DBG("Start: Processing Patched AML(s): "); if (gSettings.SortedACPICount) { @@ -1645,13 +1645,13 @@ void LoadAllPatchedAML(CHAR16* AcpiOemPath, UINTN Pass) for (ACPIPatchedAMLTmp = ACPIPatchedAML; ACPIPatchedAMLTmp; ACPIPatchedAMLTmp = ACPIPatchedAMLTmp->Next) { if (0 == StriCmp(ACPIPatchedAMLTmp->FileName, gSettings.SortedACPI[Index]) && ACPIPatchedAMLTmp->MenuItem.BValue) { if (BVALUE_ATTEMPTED != ACPIPatchedAMLTmp->MenuItem.BValue) - DBG("Disabled: %s, skip\n", ACPIPatchedAMLTmp->FileName); + DBG("Disabled: %ls, skip\n", ACPIPatchedAMLTmp->FileName); ACPIPatchedAMLTmp->MenuItem.BValue = BVALUE_ATTEMPTED; break; } } if (!ACPIPatchedAMLTmp) { // NULL when not disabled - DBG("Inserting table[%d]:%s from %s: ", Index, gSettings.SortedACPI[Index], AcpiOemPath); + DBG("Inserting table[%llu]:%ls from %ls: ", Index, gSettings.SortedACPI[Index], AcpiOemPath); if (LoadPatchedAML(AcpiOemPath, gSettings.SortedACPI[Index], Pass)) { // avoid inserting table again on second pass for (ACPI_PATCHED_AML* temp2 = ACPIPatchedAML; temp2; temp2 = temp2->Next) { @@ -1668,14 +1668,14 @@ void LoadAllPatchedAML(CHAR16* AcpiOemPath, UINTN Pass) DBG("Unsorted\n"); for (ACPIPatchedAMLTmp = ACPIPatchedAML; ACPIPatchedAMLTmp; ACPIPatchedAMLTmp = ACPIPatchedAMLTmp->Next) { if (!ACPIPatchedAMLTmp->MenuItem.BValue) { - DBG("Inserting %s from %s: ", ACPIPatchedAMLTmp->FileName, AcpiOemPath); + DBG("Inserting %ls from %ls: ", ACPIPatchedAMLTmp->FileName, AcpiOemPath); if (LoadPatchedAML(AcpiOemPath, ACPIPatchedAMLTmp->FileName, Pass)) { // avoid inserting table again on second pass ACPIPatchedAMLTmp->MenuItem.BValue = BVALUE_ATTEMPTED; } } else { if (BVALUE_ATTEMPTED != ACPIPatchedAMLTmp->MenuItem.BValue) - DBG("Disabled: %s, skip\n", ACPIPatchedAMLTmp->FileName); + DBG("Disabled: %ls, skip\n", ACPIPatchedAMLTmp->FileName); ACPIPatchedAMLTmp->MenuItem.BValue = BVALUE_ATTEMPTED; } } @@ -1814,14 +1814,14 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) for (Index = 0; Index < eCntR; Index ++) { UINT64 *pEntryX = (UINT64 *)pEntry; - // DBG("RSDT entry = 0x%x\n", *pEntryR); + // DBG("RSDT entry = 0x%X\n", *pEntryR); if (*pEntryR != 0) { *pEntryX = 0; CopyMem (pEntryX, pEntryR, sizeof(UINT32)); pEntryR++; pEntry += sizeof(UINT64); } else { - DBG("RSDT entry %d = 0 ... skip it\n", Index); + DBG("RSDT entry %llu = 0 ... skip it\n", Index); Xsdt->Header.Length -= sizeof(UINT64); pEntryR++; } @@ -1848,7 +1848,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) RsdPointer->ExtendedChecksum = (UINT8)(256-Checksum8((CHAR8*)RsdPointer, RsdPointer->Length)); DBG("Xsdt reallocation done\n"); } - // DBG("FADT pointer = %x\n", (UINTN)FadtPointer); + // DBG("FADT pointer = %X\n", (UINTN)FadtPointer); if(!FadtPointer) { return EFI_NOT_FOUND; } @@ -1859,7 +1859,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) { UINT32 oldLength = ((EFI_ACPI_DESCRIPTION_HEADER*)FadtPointer)->Length; newFadt = (EFI_ACPI_4_0_FIXED_ACPI_DESCRIPTION_TABLE*)(UINTN)BufferPtr; - DBG("old FADT length=%x\n", oldLength); + DBG("old FADT length=%X\n", oldLength); CopyMem(newFadt, FadtPointer, oldLength); //old data newFadt->Header.Length = 0xF4; CopyMem(newFadt->Header.OemId, BiosVendor, 6); @@ -1919,10 +1919,10 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) //patch for FACS included here Facs->Version = EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE_VERSION; if (GlobalConfig.SignatureFixup) { - DBG(" SignatureFixup: 0x%x -> 0x%x\n", Facs->HardwareSignature, machineSignature); + DBG(" SignatureFixup: 0x%X -> 0x%llX\n", Facs->HardwareSignature, machineSignature); Facs->HardwareSignature = (UINT32)machineSignature; } else { - DBG(" SignatureFixup: 0x%x -> 0x0\n", Facs->HardwareSignature); + DBG(" SignatureFixup: 0x%X -> 0x0\n", Facs->HardwareSignature); Facs->HardwareSignature = 0x0; } Facs->Flags = 0; //dont' support S4BIOS, as well as 64bit wake @@ -1975,7 +1975,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) Status = EFI_NOT_FOUND; if (FileExists(SelfRootDir, PoolPrint(L"%s%s", AcpiOemPath, PathDsdt))) { - DBG("DSDT found in Clover volume OEM folder: %s%s\n", AcpiOemPath, PathDsdt); + DBG("DSDT found in Clover volume OEM folder: %ls%ls\n", AcpiOemPath, PathDsdt); Status = egLoadFile(SelfRootDir, PoolPrint(L"%s%s", AcpiOemPath, PathDsdt), &buffer, &bufferLen); //REVIEW: memory leak... buffer } @@ -1987,7 +1987,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) } if (EFI_ERROR(Status) && FileExists(SelfRootDir, PoolPrint(L"%s%s", PathPatched, PathDsdt))) { - DBG("DSDT found in Clover volume: %s%s\n", PathPatched, PathDsdt); + DBG("DSDT found in Clover volume: %ls%ls\n", PathPatched, PathDsdt); Status = egLoadFile(SelfRootDir, PoolPrint(L"%s%s", PathPatched, PathDsdt), &buffer, &bufferLen); //REVIEW: memory leak... buffer } @@ -2024,9 +2024,9 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) // allocate space for fixes TableHeader = (EFI_ACPI_DESCRIPTION_HEADER*)(UINTN)FadtPointer->Dsdt; bufferLen = TableHeader->Length; - // DBG("DSDT len = 0x%x", bufferLen); + // DBG("DSDT len = 0x%X", bufferLen); // bufferLen = bufferLen + bufferLen / 8; - // DBG(" new len = 0x%x\n", bufferLen); + // DBG(" new len = 0x%X\n", bufferLen); dsdt = EFI_SYSTEM_TABLE_MAX_ADDRESS; Status = gBS->AllocatePages(AllocateMaxAddress, @@ -2055,8 +2055,8 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) } //native DSDT or loaded we want to apply autoFix to this // if (gSettings.FixDsdt) { //fix even with zero mask because we want to know PCIRootUID and count(?) - DBG("Apply DsdtFixMask=0x%08x\n", gSettings.FixDsdt); - DBG(" drop _DSM mask=0x%04x\n", dropDSM); + DBG("Apply DsdtFixMask=0x%08X\n", gSettings.FixDsdt); + DBG(" drop _DSM mask=0x%04X\n", dropDSM); FixBiosDsdt((UINT8*)(UINTN)FadtPointer->XDsdt, FadtPointer, OSVersion); if (gSettings.DebugDSDT) { for (Index=0; Index < 60; Index++) { @@ -2071,7 +2071,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) } } if (EFI_ERROR(Status)) { - DBG("...saving DSDT failed with status=%r\n", Status); + DBG("...saving DSDT failed with status=%s\n", strerror(Status)); } } @@ -2146,7 +2146,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) ApicCPUNum = gCPUStructure.Threads; } - DBG("ApicCPUNum=%d\n", ApicCPUNum); + DBG("ApicCPUNum=%llu\n", ApicCPUNum); //reallocate table if (gSettings.PatchNMI) { BufferPtr = EFI_SYSTEM_TABLE_MAX_ADDRESS; @@ -2172,10 +2172,10 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) // here we're trying to assign first IDs found in DSDT to enabled processors in MADT, such that macOS assumption to be true if (ProcLocalApic->Flags & EFI_ACPI_4_0_LOCAL_APIC_ENABLED) { if (ProcLocalApic->AcpiProcessorId != acpi_cpu_processor_id[Index]) { - DBG("AcpiProcessorId changed: 0x%02x to 0x%02x\n", ProcLocalApic->AcpiProcessorId, acpi_cpu_processor_id[Index]); + DBG("AcpiProcessorId changed: 0x%02X to 0x%02X\n", ProcLocalApic->AcpiProcessorId, acpi_cpu_processor_id[Index]); ProcLocalApic->AcpiProcessorId = acpi_cpu_processor_id[Index]; } else { - DBG("AcpiProcessorId: 0x%02x\n", ProcLocalApic->AcpiProcessorId); + DBG("AcpiProcessorId: 0x%02X\n", ProcLocalApic->AcpiProcessorId); } Index++; } @@ -2248,7 +2248,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) Status = InsertTable(Ssdt, Ssdt->Length); } if(EFI_ERROR(Status)){ - DBG("GeneratePStates failed: Status=%r\n", Status); + DBG("GeneratePStates failed: Status=%s\n", strerror(Status)); } } @@ -2259,7 +2259,7 @@ EFI_STATUS PatchACPI(IN REFIT_VOLUME *Volume, CHAR8 *OSVersion) Status = InsertTable(Ssdt, Ssdt->Length); } if(EFI_ERROR(Status)){ - DBG("GenerateCStates failed Status=%r\n", Status); + DBG("GenerateCStates failed Status=%s\n", strerror(Status)); } } @@ -2302,7 +2302,7 @@ EFI_STATUS LoadAcpiTable ( // checking \EFI\ACPI\patched dir TmpStr = PoolPrint(L"%s\\%s", PathPatched, TableName); if (FileExists(SelfRootDir, TmpStr)) { - DBG("found %s\n", TmpStr); + DBG("found %ls\n", TmpStr); Status = egLoadFile(SelfRootDir, TmpStr, Buffer, BufferLen); } FreePool(TmpStr); @@ -2327,7 +2327,7 @@ EFI_STATUS LoadAndInjectDSDT(CHAR16 *PathPatched, if (!EFI_ERROR(Status)) { // loaded - allocate EfiACPIReclaim - DBG("Loaded DSDT at %s\\%s\n", PathPatched, gSettings.DsdtName); + DBG("Loaded DSDT at %ls\\%ls\n", PathPatched, gSettings.DsdtName); Dsdt = EFI_SYSTEM_TABLE_MAX_ADDRESS; //0xFE000000; Status = gBS->AllocatePages ( AllocateMaxAddress, @@ -2344,7 +2344,7 @@ EFI_STATUS LoadAndInjectDSDT(CHAR16 *PathPatched, FadtPointer->Dsdt = (UINT32)Dsdt; FadtPointer->XDsdt = Dsdt; FixChecksum(&FadtPointer->Header); - DBG("DSDT at 0x%x injected to FADT 0x%p\n", Dsdt, FadtPointer); + DBG("DSDT at 0x%llX injected to FADT 0x%p\n", Dsdt, FadtPointer); } FreePool(Buffer); @@ -2383,26 +2383,26 @@ EFI_STATUS LoadAndInjectAcpiTable(CHAR16 *PathPatched, Status = InsertTable(Buffer, BufferLen); if(!EFI_ERROR(Status)) { - DBG("Table %s inserted.\n", TableName); + DBG("Table %ls inserted.\n", TableName); // if this was SLIC, then update IDs in XSDT/RSDT if (TableHeader->Signature == SLIC_SIGN) { if (Rsdt) { - DBG("SLIC: Rsdt OEMid '%6.6a', TabId '%8.8a'", (CHAR8*)&Rsdt->Header.OemId, (CHAR8*)&Rsdt->Header.OemTableId); + DBG("SLIC: Rsdt OEMid '%6.6s', TabId '%8.8s'", (CHAR8*)&Rsdt->Header.OemId, (CHAR8*)&Rsdt->Header.OemTableId); CopyMem(&Rsdt->Header.OemId, &TableHeader->OemId, 6); Rsdt->Header.OemTableId = TableHeader->OemTableId; - DBG(" to OEMid '%6.6a', TabId '%8.8a'\n", (CHAR8*)&Rsdt->Header.OemId, (CHAR8*)&Rsdt->Header.OemTableId); + DBG(" to OEMid '%6.6s', TabId '%8.8s'\n", (CHAR8*)&Rsdt->Header.OemId, (CHAR8*)&Rsdt->Header.OemTableId); } if (Xsdt) { - DBG("SLIC: Xsdt OEMid '%6.6a', TabId '%8.8a'", (CHAR8*)&Xsdt->Header.OemId, (CHAR8*)&Xsdt->Header.OemTableId); + DBG("SLIC: Xsdt OEMid '%6.6s', TabId '%8.8s'", (CHAR8*)&Xsdt->Header.OemId, (CHAR8*)&Xsdt->Header.OemTableId); CopyMem(&Xsdt->Header.OemId, &TableHeader->OemId, 6); Xsdt->Header.OemTableId = TableHeader->OemTableId; - DBG(" to OEMid '%6.6a', TabId '%8.8a'\n", (CHAR8*)&Xsdt->Header.OemId, (CHAR8*)&Xsdt->Header.OemTableId); + DBG(" to OEMid '%6.6s', TabId '%8.8s'\n", (CHAR8*)&Xsdt->Header.OemId, (CHAR8*)&Xsdt->Header.OemTableId); } } } else { - DBG("Insert return status %r\n", Status); + DBG("Insert return status %s\n", strerror(Status)); } FreePool(Buffer); @@ -2433,11 +2433,11 @@ EFI_STATUS PatchACPI_OtherOS(CONST CHAR16* OsSubdir, BOOLEAN DropSSDT) Status = EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, (VOID **) &RsdPointer); if (RsdPointer != NULL) { - DBG("OtherOS: Found Acpi 2.0 RSDP 0x%x\n", RsdPointer); + DBG("OtherOS: Found Acpi 2.0 RSDP 0x%llX\n", (uintptr_t)RsdPointer); } else { Status = EfiGetSystemConfigurationTable (&gEfiAcpi10TableGuid, (VOID **) &RsdPointer); if (RsdPointer != NULL) { - DBG("Found Acpi 1.0 RSDP 0x%x\n", RsdPointer); + DBG("Found Acpi 1.0 RSDP 0x%llX\n", (uintptr_t)RsdPointer); } } // if RSDP not found - quit @@ -2499,7 +2499,7 @@ EFI_STATUS PatchACPI_OtherOS(CONST CHAR16* OsSubdir, BOOLEAN DropSSDT) } if (!FileExists(SelfRootDir, PathPatched)) { FreePool(PathPatched); - DBG("Dir %s not found. No patching will be done.\n", OsSubdir); + DBG("Dir %ls not found. No patching will be done.\n", OsSubdir); return EFI_NOT_FOUND; } diff --git a/rEFIt_UEFI/Platform/AmlGenerator.cpp b/rEFIt_UEFI/Platform/AmlGenerator.cpp index 17ebfedaf..7016d7c6f 100644 --- a/rEFIt_UEFI/Platform/AmlGenerator.cpp +++ b/rEFIt_UEFI/Platform/AmlGenerator.cpp @@ -174,7 +174,7 @@ UINT32 aml_fill_simple_name(CHAR8* buffer, /* CONST*/ CHAR8* name) { if (AsciiStrLen(name) < 4) { -// MsgLog("aml_fill_simple_name: simple name %a has incorrect lengh! Must be 4.\n", name); +// MsgLog("aml_fill_simple_name: simple name %s has incorrect lengh! Must be 4.\n", name); return 0; } @@ -196,7 +196,7 @@ UINT32 aml_fill_name(AML_CHUNK* node, CONST CHAR8* name) if ((len % 4) > 1 || count == 0) { -// MsgLog("aml_fill_name: pathname %a has incorrect length! Must be 4, 8, 12, 16, etc...\n", name); +// MsgLog("aml_fill_name: pathname %s has incorrect length! Must be 4, 8, 12, 16, etc...\n", name); return 0; } @@ -671,7 +671,7 @@ UINT32 aml_write_node(AML_CHUNK* node, CHAR8* buffer, UINT32 offset) } if (offset - old != node->Size) { - MsgLog("Node size incorrect: type=0x%x size=%x offset=%x\n", + MsgLog("Node size incorrect: type=0x%X size=%X offset=%X\n", node->Type, node->Size, (offset - old)); } } diff --git a/rEFIt_UEFI/Platform/BootLog.cpp b/rEFIt_UEFI/Platform/BootLog.cpp index 373e94273..7d6297b5a 100644 --- a/rEFIt_UEFI/Platform/BootLog.cpp +++ b/rEFIt_UEFI/Platform/BootLog.cpp @@ -23,7 +23,7 @@ PrintBytesRow(IN UINT8 *Bytes, IN UINTN Number, IN UINTN MaxNumber) // print hex vals for (Index = 0; Index < Number; Index++) { - DebugLog(1, "%02x ", Bytes[Index]); + DebugLog(1, "%02X ", Bytes[Index]); } // pad to MaxNumber if needed @@ -151,7 +151,7 @@ VOID EFIAPI MemLogCallback(IN INTN DebugMode, IN CHAR8 *LastMessage) { // Print message to console if (DebugMode >= 2) { - AsciiPrint(LastMessage); + AsciiPrint("%a", LastMessage); } if ((DebugMode >= 1) && GlobalConfig.DebugLog) { @@ -176,7 +176,7 @@ VOID EFIAPI DebugLog(IN INTN DebugMode, IN CONST CHAR8 *FormatString, ...) // Print message to log buffer VA_START(Marker, FormatString); - MemLogVA(TRUE, DebugMode, FormatString, Marker); + MemLogfVA(TRUE, DebugMode, FormatString, Marker); VA_END(Marker); } diff --git a/rEFIt_UEFI/Platform/BootLog.h b/rEFIt_UEFI/Platform/BootLog.h index 8262d4e95..59959c122 100755 --- a/rEFIt_UEFI/Platform/BootLog.h +++ b/rEFIt_UEFI/Platform/BootLog.h @@ -30,10 +30,15 @@ SaveBooterLog ( IN CONST CHAR16 *FileName ); +#ifdef _MSC_VER +#define __attribute__(x) +#endif + VOID EFIAPI DebugLog ( IN INTN DebugMode, - IN CONST CHAR8 *FormatString, ...); + IN CONST CHAR8 *FormatString, ...) __attribute__((format(printf, 2, 3)));; + #endif diff --git a/rEFIt_UEFI/Platform/BootOptions.cpp b/rEFIt_UEFI/Platform/BootOptions.cpp index b959b5a9e..586d22527 100644 --- a/rEFIt_UEFI/Platform/BootOptions.cpp +++ b/rEFIt_UEFI/Platform/BootOptions.cpp @@ -261,8 +261,8 @@ DevicePathEqual ( DBG("Type: %d, %d\n", Type1, DevicePathType (DevicePath2)); DBG("SubType: %d, %d\n", SubType1, DevicePathSubType (DevicePath2)); DBG("Len: %d, %d\n", Len1, DevicePathNodeLength (DevicePath2)); - DBG("%s\n", DevicePathToStr(DevicePath1)); - DBG("%s\n", DevicePathToStr(DevicePath2)); + DBG("%ls\n", DevicePathToStr(DevicePath1)); + DBG("%ls\n", DevicePathToStr(DevicePath2)); */ if (Type1 != DevicePathType (DevicePath2) @@ -300,7 +300,7 @@ DevicePathEqual ( if (FPath2[0] == L'\\') { FPath2++; } - //DBG("COMPARING: '%s' and '%s'\n", FPath1, FPath2); + //DBG("COMPARING: '%ls' and '%ls'\n", FPath1, FPath2); if (StriCmp(FPath1, FPath2) != 0) { // Not equal //DBG("Not equal fpaths\n"); @@ -335,7 +335,7 @@ PrintBootOrder ( UINTN Index; - DBG(" %d: ", BootOrderLen); + DBG(" %llu: ", BootOrderLen); for (Index = 0; Index < BootOrderLen; Index++) { if (Index > 0) { DBG(", "); @@ -399,7 +399,7 @@ AddToBootOrder ( UINTN Index; - DBG("AddToBootOrder: Boot%04X at index %d\n", BootNumNew, BootIndexNew); + DBG("AddToBootOrder: Boot%04X at index %llu\n", BootNumNew, BootIndexNew); Status = GetBootOrder (&BootOrder, &BootOrderLen); if (EFI_ERROR(Status)) { return Status; @@ -407,7 +407,7 @@ AddToBootOrder ( if (BootIndexNew > BootOrderLen) { BootIndexNew = BootOrderLen; - DBG("AddToBootOrder: Index too big. Setting to: %d\n", BootIndexNew); + DBG("AddToBootOrder: Index too big. Setting to: %llu\n", BootIndexNew); } // @@ -452,7 +452,7 @@ AddToBootOrder ( BootOrderLen * sizeof(UINT16), BootOrderNew ); - DBG("SetVariable: %s = %r\n", BOOT_ORDER_VAR, Status); + DBG("SetVariable: %ls = %s\n", BOOT_ORDER_VAR, strerror(Status)); PrintBootOrder(BootOrderNew, BootOrderLen); FreePool (BootOrder); @@ -494,11 +494,11 @@ DeleteFromBootOrder ( } if (Index >= BootOrderLen) { - DBG("Not found in BootOrder len=%d\n", BootOrderLen); + DBG("Not found in BootOrder len=%llu\n", BootOrderLen); FreePool(BootOrder); return EFI_NOT_FOUND; } - DBG(" found at index %d\n", Index); + DBG(" found at index %llu\n", Index); // // BootNum found at Index - copy the rest over it @@ -522,7 +522,7 @@ DeleteFromBootOrder ( BootOrderLen * sizeof(UINT16), BootOrder ); - DBG("SetVariable: %s = %r\n", BOOT_ORDER_VAR, Status); + DBG("SetVariable: %ls = %s\n", BOOT_ORDER_VAR, strerror(Status)); FreePool (BootOrder); @@ -548,10 +548,10 @@ PrintBootOption ( CHAR16 *FPStr; - DBG("%2d) Boot%04X: %s, Attr: 0x%x\n", + DBG("%2llu) Boot%04X: %ls, Attr: 0x%X\n", Index, BootOption->BootNum, BootOption->Description, BootOption->Attributes); FPStr = FileDevicePathToStr(BootOption->FilePathList); - DBG(" %s\n", FPStr); + DBG(" %ls\n", FPStr); FreePool (FPStr); VarSizeTmp = sizeof(BootOption->Attributes) @@ -559,7 +559,7 @@ PrintBootOption ( + BootOption->DescriptionSize + BootOption->FilePathListLength + BootOption->OptionalDataSize; - DBG(" Size: %d (Attr:%d + FPl:%d + Desc:%d + FP:%d + Opt:%d = %d -> %s)\n", + DBG(" Size: %llu (Attr:%lu + FPl:%lu + Desc:%llu + FP:%d + Opt:%llu = %llu -> %ls)\n", BootOption->VariableSize, sizeof(BootOption->Attributes), sizeof(BootOption->FilePathListLength), @@ -570,8 +570,8 @@ PrintBootOption ( VarSizeTmp == BootOption->VariableSize ? L"OK" : L"ERROR" ); //DBG(" FilePathList: %p, %d", BootOption->FilePathList, BootOption->FilePathListLength); - //DBG(" FP F: %s\n", FileDevicePathToStr(BootOption->FilePathList)); - //DBG(" Description: %p, %d, %s\n", BootOption->Description, BootOption->DescriptionSize, BootOption->Description); + //DBG(" FP F: %ls\n", FileDevicePathToStr(BootOption->FilePathList)); + //DBG(" Description: %p, %d, %ls\n", BootOption->Description, BootOption->DescriptionSize, BootOption->Description); //DBG("OptionalData: %p, %d\n", BootOption->OptionalData, BootOption->OptionalDataSize); } @@ -776,7 +776,7 @@ FindBootOptionForFile ( UINTN SearchedDevicePathSize[2]; - DBG("FindBootOptionForFile: %p, %s\n", FileDeviceHandle, FileName); + DBG("FindBootOptionForFile: %p, %ls\n", FileDeviceHandle, FileName); // // Get BootOrder - we will search only options listed in BootOrder. @@ -794,14 +794,14 @@ FindBootOptionForFile ( return EFI_OUT_OF_RESOURCES; } SearchedDevicePathSize[0] = GetDevicePathSize (SearchedDevicePath[0]); - DBG(" Searching for: %s (Len: %d)\n", FileDevicePathToStr(SearchedDevicePath[0]), SearchedDevicePathSize[0]); + DBG(" Searching for: %ls (Len: %llu)\n", FileDevicePathToStr(SearchedDevicePath[0]), SearchedDevicePathSize[0]); Status = CreateBootOptionDevicePath (FileDeviceHandle, FileName, TRUE, &SearchedDevicePath[1]); if (EFI_ERROR(Status)) { return EFI_OUT_OF_RESOURCES; } SearchedDevicePathSize[1] = GetDevicePathSize (SearchedDevicePath[1]); - DBG(" and for: %s (Len: %d)\n", FileDevicePathToStr(SearchedDevicePath[1]), SearchedDevicePathSize[1]); + DBG(" and for: %ls (Len: %llu)\n", FileDevicePathToStr(SearchedDevicePath[1]), SearchedDevicePathSize[1]); // // Iterate over all BootXXXX vars (actually, only ones that are in BootOrder list) @@ -817,7 +817,7 @@ FindBootOptionForFile ( // Status = GetBootOption (BootOrder[Index], &BootOption); if (EFI_ERROR(Status)) { - DBG("FindBootOptionForFile: Boot%04X: %r\n", BootOrder[Index], Status); + DBG("FindBootOptionForFile: Boot%04X: %s\n", BootOrder[Index], strerror(Status)); //WaitForKeyPress(L"press a key to continue\n\n"); continue; } @@ -826,7 +826,7 @@ FindBootOptionForFile ( if (DevicePathEqual (SearchedDevicePath[0], BootOption.FilePathList) || DevicePathEqual (SearchedDevicePath[1], BootOption.FilePathList)) { - DBG("FindBootOptionForFile: Found Boot%04X, at index %d\n", BootOrder[Index], Index); + DBG("FindBootOptionForFile: Found Boot%04X, at index %llu\n", BootOrder[Index], Index); if (BootNum != NULL) { *BootNum = BootOrder[Index]; } @@ -883,7 +883,7 @@ PrintBootOptions ( // Status = GetBootOption (BootOrder[Index], &BootOption); if (EFI_ERROR(Status)) { - DBG("%2d) Boot%04X: ERROR, not found: %r\n", Index, BootOrder[Index], Status); + DBG("%2llu) Boot%04X: ERROR, not found: %s\n", Index, BootOrder[Index], strerror(Status)); continue; } @@ -952,16 +952,16 @@ AddBootOption ( CHAR16 VarName[16]; - DBG("AddBootOption: %s\n", BootOption->Description); - DBG(" FilePath: %s\n", FileDevicePathToStr(BootOption->FilePathList)); - DBG(" BootIndex: %d\n", BootIndex); + DBG("AddBootOption: %ls\n", BootOption->Description); + DBG(" FilePath: %ls\n", FileDevicePathToStr(BootOption->FilePathList)); + DBG(" BootIndex: %llu\n", BootIndex); // // Find free BootXXXX var slot. // Status = FindFreeBootNum (&BootOption->BootNum); if (EFI_ERROR(Status)) { - DBG("FindFreeBootNum: %r\n", Status); + DBG("FindFreeBootNum: %s\n", strerror(Status)); return Status; } DBG(" Found BootNum: %04X\n", BootOption->BootNum); @@ -987,10 +987,10 @@ AddBootOption ( BootOption->Variable ); if (EFI_ERROR(Status)) { - DBG("SetVariable: %s = %r\n", VarName, Status); + DBG("SetVariable: %ls = %s\n", VarName, strerror(Status)); return Status; } - DBG(" %s saved\n", VarName); + DBG(" %ls saved\n", VarName); // // Free allocated space @@ -1031,7 +1031,7 @@ AddBootOptionForFile ( BO_BOOT_OPTION BootOption; - DBG("\nAddBootOptionForFile: %p, %s, %s\n %s, %d\n", + DBG("\nAddBootOptionForFile: %p, %ls, %ls\n %ls, %llu\n", FileDeviceHandle, FileName, UseShortForm ? L"ShortDevPath" : L"FullDevPath", Description, BootIndex); @@ -1056,7 +1056,7 @@ AddBootOptionForFile ( Status = AddBootOption (&BootOption, BootIndex); if (EFI_ERROR(Status)) { FreePool (BootOption.FilePathList); - DBG("AddBootOptionForFile: Error: %r\n", Status); + DBG("AddBootOptionForFile: Error: %s\n", strerror(Status)); return Status; } @@ -1102,10 +1102,10 @@ DeleteBootOption ( NULL ); if (EFI_ERROR(Status)) { - DBG(" Error del. variable: %s = %r\n", VarName, Status); + DBG(" Error del. variable: %ls = %s\n", VarName, strerror(Status)); return Status; } - DBG(" %s deleted\n", VarName); + DBG(" %ls deleted\n", VarName); // // Update BootOrder - delete our boot option from the list @@ -1131,11 +1131,11 @@ DeleteBootOptionForFile ( IN UINT16 BootNum; - DBG("\nDeleteBootOptionForFile: %p, %s\n", FileDeviceHandle, FileName); + DBG("\nDeleteBootOptionForFile: %p, %ls\n", FileDeviceHandle, FileName); do { Status = FindBootOptionForFile (FileDeviceHandle, FileName, &BootNum, NULL); if (!EFI_ERROR(Status)) { - DBG("\tdeleted option: %04x\n", BootNum); + DBG("\tdeleted option: %04X\n", BootNum); DeleteBootOption (BootNum); } } while (!EFI_ERROR(Status)); @@ -1160,7 +1160,7 @@ DeleteBootOptionsContainingFile ( FILEPATH_DEVICE_PATH *FilePathDP; - DBG("DeleteBootOptionContainingFile: %s\n", FileName); + DBG("DeleteBootOptionContainingFile: %ls\n", FileName); // // Get BootOrder - we will search only options listed in BootOrder. @@ -1186,7 +1186,7 @@ DeleteBootOptionsContainingFile ( // Status = GetBootOption (BootOrder[Index], &BootOption); if (EFI_ERROR(Status)) { - DBG("DeleteBootOptionContainingFile: Boot%04X: ERROR: %r\n", BootOrder[Index], Status); + DBG("DeleteBootOptionContainingFile: Boot%04X: ERROR: %s\n", BootOrder[Index], strerror(Status)); //WaitForKeyPress(L"press a key to continue\n\n"); continue; } @@ -1197,7 +1197,7 @@ DeleteBootOptionsContainingFile ( if ((FilePathDP != NULL) && (StriStr (FilePathDP->PathName, FileName) != NULL)) { - DBG("DeleteBootOptionContainingFile: Found Boot%04X, at index %d\n", BootOrder[Index], Index); + DBG("DeleteBootOptionContainingFile: Found Boot%04X, at index %llu\n", BootOrder[Index], Index); Status = DeleteBootOption (BootOrder[Index]); if (!EFI_ERROR(Status)) { ReturnStatus = EFI_SUCCESS; @@ -1209,7 +1209,7 @@ DeleteBootOptionsContainingFile ( FreePool (BootOption.Variable); } - DBG("DeleteBootOptionContainingFile: %r\n", ReturnStatus); + DBG("DeleteBootOptionContainingFile: %s\n", strerror(ReturnStatus)); return ReturnStatus; } diff --git a/rEFIt_UEFI/Platform/DataHubCpu.cpp b/rEFIt_UEFI/Platform/DataHubCpu.cpp index 372e73441..fec75f4af 100644 --- a/rEFIt_UEFI/Platform/DataHubCpu.cpp +++ b/rEFIt_UEFI/Platform/DataHubCpu.cpp @@ -436,7 +436,7 @@ SetupDataForOSX(BOOLEAN Hibernate) // fool proof FrontSideBus = gCPUStructure.FSBFrequency; if ((FrontSideBus < (50 * Mega)) || (FrontSideBus > (1000 * Mega))) { - DBG("Wrong FrontSideBus=%d, set to 100MHz\n", FrontSideBus); + DBG("Wrong FrontSideBus=%llu, set to 100MHz\n", FrontSideBus); FrontSideBus = 100 * Mega; } @@ -452,7 +452,7 @@ SetupDataForOSX(BOOLEAN Hibernate) default: break; } - DBG("Using QEMU FrontSideBus=%ull\n", FrontSideBus); + DBG("Using QEMU FrontSideBus=%llull\n", FrontSideBus); } // Save values into gSettings for the genconfig aim diff --git a/rEFIt_UEFI/Platform/DevicePath.cpp b/rEFIt_UEFI/Platform/DevicePath.cpp index f59583d2d..2720dfcb8 100644 --- a/rEFIt_UEFI/Platform/DevicePath.cpp +++ b/rEFIt_UEFI/Platform/DevicePath.cpp @@ -282,7 +282,7 @@ // break; // } // -// CatPrint (Str, L"Ven%s(%g", Type, &Vendor->Guid); +// CatPrint (Str, L"Ven%s(%s", Type, strguid(&Vendor->Guid)); // DataLength = DevicePathNodeLength (&Vendor->Header) - sizeof (VENDOR_DEVICE_PATH); // if (DataLength > 0) { // CatPrint (Str, L","); @@ -888,9 +888,9 @@ // InfiniBand = DevPath; // CatPrint ( // Str, -// L"Infiniband(%x,%g,%lx,%lx,%lx)", +// L"Infiniband(%x,%s,%lx,%lx,%lx)", // (UINTN) InfiniBand->ResourceFlags, -// InfiniBand->PortGid, +// strguid(InfiniBand->PortGid), // InfiniBand->ServiceId, // InfiniBand->TargetPortId, // InfiniBand->DeviceId @@ -1079,9 +1079,9 @@ // case SIGNATURE_TYPE_GUID: // CatPrint ( // Str, -// L"HD(Part%d,Sig%g)", +// L"HD(Part%d,Sig%s)", // (UINTN) Hd->PartitionNumber, -// (EFI_GUID *) &(Hd->Signature[0]) +// strguid((EFI_GUID *) &(Hd->Signature[0])) // ); // break; // @@ -1160,7 +1160,7 @@ // MEDIA_PROTOCOL_DEVICE_PATH *MediaProt; // // MediaProt = DevPath; -// CatPrint (Str, L"Media(%g)", &MediaProt->Protocol); +// CatPrint (Str, L"Media(%s)", strguid(&MediaProt->Protocol)); //} // ///** @@ -1182,7 +1182,7 @@ // MEDIA_FW_VOL_FILEPATH_DEVICE_PATH *FvFilePath; // // FvFilePath = DevPath; -// CatPrint (Str, L"%g", &FvFilePath->FvFileName); +// CatPrint (Str, L"%s", strguid(&FvFilePath->FvFileName)); //} // ///** @@ -1324,7 +1324,7 @@ // MEDIA_FW_VOL_DEVICE_PATH *FvPath; // // FvPath = DevPath; -// CatPrint (Str, L"Fv(%g)", &FvPath->FvName); +// CatPrint (Str, L"Fv(%s)", strguid(&FvPath->FvName)); //} // //DEVICE_PATH_STRING_TABLE DevPathTable[] = { diff --git a/rEFIt_UEFI/Platform/Edid.cpp b/rEFIt_UEFI/Platform/Edid.cpp index 775d135d8..203c6329b 100644 --- a/rEFIt_UEFI/Platform/Edid.cpp +++ b/rEFIt_UEFI/Platform/Edid.cpp @@ -72,7 +72,7 @@ UINT8* getCurrentEdid (VOID) Edid = (__typeof__(Edid))AllocateCopyPool (EdidProtocol->SizeOfEdid, EdidProtocol->Edid); } } - DBG(" %a\n", Edid != NULL ? "found" : "not found"); + DBG(" %s\n", Edid != NULL ? "found" : "not found"); return Edid; } @@ -84,12 +84,12 @@ VOID DebugDumpEDID(CONST CHAR8 *Message, INTN N) if (GlobalConfig.DebugLog) { return; } - DBG("%a size:%d\n", Message, N); + DBG("%s size:%lld\n", Message, N); for (i=0; i N-1) break; - DBG(" %02x", gSettings.CustomEDID[i+j]); + DBG(" %02X", gSettings.CustomEDID[i+j]); } DBG("\n"); } @@ -114,7 +114,7 @@ EFI_STATUS GetEdidDiscovered(VOID) if (!EFI_ERROR (Status)) { //discovered N = EdidDiscovered->SizeOfEdid; if (!GlobalConfig.DebugLog) { - DBG("EdidDiscovered size=%d\n", N); + DBG("EdidDiscovered size=%llu\n", N); } if (N == 0) { return EFI_NOT_FOUND; @@ -128,17 +128,17 @@ EFI_STATUS GetEdidDiscovered(VOID) if (gSettings.CustomEDID) { // begin patching result if (gSettings.VendorEDID) { - DBG(" VendorID = 0x%04lx changed to 0x%04lx\n", ((UINT16*)gSettings.CustomEDID)[4], gSettings.VendorEDID); + DBG(" VendorID = 0x%04hx changed to 0x%04hx\n", ((UINT16*)gSettings.CustomEDID)[4], gSettings.VendorEDID); ((UINT16*)gSettings.CustomEDID)[4] = gSettings.VendorEDID; } if (gSettings.ProductEDID) { - DBG(" ProductID = 0x%04lx changed to 0x%04lx\n", ((UINT16*)gSettings.CustomEDID)[5], gSettings.ProductEDID); + DBG(" ProductID = 0x%04hx changed to 0x%04hx\n", ((UINT16*)gSettings.CustomEDID)[5], gSettings.ProductEDID); ((UINT16*)gSettings.CustomEDID)[5] = gSettings.ProductEDID; } if (gSettings.EdidFixHorizontalSyncPulseWidth) { - DBG(" HorizontalSyncPulseWidth = 0x%02lx changed to 0x%02lx\n", ((UINT8*)gSettings.CustomEDID)[63], gSettings.EdidFixHorizontalSyncPulseWidth); + DBG(" HorizontalSyncPulseWidth = 0x%02hhx changed to 0x%02hx\n", ((UINT8*)gSettings.CustomEDID)[63], gSettings.EdidFixHorizontalSyncPulseWidth); UINT8 LsBits, MsBits; LsBits = gSettings.EdidFixHorizontalSyncPulseWidth & 0xff; MsBits = (gSettings.EdidFixHorizontalSyncPulseWidth >> 8) & 0x03; @@ -148,7 +148,7 @@ EFI_STATUS GetEdidDiscovered(VOID) } if (gSettings.EdidFixVideoInputSignal) { - DBG(" VideoInputSignal = 0x%02lx changed to 0x%02lx\n", ((UINT8*)gSettings.CustomEDID)[20], gSettings.EdidFixVideoInputSignal); + DBG(" VideoInputSignal = 0x%02hhx changed to 0x%02hhx\n", ((UINT8*)gSettings.CustomEDID)[20], gSettings.EdidFixVideoInputSignal); ((UINT8*)gSettings.CustomEDID)[20] = gSettings.EdidFixVideoInputSignal; } @@ -157,9 +157,9 @@ EFI_STATUS GetEdidDiscovered(VOID) ((UINT8*)gSettings.CustomEDID)[127] = NewChecksum; DebugDumpEDID("--- Patched EDID Table", N); } else if (((UINT8*)gSettings.CustomEDID)[127] != NewChecksum) { - DBG(" Fix wrong checksum = 0x%02lx changed to ", ((UINT8*)gSettings.CustomEDID)[127]); + DBG(" Fix wrong checksum = 0x%02hhx changed to ", ((UINT8*)gSettings.CustomEDID)[127]); ((UINT8*)gSettings.CustomEDID)[127] = NewChecksum; - DBG("0x%02lx\n", ((UINT8*)gSettings.CustomEDID)[127]); + DBG("0x%02hhx\n", ((UINT8*)gSettings.CustomEDID)[127]); DebugDumpEDID("--- Patched EDID Table", N); } } diff --git a/rEFIt_UEFI/Platform/Events.cpp b/rEFIt_UEFI/Platform/Events.cpp index 37b909b23..04e5992f3 100644 --- a/rEFIt_UEFI/Platform/Events.cpp +++ b/rEFIt_UEFI/Platform/Events.cpp @@ -99,7 +99,7 @@ VOID CorrectMemoryMap(IN UINT32 memMap, case EfiBootServicesData: memDescriptor->Type = EfiConventionalMemory; memDescriptor->Attribute = 0; - // DBG(L"Range BS %x corrected to conventional\n", memDescriptor->PhysicalStart); + // DBG(L"Range BS %X corrected to conventional\n", memDescriptor->PhysicalStart); if(MEM_DEB) { UnicodeSPrint(tmp, 160, L"Range BS %x corrected to conventional\n\r", memDescriptor->PhysicalStart); gST->ConOut->OutputString (gST->ConOut, tmp); @@ -117,7 +117,7 @@ VOID CorrectMemoryMap(IN UINT32 memMap, (memDescriptor->Attribute == EFI_MEMORY_WB)) { memDescriptor->Type = EfiConventionalMemory; memDescriptor->Attribute = 0xF; -// DBG(L"Range WB %x corrected to conventional\n", memDescriptor->PhysicalStart); +// DBG(L"Range WB %X corrected to conventional\n", memDescriptor->PhysicalStart); if(MEM_DEB) { UnicodeSPrint(tmp, 160, L"Range WB %x corrected to conventional\n\r", memDescriptor->PhysicalStart); gST->ConOut->OutputString (gST->ConOut, tmp); diff --git a/rEFIt_UEFI/Platform/FixBiosDsdt.cpp b/rEFIt_UEFI/Platform/FixBiosDsdt.cpp index fb2fd8aea..7c3d4a9e2 100755 --- a/rEFIt_UEFI/Platform/FixBiosDsdt.cpp +++ b/rEFIt_UEFI/Platform/FixBiosDsdt.cpp @@ -647,7 +647,7 @@ VOID CheckHardware() PCIdevice.DeviceHandle = Handle; DevicePath = DevicePathFromHandle (Handle); if (DevicePath) { - // DBG("Device patch = %s \n", DevicePathToStr(DevicePath)); + // DBG("Device patch = %ls \n", DevicePathToStr(DevicePath)); //Display ADR if ((Pci.Hdr.ClassCode[2] == PCI_CLASS_DISPLAY) && @@ -658,11 +658,11 @@ VOID CheckHardware() // PCI_IO_DEVICE *PciIoDevice; GetPciADR(DevicePath, &DisplayADR1[display], &DisplayADR2[display], NULL); - DBG("VideoCard devID=0x%x\n", ((Pci.Hdr.DeviceId << 16) | Pci.Hdr.VendorId)); + DBG("VideoCard devID=0x%X\n", ((Pci.Hdr.DeviceId << 16) | Pci.Hdr.VendorId)); #if DEBUG_FIX dadr1 = DisplayADR1[display]; dadr2 = DisplayADR2[display]; - DBG("DisplayADR1[%d] = 0x%x, DisplayADR2[%d] = 0x%x\n", display, dadr1, display, dadr2); + DBG("DisplayADR1[%d] = 0x%X, DisplayADR2[%d] = 0x%X\n", display, dadr1, display, dadr2); #endif // dadr2 = dadr1; //to avoid warning "unused variable" :( DisplayVendor[display] = Pci.Hdr.VendorId; @@ -691,7 +691,7 @@ VOID CheckHardware() else Display2PCIE = TRUE; } - DBG("Display %d is %aPCIE\n", display, (PciIoDevice->IsPciExp) ? "" :" not"); */ + DBG("Display %d is %sPCIE\n", display, (PciIoDevice->IsPciExp) ? "" :" not"); */ display++; } @@ -699,7 +699,7 @@ VOID CheckHardware() if ((Pci.Hdr.ClassCode[2] == PCI_CLASS_NETWORK) && (Pci.Hdr.ClassCode[1] == PCI_CLASS_NETWORK_ETHERNET)) { GetPciADR(DevicePath, &NetworkADR1[net_count], &NetworkADR2[net_count], NULL); - // DBG("NetworkADR1 = 0x%x, NetworkADR2 = 0x%x\n", NetworkADR1, NetworkADR2); + // DBG("NetworkADR1 = 0x%X, NetworkADR2 = 0x%X\n", NetworkADR1, NetworkADR2); // Netmodel = get_net_model(deviceid); Netmodel[net_count] = get_net_model(deviceid); net_count++; @@ -709,16 +709,16 @@ VOID CheckHardware() if ((Pci.Hdr.ClassCode[2] == PCI_CLASS_NETWORK) && (Pci.Hdr.ClassCode[1] == PCI_CLASS_NETWORK_OTHER)) { GetPciADR(DevicePath, &ArptADR1, &ArptADR2, NULL); - // DBG("ArptADR1 = 0x%x, ArptADR2 = 0x%x\n", ArptADR1, ArptADR2); + // DBG("ArptADR1 = 0x%X, ArptADR2 = 0x%X\n", ArptADR1, ArptADR2); // Netmodel = get_arpt_model(deviceid); ArptBCM = (Pci.Hdr.VendorId == 0x14e4); if (ArptBCM) { - DBG("Found Airport BCM at 0x%x, 0x%x\n", ArptADR1, ArptADR2); + DBG("Found Airport BCM at 0x%X, 0x%X\n", ArptADR1, ArptADR2); } ArptAtheros = (Pci.Hdr.VendorId == 0x168c); ArptDID = Pci.Hdr.DeviceId; if (ArptAtheros) { - DBG("Found Airport Atheros at 0x%x, 0x%x, DeviceID=0x%04x\n", ArptADR1, ArptADR2, ArptDID); + DBG("Found Airport Atheros at 0x%X, 0x%X, DeviceID=0x%04X\n", ArptADR1, ArptADR2, ArptDID); } } @@ -726,14 +726,14 @@ VOID CheckHardware() if ((Pci.Hdr.ClassCode[2] == PCI_CLASS_SERIAL) && (Pci.Hdr.ClassCode[1] == PCI_CLASS_SERIAL_FIREWIRE)) { GetPciADR(DevicePath, &FirewireADR1, &FirewireADR2, NULL); - // DBG("FirewireADR1 = 0x%x, FirewireADR2 = 0x%x\n", FirewireADR1, FirewireADR2); + // DBG("FirewireADR1 = 0x%X, FirewireADR2 = 0x%X\n", FirewireADR1, FirewireADR2); } //SBUS ADR if ((Pci.Hdr.ClassCode[2] == PCI_CLASS_SERIAL) && (Pci.Hdr.ClassCode[1] == PCI_CLASS_SERIAL_SMB)) { GetPciADR(DevicePath, &SBUSADR1, &SBUSADR2, NULL); - // DBG("SBUSADR1 = 0x%x, SBUSADR2 = 0x%x\n", SBUSADR1, SBUSADR2); + // DBG("SBUSADR1 = 0x%X, SBUSADR2 = 0x%X\n", SBUSADR1, SBUSADR2); } //IMEI ADR if ((Pci.Hdr.ClassCode[2] == PCI_CLASS_SCC) && @@ -749,7 +749,7 @@ VOID CheckHardware() USBIntel = (Pci.Hdr.VendorId == 0x8086); USBNForce = (Pci.Hdr.VendorId == 0x10de); GetPciADR(DevicePath, &USBADR[usb], &USBADR2[usb], &USBADR3[usb]); - DBG("USBADR[%d] = 0x%x and PCIe = 0x%x\n", usb, USBADR[usb], USBADR2[usb]); + DBG("USBADR[%d] = 0x%X and PCIe = 0x%X\n", usb, USBADR[usb], USBADR2[usb]); if (USBIDFIX) { if (USBADR[usb] == 0x001D0000 && !NativeUSB(DID)) DID = 0x3a34; @@ -787,7 +787,7 @@ VOID CheckHardware() if (gSettings.HDALayoutId > 0) { // layoutId is specified - use it layoutId = (UINT32)gSettings.HDALayoutId; - DBG("Audio HDA (addr:0x%x) setting specified layout-id=%d (0x%x)\n", HDAADR1, layoutId, layoutId); + DBG("Audio HDA (addr:0x%X) setting specified layout-id=%d (0x%X)\n", HDAADR1, layoutId, layoutId); } HDAFIX = TRUE; @@ -809,7 +809,7 @@ VOID CheckHardware() if ((Pci.Hdr.ClassCode[2] == PCI_CLASS_MASS_STORAGE) && (Pci.Hdr.ClassCode[1] == PCI_CLASS_MASS_STORAGE_IDE)) { GetPciADR(DevicePath, &IDEADR1, &IDEADR2, NULL); - // DBG("IDEADR1 = 0x%x, IDEADR2 = 0x%x\n", IDEADR1, IDEADR2); + // DBG("IDEADR1 = 0x%X, IDEADR2 = 0x%X\n", IDEADR1, IDEADR2); IDEFIX = get_ide_model(deviceid); IDEVENDOR = Pci.Hdr.VendorId; } @@ -819,7 +819,7 @@ VOID CheckHardware() (Pci.Hdr.ClassCode[1] == PCI_CLASS_MASS_STORAGE_SATADPA) && (Pci.Hdr.ClassCode[0] == 0x00)) { GetPciADR(DevicePath, &SATAADR1, &SATAADR2, NULL); - // DBG("SATAADR1 = 0x%x, SATAADR2 = 0x%x\n", SATAADR1, SATAADR2); + // DBG("SATAADR1 = 0x%X, SATAADR2 = 0x%X\n", SATAADR1, SATAADR2); SATAFIX = get_ide_model(deviceid); SATAVENDOR = Pci.Hdr.VendorId; } @@ -829,7 +829,7 @@ VOID CheckHardware() (Pci.Hdr.ClassCode[1] == PCI_CLASS_MASS_STORAGE_SATADPA) && (Pci.Hdr.ClassCode[0] == 0x01)) { GetPciADR(DevicePath, &SATAAHCIADR1, &SATAAHCIADR2, NULL); - // DBG("SATAAHCIADR1 = 0x%x, SATAAHCIADR2 = 0x%x\n", SATAAHCIADR1, SATAAHCIADR2); + // DBG("SATAAHCIADR1 = 0x%X, SATAAHCIADR2 = 0x%X\n", SATAAHCIADR1, SATAAHCIADR2); // AHCIFIX = get_ahci_model(deviceid); SATAAHCIVENDOR = Pci.Hdr.VendorId; } @@ -946,7 +946,7 @@ VOID findCPU(UINT8* dsdt, UINT32 length) //1. if name begin with \\ this is with score //2. else find outer device or scope until \\ is found //3. add new name everytime is found - // DBG("first CPU found at %x offset %x\n", i, offset); + // DBG("first CPU found at %X offset %X\n", i, offset); if (dsdt[offset] == '\\') { // "\_PR.CPU0" @@ -967,7 +967,7 @@ VOID findCPU(UINT8* dsdt, UINT32 length) k = j + 2; if ((dsdt[j] == 0x5B) && (dsdt[j + 1] == 0x82) && !CmpNum(dsdt, j, TRUE)) { //device candidate - // DBG("device candidate at %x\n", j); + // DBG("device candidate at %X\n", j); size = get_size(dsdt, k); if (size) { if (k + size > i + 3) { //Yes - it is outer @@ -975,11 +975,11 @@ VOID findCPU(UINT8* dsdt, UINT32 length) if (dsdt[off2] == '\\') { // "\_SB.SCL0" InsertScore(dsdt, off2, 1); - // DBG("acpi_cpu_score calculated as %a\n", acpi_cpu_score); + // DBG("acpi_cpu_score calculated as %s\n", acpi_cpu_score); break; } else { InsertScore(dsdt, off2, 0); - // DBG("device inserted in acpi_cpu_score %a\n", acpi_cpu_score); + // DBG("device inserted in acpi_cpu_score %s\n", acpi_cpu_score); } } //else not an outer device } //else wrong size field - not a device @@ -991,7 +991,7 @@ VOID findCPU(UINT8* dsdt, UINT32 length) dsdt[j + 2] == 'B' && dsdt[j + 3] == '_') || (dsdt[j] == '_' && dsdt[j + 1] == 'P' && dsdt[j + 2] == 'R' && dsdt[j + 3] == '_')) { - // DBG("score candidate at %x\n", j); + // DBG("score candidate at %X\n", j); for (j1=0; j1 < 10; j1++) { if (dsdt[j - j1] != 0x10) { continue; @@ -999,7 +999,7 @@ VOID findCPU(UINT8* dsdt, UINT32 length) if (!CmpNum(dsdt, j - j1, TRUE)) { SBADR = j - j1 + 1; SBSIZE = get_size(dsdt, SBADR); - // DBG("found Scope(\\_SB) address = 0x%08x size = 0x%08x\n", SBADR, SBSIZE); + // DBG("found Scope(\\_SB) address = 0x%08X size = 0x%08X\n", SBADR, SBSIZE); if ((SBSIZE != 0) && (SBSIZE < length)) { //if zero or too large then search more //if found k = SBADR - 6; @@ -1013,7 +1013,7 @@ VOID findCPU(UINT8* dsdt, UINT32 length) } //else not a scope if (SBFound) { InsertScore(dsdt, j, 0); - // DBG("score inserted in acpi_cpu_score %a\n", acpi_cpu_score); + // DBG("score inserted in acpi_cpu_score %s\n", acpi_cpu_score); break; } j = k - 3; //if found then search again from found @@ -1039,7 +1039,7 @@ VOID findCPU(UINT8* dsdt, UINT32 length) if (!(IS_UPPER(c) || IS_DIGIT(c) || c == '_')) { add_name = FALSE; - DBG("Invalid character found in ProcessorOP 0x%x!\n", c); + DBG("Invalid character found in ProcessorOP 0x%X!\n", c); break; } } @@ -1054,16 +1054,16 @@ VOID findCPU(UINT8* dsdt, UINT32 length) // acpi_cpu_p_blk = dsdt[i] | (dsdt[i+1] << 8); if (acpi_cpu_count == 0) { - DBG("Found ACPI CPU: %a ", acpi_cpu_name[acpi_cpu_count]); + DBG("Found ACPI CPU: %s ", acpi_cpu_name[acpi_cpu_count]); } else { - DBG("| %a ", acpi_cpu_name[acpi_cpu_count]); + DBG("| %s ", acpi_cpu_name[acpi_cpu_count]); } if (++acpi_cpu_count == acpi_cpu_max) break; } } } - DBG(", within the score: %a\n", acpi_cpu_score); + DBG(", within the score: %s\n", acpi_cpu_score); if (!acpi_cpu_count) { for (i=0; i < acpi_cpu_max; i++) { @@ -1123,7 +1123,7 @@ UINT32 get_size(UINT8* Buffer, UINT32 adr) Buffer[adr+3] << 20; } else { - // DBG("wrong pointer to size field at %x\n", adr); + // DBG("wrong pointer to size field at %X\n", adr); return 0; } return temp; @@ -1367,11 +1367,11 @@ UINT32 CorrectOuterMethod (UINT8 *dsdt, UINT32 len, UINT32 adr, INT32 shift) if (((size <= 0x3F) && !GetName(dsdt, k+1, &Name[0], NULL)) || ((size > 0x3F) && (size <= 0xFFF) && !GetName(dsdt, k+2, &Name[0], NULL)) || ((size > 0xFFF) && !GetName(dsdt, k+3, &Name[0], NULL))) { - DBG("method found, size=0x%x but name is not\n", size); + DBG("method found, size=0x%X but name is not\n", size); continue; } if ((k+size) > adr+4) { //Yes - it is outer - DBG("found outer method %a begin=%x end=%x\n", Name, k, k+size); + DBG("found outer method %s begin=%X end=%X\n", Name, k, k+size); offset = write_size(k, dsdt, len, shift); //size corrected to sizeoffset at address j // shift += offset; len += offset; @@ -1435,7 +1435,7 @@ UINT32 CorrectOuters (UINT8 *dsdt, UINT32 len, UINT32 adr, INT32 shift) size = (INT32)get_size(dsdt, k); if (size) { if ((k + size) > (INT32)adr+4) { //Yes - it is outer - // DBG("found outer device begin=%x end=%x\n", k, k+size); + // DBG("found outer device begin=%X end=%X\n", k, k+size); offset = write_size(k, dsdt, len, shift); //size corrected to sizeoffset at address j shift += offset; len += offset; @@ -1453,12 +1453,12 @@ UINT32 CorrectOuters (UINT8 *dsdt, UINT32 len, UINT32 adr, INT32 shift) if (!CmpNum(dsdt, i-j, TRUE)) { SBADR = i-j+1; SBSIZE = get_size(dsdt, SBADR); - // DBG("found Scope(\\_SB) address = 0x%08x size = 0x%08x\n", SBADR, SBSIZE); + // DBG("found Scope(\\_SB) address = 0x%08X size = 0x%08X\n", SBADR, SBSIZE); if ((SBSIZE != 0) && (SBSIZE < len)) { //if zero or too large then search more //if found k = SBADR - 6; if ((SBADR + SBSIZE) > adr+4) { //Yes - it is outer - // DBG("found outer scope begin=%x end=%x\n", SBADR, SBADR+SBSIZE); + // DBG("found outer scope begin=%X end=%X\n", SBADR, SBADR+SBSIZE); offset = write_size(SBADR, dsdt, len, shift); shift += offset; len += offset; @@ -1490,9 +1490,9 @@ INTN ReplaceName(UINT8 *dsdt, UINT32 len, CONST CHAR8 *OldName, CONST CHAR8 *New if ((dsdt[i+0] == NewName[0]) && (dsdt[i+1] == NewName[1]) && (dsdt[i+2] == NewName[2]) && (dsdt[i+3] == NewName[3])) { if (OldName) { - MsgLog("NewName %a already present, renaming impossible\n", NewName); + MsgLog("NewName %s already present, renaming impossible\n", NewName); } else { - DBG("name %a present at %x\n", NewName, i); + DBG("name %s present at %X\n", NewName, i); } return -1; } @@ -1504,7 +1504,7 @@ INTN ReplaceName(UINT8 *dsdt, UINT32 len, CONST CHAR8 *OldName, CONST CHAR8 *New for (i = 0; len >= 4 && i < len - 4; i++) { if ((dsdt[i+0] == OldName[0]) && (dsdt[i+1] == OldName[1]) && (dsdt[i+2] == OldName[2]) && (dsdt[i+3] == OldName[3])) { - MsgLog("Name %a present at 0x%x, renaming to %a\n", OldName, i, NewName); + MsgLog("Name %s present at 0x%llX, renaming to %s\n", OldName, i, NewName); dsdt[i+0] = NewName[0]; dsdt[i+1] = NewName[1]; dsdt[i+2] = NewName[2]; @@ -1534,7 +1534,7 @@ UINT32 devFind(UINT8 *dsdt, UINT32 address) } //else continue } } - MsgLog("Device definition before adr=%x not found\n", address); + MsgLog("Device definition before adr=%X not found\n", address); return 0; //impossible value for fool proof } @@ -1553,12 +1553,12 @@ BOOLEAN CustProperties(AML_CHUNK* pack, UINT32 Dev) Injected = TRUE; if (!gSettings.AddProperties[i].MenuItem.BValue) { - //DBG(" disabled property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" disabled property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } else { aml_add_string(pack, gSettings.AddProperties[i].Key); aml_add_byte_buffer(pack, gSettings.AddProperties[i].Value, (UINT32)gSettings.AddProperties[i].ValueLen); - //DBG(" added property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" added property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } } return Injected; @@ -1569,7 +1569,7 @@ UINT32 DeleteDevice(CONST CHAR8 *Name, UINT8 *dsdt, UINT32 len) { UINT32 i, j; INT32 size = 0, sizeoffset; - MsgLog(" deleting device %a\n", Name); + MsgLog(" deleting device %s\n", Name); for (i=20; i len) { MsgLog(" the patch is too large!\n"); return len; @@ -1765,7 +1765,7 @@ UINT32 FixAny (UINT8* dsdt, UINT32 len, UINT8* ToFind, UINT32 LenTF, UINT8* ToRe MsgLog(" patched at: ["); } - MsgLog(" (%x)", adr); + MsgLog(" (%X)", adr); found = TRUE; len = move_data(adr + i, dsdt, len, sizeoffset); if ((LenTR > 0) && (ToReplace != NULL)) { @@ -1798,7 +1798,7 @@ UINT32 FixRenameByBridge2 (UINT8* dsdt, UINT32 len, CHAR8* TgtBrgName, UINT8* To return len; } - DBG(" pattern %02x%02x%02x%02x,", ToFind[0], ToFind[1], ToFind[2], ToFind[3]); + DBG(" pattern %02X%02X%02X%02X,", ToFind[0], ToFind[1], ToFind[2], ToFind[3]); if ((LenTF + sizeof(EFI_ACPI_DESCRIPTION_HEADER)) > len) { DBG(" the patch is too large!\n"); return len; @@ -1838,7 +1838,7 @@ UINT32 FixRenameByBridge2 (UINT8* dsdt, UINT32 len, CHAR8* TgtBrgName, UINT8* To DBG(" patched at: ["); } - DBG(" (%x)", adr); + DBG(" (%X)", adr); found = TRUE; if ((LenTR > 0) && (ToReplace != NULL)) { CopyMem(dsdt + BrdADR + adr, ToReplace, LenTR); @@ -1906,7 +1906,7 @@ UINT32 AddPNLF (UINT8 *dsdt, UINT32 len) //search PWRB PNP0C0C for (i=0x20; len >= 6 && i < len - 6; i++) { if (CmpPNP(dsdt, i, 0x0C0C)) { - DBG("found PWRB at %x\n", i); + DBG("found PWRB at %X\n", i); adr = devFind(dsdt, i); break; } @@ -1917,7 +1917,7 @@ UINT32 AddPNLF (UINT8 *dsdt, UINT32 len) for (i=0x20; len >= 6 && i < len - 6; i++) { if (CmpPNP(dsdt, i, 0x0C0A)) { adr = devFind(dsdt, i); - DBG("found BAT0 at %x\n", i); + DBG("found BAT0 at %X\n", i); break; } } @@ -2123,7 +2123,7 @@ UINT32 FixRTC (UINT8 *dsdt, UINT32 len) MsgLog("found RTC had IRQNoFlag will move %d bytes\n", sizeoffset); // First move offset byte remove IRQNoFlag len = move_data(l, dsdt, len, sizeoffset); - DBG("...len=%x\n", len); + DBG("...len=%X\n", len); // Fix IO (Decode16, size and _CRS size dsdt[RESADR] += (UINT8)sizeoffset; dsdt[IOADR] += (UINT8)sizeoffset; @@ -2138,9 +2138,9 @@ UINT32 FixRTC (UINT8 *dsdt, UINT32 len) shift = write_size(adr, dsdt, len, sizeoffset); sizeoffset += shift; //sizeoffset changed len += shift; - DBG("new size written to %x shift=%x len=%x\n", adr, shift, len); + DBG("new size written to %X shift=%X len=%X\n", adr, shift, len); len = CorrectOuters(dsdt, len, adr-3, sizeoffset); - DBG("len after correct outers %x\n", len); + DBG("len after correct outers %X\n", len); sizeoffset = 0; } // sizeoffset if } // l loop @@ -2167,7 +2167,7 @@ UINT32 FixTMR (UINT8 *dsdt, UINT32 len) continue; } tmrsize = get_size(dsdt, adr); - // DBG("TMR size=%x at %x\n", tmrsize, adr); + // DBG("TMR size=%X at %X\n", tmrsize, adr); if (tmrsize) { break; } @@ -2243,7 +2243,7 @@ UINT32 FixPIC (UINT8 *dsdt, UINT32 len) continue; } picsize = get_size(dsdt, adr); - DBG("PIC size=%x at %x\n", picsize, adr); + DBG("PIC size=%X at %X\n", picsize, adr); if (picsize) { break; } @@ -2267,7 +2267,7 @@ UINT32 FixPIC (UINT8 *dsdt, UINT32 len) ((dsdt[i+1] & 0xF0) == 0x40)) { RESADR = i+1; //Format 11, size1, size2, 0A, size-4,... 79, 00 IOADR = i+4; //IO (Decode16 ==> 47, 01 - DBG("found CRS at %x size %x\n", RESADR, dsdt[IOADR]); + DBG("found CRS at %X size %X\n", RESADR, dsdt[IOADR]); continue; } } @@ -2385,7 +2385,7 @@ UINT32 FIXLPCB (UINT8 *dsdt, UINT32 len) DBG("Start LPCB Fix\n"); - //DBG("len = 0x%08x\n", len); + //DBG("len = 0x%08X\n", len); //have to find LPC for (j=0x20; len >= 10 && j < len - 10; j++) { if (CmpAdr(dsdt, j, 0x001F0000)) @@ -2397,7 +2397,7 @@ UINT32 FIXLPCB (UINT8 *dsdt, UINT32 len) LPCBSIZE = get_size(dsdt, LPCBADR); device_name[3] = (__typeof_am__(device_name[3]))AllocateZeroPool(5); CopyMem(device_name[3], dsdt + j, 4); - MsgLog("found LPCB device NAME(_ADR,0x001F0000) at %x And Name is %a\n", j, + MsgLog("found LPCB device NAME(_ADR,0x001F0000) at %X And Name is %s\n", j, device_name[3]); if (LPCBSIZE) break; @@ -2524,7 +2524,7 @@ UINT32 FIXDisplay (UINT8 *dsdt, UINT32 len, INT32 VCard) } devsize1 = get_size(dsdt, devadr1); if (devsize1) { - MsgLog("Found internal video device %x @%x\n", DisplayADR2[VCard], devadr1); + MsgLog("Found internal video device %X @%X\n", DisplayADR2[VCard], devadr1); DISPLAYFIX = TRUE; break; } @@ -2543,10 +2543,10 @@ UINT32 FIXDisplay (UINT8 *dsdt, UINT32 len, INT32 VCard) if (gSettings.ReuseFFFF) { dsdt[j+10] = 0; dsdt[j+11] = 0; - MsgLog("Found internal video device FFFF@%x, ReUse as 0\n", devadr1); + MsgLog("Found internal video device FFFF@%X, ReUse as 0\n", devadr1); } else { NonUsable = TRUE; - MsgLog("Found internal video device FFFF@%x, unusable\n", devadr1); + MsgLog("Found internal video device FFFF@%X, unusable\n", devadr1); } DISPLAYFIX = TRUE; break; @@ -2619,11 +2619,11 @@ UINT32 FIXDisplay (UINT8 *dsdt, UINT32 len, INT32 VCard) ) ) ) { - MsgLog("Skipping Method(_DSM) for %04x card\n", DisplayVendor[VCard]); + MsgLog("Skipping Method(_DSM) for %04X card\n", DisplayVendor[VCard]); goto Skip_DSM; } - MsgLog("Creating Method(_DSM) for %04x card\n", DisplayVendor[VCard]); + MsgLog("Creating Method(_DSM) for %04X card\n", DisplayVendor[VCard]); met = aml_add_method(gfx0, "_DSM", 4); met2 = aml_add_store(met); pack = aml_add_package(met2); @@ -2698,7 +2698,7 @@ Skip_DSM: } } } else { - MsgLog("Warning: Method(_SUN) found for %04x card\n", DisplayVendor[VCard]); + MsgLog("Warning: Method(_SUN) found for %04X card\n", DisplayVendor[VCard]); } break; } @@ -2720,7 +2720,7 @@ Skip_DSM: if (!DISPLAYFIX || (DisplayADR2[VCard] == 0xFFFE)) { //subdevice absent devsize = get_size(dsdt, devadr); if (!devsize) { - DBG("BUG! Address of existing PEG0 is lost %x\n", devadr); + DBG("BUG! Address of existing PEG0 is lost %X\n", devadr); FreePool(display); return len; } @@ -2818,7 +2818,7 @@ UINT32 AddHDMI (UINT8 *dsdt, UINT32 len) } device_name[11] = (__typeof_am__(device_name[11]))AllocateZeroPool(5); CopyMem(device_name[11], dsdt+k, 4); - DBG("found HDMI device [0x%08x:%x] at %x and Name is %a\n", + DBG("found HDMI device [0x%08X:%X] at %X and Name is %s\n", HDMIADR1, HDMIADR2, devadr1, device_name[11]); ReplaceName(dsdt + devadr, BridgeSize, device_name[11], "HDAU"); HdauFound = TRUE; @@ -2826,7 +2826,7 @@ UINT32 AddHDMI (UINT8 *dsdt, UINT32 len) } } if (!HdauFound) { - DBG("have no HDMI device while HDMIADR2=%x\n", HDMIADR2); + DBG("have no HDMI device while HDMIADR2=%X\n", HDMIADR2); devadr1 = devadr; } } else { @@ -2861,10 +2861,10 @@ UINT32 AddHDMI (UINT8 *dsdt, UINT32 len) root = aml_add_device(brd, "HDM0"); aml_add_name(root, "_ADR"); aml_add_dword(root, HDMIADR1); - DBG("Created bridge device with ADR=0x%x\n", HDMIADR1); + DBG("Created bridge device with ADR=0x%X\n", HDMIADR1); } - DBG("HDMIADR1=%x HDMIADR2=%x\n", HDMIADR1, HDMIADR2); + DBG("HDMIADR1=%X HDMIADR2=%X\n", HDMIADR1, HDMIADR2); if (!HdauFound && (HDMIADR2 != 0xFFFE)) //there is no HDMI device at dsdt, creating new one { AML_CHUNK* dev = aml_add_device(root, "HDAU"); @@ -2993,7 +2993,7 @@ UINT32 FIXNetwork (UINT8 *dsdt, UINT32 len, UINT32 card) device_name[1] = (__typeof_am__(device_name[1]))AllocateZeroPool(5); CopyMem(device_name[1], dsdt+k, 4); - DBG("found NetWork device [0x%08x:%x] at %x and Name is %a\n", + DBG("found NetWork device [0x%08X:%X] at %X and Name is %s\n", NetworkADR1[card], NetworkADR2[card], NetworkADR, device_name[1]); //renaming disabled until better way will found // ReplaceName(dsdt + BrdADR, BridgeSize, device_name[1], "GIGE"); @@ -3002,7 +3002,7 @@ UINT32 FIXNetwork (UINT8 *dsdt, UINT32 len, UINT32 card) } } if (!NetworkName) { - DBG("have no Network device while NetworkADR2=%x\n", NetworkADR2[card]); + DBG("have no Network device while NetworkADR2=%X\n", NetworkADR2[card]); //in this case NetworkADR point to bridge NetworkADR = BrdADR; } @@ -3037,10 +3037,10 @@ UINT32 FIXNetwork (UINT8 *dsdt, UINT32 len, UINT32 card) root = aml_add_device(brd, "LAN0"); aml_add_name(root, "_ADR"); aml_add_dword(root, NetworkADR1[card]); - DBG("Created bridge device with ADR=0x%x\n", NetworkADR1[card]); + DBG("Created bridge device with ADR=0x%X\n", NetworkADR1[card]); } - DBG("NetworkADR1=%x NetworkADR2=%x\n", NetworkADR1[card], NetworkADR2[card]); + DBG("NetworkADR1=%X NetworkADR2=%X\n", NetworkADR1[card], NetworkADR2[card]); dev = root; if (!NetworkName && (NetworkADR2[card] != 0xFFFE)) //there is no network device at dsdt, creating new one { @@ -3113,7 +3113,7 @@ UINT32 FIXNetwork (UINT8 *dsdt, UINT32 len, UINT32 card) return len; } sizeoffset = root->Size; - DBG("network DSM created, size=%x\n", sizeoffset); + DBG("network DSM created, size=%X\n", sizeoffset); aml_write_node(root, network, 0); aml_destroy_node(root); if (NetworkADR) { // bridge or lan @@ -3193,7 +3193,7 @@ UINT32 FIXAirport (UINT8 *dsdt, UINT32 len) } device_name[9] = (__typeof_am__(device_name[9]))AllocateZeroPool(5); CopyMem(device_name[9], dsdt+k, 4); - DBG("found Airport device [%08x:%x] at %x And Name is %a\n", + DBG("found Airport device [%08X:%X] at %X And Name is %s\n", ArptADR1, ArptADR2, ArptADR, device_name[9]); // ReplaceName(dsdt + BrdADR, BridgeSize, device_name[9], "ARPT"); //sometimes dangeous ArptName = TRUE; @@ -3232,7 +3232,7 @@ UINT32 FIXAirport (UINT8 *dsdt, UINT32 len) root = aml_add_device(brd, "ARP0"); aml_add_name(root, "_ADR"); aml_add_dword(root, ArptADR1); - DBG("Created bridge device with ADR=0x%x\n", ArptADR1); + DBG("Created bridge device with ADR=0x%X\n", ArptADR1); } dev = root; @@ -3309,7 +3309,7 @@ UINT32 FIXAirport (UINT8 *dsdt, UINT32 len) sizeoffset = root->Size; aml_write_node(root, network, 0); aml_destroy_node(root); - DBG("AirportADR=%x add patch size=%x\n", ArptADR, sizeoffset); + DBG("AirportADR=%X add patch size=%X\n", ArptADR, sizeoffset); if (ArptADR) { // bridge or WiFi i = ArptADR; @@ -3317,7 +3317,7 @@ UINT32 FIXAirport (UINT8 *dsdt, UINT32 len) i = PCIADR; } Size = get_size(dsdt, i); - DBG("adr %x size of arpt=%x\n", i, Size); + DBG("adr %X size of arpt=%X\n", i, Size); // move data to back for add patch k = i + Size; len = move_data(k, dsdt, len, sizeoffset); @@ -3345,7 +3345,7 @@ UINT32 FIXSBUS (UINT8 *dsdt, UINT32 len) // DBG("wrong PCI0 address, patch SBUS will not be applied\n"); return len; } - DBG("Start SBUS Fix PCI=%x len=%x\n", PCIADR, len); + DBG("Start SBUS Fix PCI=%X len=%X\n", PCIADR, len); // Find Device SBUS if (SBUSADR1) { @@ -3354,7 +3354,7 @@ UINT32 FIXSBUS (UINT8 *dsdt, UINT32 len) { SBUSADR = devFind(dsdt, i); if (SBUSADR) { - DBG("device (SBUS) found at %x\n", SBUSADR); + DBG("device (SBUS) found at %X\n", SBUSADR); break; } } // end SBUS @@ -3390,7 +3390,7 @@ UINT32 FIXSBUS (UINT8 *dsdt, UINT32 len) else sizeoffset = sizeof(sbus1); -// DBG("SBUS address %x code size = 0x%08x\n", SBUSADR, sizeoffset); +// DBG("SBUS address %X code size = 0x%08X\n", SBUSADR, sizeoffset); if (SBUSADR) { // move data to back for add sbus @@ -3404,11 +3404,11 @@ UINT32 FIXSBUS (UINT8 *dsdt, UINT32 len) len += k; len = CorrectOuters(dsdt, len, SBUSADR-3, sizeoffset); // SBUSADR = adr1; - DBG("SBUS code size fix = 0x%08x\n", sizeoffset); + DBG("SBUS code size fix = 0x%08X\n", sizeoffset); } else { PCISIZE = get_size(dsdt, PCIADR); i = PCIADR + PCISIZE; - DBG("SBUS absent, adding to the end of PCI0 at %x\n", i); + DBG("SBUS absent, adding to the end of PCI0 at %X\n", i); len = move_data(i, dsdt, len, sizeoffset); CopyMem(dsdt+i, sbus1, sizeoffset); @@ -3446,7 +3446,7 @@ UINT32 AddMCHC (UINT8 *dsdt, UINT32 len) for (i=0x20; len >= 10 && i < len - 10; i++) { k = CmpDev(dsdt, i, (UINT8*)"MCHC"); if (k != 0) { - DBG("device name (MCHC) found at %x, don't add!\n", k); + DBG("device name (MCHC) found at %X, don't add!\n", k); // break; return len; } @@ -3540,7 +3540,7 @@ UINT32 AddIMEI (UINT8 *dsdt, UINT32 len) if (CmpAdr(dsdt, i, IMEIADR1)) { k = devFind(dsdt, i); if (k) { - MsgLog("device (IMEI) found at %x, don't add!\n", k); + MsgLog("device (IMEI) found at %X, don't add!\n", k); // break; return len; } @@ -3551,7 +3551,7 @@ UINT32 AddIMEI (UINT8 *dsdt, UINT32 len) for (i=0x20; len >= 10 && i < len - 10; i++) { k = CmpDev(dsdt, i, (UINT8*)"IMEI"); if (k != 0) { - MsgLog("device name (IMEI) found at %x, don't add!\n", k); + MsgLog("device name (IMEI) found at %X, don't add!\n", k); return len; } } @@ -3638,7 +3638,7 @@ UINT32 FIXFirewire (UINT8 *dsdt, UINT32 len) device_name[2] = (__typeof_am__(device_name[2]))AllocateZeroPool(5); CopyMem(device_name[2], dsdt+k, 4); - DBG("found Firewire device NAME(_ADR,0x%08x) at %x And Name is %a\n", + DBG("found Firewire device NAME(_ADR,0x%08X) at %X And Name is %s\n", FirewireADR2, k, device_name[2]); ReplaceName(dsdt + BrdADR, BridgeSize, device_name[2], "FRWR"); FirewireName = TRUE; @@ -3781,7 +3781,7 @@ UINT32 AddHDEF (UINT8 *dsdt, UINT32 len, CHAR8* OSVersion) // BridgeSize = get_size(dsdt, HDAADR); device_name[4] = (__typeof_am__(device_name[4]))AllocateZeroPool(5); CopyMem(device_name[4], dsdt+i, 4); - DBG("found HDA device NAME(_ADR,0x%08x) And Name is %a\n", + DBG("found HDA device NAME(_ADR,0x%08X) And Name is %s\n", HDAADR1, device_name[4]); ReplaceName(dsdt, len, device_name[4], "HDEF"); HDAFIX = FALSE; @@ -3889,7 +3889,7 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len) // CHAR8 *USBDATA4; DBG("Start USB Fix\n"); - //DBG("len = 0x%08x\n", len); + //DBG("len = 0x%08X\n", len); root = aml_create_node(NULL); root1 = aml_create_node(NULL); @@ -3922,7 +3922,7 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len) USBDATA1 = (__typeof__(USBDATA1))AllocateZeroPool(root->Size); size1 = root->Size; -// DBG("USB1 code size = 0x%08x\n", size1); +// DBG("USB1 code size = 0x%08X\n", size1); aml_write_node(root, USBDATA1, 0); aml_destroy_node(root); @@ -3995,7 +3995,7 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len) aml_calculate_size(root1); USBDATA2 = (__typeof__(USBDATA2))AllocateZeroPool(root1->Size); size2 = root1->Size; -// DBG("USB2 code size = 0x%08x\n", size2); +// DBG("USB2 code size = 0x%08X\n", size2); aml_write_node(root1, USBDATA2, 0); aml_destroy_node(root1); @@ -4003,7 +4003,7 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len) /* aml_calculate_size(root1); USBDATA4 = (__typeof__(USBDATA4))AllocateZeroPool(root1->Size); size4 = root1->Size; - DBG("USB OHCI code size = 0x%08x\n", size4); + DBG("USB OHCI code size = 0x%08X\n", size4); aml_write_node(root1, USBDATA4, 0); aml_destroy_node(root1); */ //NFORCE_USB_END @@ -4044,7 +4044,7 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len) aml_calculate_size(root1); USBDATA3 = (__typeof__(USBDATA3))AllocateZeroPool(root1->Size); size3 = root1->Size; -// DBG("USB3 code size = 0x%08x\n", size3); +// DBG("USB3 code size = 0x%08X\n", size3); aml_write_node(root1, USBDATA3, 0); aml_destroy_node(root1); @@ -4058,14 +4058,14 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len) if (CmpAdr(dsdt, j, USBADR[i])) { //j+4 -> _ADR XhciName = FALSE; UsbName[i] = (__typeof_am__(UsbName[i]))AllocateZeroPool(5); - // DBG("found USB at 0x%x\n", j); + // DBG("found USB at 0x%X\n", j); adr1 = devFind(dsdt, j + 2); if (!adr1) { continue; } Size = get_size(dsdt, adr1); //bridgesize - DBG("USB bridge[%x] at %x, size = %x\n", USBADR[i], adr1, Size); + DBG("USB bridge[%X] at %X, size = %X\n", USBADR[i], adr1, Size); if (USBADR2[i] != 0xFFFE ){ for (k = adr1 + 9; k < adr1 + Size; k++) { if (CmpAdr(dsdt, k, USBADR2[i])) { @@ -4076,7 +4076,7 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len) device_name[10] = (__typeof_am__(device_name[10]))AllocateZeroPool(5); CopyMem(device_name[10], dsdt+k, 4); - DBG("found USB device [%08x:%x] at %x and Name was %a ->", + DBG("found USB device [%08X:%X] at %X and Name was %s ->", USBADR[i], USBADR2[i], k, device_name[10]); if (USB30[i]) { if (gSettings.NameXH00) { @@ -4093,7 +4093,7 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len) } else { AsciiSPrint(UsbName[i], 5, "USB%d", i); } - DBG(" %a\n", UsbName[i]); + DBG(" %s\n", UsbName[i]); ReplaceName(dsdt + adr1, Size, device_name[10], UsbName[i]); XhciName = TRUE; break; @@ -4119,7 +4119,7 @@ UINT32 FIXUSB (UINT8 *dsdt, UINT32 len) sizeoffset = - 1 - Size; len = move_data(k - 1, dsdt, len, sizeoffset); len = CorrectOuters(dsdt, len, k - 2, sizeoffset); - DBG("_DSM in USB already exists, dropped by 0x%x\n", sizeoffset); + DBG("_DSM in USB already exists, dropped by 0x%X\n", sizeoffset); } else { DBG("_DSM already exists, patch USB will not be applied\n"); continue; @@ -4289,7 +4289,7 @@ UINT32 FIXIDE (UINT8 *dsdt, UINT32 len) for (i=0x20; len >= 10 && i < len - 10; i++) { if (CmpAdr(dsdt, i, IDEADR1)) { - DBG("Found IDEADR1=%x at %x\n", IDEADR1, i); + DBG("Found IDEADR1=%X at %X\n", IDEADR1, i); IDEADR = devFind(dsdt, i); if (!IDEADR) { continue; @@ -4415,7 +4415,7 @@ UINT32 FIXIDE (UINT8 *dsdt, UINT32 len) //add patafix sizeoffset = sizeof(patafix); -// DBG("add patafix size=%x\n", sizeoffset); +// DBG("add patafix size=%X\n", sizeoffset); i = get_size(dsdt, IDEADR); j = IDEADR + i; len = move_data(j, dsdt, len, sizeoffset); @@ -4451,7 +4451,7 @@ UINT32 FIXSATAAHCI (UINT8 *dsdt, UINT32 len) for (i=0x20; len >= 10 && i < len - 10; i++) { if (CmpAdr(dsdt, i, SATAAHCIADR1)) { - // DBG("Found SATAAHCIADR1=%x at %x\n", SATAAHCIADR1, i); + // DBG("Found SATAAHCIADR1=%X at %X\n", SATAAHCIADR1, i); SATAAHCIADR = devFind(dsdt, i); if (!SATAAHCIADR) { continue; @@ -4550,7 +4550,7 @@ UINT32 FIXSATA (UINT8 *dsdt, UINT32 len) for (i=0x20; len >= 10 && i < len - 10; i++) { if (CmpAdr(dsdt, i, SATAADR1)) { - // DBG("Found SATAAHCIADR1=%x at %x\n", SATAAHCIADR1, j); + // DBG("Found SATAAHCIADR1=%X at %X\n", SATAAHCIADR1, j); SATAADR = devFind(dsdt, i); if (!SATAADR) { continue; @@ -4634,7 +4634,7 @@ UINT32 FIXCPU1 (UINT8 *dsdt, UINT32 len) INT32 offset, sizeoffset; DBG("Start CPUS=1 Fix\n"); - DBG("len = 0x%08x\n", len); + DBG("len = 0x%08X\n", len); // find _PR_ and get PR size for (i=0x20; i 0x3F there should be had P_states code so don't fix if (prsize > 0x3F) return len; - DBG("_PR_ adr = 0x%08x size = 0x%08x\n", pradr, prsize); + DBG("_PR_ adr = 0x%08X size = 0x%08X\n", pradr, prsize); break; } } @@ -4662,7 +4662,7 @@ UINT32 FIXCPU1 (UINT8 *dsdt, UINT32 len) for (i=pradr; i> 6); if (dsdt[offset] == '\\') offset = i + 8 + (dsdt[i+7] >> 6); @@ -4686,7 +4686,7 @@ UINT32 FIXCPU1 (UINT8 *dsdt, UINT32 len) } } } - DBG("return len=%x\n", len); + DBG("return len=%X\n", len); return len; } */ @@ -4710,7 +4710,7 @@ UINT32 FIXWAK (UINT8 *dsdt, UINT32 len, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABL if (!waksize) { continue; } - //DBG( "_WAK adr = 0x%08x, size = 0x%08x\n", wakadr, waksize); + //DBG( "_WAK adr = 0x%08X, size = 0x%08X\n", wakadr, waksize); for (k=0; k 0) { - MsgLog(" indirect name=%a\n", NameAdr); + MsgLog(" indirect name=%s\n", NameAdr); if (dsdt[j+4] == 0x0C) { CopyMem(&oldAddress, &dsdt[j+5], 4); CopyMem(&dsdt[j+5], &p->Address, 4); @@ -5116,7 +5116,7 @@ VOID FixRegions (UINT8 *dsdt, UINT32 len) } } if (oldAddress != p->Address) { - MsgLog("OperationRegion (%a...) corrected from 0x%x to addr=0x%x\n", Name, oldAddress, p->Address); + MsgLog("OperationRegion (%s...) corrected from 0x%X to addr=0x%X\n", Name, oldAddress, p->Address); } break; } @@ -5170,13 +5170,13 @@ VOID GetBiosRegions(UINT8 *buffer) } if (tmp.Address) { OPER_REGION *newRegion = (__typeof__(newRegion))AllocateZeroPool(sizeof(OPER_REGION)); - MsgLog("Found OperationRegion(%a, SystemMemory, %x, ...)\n", tmp.Name, tmp.Address); + MsgLog("Found OperationRegion(%s, SystemMemory, %X, ...)\n", tmp.Name, tmp.Address); *newRegion = tmp; newRegion->next = gRegions; gRegions = newRegion; } else { // ignore OperationRegion where the address cannot be determined - //DBG("Unable to determine address for OperationRegion(%a, SystemMemory, ...) skipping\n", tmp.Name); + //DBG("Unable to determine address for OperationRegion(%s, SystemMemory, ...) skipping\n", tmp.Name); } } } @@ -5293,7 +5293,7 @@ VOID RenameDevices(UINT8* table) Replace = gSettings.DeviceRename[index].Name; Find = List->Name; Bridge = List->Next; - MsgLog("Name: %a, Bridge: %a, Replace: %a\n", Find, Bridge->Name, Replace); + MsgLog("Name: %s, Bridge: %s, Replace: %s\n", Find, Bridge->Name, Replace); adr = 0; do { @@ -5303,7 +5303,7 @@ VOID RenameDevices(UINT8* table) break; //not found } adr += shift; -// DBG("found Name @ 0x%x\n", adr); +// DBG("found Name @ 0x%X\n", adr); if (!Bridge || (FindBin(table + adr - 4, 5, (UINT8*)(Bridge->Name), 4) == 0)) { // long name like "RP02.PXSX" CopyMem(table + adr, Replace, 4); adr += 5; //at least, it is impossible to see PXSXPXSX @@ -5330,10 +5330,10 @@ VOID RenameDevices(UINT8* table) found = TRUE; } if (found) { // i points to Device or Scope - size = get_size(table, (UINT32)(UINTN)k); //k points to size // DBG("found bridge candidate 0x%x size %d\n", table[i], size); + size = get_size(table, (UINT32)(UINTN)k); //k points to size // DBG("found bridge candidate 0x%X size %d\n", table[i], size); if (size) { if ((k + size) > (adr + 4)) { //Yes - it is outer - // DBG("found Bridge device begin=%x end=%x\n", k, k+size); + // DBG("found Bridge device begin=%X end=%X\n", k, k+size); if (table[k] < 0x40) { k += 1; } @@ -5346,7 +5346,7 @@ VOID RenameDevices(UINT8* table) if (CmpFullName(table + k, len - k, Bridge)) { CopyMem(table + adr, Replace, 4); adr += 5; - DBG("found Bridge device begin=%x end=%x\n", k, k+size); + DBG("found Bridge device begin=%X end=%X\n", k, k+size); // DBG(" name copied\n"); Num++; break; //cancel search outer bridge, we found it. @@ -5359,7 +5359,7 @@ VOID RenameDevices(UINT8* table) adr += 5; } while (1); //next occurence } //DeviceRenameCount - MsgLog(" %d replacements\n", Num); + MsgLog(" %lld replacements\n", Num); } VOID FixBiosDsdt (UINT8* temp, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* fadt, CHAR8 *OSVersion) @@ -5397,7 +5397,7 @@ VOID FixBiosDsdt (UINT8* temp, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* fadt, continue; } - MsgLog(" - [%a]:", gSettings.PatchDsdtLabel[i]); //yyyy + MsgLog(" - [%s]:", gSettings.PatchDsdtLabel[i]); //yyyy if (gSettings.PatchDsdtMenuItem[i].BValue) { if (!gSettings.PatchDsdtTgt[i]) { DsdtLen = FixAny(temp, DsdtLen, @@ -5476,7 +5476,7 @@ VOID FixBiosDsdt (UINT8* temp, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* fadt, if (((DisplayVendor[j] != 0x8086) && (gSettings.FixDsdt & FIX_DISPLAY)) || ((DisplayVendor[j] == 0x8086) && (gSettings.FixDsdt & FIX_INTELGFX))) { DsdtLen = FIXDisplay(temp, DsdtLen, j); - MsgLog("patch Display #%d of Vendor=0x%4x\n", j, DisplayVendor[j]); + MsgLog("patch Display #%d of Vendor=0x%4X\n", j, DisplayVendor[j]); } } } @@ -5634,7 +5634,7 @@ VOID FixBiosDsdt (UINT8* temp, EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE* fadt, temp[7] = (UINT8)((DsdtLen & 0xFF000000) >> 24); CopyMem((UINT8*)((EFI_ACPI_DESCRIPTION_HEADER*)temp)->OemId, (UINT8*)BiosVendor, 6); - //DBG("orgBiosDsdtLen = 0x%08x\n", orgBiosDsdtLen); + //DBG("orgBiosDsdtLen = 0x%08X\n", orgBiosDsdtLen); ((EFI_ACPI_DESCRIPTION_HEADER*)temp)->Checksum = 0; ((EFI_ACPI_DESCRIPTION_HEADER*)temp)->Checksum = (UINT8)(256-Checksum8(temp, DsdtLen)); */ diff --git a/rEFIt_UEFI/Platform/HdaCodecDump.cpp b/rEFIt_UEFI/Platform/HdaCodecDump.cpp index 97ca48aec..7059810c4 100644 --- a/rEFIt_UEFI/Platform/HdaCodecDump.cpp +++ b/rEFIt_UEFI/Platform/HdaCodecDump.cpp @@ -51,7 +51,7 @@ CONST CHAR8 *gColors[HDA_CONFIG_DEFAULT_COLOR_OTHER + 1] = { "Reserved", "White", "Other" }; #define HDC_ID { 'H','D','C','O' } -#define HdaLog(n, ...) MemLog(FALSE, 0, n, ##__VA_ARGS__) +#define HdaLog(format, ...) MemLogf(FALSE, 0, format, ##__VA_ARGS__) CONST CHAR8 hdcID[4] = HDC_ID; @@ -140,7 +140,7 @@ HdaCodecDumpPrintWidgets( // Print each widget. for (UINTN w = 0; w < WidgetCount; w++) { // Print header and capabilities. - HdaLog("Node 0x%02X [%a] wcaps 0x%08X:", Widgets[w].NodeId, + HdaLog("Node 0x%02X [%s] wcaps 0x%08X:", Widgets[w].NodeId, gWidgetNames[HDA_PARAMETER_WIDGET_CAPS_TYPE(Widgets[w].Capabilities)], Widgets[w].Capabilities); if (Widgets[w].Capabilities & HDA_PARAMETER_WIDGET_CAPS_STEREO) HdaLog(" Stereo"); @@ -224,14 +224,14 @@ HdaCodecDumpPrintWidgets( } // Print pin default header. - HdaLog(" Pin Default 0x%08X: [%a] %a at %a %a\n", Widgets[w].DefaultConfiguration, + HdaLog(" Pin Default 0x%08X: [%s] %s at %s %s\n", Widgets[w].DefaultConfiguration, gPortConnectivities[HDA_VERB_GET_CONFIGURATION_DEFAULT_PORT_CONN(Widgets[w].DefaultConfiguration)], gDefaultDevices[HDA_VERB_GET_CONFIGURATION_DEFAULT_DEVICE(Widgets[w].DefaultConfiguration)], gSurfaces[HDA_VERB_GET_CONFIGURATION_DEFAULT_SURF(Widgets[w].DefaultConfiguration)], gLocations[HDA_VERB_GET_CONFIGURATION_DEFAULT_LOC(Widgets[w].DefaultConfiguration)]); // Print connection type and color. - HdaLog(" Conn = %a, Color = %a\n", + HdaLog(" Conn = %s, Color = %s\n", gConnTypes[HDA_VERB_GET_CONFIGURATION_DEFAULT_CONN_TYPE(Widgets[w].DefaultConfiguration)], gColors[HDA_VERB_GET_CONFIGURATION_DEFAULT_COLOR(Widgets[w].DefaultConfiguration)]); @@ -301,7 +301,7 @@ EFI_STATUS SaveHdaDumpTxt() { HdaIo = HdaCodecDev->HdaIo; // Get name. - HdaLog("Codec: %s\n", HdaCodecDev->Name); + HdaLog("Codec: %ls\n", HdaCodecDev->Name); // Get address UINT8 CodecAddress; diff --git a/rEFIt_UEFI/Platform/Hibernate.cpp b/rEFIt_UEFI/Platform/Hibernate.cpp index 909f72b48..849894571 100644 --- a/rEFIt_UEFI/Platform/Hibernate.cpp +++ b/rEFIt_UEFI/Platform/Hibernate.cpp @@ -343,16 +343,16 @@ EFIAPI OurBlockIoRead ( Header = (IOHibernateImageHeaderMin *) Buffer; Header2 = (IOHibernateImageHeaderMinSnow *) Buffer; - // DBG(" sig lion: %x\n", Header->signature); - // DBG(" sig snow: %x\n", Header2->signature); - // DBG(" sig swap: %x\n", SwapBytes32(Header->signature)); + // DBG(" sig lion: %X\n", Header->signature); + // DBG(" sig snow: %X\n", Header2->signature); + // DBG(" sig swap: %X\n", SwapBytes32(Header->signature)); if (Header->signature == kIOHibernateHeaderSignature || Header2->signature == kIOHibernateHeaderSignature) { gSleepImageOffset = MultU64x32(Lba, BlockSize); DBG(" got sleep image offset\n"); machineSignature = ((IOHibernateImageHeaderMin*)Buffer)->machineSignature; - DBG(" image has machineSignature =0x%x\n", machineSignature); + DBG(" image has machineSignature =0x%llX\n", machineSignature); //save sleep time as lvs1974 suggested if (Header->signature == kIOHibernateHeaderSignature) { @@ -394,13 +394,13 @@ GetSleepImageLocation(IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume, if (EFI_ERROR(Status)) { Status = egLoadFile(Volume->RootDir, PrefName2, &PrefBuffer, &PrefBufferLen); if (!EFI_ERROR(Status)) { - DBG(" read prefs %s status=%r\n", PrefName2, Status); + DBG(" read prefs %ls status=%s\n", PrefName2, strerror(Status)); } } else { - DBG(" read prefs %s status=%r\n", PrefName3, Status); + DBG(" read prefs %ls status=%s\n", PrefName3, strerror(Status)); } } else { - DBG(" read prefs %s status=%r\n", PrefName, Status); + DBG(" read prefs %ls status=%s\n", PrefName, strerror(Status)); } } @@ -451,7 +451,7 @@ GetSleepImageLocation(IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume, } p++; } - DBG(" SleepImage name from pref: ImageVolume = '%s', ImageName = '%s'\n", ImageVolume->VolName, ImageName); + DBG(" SleepImage name from pref: ImageVolume = '%ls', ImageName = '%ls'\n", ImageVolume->VolName, ImageName); } } } @@ -460,7 +460,7 @@ GetSleepImageLocation(IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume, if (!ImageName) { ImageName = PoolPrint(L"\\private\\var\\vm\\sleepimage"); - DBG(" using default sleep image name = %s\n", ImageName); + DBG(" using default sleep image name = %ls\n", ImageName); } if (PrefBuffer) { FreePool(PrefBuffer); //allocated by egLoadFile @@ -507,7 +507,7 @@ GetSleepImagePosition (IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume) // Update caller's SleepImageVolume when requested GetSleepImageLocation(Volume, SleepImageVolume, &ImageName); } - DBG(" returning previously calculated offset: %lx\n", Volume->SleepImageOffset); + DBG(" returning previously calculated offset: %llx\n", Volume->SleepImageOffset); return Volume->SleepImageOffset; } @@ -518,7 +518,7 @@ GetSleepImagePosition (IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume) // Open sleepimage Status = ImageVolume->RootDir->Open(ImageVolume->RootDir, &File, ImageName, EFI_FILE_MODE_READ, 0); if (EFI_ERROR(Status)) { - DBG(" sleepimage not found -> %r\n", Status); + DBG(" sleepimage not found -> %s\n", strerror(Status)); return 0; } } @@ -554,7 +554,7 @@ GetSleepImagePosition (IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume) if (Status == EFI_INVALID_PARAMETER) { Status = EFI_SUCCESS; } - // DBG(" Reading completed -> %r\n", Status); + // DBG(" Reading completed -> %s\n", strerror(Status)); // Close sleepimage File->Close(File); @@ -565,13 +565,13 @@ GetSleepImagePosition (IN REFIT_VOLUME *Volume, REFIT_VOLUME **SleepImageVolume) } if (EFI_ERROR(Status)) { - DBG(" can not read sleepimage -> %r\n", Status); + DBG(" can not read sleepimage -> %s\n", strerror(Status)); return 0; } // We store SleepImageOffset, in case our BlockIoRead does not execute again on next read due to driver caching. if (gSleepImageOffset != 0) { - DBG(" sleepimage offset acquired successfully: %lx\n", gSleepImageOffset); + DBG(" sleepimage offset acquired successfully: %llx\n", gSleepImageOffset); ImageVolume->SleepImageOffset = gSleepImageOffset; } else { DBG(" sleepimage offset could not be acquired\n"); @@ -619,7 +619,7 @@ IsSleepImageValidBySleepTime (IN REFIT_VOLUME *Volume) } Status = BlockIo->ReadBlocks(BlockIo, BlockIo->Media->MediaId, 2, BlockIo->Media->BlockSize, Buffer); if (EFI_ERROR(Status)) { - DBG(" can not read HFS+ header -> %r\n", Status); + DBG(" can not read HFS+ header -> %s\n", strerror(Status)); FreePages(Buffer, Pages); return FALSE; } @@ -637,16 +637,16 @@ IsSleepImageValidBySleepTime (IN REFIT_VOLUME *Volume) // Idea is from Chameleon // TimeDelta = HFSVolumeModifyDate - (INTN)gSleepTime; - DBG(" image older then volume: %d sec\n", TimeDelta); + DBG(" image older then volume: %lld sec\n", TimeDelta); if (TimeDelta > 5 /*|| TimeDelta < -5 */) { //Slice - if image newer then volume it should be OK DBG(" image too old\n"); FreePages(Buffer, Pages); return FALSE; } - DBG(" machineSignature from FACS =0x%x\n", machineSignature); + DBG(" machineSignature from FACS =0x%llX\n", machineSignature); // machineSignature = ((IOHibernateImageHeaderMin*)Buffer)->machineSignature; - // DBG(" image has machineSignature =0x%x\n", machineSignature); + // DBG(" image has machineSignature =0x%X\n", machineSignature); FreePages(Buffer, Pages); return TRUE; } @@ -760,29 +760,29 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry) for (VolumeIndex = 0; VolumeIndex < VolumesCount; VolumeIndex++) { Volume = Volumes[VolumeIndex]; VolumeUUID = FindGPTPartitionGuidInDevicePath(Volume->DevicePath); - DBG("Volume[%d] has UUID=%s\n", VolumeIndex, GuidLEToStr(VolumeUUID)); + DBG("Volume[%d] has UUID=%ls\n", VolumeIndex, GuidLEToStr(VolumeUUID)); if (CompareGuid(&ThisVolume->RootUUID, VolumeUUID)) { - DBG("found root volume at path: %s\n", FileDevicePathToStr(Volume->DevicePath)); + DBG("found root volume at path: %ls\n", FileDevicePathToStr(Volume->DevicePath)); Status = EFI_SUCCESS; break; } } if (EFI_ERROR(Status)) { Volume = ThisVolume; - DBG("cant find volume with UUID=%s\n", GuidLEToStr(&ThisVolume->RootUUID)); + DBG("cant find volume with UUID=%ls\n", GuidLEToStr(&ThisVolume->RootUUID)); } - DBG(" got RootUUID %g\n", &ThisVolume->RootUUID); + DBG(" got RootUUID %s\n", strguid(&ThisVolume->RootUUID)); VolumeUUIDStr = GuidLEToStr(&ThisVolume->RootUUID); - DBG(" Search for Volume with UUID: %s\n", VolumeUUIDStr); + DBG(" Search for Volume with UUID: %ls\n", VolumeUUIDStr); if (VolumeUUIDStr) { FreePool(VolumeUUIDStr); } Volume = FoundParentVolume(ThisVolume); if (Volume) { - DBG(" Found parent Volume with name %s\n", Volume->VolName); + DBG(" Found parent Volume with name %ls\n", Volume->VolName); if (Volume->RootDir == NULL) { return FALSE; } @@ -798,15 +798,15 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry) EFI_GUID TmpGuid; CHAR16 *TmpStr = NULL; CHAR16 *Ptr = GuidLEToStr(&Volume->RootUUID); - DBG("got str=%s\n", Ptr); + DBG("got str=%ls\n", Ptr); Status = StrToGuidLE (Ptr, &TmpGuid); if (EFI_ERROR(Status)) { - DBG(" cant convert Str %s to GUID\n", Ptr); + DBG(" cant convert Str %ls to GUID\n", Ptr); } else { - TmpStr = PoolPrint(L"%g", &TmpGuid); //PoolPrint не работает!!! - DBG("got the guid %s\n", TmpStr); + TmpStr = PoolPrint(L"%s", strguid(&TmpGuid)); //PoolPrint не работает!!! + DBG("got the guid %ls\n", TmpStr); CopyMem((VOID*)Ptr, TmpStr, StrSize(TmpStr)); - DBG("fter CopyMem: %s\n", Ptr); + DBG("fter CopyMem: %ls\n", Ptr); FreePool(TmpStr); } } @@ -860,20 +860,20 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry) if ((VolumeUUID = APFSPartitionUUIDExtract(Volume->DevicePath)) != NULL) { //BootGUID = (EFI_GUID*)(Data + Size - 0x14); BootGUID = (EFI_GUID*)ScanGuid(Data, Size, VolumeUUID); - //DBG(" APFS Boot0082 points to UUID:%g\n", BootGUID); + //DBG(" APFS Boot0082 points to UUID:%s\n", strguid(BootGUID)); } else { //BootGUID = (EFI_GUID*)(Data + Size - 0x16); VolumeUUID = FindGPTPartitionGuidInDevicePath(Volume->DevicePath); if (VolumeUUID != NULL) { BootGUID = (EFI_GUID*)ScanGuid(Data, Size, VolumeUUID); - //DBG(" Boot0082 points to UUID:%g\n", BootGUID); + //DBG(" Boot0082 points to UUID:%s\n", strguid(BootGUID)); } } - //DBG(" Volume has PartUUID=%g\n", VolumeUUID); + //DBG(" Volume has PartUUID=%s\n", strguid(VolumeUUID)); if (BootGUID != NULL && VolumeUUID != NULL && !CompareGuid(BootGUID, VolumeUUID)) { ret = FALSE; } else { - DBG(" Boot0082 points to Volume with UUID:%g\n", BootGUID); + DBG(" Boot0082 points to Volume with UUID:%s\n", strguid(BootGUID)); //3. Checks for boot-image exists if (GlobalConfig.StrictHibernate) { @@ -903,13 +903,13 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry) // UINTN Size; CHAR16 *Ptr = (CHAR16*)&OffsetHexStr[0]; - DBG(" boot-image before: %s\n", FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL*)Value)); + DBG(" boot-image before: %ls\n", FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL*)Value)); UnicodeSPrint(OffsetHexStr, sizeof(OffsetHexStr), L"%s", (CHAR16 *)(Value + 0x20)); - // DBG("OffsetHexStr=%s\n", OffsetHexStr); + // DBG("OffsetHexStr=%ls\n", OffsetHexStr); while ((*Ptr != L':') && (*Ptr != 0)) { Ptr++; } - // DBG(" have ptr=%p, in Str=%p, text:%s\n", Ptr, &OffsetHexStr, Ptr); + // DBG(" have ptr=%p, in Str=%p, text:%ls\n", Ptr, &OffsetHexStr, Ptr); if (*Ptr++ == L':') { //Convert BeUUID to LeUUID //Ptr points to begin L"A82E84C6-9DD6-49D6-960A-0F4C2FE4851C" @@ -917,14 +917,14 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry) CHAR16 *TmpStr = NULL; ResumeFromCoreStorage = TRUE; - // DBG("got str=%s\n", Ptr); + // DBG("got str=%ls\n", Ptr); Status = StrToGuidLE (Ptr, &TmpGuid); if (EFI_ERROR(Status)) { - DBG(" cant convert Str %s to GUID\n", Ptr); + DBG(" cant convert Str %ls to GUID\n", Ptr); } else { - //TmpStr = PoolPrint(L"%g", &TmpGuid); + //TmpStr = PoolPrint(L"%s", strguid(&TmpGuid)); TmpStr = GuidLEToStr(&TmpGuid); - // DBG("got the guid %s\n", TmpStr); + // DBG("got the guid %ls\n", TmpStr); CopyMem((VOID*)Ptr, TmpStr, StrSize(TmpStr)); FreePool(TmpStr); } @@ -937,20 +937,20 @@ IsOsxHibernated (IN LOADER_ENTRY *Entry) // DBG(" boot-image device path:\n"); Size = GetDevicePathSize(BootImageDevPath); Value = (UINT8*)BootImageDevPath; - DBG(" boot-image after: %s\n", FileDevicePathToStr(BootImageDevPath)); + DBG(" boot-image after: %ls\n", FileDevicePathToStr(BootImageDevPath)); //Apple's device path differs from UEFI BIOS device path that will be used by boot.efi //Value[6] = 8; //Acpi(PNP0A08,0) Value[22] = SataNum; Value[24] = 0xFF; Value[25] = 0xFF; - DBG(" boot-image corrected: %s\n", FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL*)Value)); + DBG(" boot-image corrected: %ls\n", FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL*)Value)); PrintBytes(Value, Size); Status = gRT->SetVariable(L"boot-image", &gEfiAppleBootGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, Size , Value); if (EFI_ERROR(Status)) { - DBG(" can not write boot-image -> %r\n", Status); + DBG(" can not write boot-image -> %s\n", strerror(Status)); ret = FALSE; } } @@ -1004,7 +1004,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) if (!GlobalConfig.StrictHibernate) { // Find sleep image offset SleepImageOffset = GetSleepImagePosition (Volume, &SleepImageVolume); - DBG(" SleepImageOffset: %lx\n", SleepImageOffset); + DBG(" SleepImageOffset: %llx\n", SleepImageOffset); if (SleepImageOffset == 0 || SleepImageVolume == NULL) { DBG(" sleepimage offset not found\n"); return FALSE; @@ -1017,18 +1017,18 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) Size = GetDevicePathSize(BootImageDevPath); VarData = (UINT8*)BootImageDevPath; PrintBytes(VarData, Size); - DBG("boot-image before: %s\n", FileDevicePathToStr(BootImageDevPath)); + DBG("boot-image before: %ls\n", FileDevicePathToStr(BootImageDevPath)); // VarData[6] = 8; // VarData[24] = 0xFF; // VarData[25] = 0xFF; - // DBG("boot-image corrected: %s\n", FileDevicePathToStr(BootImageDevPath)); + // DBG("boot-image corrected: %ls\n", FileDevicePathToStr(BootImageDevPath)); Status = gRT->SetVariable(L"boot-image", &gEfiAppleBootGuid, EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, Size , BootImageDevPath); if (EFI_ERROR(Status)) { - DBG(" can not write boot-image -> %r\n", Status); + DBG(" can not write boot-image -> %s\n", strerror(Status)); return FALSE; } } @@ -1036,7 +1036,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) // now we should delete boot0082 to do hibernate only once Status = DeleteBootOption(0x82); if (EFI_ERROR(Status)) { - DBG("Options 0082 was not deleted: %r\n", Status); + DBG("Options 0082 was not deleted: %s\n", strerror(Status)); } // @@ -1071,7 +1071,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) // Prior to 10.13.6. // Status = GetVariable2 (L"IOHibernateRTCVariables", &gEfiAppleBootGuid, &Value, &Size); - DBG("get IOHR variable status=%r, size=%d, RTC info=%d\n", Status, Size, HasHibernateInfoInRTC); + DBG("get IOHR variable status=%s, size=%llu, RTC info=%d\n", strerror(Status), Size, HasHibernateInfoInRTC); if (!HasHibernateInfo && !EFI_ERROR (Status) && Size == sizeof (RtcVars)) { CopyMem (RtcRawVars, Value, sizeof (RtcVars)); HasHibernateInfo = (RtcVars.signature[0] == 'A' && RtcVars.signature[1] == 'A' && @@ -1176,7 +1176,7 @@ PrepareHibernation (IN REFIT_VOLUME *Volume) } if (EFI_ERROR(Status)) { - DBG(" can not write boot-switch-vars -> %r\n", Status); + DBG(" can not write boot-switch-vars -> %s\n", strerror(Status)); return FALSE; } diff --git a/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp b/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp index ebbc549cd..209bf58d1 100644 --- a/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp +++ b/rEFIt_UEFI/Platform/LegacyBiosThunk.cpp @@ -176,7 +176,7 @@ DisconnectVga ( VOID ) // disconnect VGA DBG("Disonnecting VGA\n"); Status = gBS->DisconnectController(Handles[Index], NULL, NULL); - DBG("disconnect %r", Status); + DBG("disconnect %s", strerror(Status)); } } } diff --git a/rEFIt_UEFI/Platform/LegacyBoot.cpp b/rEFIt_UEFI/Platform/LegacyBoot.cpp index 36bf7bdb0..340353de7 100644 --- a/rEFIt_UEFI/Platform/LegacyBoot.cpp +++ b/rEFIt_UEFI/Platform/LegacyBoot.cpp @@ -190,13 +190,13 @@ EFI_STATUS BiosReadSectorsFromDrive(UINT8 DriveNum, UINT64 Lba, UINTN NumSectors SetMem (&Regs, sizeof (Regs), 0); // first reset disk controller as the controller seems to be in an undefined state sometimes - DBG("Reset disk controller: %x\n", DriveNum); + DBG("Reset disk controller: %X\n", DriveNum); Regs.H.AH = 0x00; // INT 13h AH=00h: Reset disk controller Regs.H.DL = DriveNum; Status = EFI_SUCCESS; if (LegacyBiosInt86(0x13, &Regs)) { // TRUE = error - DBG("Reset 0 disk controller: %x\n", DriveNum); + DBG("Reset 0 disk controller: %X\n", DriveNum); Regs.H.AH = 0x0D; // INT 13h AH=00h: Reset disk controller Regs.H.DL = DriveNum; if (LegacyBiosInt86(0x13, &Regs)) { @@ -212,7 +212,7 @@ EFI_STATUS BiosReadSectorsFromDrive(UINT8 DriveNum, UINT64 Lba, UINTN NumSectors Regs.E.DS = (UINT16) (((UINTN) Dap >> 16) << 12); Regs.X.SI = (UINT16) (UINTN) Dap; -// DBG("Drive: %x, Dap=%p, Buffer=%p, d.size=%X, d.nsect=%d, d.buff=[%X:%X]\n", +// DBG("Drive: %X, Dap=%p, Buffer=%p, d.size=%X, d.nsect=%d, d.buff=[%X:%X]\n", // DriveNum, Dap, Buffer, Dap->size, Dap->numSectors, Dap->buffSegment, Dap->buffOffset); // DBG("Dap: Reg.DS:SI = [%X:%X]\n", Regs.E.DS, Regs.X.SI); @@ -223,7 +223,7 @@ EFI_STATUS BiosReadSectorsFromDrive(UINT8 DriveNum, UINT64 Lba, UINTN NumSectors LegacyBiosInt86(0x13, &Regs); Status = EFI_NOT_FOUND; } - DBG("LegacyBiosInt86 status=%r, AH=%x\n", Status, Regs.H.AH); + DBG("LegacyBiosInt86 status=%s, AH=%X\n", strerror(Status), Regs.H.AH); return Status; } @@ -242,7 +242,7 @@ EFI_STATUS GetBiosDriveCRC32(UINT8 DriveNum, if (!EFI_ERROR(Status)) { *DriveCRC32 = GetCrc32((UINT8*)Buffer, 2 * 512); //gBS->CalculateCrc32(Buffer, 2 * 512, DriveCRC32); - DBG("Bios drive CRC32 = 0x%x\n", *DriveCRC32); + DBG("Bios drive CRC32 = 0x%X\n", *DriveCRC32); } return Status; } @@ -284,11 +284,11 @@ UINT8 GetBiosDriveNumForVolume(REFIT_VOLUME *Volume) if (EFI_ERROR(Status)) { // error or no more disks //DriveNum = 0; - DBG("Can't get drive 0x%x CRC32\n", DriveNum); + DBG("Can't get drive 0x%X CRC32\n", DriveNum); continue; } BestNum = DriveNum; - DBG("Calculated CRC=%X at drive 0x%x\n", Volume->DriveCRC32, BestNum); + DBG("Calculated CRC=%X at drive 0x%X\n", Volume->DriveCRC32, BestNum); if (Volume->DriveCRC32 == DriveCRC32) { break; } @@ -335,7 +335,7 @@ EFI_STATUS bootElTorito(REFIT_VOLUME* volume) Status = pBlockIO->ReadBlocks(pBlockIO, pBlockIO->Media->MediaId, 0x11, 2048, sectorBuffer); } if (EFI_ERROR(Status)) { - DBG("CDROMBoot: Unable to read block %X: %r\n", 0x11, Status); + DBG("CDROMBoot: Unable to read block %X: %s\n", 0x11, strerror(Status)); return Status; } } @@ -349,12 +349,12 @@ EFI_STATUS bootElTorito(REFIT_VOLUME* volume) lba = sectorBuffer[0x47] + sectorBuffer[0x48] * 256 + sectorBuffer[0x49] * 65536 + sectorBuffer[0x4A] * 16777216; Status = pBlockIO->ReadBlocks(pBlockIO, pBlockIO->Media->MediaId, lba, 2048, sectorBuffer); if (EFI_ERROR(Status)) { - DBG("CDROMBoot: Unable to read block %X: %r\n", lba, Status); + DBG("CDROMBoot: Unable to read block %llX: %s\n", lba, strerror(Status)); return Status; } if (sectorBuffer[0x00] != 1 || sectorBuffer[0x1E] != 0x55 || sectorBuffer[0x1F] != 0xAA) { - DBG("CDROMBoot: Invalid El Torito validation entry in boot catalog LBA %X\n", lba); + DBG("CDROMBoot: Invalid El Torito validation entry in boot catalog LBA %llX\n", lba); // DumpHex(0, 0, 64, sectorBuffer); return Status; } @@ -381,17 +381,17 @@ EFI_STATUS bootElTorito(REFIT_VOLUME* volume) bootSize = bootSectors * pBlockIO->Media->BlockSize; bootLoadAddress = addrRealFromSegOfs(bootLoadSegment, 0); if (addrLT(bootLoadAddress, bootAddress) || addrGTE(bootLoadAddress, krnMemoryTop)) { - DBG("CDROMBoot: Illegal boot load address %xL%x\n", addrToOffset(bootLoadAddress), bootSize); + DBG("CDROMBoot: Illegal boot load address %XL%X\n", addrToOffset(bootLoadAddress), bootSize); return Status; } lba = sectorBuffer[0x28] + sectorBuffer[0x29] * 256 + sectorBuffer[0x2A] * 65536 + sectorBuffer[0x2B] * 16777216; - DBG("CDROMBoot: Booting LBA %ld @%x L%x\n", lba, addrToOffset(bootLoadAddress), bootSize); + DBG("CDROMBoot: Booting LBA %llu @%X L%X\n", lba, addrToOffset(bootLoadAddress), bootSize); gBS->FreePages((EFI_PHYSICAL_ADDRESS)(UINTN)sectorBuffer, 1); // Read the boot sectors into the boot load address Status = pBlockIO->ReadBlocks(pBlockIO, pBlockIO->Media->MediaId, lba, bootSize, addrToPointer(bootLoadAddress)); if (EFI_ERROR(Status)) { - DBG("CDROMBoot: Unable to read block %ld: %r\n", lba, Status); + DBG("CDROMBoot: Unable to read block %llu: %s\n", lba, strerror(Status)); return Status; } @@ -486,7 +486,7 @@ EFI_STATUS bootMBR(REFIT_VOLUME* volume) return Status; } - DBG("boot from partition %s\n", FileDevicePathToStr(volume->DevicePath)); + DBG("boot from partition %ls\n", FileDevicePathToStr(volume->DevicePath)); Status = InitializeBiosIntCaller(); //mThunkContext); if (EFI_ERROR (Status)) { @@ -498,14 +498,14 @@ EFI_STATUS bootMBR(REFIT_VOLUME* volume) // Read the MBR Status = pDisk->ReadBlocks(pDisk, pDisk->Media->MediaId, 0, 512, pMBR); if (EFI_ERROR(Status)) { - DBG("HDBoot: Unable to read MBR: %r\n", Status); + DBG("HDBoot: Unable to read MBR: %s\n", strerror(Status)); return Status; } for (i=0; i<16; i++) { - DBG("%04x: ", i*16); + DBG("%04llX: ", i*16); for (j=0; j<16; j++) { - DBG("%02x ", pMBR[i*16+j]); + DBG("%02X ", pMBR[i*16+j]); } DBG("\n"); } @@ -568,7 +568,7 @@ EFI_STATUS bootMBR(REFIT_VOLUME* volume) // Read the boot sector Status = pDisk->ReadBlocks(pDisk, pDisk->Media->MediaId, activePartition->StartLBA, 512, pBootSector); if (EFI_ERROR(Status)) { - DBG("HDBoot: Unable to read partition %d's boot sector: %r\n", partitionIndex, Status); + DBG("HDBoot: Unable to read partition %d's boot sector: %s\n", partitionIndex, strerror(Status)); Status = EFI_NOT_FOUND; return Status; } @@ -629,10 +629,10 @@ EFI_STATUS bootPBRtest(REFIT_VOLUME* volume) } if (HdPath != NULL) { - DBG("boot from partition %s\n", FileDevicePathToStr((EFI_DEVICE_PATH *)HdPath)); + DBG("boot from partition %ls\n", FileDevicePathToStr((EFI_DEVICE_PATH *)HdPath)); LbaOffset = (UINT32)HdPath->PartitionStart; LbaSize = (UINT32)HdPath->PartitionSize; - DBG("starting from 0x%x LBA \n", LbaOffset); + DBG("starting from 0x%X LBA \n", LbaOffset); } else { return Status; } @@ -657,9 +657,9 @@ EFI_STATUS bootPBRtest(REFIT_VOLUME* volume) CopyMem(pBootSector, mBootSector, 1024); DBG("PBR after readDisk:\n"); for (i=0; i<4; i++) { - DBG("%04x: ", i*16); + DBG("%04llX: ", i*16); for (j=0; j<16; j++) { - DBG("%02x ", pBootSector[i*16+j]); + DBG("%02X ", pBootSector[i*16+j]); } DBG("\n"); } @@ -772,7 +772,7 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset) // get EfiLegacy8259Protocol - mandatory // Status = gBS->LocateProtocol(&gEfiLegacy8259ProtocolGuid, NULL, (VOID**)&gLegacy8259); - DBG("EfiLegacy8259ProtocolGuid: %r\n", Status); + DBG("EfiLegacy8259ProtocolGuid: %s\n", strerror(Status)); if (EFI_ERROR(Status)) { return Status; } @@ -785,16 +785,16 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset) // get EfiLegacyBiosProtocol - optional // Status = gBS->LocateProtocol(&gEfiLegacyBiosProtocolGuid, NULL, (VOID**)&LegacyBios); - DBG("EfiLegacyBiosProtocolGuid: %r\n", Status); + DBG("EfiLegacyBiosProtocolGuid: %s\n", strerror(Status)); if (!EFI_ERROR(Status)) { // // call PrepareToBootEfi() to init BIOS drives // //Status = LegacyBios->GetBbsInfo(LegacyBios, &HddCount, &HddInfo, &BbsCount, &BbsTable); - //DBG("GetBbsInfo = %r, HddCnt=%d, HddInfo=%p, BbsCount=%d, BbsTabl%p\n", Status, HddCount, HddInfo, BbsCount, BbsTable); + //DBG("GetBbsInfo = %s, HddCnt=%d, HddInfo=%p, BbsCount=%d, BbsTabl%p\n", strerror(Status), HddCount, HddInfo, BbsCount, BbsTable); Status = LegacyBios->PrepareToBootEfi(LegacyBios, &BbsCount, &BbsTable); - DBG("PrepareToBootEfi = %r, BbsCount=%d, BbsTabl%p\n", Status, BbsCount, BbsTable); + DBG("PrepareToBootEfi = %s, BbsCount=%d, BbsTabl%p\n", strerror(Status), BbsCount, BbsTable); //PauseForKey(L"continue ...\n"); // @@ -853,10 +853,10 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset) break; } - DBG("%d: Drv: %x P: %x %s PCI(%x,%x,%x), DT: %x %s SF: %x Txt: '%a'\n", + DBG("%llu: Drv: %X P: %X %ls PCI(%X,%X,%X), DT: %X %ls SF: %X Txt: '%s'\n", i, BbsTableIt->AssignedDriveNumber, BbsTableIt->BootPriority, BbsPriorityTxt, BbsTableIt->Bus, BbsTableIt->Device, BbsTableIt->Function, - BbsTableIt->DeviceType, BbsDevTypeTxt, BbsTableIt->StatusFlags, + BbsTableIt->DeviceType, BbsDevTypeTxt, *(UINT32*)(&BbsTableIt->StatusFlags), (CHAR8*)(UINTN)((BbsTableIt->DescStringSegment << 4) + BbsTableIt->DescStringOffset) ); } @@ -876,10 +876,10 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset) } if (HdPath != NULL) { - DBG("boot from partition %s\n", FileDevicePathToStr((EFI_DEVICE_PATH *)HdPath)); + DBG("boot from partition %ls\n", FileDevicePathToStr((EFI_DEVICE_PATH *)HdPath)); LbaOffset = (UINT32)HdPath->PartitionStart; LbaSize = (UINT32)HdPath->PartitionSize; - DBG("starting from 0x%x LBA \n", LbaOffset); + DBG("starting from 0x%X LBA \n", LbaOffset); } else { return Status; } @@ -907,9 +907,9 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset) CopyMem(pBootSector, mBootSector, 1*512); DBG("PBR:\n"); for (i=0; i<4; i++) { - DBG("%04x: ", i*16); + DBG("%04llX: ", i*16); for (j=0; j<16; j++) { - DBG("%02x ", pBootSector[i*16+j]); + DBG("%02X ", pBootSector[i*16+j]); } DBG("\n"); } @@ -919,7 +919,7 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset) // todo: if we managed to get BbsTable, then we may find // BIOS drive from there, by matching PCI bus, device, function // - DBG("Looking for parent disk of %s\n", FileDevicePathToStr(volume->DevicePath)); + DBG("Looking for parent disk of %ls\n", FileDevicePathToStr(volume->DevicePath)); BiosDriveNum = 0; for (i = 0; i < Volumes.size(); i++) { if (&Volumes[i] != volume && Volumes[i].BlockIO == volume->WholeDiskBlockIO) @@ -955,8 +955,8 @@ EFI_STATUS bootPBR(REFIT_VOLUME* volume, BOOLEAN SataReset) Regs.X.SI = (UINT16)(UINTN)pMBR; } - DBG("mbr: %x index: %x pointer: %x dx: %x si: %x\n", volume->IsMbrPartition, volume->MbrPartitionIndex, volume->MbrPartitionTable, Regs.X.DX, Regs.X.SI); - DBG("pmbr: %x start: %x size: %x\n", pMBR[volume->MbrPartitionIndex], pMBR[volume->MbrPartitionIndex].StartLBA, pMBR[volume->MbrPartitionIndex].Size); + DBG("mbr: %X index: %llX pointer: %llX dx: %X si: %X\n", volume->IsMbrPartition, volume->MbrPartitionIndex, (uintptr_t)volume->MbrPartitionTable, Regs.X.DX, Regs.X.SI); + DBG("pmbr: %llX start: %X size: %X\n", (uintptr_t)&pMBR[volume->MbrPartitionIndex], pMBR[volume->MbrPartitionIndex].StartLBA, pMBR[volume->MbrPartitionIndex].Size); // // call 16bit partition boot code @@ -1017,7 +1017,7 @@ static VOID PatchBbsTable(EFI_LEGACY_BIOS_PROTOCOL *LegacyBios, UINT16 BootEntry LocalBbsTable[Idx].BootPriority = Priority++; } - DBG (" %02d: 0x%02x %04x %04x %02x/%02x/%02x %02x/%02x %04x %04x %04x:%04x\n", + DBG (" %02llu: 0x%02llX %04llX %04llX %02llX/%02llX/%02llX %02llX/%02llX %04llX %04llX %04llX:%04llX\n", (UINTN) IdxCount, (UINTN) Idx, (UINTN) OldPriority, @@ -1030,9 +1030,9 @@ static VOID PatchBbsTable(EFI_LEGACY_BIOS_PROTOCOL *LegacyBios, UINT16 BootEntry (UINTN) LocalBbsTable[Idx].DeviceType, (UINTN) * (UINT16 *) &LocalBbsTable[Idx].StatusFlags, (UINTN) LocalBbsTable[Idx].BootHandlerSegment, - (UINTN) LocalBbsTable[Idx].BootHandlerOffset, + (UINTN) LocalBbsTable[Idx].BootHandlerOffset/*, (UINTN) ((LocalBbsTable[Idx].MfgStringSegment << 4) + LocalBbsTable[Idx].MfgStringOffset), - (UINTN) ((LocalBbsTable[Idx].DescStringSegment << 4) + LocalBbsTable[Idx].DescStringOffset) + (UINTN) ((LocalBbsTable[Idx].DescStringSegment << 4) + LocalBbsTable[Idx].DescStringOffset)*/ ); } @@ -1053,7 +1053,7 @@ EFI_STATUS bootLegacyBiosDefault(IN UINT16 LegacyBiosDefaultEntry) // get EfiLegacyBiosProtocol - optional // Status = gBS->LocateProtocol(&gEfiLegacyBiosProtocolGuid, NULL, (VOID**)&LegacyBios); - DBG("EfiLegacyBiosProtocolGuid: %r\n", Status); + DBG("EfiLegacyBiosProtocolGuid: %s\n", strerror(Status)); if (EFI_ERROR(Status)) { return Status; } @@ -1088,7 +1088,7 @@ EFI_STATUS bootLegacyBiosDefault(IN UINT16 LegacyBiosDefaultEntry) // do boot from default MBR hard disk // Status = LegacyBios->LegacyBoot(LegacyBios, BbsDP, 0, NULL); - DBG("LegacyBios->LegacyBoot(): %r\n", Status); + DBG("LegacyBios->LegacyBoot(): %s\n", strerror(Status)); return Status; } @@ -1143,7 +1143,7 @@ VOID DumpBiosMemoryMap() for (i = 0; i < Length; i++) { Start = *(UINT64*)BiosMap; Size = *((UINT64*)BiosMap + 1); - DBG(" %08lx %08lx %x %08x\n", Start, Start + Size - 1, *(UINT32*)(BiosMap + 16), *(UINT32*)(BiosMap + 20)); + DBG(" %08llx %08llx %X %08X\n", Start, Start + Size - 1, *(UINT32*)(BiosMap + 16), *(UINT32*)(BiosMap + 20)); BiosMap += 24; } diff --git a/rEFIt_UEFI/Platform/Net.cpp b/rEFIt_UEFI/Platform/Net.cpp index c32e27880..44a5621bc 100644 --- a/rEFIt_UEFI/Platform/Net.cpp +++ b/rEFIt_UEFI/Platform/Net.cpp @@ -130,10 +130,10 @@ GetMacAddress() // HwAddressSize = 6; //} CopyMem(&MacAddr, &MacAddressNode->MacAddress.Addr[0], HwAddressSize); - DBG("MAC address of LAN #%d= ", nLanPaths); + DBG("MAC address of LAN #%llu= ", nLanPaths); HwAddress = &MacAddressNode->MacAddress.Addr[0]; for (Index2 = 0; Index2 < HwAddressSize; Index2++) { - DBG("%02x:", *HwAddress++); + DBG("%02X:", *HwAddress++); } DBG("\n"); Found = TRUE; @@ -155,7 +155,7 @@ GetMacAddress() // Legacy boot. Get MAC-address from hardwaredirectly // //// - DBG(" get legacy LAN MAC, %d card found\n", nLanCards); + DBG(" get legacy LAN MAC, %llu card found\n", nLanCards); for (Index = 0; Index < nLanCards; Index++) { if (!gLanMmio[Index]) { //security continue; @@ -219,10 +219,10 @@ GetMacAddress() done: PreviousVendor = gLanVendor[Index]; - DBG("Legacy MAC address of LAN #%d= ", Index); + DBG("Legacy MAC address of LAN #%llu= ", Index); HwAddress = &gLanMac[Index][0]; for (Index2 = 0; Index2 < HwAddressSize; Index2++) { - DBG("%02x:", *HwAddress++); + DBG("%02X:", *HwAddress++); } DBG("\n"); diff --git a/rEFIt_UEFI/Platform/Nvram.cpp b/rEFIt_UEFI/Platform/Nvram.cpp index 8e7857526..dd744c12e 100644 --- a/rEFIt_UEFI/Platform/Nvram.cpp +++ b/rEFIt_UEFI/Platform/Nvram.cpp @@ -148,11 +148,11 @@ SetNvramVariable ( UINTN OldDataSize = 0; UINT32 OldAttributes = 0; - //DBG ("SetNvramVariable (%s, guid, 0x%x, %d):", VariableName, Attributes, DataSize); + //DBG ("SetNvramVariable (%ls, guid, 0x%X, %d):", VariableName, Attributes, DataSize); OldData = (__typeof__(OldData))GetNvramVariable (VariableName, VendorGuid, &OldAttributes, &OldDataSize); if (OldData != NULL) { // var already exists - check if it equal to new value - //DBG (" exists(0x%x, %d)", OldAttributes, OldDataSize); + //DBG (" exists(0x%X, %d)", OldAttributes, OldDataSize); if ((OldAttributes == Attributes) && (OldDataSize == DataSize) && (CompareMem (OldData, Data, DataSize) == 0)) { @@ -168,11 +168,11 @@ SetNvramVariable ( // not the same - delete previous one if attributes are different if (OldAttributes != Attributes) { DeleteNvramVariable (VariableName, VendorGuid); - //DBG (", diff. attr: deleting old (%r)", Status); + //DBG (", diff. attr: deleting old (%s)", strerror(Status)); } } //DBG ("\n"); // for debug without Status - //DBG (" -> writing new (%r)\n", Status); + //DBG (" -> writing new (%s)\n", strerror(Status)); //return Status; return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, (VOID*)Data); // CONST missing in EFI_SET_VARIABLE->SetVariable @@ -191,13 +191,13 @@ AddNvramVariable ( { VOID *OldData; - //DBG ("SetNvramVariable (%s, guid, 0x%x, %d):\n", VariableName, Attributes, DataSize); + //DBG ("SetNvramVariable (%ls, guid, 0x%X, %d):\n", VariableName, Attributes, DataSize); OldData = (__typeof__(OldData))GetNvramVariable (VariableName, VendorGuid, NULL, NULL); if (OldData == NULL) { // set new value return gRT->SetVariable (VariableName, VendorGuid, Attributes, DataSize, Data); -// DBG (" -> writing new (%r)\n", Status); +// DBG (" -> writing new (%s)\n", strerror(Status)); } else { FreePool (OldData); return EFI_ABORTED; @@ -216,7 +216,7 @@ DeleteNvramVariable ( // Delete: attributes and data size = 0 Status = gRT->SetVariable (VariableName, VendorGuid, 0, 0, NULL); - //DBG ("DeleteNvramVariable (%s, guid = %r):\n", VariableName, Status); + //DBG ("DeleteNvramVariable (%ls, guid = %s):\n", VariableName, strerror(Status)); return Status; } @@ -316,13 +316,13 @@ ResetNativeNvram () if (!EFI_ERROR (Status)) { if (IsDeletableVariable (Name, &Guid)) { - //DBG ("Deleting %g:%s...", &Guid, Name); + //DBG ("Deleting %s:%ls...", strguid(&Guid), Name); Status = DeleteNvramVariable(Name, &Guid); if (!EFI_ERROR (Status)) { //DBG ("OK\n"); Restart = TRUE; } else { - //DBG ("FAIL (%r)\n", Status); + //DBG ("FAIL (%s)\n", strerror(Status)); break; } } @@ -344,17 +344,17 @@ ResetNativeNvram () Status = Volume->RootDir->Open (Volume->RootDir, &FileHandle, L"nvram.plist", EFI_FILE_MODE_READ, 0); if (EFI_ERROR(Status)) { - //DBG("- [%02d]: '%s' - no nvram.plist - skipping!\n", VolumeIndex, Volume->VolName); + //DBG("- [%02d]: '%ls' - no nvram.plist - skipping!\n", VolumeIndex, Volume->VolName); continue; } // find the partition where nvram.plist can be deleted and delete it if (Volume != NULL) { if (StriStr(Volume->VolName, L"EFI") != NULL) { - //DBG("- [%02d]: '%s' - found nvram.plist and deleted it\n", VolumeIndex, Volume->VolName); + //DBG("- [%02d]: '%ls' - found nvram.plist and deleted it\n", VolumeIndex, Volume->VolName); Status = DeleteFile (Volume->RootDir, L"nvram.plist"); } else { - //DBG("- [%02d]: '%s' - found nvram.plist but can't delete it\n", VolumeIndex, Volume->VolName); + //DBG("- [%02d]: '%ls' - found nvram.plist but can't delete it\n", VolumeIndex, Volume->VolName); } } } @@ -452,16 +452,16 @@ GetSmcKeys (BOOLEAN WriteToSMC) Data = (__typeof__(Data))GetNvramVariable (Name, &Guid, NULL, &DataSize); if (Data) { /* UINTN Index; - DBG(" %s:", Name); + DBG(" %ls:", Name); for (Index = 0; Index < DataSize; Index++) { - DBG("%02x ", *((UINT8*)Data + Index)); + DBG("%02X ", *((UINT8*)Data + Index)); } DBG("\n"); */ if (gAppleSmc && WriteToSMC) { Status = gAppleSmc->SmcAddKey(gAppleSmc, KeyFromName(Name), (SMC_DATA_SIZE)DataSize, TypeFromName(Name), 0xC0); if (!EFI_ERROR(Status)) { Status = gAppleSmc->SmcWriteValue(gAppleSmc, KeyFromName(Name), (SMC_DATA_SIZE)DataSize, Data); - // DBG("Write to AppleSMC status=%r\n", Status); + // DBG("Write to AppleSMC status=%s\n", strerror(Status)); } NumKey++; } @@ -472,7 +472,7 @@ GetSmcKeys (BOOLEAN WriteToSMC) CHAR8 Mode = SMC_MODE_APPCODE; NKey[3] = NumKey & 0xFF; NKey[2] = (NumKey >> 8) & 0xFF; //key, size, type, attr - DBG("Registered %d SMC keys\n", NumKey); + DBG("Registered %lld SMC keys\n", NumKey); Status = gAppleSmc->SmcAddKey(gAppleSmc, FourCharKey("#KEY"), 4, SmcKeyTypeUint32, 0xC0); if (!EFI_ERROR(Status)) { Status = gAppleSmc->SmcWriteValue(gAppleSmc, FourCharKey("#KEY"), 4, (SMC_DATA *)&NKey); @@ -717,7 +717,7 @@ GetEfiBootDeviceFromNvram () if (gEfiBootDeviceData != NULL) { // DBG("Got efi-boot-next-data size=%d\n", Size); if (IsDevicePathValid(gEfiBootDeviceData, Size)) { -// DBG(" - efi-boot-next-data: %s\n", FileDevicePathToStr (gEfiBootDeviceData)); +// DBG(" - efi-boot-next-data: %ls\n", FileDevicePathToStr (gEfiBootDeviceData)); } else { // DBG(" - device path for efi-boot-next-data is invalid\n"); FreePool(gEfiBootDeviceData); @@ -750,7 +750,7 @@ GetEfiBootDeviceFromNvram () } // DBG ("\n"); - DBG (" - efi-boot-device-data: %s\n", FileDevicePathToStr (gEfiBootDeviceData)); + DBG (" - efi-boot-device-data: %ls\n", FileDevicePathToStr (gEfiBootDeviceData)); gEfiBootVolume = gEfiBootDeviceData; @@ -774,7 +774,7 @@ GetEfiBootDeviceFromNvram () return EFI_NOT_FOUND; } - DBG (" - BootCampHD: %s\n", FileDevicePathToStr (gBootCampHD)); + DBG (" - BootCampHD: %ls\n", FileDevicePathToStr (gBootCampHD)); } // @@ -791,8 +791,8 @@ GetEfiBootDeviceFromNvram () // gEfiBootVolume now contains only Volume path } - DBG (" - Volume: '%s'\n", FileDevicePathToStr (gEfiBootVolume)); - DBG (" - LoaderPath: '%s'\n", gEfiBootLoaderPath); + DBG (" - Volume: '%ls'\n", FileDevicePathToStr (gEfiBootVolume)); + DBG (" - LoaderPath: '%ls'\n", gEfiBootLoaderPath); // // if this is GPT disk, extract GUID @@ -803,7 +803,7 @@ GetEfiBootDeviceFromNvram () gEfiBootDeviceGuid = (__typeof__(gEfiBootDeviceGuid))AllocatePool (sizeof(EFI_GUID)); if (gEfiBootDeviceGuid != NULL) { CopyMem (gEfiBootDeviceGuid, Guid, sizeof(EFI_GUID)); - DBG (" - Guid = %g\n", gEfiBootDeviceGuid); + DBG (" - Guid = %s\n", strguid(gEfiBootDeviceGuid)); } } @@ -822,7 +822,7 @@ LoadNvramPlist ( CHAR8 *NvramPtr = NULL; UINTN Size = 0; - DBG(" begin load gNvramDict=0x%x\n", gNvramDict); + DBG(" begin load gNvramDict=0x%llX\n", (uintptr_t)gNvramDict); // // skip loading if already loaded // @@ -839,7 +839,7 @@ LoadNvramPlist ( return Status; } - DBG (" loaded, size=%d\n", Size); + DBG (" loaded, size=%llu\n", Size); // // parse it into gNvramDict @@ -899,7 +899,7 @@ LoadLatestNvramPlist () /* Guid = FindGPTPartitionGuidInDevicePath (Volume->DevicePath); - DBG (" %2d. Volume '%s', GUID = %g", Index, Volume->VolName, Guid); + DBG (" %2d. Volume '%ls', GUID = %s", Index, Volume->VolName, strguid(Guid)); if (Guid == NULL) { // not a GUID partition DBG (" - not GPT"); @@ -911,7 +911,7 @@ LoadLatestNvramPlist () // DBG (" - no nvram.plist - skipping!\n"); continue; } -// DBG(" Status=%r\n", Status); +// DBG(" Status=%s\n", strerror(Status)); if (GlobalConfig.FastBoot) { VolumeWithLatestNvramPlist = Volume; break; @@ -919,7 +919,7 @@ LoadLatestNvramPlist () // get nvram.plist modification date FileInfo = EfiLibFileInfo(FileHandle); -// DBG("got FileInfo=0x%x\n", FileInfo); +// DBG("got FileInfo=0x%X\n", FileInfo); if (FileInfo == NULL) { // DBG (" - no nvram.plist file info - skipping!\n"); FileHandle->Close(FileHandle); @@ -951,13 +951,13 @@ LoadLatestNvramPlist () // if we have nvram.plist - load it // if (VolumeWithLatestNvramPlist != NULL) { - DBG ("Loading nvram.plist from Vol '%s' -", VolumeWithLatestNvramPlist->VolName); + DBG ("Loading nvram.plist from Vol '%ls' -", VolumeWithLatestNvramPlist->VolName); Status = LoadNvramPlist (VolumeWithLatestNvramPlist->RootDir, L"nvram.plist"); } else { // DBG (" nvram.plist not found!\n"); } - DBG("loaded Status=%r\n", Status); + DBG("loaded Status=%s\n", strerror(Status)); return Status; } @@ -993,10 +993,10 @@ PutNvramPlistToRtVars () // process only valid tags if (Tag->type != kTagTypeKey || ValTag == NULL) { - DBG (" ERROR: Tag is not , type = %d\n", Tag->type); + DBG (" ERROR: Tag is not , type = %llu\n", Tag->type); continue; } -// DBG("tag: %a\n", Tag->string); +// DBG("tag: %s\n", Tag->string); // skip OsxAptioFixDrv-RelocBase - appears and causes trouble // in kernel and kext patcher when mixing UEFI and CloverEFI boot if (AsciiStrCmp (Tag->string, "OsxAptioFixDrv-RelocBase") == 0) { @@ -1027,7 +1027,7 @@ PutNvramPlistToRtVars () AsciiStrToUnicodeStrS(Tag->string, KeyBuf, 128); if (!GlobalConfig.DebugLog) { - DBG (" Adding Key: %s: ", KeyBuf); + DBG (" Adding Key: %ls: ", KeyBuf); } // process value tag @@ -1037,7 +1037,7 @@ PutNvramPlistToRtVars () Value = ValTag->string; Size = AsciiStrLen((CONST CHAR8*)Value); if (!GlobalConfig.DebugLog) { - DBG ("String: Size = %d, Val = '%a'\n", Size, Value); + DBG ("String: Size = %lld, Val = '%s'\n", Size, (__typeof__(ValTag->string))Value); } } else if (ValTag->type == kTagTypeData) { @@ -1046,16 +1046,16 @@ PutNvramPlistToRtVars () Size = ValTag->dataLen; Value = ValTag->data; if (!GlobalConfig.DebugLog) { - DBG ("Size = %d, Data: ", Size); + DBG ("Size = %lld, Data: ", Size); for (i = 0; i < Size; i++) { - DBG("%02x ", *((UINT8*)Value + i)); + DBG("%02X ", *((__typeof__(ValTag->string))Value + i)); } } if (!GlobalConfig.DebugLog) { DBG ("\n"); } } else { - DBG ("ERROR: Unsupported tag type: %d\n", ValTag->type); + DBG ("ERROR: Unsupported tag type: %llu\n", ValTag->type); continue; } @@ -1123,26 +1123,26 @@ FindStartupDiskVolume ( // EfiBootVolumeStr = FileDevicePathToStr (gEfiBootVolume); IsPartitionVolume = NULL != FindDevicePathNodeWithType (gEfiBootVolume, MEDIA_DEVICE_PATH, 0); - DBG (" - Volume: %s = %s\n", IsPartitionVolume ? L"partition" : L"disk", EfiBootVolumeStr); + DBG (" - Volume: %ls = %ls\n", IsPartitionVolume ? L"partition" : L"disk", EfiBootVolumeStr); // // 1. gEfiBootVolume + gEfiBootLoaderPath // PciRoot(0x0)/.../Sata(...)/HD(...)/\EFI\BOOT\XXX.EFI - set by Clover // if (gEfiBootLoaderPath != NULL) { - DBG (" - searching for that partition and loader '%s'\n", gEfiBootLoaderPath); + DBG (" - searching for that partition and loader '%ls'\n", gEfiBootLoaderPath); for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) { if (MainMenu->Entries[Index].getLOADER_ENTRY()) { LOADER_ENTRY& LoaderEntry = *MainMenu->Entries[Index].getLOADER_ENTRY(); Volume = LoaderEntry.Volume; LoaderPath = LoaderEntry.LoaderPath; if (Volume != NULL && BootVolumeDevicePathEqual(gEfiBootVolume, Volume->DevicePath)) { - //DBG (" checking '%s'\n", DevicePathToStr (Volume->DevicePath)); - //DBG (" '%s'\n", LoaderPath); + //DBG (" checking '%ls'\n", DevicePathToStr (Volume->DevicePath)); + //DBG (" '%ls'\n", LoaderPath); // case insensitive cmp if (LoaderPath != NULL && StriCmp(gEfiBootLoaderPath, LoaderPath) == 0) { // that's the one - DBG (" - found entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderPath); + DBG (" - found entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderPath); return Index; } } @@ -1160,12 +1160,12 @@ FindStartupDiskVolume ( Volume = LoaderEntry.Volume; LoaderPath = LoaderEntry.LoaderPath; if (Volume != NULL && BootVolumeMediaDevicePathNodesEqual (gEfiBootVolume, Volume->DevicePath)) { - //DBG (" checking '%s'\n", DevicePathToStr (Volume->DevicePath)); - //DBG (" '%s'\n", LoaderPath); + //DBG (" checking '%ls'\n", DevicePathToStr (Volume->DevicePath)); + //DBG (" '%ls'\n", LoaderPath); // case insensitive cmp if (LoaderPath != NULL && StriCmp(gEfiBootLoaderPath, LoaderPath) == 0) { // that's the one - DBG (" - found entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderPath); + DBG (" - found entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderPath); return Index; } } @@ -1188,7 +1188,7 @@ FindStartupDiskVolume ( Volume = MainMenu->Entries[Index].getLOADER_ENTRY()->Volume; } if (Volume != NULL && BootVolumeDevicePathEqual (gEfiBootVolume, Volume->DevicePath)) { - DBG (" - found entry %d. '%s', Volume '%s'\n", Index, MainMenu->Entries[Index].Title.s(), Volume->VolName); + DBG (" - found entry %lld. '%ls', Volume '%ls'\n", Index, MainMenu->Entries[Index].Title.s(), Volume->VolName); return Index; } } @@ -1205,7 +1205,7 @@ FindStartupDiskVolume ( Volume = MainMenu->Entries[Index].getLOADER_ENTRY()->Volume; } if (Volume != NULL && BootVolumeMediaDevicePathNodesEqual (gEfiBootVolume, Volume->DevicePath)) { - DBG (" - found entry %d. '%s', Volume '%s'\n", Index, MainMenu->Entries[Index].Title.s(), Volume->VolName); + DBG (" - found entry %lld. '%ls', Volume '%ls'\n", Index, MainMenu->Entries[Index].Title.s(), Volume->VolName); return Index; } } @@ -1226,7 +1226,7 @@ FindStartupDiskVolume ( if (BootVolumeDevicePathEqual (gEfiBootVolume, Volume->DevicePath)) { // that's the one DiskVolume = Volume; - DBG (" - found disk as volume %d. '%s'\n", Index, Volume->VolName); + DBG (" - found disk as volume %lld. '%ls'\n", Index, Volume->VolName); break; } } @@ -1246,12 +1246,12 @@ FindStartupDiskVolume ( Volume = LegacyEntry.Volume; if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) { // check for Win - //DBG (" checking legacy entry %d. %s\n", Index, LegacyEntry.Title); - //DBG (" %s\n", DevicePathToStr (Volume->DevicePath)); + //DBG (" checking legacy entry %d. %ls\n", Index, LegacyEntry.Title); + //DBG (" %ls\n", DevicePathToStr (Volume->DevicePath)); //DBG (" OSType = %d\n", Volume->OSType); if (Volume->LegacyOS->Type == OSTYPE_WIN) { // that's the one - legacy win partition - DBG (" - found legacy entry %d. '%s', Volume '%s'\n", Index, LegacyEntry.Title.s(), Volume->VolName); + DBG (" - found legacy entry %lld. '%ls', Volume '%ls'\n", Index, LegacyEntry.Title.s(), Volume->VolName); return Index; } } @@ -1260,13 +1260,13 @@ FindStartupDiskVolume ( Volume = LoaderEntry.Volume; if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) { // check for Win - //DBG (" checking loader entry %d. %s\n", Index, LoaderEntry.Title); - //DBG (" %s\n", DevicePathToStr (Volume->DevicePath)); - //DBG (" LoaderPath = %s\n", LoaderEntry.LoaderPath); + //DBG (" checking loader entry %d. %ls\n", Index, LoaderEntry.Title); + //DBG (" %ls\n", DevicePathToStr (Volume->DevicePath)); + //DBG (" LoaderPath = %ls\n", LoaderEntry.LoaderPath); //DBG (" LoaderType = %d\n", LoaderEntry.LoaderType); if (LoaderEntry.LoaderType == OSTYPE_WINEFI) { // that's the one - win loader entry - DBG (" - found loader entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderEntry.LoaderPath); + DBG (" - found loader entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderEntry.LoaderPath); return Index; } } @@ -1279,14 +1279,14 @@ FindStartupDiskVolume ( // PciRoot(0x0)/.../Sata(...) // just find first menu entry on that disk? // - DBG (" - searching for any entry from disk '%s'\n", DiskVolume->VolName); + DBG (" - searching for any entry from disk '%ls'\n", DiskVolume->VolName); for (Index = 0; ((Index < (INTN)MainMenu->Entries.size()) && (MainMenu->Entries[Index].Row == 0)); ++Index) { if (MainMenu->Entries[Index].getLEGACY_ENTRY()) { LEGACY_ENTRY& LegacyEntry = (LEGACY_ENTRY&)MainMenu->Entries[Index]; Volume = LegacyEntry.Volume; if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) { // that's the one - DBG (" - found legacy entry %d. '%s', Volume '%s'\n", Index, LegacyEntry.Title.s(), Volume->VolName); + DBG (" - found legacy entry %lld. '%ls', Volume '%ls'\n", Index, LegacyEntry.Title.s(), Volume->VolName); return Index; } @@ -1295,7 +1295,7 @@ FindStartupDiskVolume ( Volume = LoaderEntry.Volume; if (Volume != NULL && Volume->WholeDiskBlockIO == DiskVolume->BlockIO) { // that's the one - DBG (" - found loader entry %d. '%s', Volume '%s', '%s'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderEntry.LoaderPath); + DBG (" - found loader entry %lld. '%ls', Volume '%ls', '%ls'\n", Index, LoaderEntry.Title.s(), Volume->VolName, LoaderEntry.LoaderPath); return Index; } @@ -1324,8 +1324,8 @@ EFI_STATUS SetStartupDiskVolume ( DBG ("SetStartupDiskVolume:\n"); - DBG (" * Volume: '%s'\n", Volume->VolName); - DBG (" * LoaderPath: '%s'\n", LoaderPath); + DBG (" * Volume: '%ls'\n", Volume->VolName); + DBG (" * LoaderPath: '%ls'\n", LoaderPath); // // construct dev path for Volume/LoaderPath @@ -1335,10 +1335,10 @@ EFI_STATUS SetStartupDiskVolume ( FileDevPath = FileDevicePath (NULL, LoaderPath); DevPath = AppendDevicePathNode (DevPath, FileDevPath); } - DBG (" * DevPath: %s\n", Volume->VolName, FileDevicePathToStr (DevPath)); + DBG (" * DevPath: %ls\n", Volume->VolName/*, FileDevicePathToStr (DevPath)*/); Guid = FindGPTPartitionGuidInDevicePath (Volume->DevicePath); - DBG (" * GUID = %g\n", Guid); + DBG (" * GUID = %s\n", strguid(Guid)); // // let's save it without EFI_VARIABLE_NON_VOLATILE in CloverEFI like other vars so far @@ -1369,15 +1369,15 @@ EFI_STATUS SetStartupDiskVolume ( "" "IOProviderClassIOMedia" "IOPropertyMatch" - "UUID%g" + "UUID%s" "" ""; Size = AsciiStrLen (EfiBootDeviceTmpl) + 36; EfiBootDevice = (__typeof__(EfiBootDevice))AllocateZeroPool(AsciiStrLen (EfiBootDeviceTmpl) + 36); - AsciiSPrint (EfiBootDevice, Size, EfiBootDeviceTmpl, Guid); + AsciiSPrint (EfiBootDevice, Size, EfiBootDeviceTmpl, strguid(Guid)); Size = AsciiStrLen (EfiBootDevice); - DBG (" * efi-boot-device: %a\n", EfiBootDevice); + DBG (" * efi-boot-device: %s\n", EfiBootDevice); Status = SetNvramVariable (L"efi-boot-device", &gEfiAppleBootGuid, Attributes, Size, EfiBootDevice); @@ -1397,12 +1397,12 @@ RemoveStartupDiskVolume () // DBG ("RemoveStartupDiskVolume:\n"); /*Status =*/ DeleteNvramVariable (L"efi-boot-device", &gEfiAppleBootGuid); -// DBG (" * efi-boot-device = %r\n", Status); +// DBG (" * efi-boot-device = %s\n", strerror(Status)); /*Status =*/ DeleteNvramVariable (L"efi-boot-device-data", &gEfiAppleBootGuid); -// DBG (" * efi-boot-device-data = %r\n", Status); +// DBG (" * efi-boot-device-data = %s\n", strerror(Status)); /*Status =*/ DeleteNvramVariable (L"BootCampHD", &gEfiAppleBootGuid); -// DBG (" * BootCampHD = %r\n", Status); -// DBG ("Removed efi-boot-device-data variable: %r\n", Status); +// DBG (" * BootCampHD = %s\n", strerror(Status)); +// DBG ("Removed efi-boot-device-data variable: %s\n", strerror(Status)); } diff --git a/rEFIt_UEFI/Platform/PlatformDriverOverride.cpp b/rEFIt_UEFI/Platform/PlatformDriverOverride.cpp index 4e80b43e1..5dfc61a60 100644 --- a/rEFIt_UEFI/Platform/PlatformDriverOverride.cpp +++ b/rEFIt_UEFI/Platform/PlatformDriverOverride.cpp @@ -126,12 +126,12 @@ OurPlatformDriverLoaded ( EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (EFI_ERROR(Status)) { - DBG(" CompName %r\n", Status); + DBG(" CompName %s\n", strerror(Status)); return EFI_UNSUPPORTED; } Status = CompName->GetDriverName(CompName, "eng", &DriverName); if (!EFI_ERROR(Status)) { - DBG(" DriverName=%s at Controller=%x\n", DriverName, ControllerHandle); + DBG(" DriverName=%ls at Controller=%X\n", DriverName, ControllerHandle); } #endif @@ -222,7 +222,7 @@ VOID RegisterDriversToHighestPriority(IN EFI_HANDLE *PriorityDrivers) &mOurPlatformDriverOverrideProtocol, NULL ); - DBG("%r\n", Status); + DBG("%s\n", strerror(Status)); return; } diff --git a/rEFIt_UEFI/Platform/Settings.cpp b/rEFIt_UEFI/Platform/Settings.cpp index cccc9941a..a26c47cb0 100644 --- a/rEFIt_UEFI/Platform/Settings.cpp +++ b/rEFIt_UEFI/Platform/Settings.cpp @@ -331,7 +331,7 @@ ParseACPIName(CHAR8 *String) ACPI_NAME_LIST* Next = NULL; INTN i, j, Len, pos0, pos1; Len = AsciiStrLen(String); - // DBG("parse ACPI name: %a\n", String); + // DBG("parse ACPI name: %s\n", String); if (Len > 0) { //Parse forward but put in stack LIFO "_SB.PCI0.RP02.PXSX" -1,3,8,13,18 pos0 = -1; @@ -351,7 +351,7 @@ ParseACPIName(CHAR8 *String) } List->Name[4] = '\0'; // } - // DBG("string between [%d,%d]: %a\n", pos0, pos1, List->Name); + // DBG("string between [%d,%d]: %s\n", pos0, pos1, List->Name); pos0 = pos1; //comma or zero@end Next = List; } @@ -401,10 +401,10 @@ ParseLoadOptions ( for (i = 0; PlistStrings[i][0] != '\0'; i++) { PlistStringsLen = AsciiStrLen (PlistStrings[i]); - //DBG ("PlistStrings[%d] = %a\n", i, PlistStrings[i]); + //DBG ("PlistStrings[%d] = %s\n", i, PlistStrings[i]); if (PlistStringsLen < TailSize) { if (AsciiStriNCmp (PlistStrings[i], Start, PlistStringsLen)) { - DBG (" - found plist string = %a, parse XML in LoadOptions\n", PlistStrings[i]); + DBG (" - found plist string = %s, parse XML in LoadOptions\n", PlistStrings[i]); if (ParseXML (Start, Dict, (UINT32)TailSize) != EFI_SUCCESS) { *Dict = NULL; DBG (" - [!] xml in load options is bad\n"); @@ -464,7 +464,7 @@ GetBootFromOption(VOID) gSettings.DefaultLoader = (__typeof__(gSettings.DefaultLoader))AllocateCopyPool(Name2Size, Data); } - DBG("Clover started with option to boot %s from %s\n", + DBG("Clover started with option to boot %ls from %ls\n", (gSettings.DefaultLoader != NULL)?gSettings.DefaultLoader:L"legacy", gSettings.DefaultVolume); } @@ -492,7 +492,7 @@ SetBootCurrent(REFIT_MENU_ITEM_BOOTNUM *Entry) VarName = PoolPrint(L"Boot%04x", Entry->BootNum); BootVariable = (UINT8*)GetNvramVariable (VarName, &gEfiGlobalVariableGuid, NULL, &VarSize); if ((BootVariable == NULL) || (VarSize == 0)) { - DBG("Boot option %s not found\n", VarName); + DBG("Boot option %ls not found\n", VarName); FreePool(VarName); return; } @@ -514,7 +514,7 @@ SetBootCurrent(REFIT_MENU_ITEM_BOOTNUM *Entry) NameSize = *(UINT16*)Data; Data += 2; if (StriCmp((CHAR16*)Data, Entry->Volume->VolName) != 0) { - DBG("Boot option %d has other volume name %s\n", Entry->BootNum, (CHAR16*)Data); + DBG("Boot option %llu has other volume name %ls\n", Entry->BootNum, (CHAR16*)Data); FreePool(BootVariable); return; } @@ -522,7 +522,7 @@ SetBootCurrent(REFIT_MENU_ITEM_BOOTNUM *Entry) if (VarSize > NameSize + 6) { Data += NameSize; if (StriCmp((CHAR16*)Data, Basename(Entry->LoaderPath)) != 0) { - DBG("Boot option %d has other loader name %s\n", Entry->BootNum, (CHAR16*)Data); + DBG("Boot option %llu has other loader name %ls\n", Entry->BootNum, (CHAR16*)Data); FreePool(BootVariable); return; } @@ -536,7 +536,7 @@ SetBootCurrent(REFIT_MENU_ITEM_BOOTNUM *Entry) sizeof(UINT16), &Entry->BootNum); if (EFI_ERROR(Status)) { - DBG("Can't save BootCurrent, status=%r\n", Status); + DBG("Can't save BootCurrent, status=%s\n", strerror(Status)); } //Next step is rotate BootOrder to set BootNum to first place BootOrder = (__typeof__(BootOrder))GetNvramVariable (L"BootOrder", &gEfiGlobalVariableGuid, NULL, &BootOrderSize); @@ -568,7 +568,7 @@ SetBootCurrent(REFIT_MENU_ITEM_BOOTNUM *Entry) BootOrderNew ); if (EFI_ERROR(Status)) { - DBG("Can't save BootOrder, status=%r\n", Status); + DBG("Can't save BootOrder, status=%s\n", strerror(Status)); } DBG("Set new BootOrder\n"); PrintBootOrder(BootOrderNew, VarSize); @@ -608,7 +608,7 @@ UINT8 /* DBG ("Data: %p, Len: %d = ", Data, Prop->dataLen); for (i = 0; i < Prop->dataLen; i++) { - DBG ("%02x ", Data[i]); + DBG ("%02X ", Data[i]); } DBG ("\n"); */ @@ -624,7 +624,7 @@ UINT8 /* DBG ("Data(str): %p, Len: %d = ", data, len); for (i = 0; i < Len; i++) { - DBG ("%02x ", data[i]); + DBG ("%02X ", data[i]); } DBG ("\n"); */ @@ -663,11 +663,11 @@ LoadUserSettings ( Status = egLoadFile (RootDir, ConfigPlistPath, (UINT8**)&gConfigPtr, &Size); } if (!EFI_ERROR (Status)) { - DBG ("Using %s.plist at RootDir at path: %s\n", ConfName, ConfigPlistPath); + DBG ("Using %ls.plist at RootDir at path: %ls\n", ConfName, ConfigPlistPath); } else { Status = egLoadFile (SelfRootDir, ConfigPlistPath, (UINT8**)&gConfigPtr, &Size); if (!EFI_ERROR (Status)) { - DBG ("Using %s.plist at SelfRootDir at path: %s\n", ConfName, ConfigPlistPath); + DBG ("Using %ls.plist at SelfRootDir at path: %ls\n", ConfName, ConfigPlistPath); } } } @@ -676,7 +676,7 @@ LoadUserSettings ( Status = ParseXML ((const CHAR8*)gConfigPtr, Dict, (UINT32)Size); if (EFI_ERROR (Status)) { // Dict = NULL; - DBG ("config.plist parse error Status=%r\n", Status); + DBG ("config.plist parse error Status=%s\n", strerror(Status)); return Status; } } @@ -1015,7 +1015,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, Prop = GetProperty (DictPointer, "FakeCPUID"); if (Prop != NULL || gBootChanged) { Patches->FakeCPUID = (UINT32)GetPropertyInteger (Prop, 0); - DBG ("FakeCPUID: %x\n", Patches->FakeCPUID); + DBG ("FakeCPUID: %X\n", Patches->FakeCPUID); } Prop = GetProperty (DictPointer, "ATIConnectorsController"); @@ -1069,12 +1069,12 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } Patches->ForceKexts = newForceKexts; - DBG ("ForceKextsToLoad: %d requested\n", Count); + DBG ("ForceKextsToLoad: %lld requested\n", Count); for (i = 0; i < Count; i++) { EFI_STATUS Status = GetElement (Prop, i, &Prop2); if (EFI_ERROR (Status)) { - DBG (" - [%02d]: ForceKexts error %r getting next element\n", i, Status); + DBG (" - [%02lld]: ForceKexts error %s getting next element\n", i, strerror(Status)); continue; } @@ -1090,7 +1090,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, if (AsciiStrSize(Prop2->string) > 1) { Patches->ForceKexts[Patches->NrForceKexts] = (__typeof_am__(Patches->ForceKexts[Patches->NrForceKexts]))AllocateZeroPool (AsciiStrSize(Prop2->string) * sizeof(CHAR16)); AsciiStrToUnicodeStrS(Prop2->string, Patches->ForceKexts[Patches->NrForceKexts], 255); - DBG (" - [%d]: %s\n", Patches->NrForceKexts, Patches->ForceKexts[Patches->NrForceKexts]); + DBG (" - [%d]: %ls\n", Patches->NrForceKexts, Patches->ForceKexts[Patches->NrForceKexts]); ++Patches->NrForceKexts; } } @@ -1138,21 +1138,21 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, KEXT_PATCH *newPatches = (__typeof__(newPatches))AllocateZeroPool (Count * sizeof(KEXT_PATCH)); Patches->KextPatches = newPatches; - DBG ("KextsToPatch: %d requested\n", Count); + DBG ("KextsToPatch: %lld requested\n", Count); for (i = 0; i < Count; i++) { CHAR8 *KextPatchesName, *KextPatchesLabel; UINTN FindLen = 0, ReplaceLen = 0, MaskLen = 0; UINT8 *TmpData, *TmpPatch; EFI_STATUS Status = GetElement (Prop, i, &Prop2); if (EFI_ERROR (Status)) { - DBG (" - [%02d]: Patches error %r getting next element\n", i, Status); + DBG (" - [%02lld]: Patches error %s getting next element\n", i, strerror(Status)); continue; } if (Prop2 == NULL) { break; } - DBG (" - [%02d]:", i); + DBG (" - [%02lld]:", i); Dict = GetProperty (Prop2, "Name"); if (Dict == NULL) { @@ -1175,7 +1175,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } else { AsciiStrCatS(KextPatchesLabel, 255, " (NoLabel)"); } - DBG (" %a", KextPatchesLabel); + DBG (" %s", KextPatchesLabel); Patches->KextPatches[Patches->NrKexts].MenuItem.BValue = TRUE; Dict = GetProperty (Prop2, "Disabled"); @@ -1229,13 +1229,13 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, Dict = GetProperty (Prop2, "MatchOS"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->KextPatches[Patches->NrKexts].MatchOS = (__typeof__(Patches->KextPatches[Patches->NrKexts].MatchOS))AllocateCopyPool (AsciiStrSize(Dict->string), Dict->string); - DBG(" :: MatchOS: %a", Patches->KextPatches[Patches->NrKexts].MatchOS); + DBG(" :: MatchOS: %s", Patches->KextPatches[Patches->NrKexts].MatchOS); } Dict = GetProperty (Prop2, "MatchBuild"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->KextPatches[Patches->NrKexts].MatchBuild = (__typeof__(Patches->KextPatches[Patches->NrKexts].MatchBuild))AllocateCopyPool (AsciiStrSize(Dict->string), Dict->string); - DBG(" :: MatchBuild: %a", Patches->KextPatches[Patches->NrKexts].MatchBuild); + DBG(" :: MatchBuild: %s", Patches->KextPatches[Patches->NrKexts].MatchBuild); } // check if this is Info.plist patch or kext binary patch @@ -1248,7 +1248,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, DBG (" :: BinPatch"); } - DBG (" :: data len: %d\n", Patches->KextPatches[Patches->NrKexts].DataLen); + DBG (" :: data len: %lld\n", Patches->KextPatches[Patches->NrKexts].DataLen); if (!Patches->KextPatches[Patches->NrKexts++].MenuItem.BValue) { DBG(" - patch disabled at config\n"); } @@ -1300,21 +1300,21 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, KERNEL_PATCH *newPatches = (__typeof__(newPatches))AllocateZeroPool (Count * sizeof(KERNEL_PATCH)); Patches->KernelPatches = newPatches; - DBG ("KernelToPatch: %d requested\n", Count); + DBG ("KernelToPatch: %lld requested\n", Count); for (i = 0; i < Count; i++) { CHAR8 *KernelPatchesLabel; UINTN FindLen = 0, ReplaceLen = 0, MaskLen = 0; UINT8 *TmpData, *TmpPatch; EFI_STATUS Status = GetElement (Prop, i, &Prop2); if (EFI_ERROR (Status)) { - DBG (" - [%02d]: Patches error %r getting next element\n", i, Status); + DBG (" - [%02lld]: Patches error %s getting next element\n", i, strerror(Status)); continue; } if (Prop2 == NULL) { break; } - DBG (" - [%02d]:", i); + DBG (" - [%02lld]:", i); Dict = GetProperty (Prop2, "Comment"); if (Dict != NULL) { @@ -1322,7 +1322,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, } else { KernelPatchesLabel = (__typeof__(KernelPatchesLabel))AllocateCopyPool (8, "NoLabel"); } - DBG (" %a", KernelPatchesLabel); + DBG (" %s", KernelPatchesLabel); Dict = GetProperty (Prop2, "Disabled"); Patches->KernelPatches[Patches->NrKernels].MenuItem.BValue = !IsPropertyTrue (Dict); @@ -1376,15 +1376,15 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, Dict = GetProperty (Prop2, "MatchOS"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->KernelPatches[Patches->NrKernels].MatchOS = (__typeof__(Patches->KernelPatches[Patches->NrKernels].MatchOS))AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string); - DBG(" :: MatchOS: %a", Patches->KernelPatches[Patches->NrKernels].MatchOS); + DBG(" :: MatchOS: %s", Patches->KernelPatches[Patches->NrKernels].MatchOS); } Dict = GetProperty (Prop2, "MatchBuild"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->KernelPatches[Patches->NrKernels].MatchBuild = (__typeof__(Patches->KernelPatches[Patches->NrKernels].MatchBuild))AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string); - DBG(" :: MatchBuild: %a", Patches->KernelPatches[Patches->NrKernels].MatchBuild); + DBG(" :: MatchBuild: %s", Patches->KernelPatches[Patches->NrKernels].MatchBuild); } - DBG (" :: data len: %d\n", Patches->KernelPatches[Patches->NrKernels].DataLen); + DBG (" :: data len: %lld\n", Patches->KernelPatches[Patches->NrKernels].DataLen); Patches->NrKernels++; } } @@ -1427,20 +1427,20 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, KERNEL_PATCH *newPatches = (__typeof__(newPatches))AllocateZeroPool (Count * sizeof(KERNEL_PATCH)); Patches->BootPatches = newPatches; - DBG ("BootPatches: %d requested\n", Count); + DBG ("BootPatches: %lld requested\n", Count); for (i = 0; i < Count; i++) { CHAR8 *BootPatchesLabel; UINTN FindLen = 0, ReplaceLen = 0, MaskLen = 0; UINT8 *TmpData, *TmpPatch; EFI_STATUS Status = GetElement (Prop, i, &Prop2); if (EFI_ERROR (Status)) { - DBG (" - [%02d]: error %r getting next element\n", i, Status); + DBG (" - [%02lld]: error %s getting next element\n", i, strerror(Status)); continue; } if (Prop2 == NULL) { break; } - DBG (" - [%02d]:", i); + DBG (" - [%02lld]:", i); Dict = GetProperty (Prop2, "Comment"); if (Dict != NULL) { @@ -1449,7 +1449,7 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, BootPatchesLabel = (__typeof__(BootPatchesLabel))AllocateCopyPool (8, "NoLabel"); } - DBG (" %a", BootPatchesLabel); + DBG (" %s", BootPatchesLabel); Dict = GetProperty (Prop2, "Disabled"); Patches->BootPatches[Patches->NrBoots].MenuItem.BValue = !IsPropertyTrue (Dict); @@ -1500,16 +1500,16 @@ FillinKextPatches (IN OUT KERNEL_AND_KEXT_PATCHES *Patches, Dict = GetProperty (Prop2, "MatchOS"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->BootPatches[Patches->NrBoots].MatchOS = (__typeof__(Patches->BootPatches[Patches->NrBoots].MatchOS))AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string); - DBG(" :: MatchOS: %a", Patches->BootPatches[Patches->NrBoots].MatchOS); + DBG(" :: MatchOS: %s", Patches->BootPatches[Patches->NrBoots].MatchOS); } Dict = GetProperty (Prop2, "MatchBuild"); if ((Dict != NULL) && (Dict->type == kTagTypeString)) { Patches->BootPatches[Patches->NrBoots].MatchBuild = (__typeof__(Patches->BootPatches[Patches->NrBoots].MatchBuild))AllocateCopyPool (AsciiStrSize (Dict->string), Dict->string); - DBG(" :: MatchBuild: %a", Patches->BootPatches[Patches->NrBoots].MatchBuild); + DBG(" :: MatchBuild: %s", Patches->BootPatches[Patches->NrBoots].MatchBuild); } - DBG (" :: data len: %d\n", Patches->BootPatches[Patches->NrBoots].DataLen); + DBG (" :: data len: %lld\n", Patches->BootPatches[Patches->NrBoots].DataLen); Patches->NrBoots++; } } @@ -1547,7 +1547,7 @@ IsPatchEnabled (CHAR8 *MatchOSEntry, CHAR8 *CurrOS) ((AsciiStrStr(mos->array[i], ".") != NULL) && IsOSValid(mos->array[i], CurrOS)) || // MatchOS (AsciiStrStr(mos->array[i], CurrOS) != NULL) // MatchBuild ) { - //DBG ("\nthis patch will activated for OS %s!\n", mos->array[i]); + //DBG ("\nthis patch will activated for OS %ls!\n", mos->array[i]); ret = TRUE; break; } @@ -1569,7 +1569,7 @@ MatchOSes *GetStrArraySeparatedByChar(CHAR8 *str, CHAR8 sep) return NULL; } mo->count = countOccurrences( str, sep ) + 1; - // DBG("found %d %c in %s\n", mo->count, sep, str); + // DBG("found %d %c in %ls\n", mo->count, sep, str); len = (INTN)AsciiStrLen(str); doubleSep[0] = sep; doubleSep[1] = sep; @@ -1623,7 +1623,7 @@ MatchOSes *GetStrArraySeparatedByChar(CHAR8 *str, CHAR8 sep) FreePool(indexes); } else { - // DBG("str contains only one component and it is our string %s!\n", str); + // DBG("str contains only one component and it is our string %ls!\n", str); mo->array[0] = (__typeof_am__(mo->array[0]))AllocateCopyPool(AsciiStrLen(str)+1, str); } return mo; @@ -1995,7 +1995,7 @@ FillinCustomEntry ( } Entry->CustomLogo = egLoadImage (SelfRootDir, customLogo, TRUE); if (Entry->CustomLogo == NULL) { - DBG ("Custom boot logo not found at path `%s`!\n", customLogo); + DBG ("Custom boot logo not found at path `%ls`!\n", customLogo); } if (customLogo != NULL) { FreePool (customLogo); @@ -2011,12 +2011,12 @@ FillinCustomEntry ( Entry->CustomLogo = egDecodePNG (Prop->data, Prop->dataLen, TRUE); if (Entry->CustomLogo == NULL) { - DBG ("Custom boot logo not decoded from data!\n", Prop->string); + DBG ("Custom boot logo not decoded from data!\n"/*, Prop->string*/); } } else { Entry->CustomBoot = CUSTOM_BOOT_USER_DISABLED; } - DBG ("Custom entry boot %s (0x%X)\n", CustomBootModeToStr (Entry->CustomBoot), Entry->CustomLogo); + DBG ("Custom entry boot %ls (0x%llX)\n", CustomBootModeToStr(Entry->CustomBoot), (uintptr_t)Entry->CustomLogo); } Prop = GetProperty (DictPointer, "BootBgColor"); @@ -2062,7 +2062,7 @@ FillinCustomEntry ( } else if (AsciiStriCmp (Prop->string, "LinuxKernel") == 0) { Entry->Type = OSTYPE_LINEFI; } else { - DBG ("** Warning: unknown custom entry Type '%a'\n", Prop->string); + DBG ("** Warning: unknown custom entry Type '%s'\n", Prop->string); Entry->Type = OSTYPE_OTHER; } } else { @@ -2115,7 +2115,7 @@ FillinCustomEntry ( Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_CHECKFAKESMC); Entry->Flags = OSFLAG_SET(Entry->Flags, OSFLAG_WITHKEXTS); } else { - DBG ("** Warning: unknown custom entry InjectKexts value '%a'\n", Prop->string); + DBG ("** Warning: unknown custom entry InjectKexts value '%s'\n", Prop->string); } } else { // Use global settings @@ -2510,7 +2510,7 @@ GetEDIDSettings(TagPtr DictPointer) if (Prop != NULL) { gSettings.CustomEDID = GetDataSetting(Dict, "Custom", &j); if ((j % 128) != 0) { - DBG (" Custom EDID has wrong length=%d\n", j); + DBG (" Custom EDID has wrong length=%llu\n", j); } else { DBG (" Custom EDID is ok\n"); gSettings.CustomEDIDsize = (UINT16)j; @@ -2586,7 +2586,7 @@ GetEarlyUserSettings ( Prop = GetProperty (DictPointer, "Timeout"); if (Prop != NULL) { GlobalConfig.Timeout = (INT32)GetPropertyInteger (Prop, GlobalConfig.Timeout); - DBG ("timeout set to %d\n", GlobalConfig.Timeout); + DBG ("timeout set to %lld\n", GlobalConfig.Timeout); } Prop = GetProperty (DictPointer, "SkipHibernateTimeout"); @@ -2813,7 +2813,7 @@ GetEarlyUserSettings ( gSettings.CustomLogo = egLoadImage (RootDir, customLogo, TRUE); if (gSettings.CustomLogo == NULL) { - DBG ("Custom boot logo not found at path `%s`!\n", customLogo); + DBG ("Custom boot logo not found at path `%ls`!\n", customLogo); } if (customLogo != NULL) { @@ -2829,7 +2829,7 @@ GetEarlyUserSettings ( gSettings.CustomLogo = egDecodePNG (Prop->data, Prop->dataLen, TRUE); if (gSettings.CustomLogo == NULL) { - DBG ("Custom boot logo not decoded from data!\n", Prop->string); + DBG ("Custom boot logo not decoded from data!\n"/*, Prop->string*/); } } else { gSettings.CustomBoot = CUSTOM_BOOT_USER_DISABLED; @@ -2838,7 +2838,7 @@ GetEarlyUserSettings ( gSettings.CustomBoot = CUSTOM_BOOT_DISABLED; } - DBG ("Custom boot %s (0x%X)\n", CustomBootModeToStr (gSettings.CustomBoot), gSettings.CustomLogo); + DBG ("Custom boot %ls (0x%llX)\n", CustomBootModeToStr(gSettings.CustomBoot), (uintptr_t)gSettings.CustomLogo); } //*** SYSTEM *** @@ -2889,7 +2889,7 @@ GetEarlyUserSettings ( if ((Prop->type == kTagTypeString) && Prop->string) { UINTN i; GlobalConfig.Theme = PoolPrint (L"%a", Prop->string); - DBG ("Default theme: %s\n", GlobalConfig.Theme); + DBG ("Default theme: %ls\n", GlobalConfig.Theme); OldChosenTheme = 0xFFFF; //default for embedded for (i = 0; i < ThemesNum; i++) { if (StriCmp(GlobalConfig.Theme, ThemesList[i]) == 0) { @@ -2971,7 +2971,7 @@ GetEarlyUserSettings ( } } if (GlobalConfig.ConsoleMode > 0) { - DBG ("ConsoleMode will be set to mode #%d\n", GlobalConfig.ConsoleMode); + DBG ("ConsoleMode will be set to mode #%lld\n", GlobalConfig.ConsoleMode); } } @@ -3075,7 +3075,7 @@ GetEarlyUserSettings ( if ((Dict2->type == kTagTypeString) && Dict2->string) { gSettings.HVHideStrings[gSettings.HVCount] = PoolPrint (L"%a", Dict2->string); if (gSettings.HVHideStrings[gSettings.HVCount]) { - DBG ("Hiding entries with string %s\n", gSettings.HVHideStrings[gSettings.HVCount]); + DBG ("Hiding entries with string %ls\n", gSettings.HVHideStrings[gSettings.HVCount]); gSettings.HVCount++; } } @@ -3263,17 +3263,17 @@ GetEarlyUserSettings ( if (VBiosPatch->Find == NULL || FindSize == 0) { Valid = FALSE; - DBG ("PatchVBiosBytes[%d]: missing Find data\n", i); + DBG ("PatchVBiosBytes[%lld]: missing Find data\n", i); } if (VBiosPatch->Replace == NULL || ReplaceSize == 0) { Valid = FALSE; - DBG ("PatchVBiosBytes[%d]: missing Replace data\n", i); + DBG ("PatchVBiosBytes[%lld]: missing Replace data\n", i); } if (FindSize != ReplaceSize) { Valid = FALSE; - DBG ("PatchVBiosBytes[%d]: Find and Replace data are not the same size\n", i); + DBG ("PatchVBiosBytes[%lld]: Find and Replace data are not the same size\n", i); } if (Valid) { @@ -3372,7 +3372,7 @@ GetListOfConfigs () NameLen = StrLen(DirEntry->FileName) - 6; //without ".plist" ConfigsList[ConfigsNum] = (CHAR16*)AllocateCopyPool (NameLen * sizeof(CHAR16) + 2, DirEntry->FileName); ConfigsList[ConfigsNum++][NameLen] = L'\0'; - DBG("- %s\n", DirEntry->FileName); + DBG("- %ls\n", DirEntry->FileName); } } DirIterClose(&DirIter); @@ -3405,7 +3405,7 @@ GetListOfDsdts () NameLen = StrLen(DirEntry->FileName); //with ".aml" DsdtsList[DsdtsNum] = (CHAR16*)AllocateCopyPool (NameLen * sizeof(CHAR16) + 2, DirEntry->FileName); DsdtsList[DsdtsNum++][NameLen] = L'\0'; - DBG("- %s\n", DirEntry->FileName); + DBG("- %ls\n", DirEntry->FileName); } } DirIterClose(&DirIter); @@ -3527,7 +3527,7 @@ VOID GetListOfInjectKext(CHAR16 *KextDirNameUnderOEMPath) mKext->Next = InjectKextList; mKext->Version = GetBundleVersion(FullName); InjectKextList = mKext; - // DBG("Added mKext=%s, MatchOS=%s\n", mKext->FileName, mKext->MatchOS); + // DBG("Added mKext=%ls, MatchOS=%ls\n", mKext->FileName, mKext->MatchOS); // Obtain PlugInList // Iterate over PlugIns directory @@ -3546,7 +3546,7 @@ VOID GetListOfInjectKext(CHAR16 *KextDirNameUnderOEMPath) mPlugInKext->Next = mKext->PlugInList; mPlugInKext->Version = GetBundleVersion(PlugInsName); mKext->PlugInList = mPlugInKext; - // DBG("---| added plugin=%s, MatchOS=%s\n", mPlugInKext->FileName, mPlugInKext->MatchOS); + // DBG("---| added plugin=%ls, MatchOS=%ls\n", mPlugInKext->FileName, mPlugInKext->MatchOS); FreePool(PlugInsName); } FreePool(PlugInsPath); @@ -3601,11 +3601,11 @@ GetListOfThemes () DirIterOpen (SelfRootDir, L"\\EFI\\CLOVER\\themes", &DirIter); while (DirIterNext(&DirIter, 1, L"*", &DirEntry)) { if (DirEntry->FileName[0] == '.') { - //DBG("Skip theme: %s\n", DirEntry->FileName); + //DBG("Skip theme: %ls\n", DirEntry->FileName); continue; } - //DBG ("Found theme directory: %s", DirEntry->FileName); - DBG ("- [%02d]: %s", ThemesNum, DirEntry->FileName); + //DBG ("Found theme directory: %ls", DirEntry->FileName); + DBG ("- [%02llu]: %ls", ThemesNum, DirEntry->FileName); ThemeTestPath = PoolPrint (L"EFI\\CLOVER\\themes\\%s", DirEntry->FileName); if (ThemeTestPath != NULL) { Status = SelfRootDir->Open (SelfRootDir, &ThemeTestDir, ThemeTestPath, EFI_FILE_MODE_READ, 0); @@ -3615,7 +3615,7 @@ GetListOfThemes () Status = egLoadFile (ThemeTestDir, CONFIG_THEME_SVG, (UINT8**)&ThemePtr, &Size); if (EFI_ERROR (Status)) { Status = EFI_NOT_FOUND; - DBG (" - bad theme because %s nor %s can't be load", CONFIG_THEME_FILENAME, CONFIG_THEME_SVG); + DBG (" - bad theme because %ls nor %ls can't be load", CONFIG_THEME_FILENAME, CONFIG_THEME_SVG); } } if (!EFI_ERROR (Status)) { @@ -4000,7 +4000,7 @@ GetThemeTagSettings ( Dict2 = GetProperty (Dict, "CharWidth"); GlobalConfig.CharWidth = (UINTN)GetPropertyInteger (Dict2, GlobalConfig.CharWidth); if (GlobalConfig.CharWidth & 1) { - MsgLog("Warning! Character width %d should be even!\n", GlobalConfig.CharWidth); + MsgLog("Warning! Character width %lld should be even!\n", GlobalConfig.CharWidth); } Dict2 = GetProperty (Dict, "Proportional"); @@ -4179,9 +4179,9 @@ LoadTheme (CHAR16 *TestTheme) ThemeDict = NULL; } if (ThemeDict == NULL) { - DBG("svg file %s not parsed\n", CONFIG_THEME_SVG); + DBG("svg file %ls not parsed\n", CONFIG_THEME_SVG); } else { - DBG("Using vector theme '%s' (%s)\n", TestTheme, ThemePath); + DBG("Using vector theme '%ls' (%ls)\n", TestTheme, ThemePath); } } else { Status = egLoadFile(ThemeDir, CONFIG_THEME_FILENAME, (UINT8**)&ThemePtr, &Size); @@ -4191,9 +4191,9 @@ LoadTheme (CHAR16 *TestTheme) ThemeDict = NULL; } if (ThemeDict == NULL) { - DBG ("xml file %s not parsed\n", CONFIG_THEME_FILENAME); + DBG ("xml file %ls not parsed\n", CONFIG_THEME_FILENAME); } else { - DBG ("Using theme '%s' (%s)\n", TestTheme, ThemePath); + DBG ("Using theme '%ls' (%ls)\n", TestTheme, ThemePath); } } } @@ -4241,7 +4241,7 @@ InitTheme( NSVGfontChain *fontChain = fontsDB; while (fontChain) { NSVGfont *font = fontChain->font; -// DBG("free font %a\n", font->fontFamily); +// DBG("free font %s\n", font->fontFamily); NSVGfontChain *nextChain = fontChain->next; if (font) { nsvg__deleteFont(font); @@ -4336,13 +4336,13 @@ InitTheme( if (TestTheme != NULL) { ThemeDict = LoadTheme (TestTheme); if (ThemeDict != NULL) { - DBG ("special theme %s found and %s parsed\n", TestTheme, CONFIG_THEME_FILENAME); + DBG ("special theme %ls found and %ls parsed\n", TestTheme, CONFIG_THEME_FILENAME); if (GlobalConfig.Theme) { FreePool (GlobalConfig.Theme); } GlobalConfig.Theme = TestTheme; } else { // special theme not loaded - DBG ("special theme %s not found, skipping\n", TestTheme, CONFIG_THEME_FILENAME); + DBG ("special theme %ls not found, skipping\n", TestTheme/*, CONFIG_THEME_FILENAME*/); FreePool (TestTheme); } TestTheme = NULL; @@ -4364,16 +4364,16 @@ InitTheme( if (TestTheme != NULL) { ThemeDict = LoadTheme (TestTheme); if (ThemeDict != NULL) { - DBG ("theme %a defined in NVRAM found and %s parsed\n", ChosenTheme, CONFIG_THEME_FILENAME); + DBG ("theme %s defined in NVRAM found and %ls parsed\n", ChosenTheme, CONFIG_THEME_FILENAME); if (GlobalConfig.Theme != NULL) { FreePool (GlobalConfig.Theme); } GlobalConfig.Theme = TestTheme; } else { // theme from nvram not loaded if (GlobalConfig.Theme != NULL) { - DBG ("theme %a chosen from nvram is absent, using theme defined in config: %s\n", ChosenTheme, GlobalConfig.Theme); + DBG ("theme %s chosen from nvram is absent, using theme defined in config: %ls\n", ChosenTheme, GlobalConfig.Theme); } else { - DBG ("theme %a chosen from nvram is absent, get first theme\n", ChosenTheme); + DBG ("theme %s chosen from nvram is absent, get first theme\n", ChosenTheme); } FreePool (TestTheme); } @@ -4387,9 +4387,9 @@ InitTheme( if (ThemeDict == NULL) { if (GlobalConfig.Theme == NULL) { if (Time != NULL) { - DBG ("no default theme, get random theme %s\n", ThemesList[Rnd]); + DBG ("no default theme, get random theme %ls\n", ThemesList[Rnd]); } else { - DBG ("no default theme, get first theme %s\n", ThemesList[0]); + DBG ("no default theme, get first theme %ls\n", ThemesList[0]); } } else { if (StriCmp(GlobalConfig.Theme, L"random") == 0) { @@ -4397,7 +4397,7 @@ InitTheme( } else { ThemeDict = LoadTheme (GlobalConfig.Theme); if (ThemeDict == NULL) { - DBG ("GlobalConfig: %s not found, get embedded theme\n", GlobalConfig.Theme); + DBG ("GlobalConfig: %ls not found, get embedded theme\n", GlobalConfig.Theme); FreePool (GlobalConfig.Theme); GlobalConfig.Theme = NULL; } @@ -4437,7 +4437,7 @@ finish: if (DictPointer != NULL) { Status = GetThemeTagSettings(DictPointer); if (EFI_ERROR (Status)) { - DBG ("Config theme error: %r\n", Status); + DBG ("Config theme error: %s\n", strerror(Status)); } } } @@ -4494,9 +4494,9 @@ ParseSMBIOSSettings( // something else? SetDMISettingsForModel (iMac132, FALSE); } - DBG ("Using ProductName from config: %a\n", gSettings.ProductName); + DBG ("Using ProductName from config: %s\n", gSettings.ProductName); } else { - DBG ("Using ProductName from clover: %a\n", gSettings.ProductName); + DBG ("Using ProductName from clover: %s\n", gSettings.ProductName); } Prop = GetProperty(DictPointer, "SmbiosVersion"); @@ -4544,7 +4544,7 @@ ParseSMBIOSSettings( } else { DBG ("BiosVersion: not set, Using BiosVersion from clover\n"); } - DBG ("BiosVersion: %a\n", gSettings.RomVersion); + DBG ("BiosVersion: %s\n", gSettings.RomVersion); Prop1 = GetProperty (DictPointer, "BiosReleaseDate"); if (Prop1 != NULL) { @@ -4691,7 +4691,7 @@ ParseSMBIOSSettings( } } } else { - //DBG ("BiosReleaseDate: set to %a from config, Ignore BiosReleaseDate\n", Prop1->string); + //DBG ("BiosReleaseDate: set to %s from config, Ignore BiosReleaseDate\n", Prop1->string); //DBG ("Using BiosReleaseDate from clover\n"); } } else { @@ -4717,36 +4717,36 @@ ParseSMBIOSSettings( //DBG ("BiosReleaseDate: not set, Using BiosReleaseDate from clover\n"); } } - DBG ("BiosReleaseDate: %a\n", gSettings.ReleaseDate); + DBG ("BiosReleaseDate: %s\n", gSettings.ReleaseDate); Prop = GetProperty (DictPointer, "EfiVersion"); if (Prop != NULL) { if (AsciiStrVersionToUint64(gSettings.EfiVersion, 4, 5) > AsciiStrVersionToUint64(Prop->string, 4, 5)) { - DBG ("Using latest EfiVersion from clover: %a\n", gSettings.EfiVersion); + DBG ("Using latest EfiVersion from clover: %s\n", gSettings.EfiVersion); } else if (AsciiStrVersionToUint64(gSettings.EfiVersion, 4, 5) < AsciiStrVersionToUint64(Prop->string, 4, 5)) { AsciiStrCpyS (gSettings.EfiVersion, 64, Prop->string); - DBG ("Using latest EfiVersion from config: %a\n", gSettings.EfiVersion); + DBG ("Using latest EfiVersion from config: %s\n", gSettings.EfiVersion); } else { - DBG ("Using EfiVersion from clover: %a\n", gSettings.EfiVersion); + DBG ("Using EfiVersion from clover: %s\n", gSettings.EfiVersion); } } else if (iStrLen(gSettings.EfiVersion, 64) > 0) { - DBG ("Using EfiVersion from clover: %a\n", gSettings.EfiVersion); + DBG ("Using EfiVersion from clover: %s\n", gSettings.EfiVersion); } Prop = GetProperty (DictPointer, "FirmwareFeatures"); if (Prop != NULL) { gFwFeatures = (UINT32)GetPropertyInteger (Prop, gFwFeatures); - DBG ("Using FirmwareFeatures from config: 0x%08x\n", gFwFeatures); + DBG ("Using FirmwareFeatures from config: 0x%08X\n", gFwFeatures); } else { - DBG ("Using FirmwareFeatures from clover: 0x%08x\n", gFwFeatures); + DBG ("Using FirmwareFeatures from clover: 0x%08X\n", gFwFeatures); } Prop = GetProperty (DictPointer, "FirmwareFeaturesMask"); if (Prop != NULL) { gFwFeaturesMask = (UINT32)GetPropertyInteger (Prop, gFwFeaturesMask); - DBG ("Using FirmwareFeaturesMask from config: 0x%08x\n", gFwFeaturesMask); + DBG ("Using FirmwareFeaturesMask from config: 0x%08X\n", gFwFeaturesMask); } else { - DBG ("Using FirmwareFeaturesMask from clover: 0x%08x\n", gFwFeaturesMask); + DBG ("Using FirmwareFeaturesMask from clover: 0x%08X\n", gFwFeaturesMask); } Prop = GetProperty (DictPointer, "PlatformFeature"); @@ -4756,7 +4756,7 @@ ParseSMBIOSSettings( if (gPlatformFeature == 0xFFFF) { DBG ("PlatformFeature will not set in SMBIOS\n"); } else { - DBG ("Using PlatformFeature from clover: 0x%x\n", gPlatformFeature); + DBG ("Using PlatformFeature from clover: 0x%llX\n", gPlatformFeature); } } @@ -4793,7 +4793,7 @@ ParseSMBIOSSettings( StrToGuidLE ((CHAR16*)&UStr[0], &gSettings.SmUUID); gSettings.SmUUIDConfig = TRUE; } else { - DBG ("Error: invalid SmUUID '%a' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->string); + DBG ("Error: invalid SmUUID '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->string); } } @@ -4810,7 +4810,7 @@ ParseSMBIOSSettings( Prop = GetProperty (DictPointer, "Board-ID"); if (Prop != NULL) { AsciiStrCpyS (gSettings.BoardNumber, 64, Prop->string); - DBG ("Board-ID set from config as %a\n", gSettings.BoardNumber); + DBG ("Board-ID set from config as %s\n", gSettings.BoardNumber); } Prop = GetProperty (DictPointer, "BoardVersion"); @@ -4823,7 +4823,7 @@ ParseSMBIOSSettings( Prop = GetProperty (DictPointer, "BoardType"); if (Prop != NULL) { gSettings.BoardType = (UINT8)GetPropertyInteger (Prop, gSettings.BoardType); - DBG ("BoardType: 0x%x\n", gSettings.BoardType); + DBG ("BoardType: 0x%X\n", gSettings.BoardType); } Prop = GetProperty (DictPointer, "Mobile"); @@ -4854,7 +4854,7 @@ ParseSMBIOSSettings( Prop = GetProperty (DictPointer, "ChassisType"); if (Prop != NULL) { gSettings.ChassisType = (UINT8)GetPropertyInteger (Prop, gSettings.ChassisType); - DBG ("ChassisType: 0x%x\n", gSettings.ChassisType); + DBG ("ChassisType: 0x%X\n", gSettings.ChassisType); } Prop = GetProperty (DictPointer, "NoRomInfo"); @@ -4972,7 +4972,7 @@ GetUserSettings( DBG ("Read NVCAP:"); for (i = 0; i<20; i++) { - DBG ("%02x", gSettings.NVCAP[i]); + DBG ("%02X", gSettings.NVCAP[i]); } DBG ("\n"); @@ -5057,7 +5057,7 @@ GetUserSettings( DEV_PROPERTY **Child; if (Count > 0) { - DBG("Add %d devices (kTagTypeDict):\n", Count); + DBG("Add %lld devices (kTagTypeDict):\n", Count); for (i = 0; i < Count; i++) { Prop2 = NULL; @@ -5065,7 +5065,7 @@ GetUserSettings( if (!EFI_ERROR(GetElement(Prop, i, &Prop2))) { //take a with DevicePath if ((Prop2 != NULL) && (Prop2->type == kTagTypeKey)) { CHAR16* DevicePathStr = PoolPrint(L"%a", Prop2->string); - // DBG("Device: %s\n", DevicePathStr); + // DBG("Device: %ls\n", DevicePathStr); // when key in Devices/Properties is one of the strings "PrimaryGPU" / "SecondaryGPU", use device path of first / second gpu accordingly if (StriCmp(DevicePathStr, L"PrimaryGPU") == 0) { @@ -5119,7 +5119,7 @@ GetUserSettings( } Prop3 = Prop3->tag; //expected value - // DBG("%a\n type %d\n", (*Child)->Key, Prop3->type); + // DBG("%s\n type %d\n", (*Child)->Key, Prop3->type); if (Prop3 && (Prop3->type == kTagTypeString) && Prop3->string) { //first suppose it is Ascii string (*Child)->Value = (__typeof__((*Child)->Value))AllocateCopyPool(AsciiStrSize(Prop3->string), Prop3->string); @@ -5177,13 +5177,13 @@ GetUserSettings( DEV_PROPERTY *DevProp; if (Count > 0) { - DBG ("Add %d devices (Arbitrary):\n", Count); + DBG ("Add %lld devices (Arbitrary):\n", Count); for (Index = 0; Index < Count; Index++) { UINTN DeviceAddr = 0U; CHAR8 *Label; - DBG (" - [%02d]:", Index); + DBG (" - [%02lld]:", Index); if (EFI_ERROR (GetElement (Prop, Index, &Prop2))) { - DBG (" continue\n", Index); + DBG (" continue\n"/*, Index*/); continue; } Dict2 = GetProperty (Prop2, "PciAddr"); @@ -5192,7 +5192,7 @@ GetUserSettings( CHAR8 *Str = Dict2->string; if (Str[2] != ':') { - DBG(" wrong PciAddr string: %a\n", Str); + DBG(" wrong PciAddr string: %s\n", Str); continue; } Label = (__typeof__(Label))AllocatePool(64); @@ -5201,7 +5201,7 @@ GetUserSettings( Func = hexstrtouint8(&Str[6]); DeviceAddr = PCIADDR(Bus, Dev, Func); AsciiSPrint(Label, 64, "[%02x:%02x.%02x] ", Bus, Dev, Func); - DBG(" %a", Label); + DBG(" %s", Label); } else { DBG (" no PciAddr\n"); continue; @@ -5210,7 +5210,7 @@ GetUserSettings( Dict2 = GetProperty (Prop2, "Comment"); if (Dict2 != NULL) { AsciiStrCatS(Label, 64, Dict2->string); - DBG (" (%a)", Dict2->string); + DBG (" (%s)", Dict2->string); } DBG ("\n"); Dict2 = GetProperty (Prop2, "CustomProperties"); @@ -5284,19 +5284,19 @@ GetUserSettings( INTN Index = 0; //begin from 0 if second enter if (Count > 0) { - DBG ("Add %d properties:\n", Count); + DBG ("Add %lld properties:\n", Count); gSettings.AddProperties = (__typeof__(gSettings.AddProperties))AllocateZeroPool (Count * sizeof(DEV_PROPERTY)); for (i = 0; i < Count; i++) { UINTN Size = 0; - DBG (" - [%02d]:", i); + DBG (" - [%02lld]:", i); if (EFI_ERROR (GetElement (Prop, i, &Dict2))) { DBG (" continue\n"); continue; } if (Dict2 == NULL) { - DBG (" break\n", i); + DBG (" break\n"/*, i*/); break; } @@ -5331,12 +5331,12 @@ GetUserSettings( } else if (AsciiStriCmp (Prop2->string, "USB") == 0) { Property->Device = (UINT32)DEV_USB; } else { - DBG (" unknown device, ignored\n", i); + DBG (" unknown device, ignored\n"/*, i*/); continue; } } - DBG (" %a ", Prop2->string); + DBG (" %s ", Prop2->string); Prop2 = GetProperty (Dict2, "Disabled"); gSettings.AddProperties[Index].MenuItem.BValue = !IsPropertyTrue (Prop2); @@ -5361,7 +5361,7 @@ GetUserSettings( gSettings.AddProperties[Index].ValueLen = Size; } - DBG ("Key: %a, len: %d\n", gSettings.AddProperties[Index].Key, gSettings.AddProperties[Index].ValueLen); + DBG ("Key: %s, len: %llu\n", gSettings.AddProperties[Index].Key, gSettings.AddProperties[Index].ValueLen); if (!gSettings.AddProperties[Index].MenuItem.BValue) { DBG (" property disabled at config\n"); @@ -5489,7 +5489,7 @@ GetUserSettings( if (Prop != NULL) { gSettings.USBFixOwnership = IsPropertyTrue (Prop); } - DBG ("USB FixOwnership: %a\n", gSettings.USBFixOwnership?"yes":"no"); + DBG ("USB FixOwnership: %s\n", gSettings.USBFixOwnership?"yes":"no"); Prop = GetProperty (Prop2, "HighCurrent"); gSettings.HighCurrent = IsPropertyTrue (Prop); @@ -5509,7 +5509,7 @@ GetUserSettings( BOOLEAN Dropped; if (Count > 0) { - DBG ("Dropping %d tables:\n", Count); + DBG ("Dropping %lld tables:\n", Count); for (i = 0; i < Count; i++) { UINT32 Signature = 0; @@ -5517,16 +5517,16 @@ GetUserSettings( UINT64 TableId = 0; if (EFI_ERROR (GetElement (Prop, i, &Dict2))) { - DBG (" - [%02d]: Drop table continue\n", i); + DBG (" - [%02lld]: Drop table continue\n", i); continue; } if (Dict2 == NULL) { - DBG (" - [%02d]: Drop table break\n", i); + DBG (" - [%02lld]: Drop table break\n", i); break; } - DBG (" - [%02d]: Drop table ", i); + DBG (" - [%02lld]: Drop table ", i); // Get the table signatures to drop Prop2 = GetProperty (Dict2, "Signature"); if (Prop2 && (Prop2->type == kTagTypeString) && Prop2->string) { @@ -5569,20 +5569,20 @@ GetUserSettings( } CopyMem (&TableId, (CHAR8*)&Id[0], 8); - DBG ("\" (%16.16lX)", TableId); + DBG ("\" (%16.16llX)", TableId); } // Get the table len to drop Prop2 = GetProperty (Dict2, "Length"); if (Prop2 != NULL) { TabLength = (UINT32)GetPropertyInteger (Prop2, 0); - DBG (" length=%d(0x%x)", TabLength); + DBG (" length=%d(0x%X)", TabLength, TabLength); } DBG ("\n"); //set to drop if (gSettings.ACPIDropTables) { ACPI_DROP_TABLE *DropTable = gSettings.ACPIDropTables; - DBG (" - set table: %08x, %16lx to drop:", Signature, TableId); + DBG (" - set table: %08X, %16llx to drop:", Signature, TableId); Dropped = FALSE; while (DropTable) { if (((Signature == DropTable->Signature) && @@ -5596,7 +5596,7 @@ GetUserSettings( } DropTable = DropTable->Next; } - DBG (" %a\n", Dropped ? "yes" : "no"); + DBG (" %s\n", Dropped ? "yes" : "no"); } } } @@ -5625,7 +5625,7 @@ GetUserSettings( Prop = GetProperty (Dict2, "Fixes"); if (Prop != NULL) { UINTN Index; - // DBG ("Fixes will override DSDT fix mask %08x!\n", gSettings.FixDsdt); + // DBG ("Fixes will override DSDT fix mask %08X!\n", gSettings.FixDsdt); if (Prop->type == kTagTypeDict) { gSettings.FixDsdt = 0; for (Index = 0; Index < sizeof(FixesConfig)/sizeof(FixesConfig[0]); Index++) { @@ -5639,7 +5639,7 @@ GetUserSettings( } } } - DBG (" - final DSDT Fix mask=%08x\n", gSettings.FixDsdt); + DBG (" - final DSDT Fix mask=%08X\n", gSettings.FixDsdt); Prop = GetProperty (Dict2, "Patches"); //yyyy if (Prop != NULL) { @@ -5653,14 +5653,14 @@ GetUserSettings( gSettings.LenToReplace = (__typeof__(gSettings.LenToReplace))AllocateZeroPool (Count * sizeof(UINT32)); gSettings.PatchDsdtLabel = (__typeof__(gSettings.PatchDsdtLabel))AllocateZeroPool (Count * sizeof(UINT8*)); gSettings.PatchDsdtMenuItem = (__typeof__(gSettings.PatchDsdtMenuItem))AllocateZeroPool (Count * sizeof(INPUT_ITEM)); - DBG ("PatchesDSDT: %d requested\n", Count); + DBG ("PatchesDSDT: %lld requested\n", Count); for (i = 0; i < Count; i++) { UINTN Size = 0; CHAR8 *DSDTPatchesLabel; Status = GetElement (Prop, i, &Prop2); if (EFI_ERROR (Status)) { - DBG ("error %r getting next element of PatchesDSDT at index %d\n", Status, i); + DBG ("error %s getting next element of PatchesDSDT at index %lld\n", strerror(Status), i); continue; } @@ -5668,7 +5668,7 @@ GetUserSettings( break; } - DBG(" - [%02d]:", i); + DBG(" - [%02lld]:", i); DSDTPatchesLabel = (__typeof__(DSDTPatchesLabel))AllocateZeroPool(256); Prop3 = GetProperty (Prop2, "Comment"); @@ -5679,7 +5679,7 @@ GetUserSettings( } gSettings.PatchDsdtLabel[i] = (__typeof_am__(gSettings.PatchDsdtLabel[i]))AllocateZeroPool(256); AsciiSPrint(gSettings.PatchDsdtLabel[i], 255, "%a", DSDTPatchesLabel); - DBG(" (%a)", gSettings.PatchDsdtLabel[i]); + DBG(" (%s)", gSettings.PatchDsdtLabel[i]); FreePool(DSDTPatchesLabel); @@ -5688,13 +5688,13 @@ GetUserSettings( //DBG (" DSDT bin patch #%d ", i); gSettings.PatchDsdtFind[i] = GetDataSetting (Prop2, "Find", &Size); - DBG (" lenToFind: %d", Size); + DBG (" lenToFind: %llu", Size); gSettings.LenToFind[i] = (UINT32)Size; gSettings.PatchDsdtReplace[i] = GetDataSetting (Prop2, "Replace", &Size); - DBG (", lenToReplace: %d", Size); + DBG (", lenToReplace: %llu", Size); gSettings.LenToReplace[i] = (UINT32)Size; gSettings.PatchDsdtTgt[i] = (CHAR8*)GetDataSetting (Prop2, "TgtBridge", &Size); - DBG (", Target Bridge: %a\n", gSettings.PatchDsdtTgt[i]); + DBG (", Target Bridge: %s\n", gSettings.PatchDsdtTgt[i]); if (!gSettings.PatchDsdtMenuItem[i].BValue) { DBG(" patch disabled at config\n"); } @@ -5848,25 +5848,25 @@ GetUserSettings( Prop = GetProperty (Dict2, "EnableC7"); if (Prop != NULL) { gSettings.EnableC7 = IsPropertyTrue (Prop); - DBG ("EnableC7: %a\n", gSettings.EnableC7 ? "yes" : "no"); + DBG ("EnableC7: %s\n", gSettings.EnableC7 ? "yes" : "no"); } Prop = GetProperty (Dict2, "EnableC6"); if (Prop != NULL) { gSettings.EnableC6 = IsPropertyTrue (Prop); - DBG ("EnableC6: %a\n", gSettings.EnableC6 ? "yes" : "no"); + DBG ("EnableC6: %s\n", gSettings.EnableC6 ? "yes" : "no"); } Prop = GetProperty (Dict2, "EnableC4"); if (Prop != NULL) { gSettings.EnableC4 = IsPropertyTrue (Prop); - DBG ("EnableC4: %a\n", gSettings.EnableC4 ? "yes" : "no"); + DBG ("EnableC4: %s\n", gSettings.EnableC4 ? "yes" : "no"); } Prop = GetProperty (Dict2, "EnableC2"); if (Prop != NULL) { gSettings.EnableC2 = IsPropertyTrue (Prop); - DBG ("EnableC2: %a\n", gSettings.EnableC2 ? "yes" : "no"); + DBG ("EnableC2: %s\n", gSettings.EnableC2 ? "yes" : "no"); } Prop = GetProperty (Dict2, "C3Latency"); @@ -5909,7 +5909,7 @@ GetUserSettings( Prop = GetProperty (DictPointer, "ResetAddress"); if (Prop) { gSettings.ResetAddr = (UINT32)GetPropertyInteger (Prop, 0x64); - DBG ("ResetAddr: 0x%x\n", gSettings.ResetAddr); + DBG ("ResetAddr: 0x%llX\n", gSettings.ResetAddr); if (gSettings.ResetAddr == 0x64) { gSettings.ResetVal = 0xFE; @@ -5917,13 +5917,13 @@ GetUserSettings( gSettings.ResetVal = 0x06; } - DBG ("Calc ResetVal: 0x%x\n", gSettings.ResetVal); + DBG ("Calc ResetVal: 0x%X\n", gSettings.ResetVal); } Prop = GetProperty (DictPointer, "ResetValue"); if (Prop) { gSettings.ResetVal = (UINT8)GetPropertyInteger (Prop, gSettings.ResetVal); - DBG ("ResetVal: 0x%x\n", gSettings.ResetVal); + DBG ("ResetVal: 0x%X\n", gSettings.ResetVal); } //other known pair is 0x0CF9/0x06. What about 0x92/0x01 ? @@ -5997,7 +5997,7 @@ GetUserSettings( if (Count > 0) { gSettings.DeviceRenameCount = 0; gSettings.DeviceRename = (__typeof__(gSettings.DeviceRename))AllocateZeroPool(Count * sizeof(ACPI_NAME_LIST)); - DBG("Devices to rename %d\n", Count); + DBG("Devices to rename %lld\n", Count); for (i = 0; i < Count; i++) { Prop2 = NULL; if (!EFI_ERROR(GetElement(Prop, i, &Prop2)) && @@ -6006,13 +6006,13 @@ GetUserSettings( ACPI_NAME_LIST *List = ParseACPIName(Prop2->string); gSettings.DeviceRename[gSettings.DeviceRenameCount].Next = List; while (List) { - DBG("%a:", List->Name); + DBG("%s:", List->Name); List = List->Next; } Prop2 = Prop2->tag; if (Prop2->type == kTagTypeString) { gSettings.DeviceRename[gSettings.DeviceRenameCount++].Name = (__typeof__(gSettings.DeviceRename[gSettings.DeviceRenameCount++].Name))AllocateCopyPool(5, Prop2->string); - DBG("->will be renamed to %a\n", Prop2->string); + DBG("->will be renamed to %s\n", Prop2->string); } } } @@ -6180,7 +6180,7 @@ GetUserSettings( } else if (AsciiStriCmp (Prop2->string, "NVME") == 0) { DeviceN = 13; } else { - DBG (" - add properties to unknown device %a, ignored\n", Prop2->string); + DBG (" - add properties to unknown device %s, ignored\n", Prop2->string); continue; } } else { @@ -6233,7 +6233,7 @@ GetUserSettings( AsciiSPrint (SlotDevice->SlotName, 31, "PCI Slot %d", DeviceN); } - DBG (" - %a\n", SlotDevice->SlotName); + DBG (" - %s\n", SlotDevice->SlotName); } } } @@ -6258,7 +6258,7 @@ GetUserSettings( gSettings.CpuType = GetAdvancedCpuType(); if (Prop != NULL) { gSettings.CpuType = (UINT16)GetPropertyInteger (Prop, gSettings.CpuType); - DBG ("CpuType: %x\n", gSettings.CpuType); + DBG ("CpuType: %X\n", gSettings.CpuType); } Prop = GetProperty (DictPointer, "QEMU"); @@ -6376,7 +6376,7 @@ GetUserSettings( if (!EFI_ERROR(Status)) { Prop2 = GetProperty (Dict, "Comment"); if (Prop2 && Prop2->string) { - DBG(" %a\n", Prop2->string); + DBG(" %s\n", Prop2->string); } Prop2 = GetProperty(Dict, "Disabled"); if (IsPropertyFalse(Prop2)) { @@ -6390,7 +6390,7 @@ GetUserSettings( StrToGuidLE((CHAR16*)&UStr[0], &RtVariables[RtVariablesNum].VarGuid); } else { - DBG("Error: invalid GUID for RT var '%a' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->string); + DBG("Error: invalid GUID for RT var '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->string); } } @@ -6437,7 +6437,7 @@ GetUserSettings( if (Prop != NULL) { if (IsValidGuidAsciiString (Prop->string)) { AsciiStrToUnicodeStrS(Prop->string, gSettings.CustomUuid, 40); - DBG("Converted CustomUUID %s\n", gSettings.CustomUuid); + DBG("Converted CustomUUID %ls\n", gSettings.CustomUuid); Status = StrToGuidLE (gSettings.CustomUuid, &gUuid); if (!EFI_ERROR (Status)) { IsValidCustomUUID = TRUE; @@ -6449,11 +6449,11 @@ GetUserSettings( } if (!IsValidCustomUUID) { - DBG ("Error: invalid CustomUUID '%a' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->string); + DBG ("Error: invalid CustomUUID '%s' - should be in the format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n", Prop->string); } } //else gUuid value from SMBIOS - // DBG("Finally use %g\n", &gUuid); + // DBG("Finally use %s\n", strguid(&gUuid)); Prop = GetProperty (DictPointer, "InjectSystemID"); gSettings.InjectSystemID = gSettings.InjectSystemID ? !IsPropertyFalse(Prop) : IsPropertyTrue (Prop); @@ -6510,7 +6510,7 @@ GetUserSettings( AppleGuid.Data1 = SwapBytes32 (AppleGuid.Data1); AppleGuid.Data2 = SwapBytes16 (AppleGuid.Data2); AppleGuid.Data3 = SwapBytes16 (AppleGuid.Data3); - DBG ("Platform Uuid: %g, InjectSystemID: %a\n", &AppleGuid, gSettings.InjectSystemID ? "Yes" : "No"); + DBG ("Platform Uuid: %s, InjectSystemID: %s\n", strguid(&AppleGuid), gSettings.InjectSystemID ? "Yes" : "No"); } */ @@ -6521,7 +6521,7 @@ GetUserSettings( FillinKextPatches ((KERNEL_AND_KEXT_PATCHES *)(((UINTN)&gSettings) + OFFSET_OF(SETTINGS_DATA, KernelAndKextPatches)), DictPointer); } } else { - //DBG("\n ConfigName: %s n", gSettings.ConfigName); + //DBG("\n ConfigName: %ls n", gSettings.ConfigName); } if (gThemeChanged && GlobalConfig.Theme) { @@ -6531,14 +6531,14 @@ GetUserSettings( if ((Prop != NULL) && (Prop->type == kTagTypeString) && Prop->string) { FreePool(GlobalConfig.Theme); GlobalConfig.Theme = PoolPrint (L"%a", Prop->string); - DBG ("Theme from new config: %s\n", GlobalConfig.Theme); + DBG ("Theme from new config: %ls\n", GlobalConfig.Theme); } } } SaveSettings(); } - //DBG ("config.plist read and return %r\n", Status); + //DBG ("config.plist read and return %s\n", strerror(Status)); return EFI_SUCCESS; } /* @@ -7017,7 +7017,7 @@ GetDevices () Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiGraphicsOutputProtocolGuid, NULL, &HandleCount, &HandleArray); if (!EFI_ERROR(Status)) { GopDevicePathStr = DevicePathToStr(DevicePathFromHandle(HandleArray[0])); - DBG("GOP found at: %s\n", GopDevicePathStr); + DBG("GOP found at: %ls\n", GopDevicePathStr); } // Scan PCI handles @@ -7043,7 +7043,7 @@ GetDevices () &Pci ); - DBG ("PCI (%02x|%02x:%02x.%02x) : %04x %04x class=%02x%02x%02x\n", + DBG ("PCI (%02llX|%02llX:%02llX.%02llX) : %04X %04X class=%02X%02X%02X\n", Segment, Bus, Device, @@ -7108,7 +7108,7 @@ GetDevices () AsciiSPrint (gfx->Model, 64, "%a", info->model_name); AsciiSPrint (gfx->Config, 64, "%a", card_configs[info->cfg_name].name); gfx->Ports = card_configs[info->cfg_name].ports; - DBG (" - GFX: Model=%a (ATI/AMD)\n", gfx->Model); + DBG (" - GFX: Model=%s (ATI/AMD)\n", gfx->Model); //get mmio if (info->chip_family < CHIP_FAMILY_HAINAN) { @@ -7117,7 +7117,7 @@ GetDevices () gfx->Mmio = (UINT8 *)(UINTN)(Pci.Device.Bar[5] & ~0x0f); } gfx->Connectors = *(UINT32*)(gfx->Mmio + RADEON_BIOS_0_SCRATCH); - // DBG(" - RADEON_BIOS_0_SCRATCH = 0x%08x\n", gfx->Connectors); + // DBG(" - RADEON_BIOS_0_SCRATCH = 0x%08X\n", gfx->Connectors); gfx->ConnChanged = FALSE; SlotDevice = &SlotDevices[0]; @@ -7133,7 +7133,7 @@ GetDevices () case 0x8086: gfx->Vendor = Intel; AsciiSPrint (gfx->Model, 64, "%a", get_gma_model (Pci.Hdr.DeviceId)); - DBG (" - GFX: Model=%a (Intel)\n", gfx->Model); + DBG (" - GFX: Model=%s (Intel)\n", gfx->Model); gfx->Ports = 1; gfx->Connectors = (1 << NGFX); gfx->ConnChanged = FALSE; @@ -7184,7 +7184,7 @@ GetDevices () NULL) //NULL: get from generic lists ); - DBG(" - GFX: Model=%a family %x (%a)\n", gfx->Model, gfx->Family, CardFamily); + DBG(" - GFX: Model=%s family %X (%s)\n", gfx->Model, gfx->Family, CardFamily); gfx->Ports = 0; SlotDevice = &SlotDevices[1]; @@ -7220,7 +7220,7 @@ GetDevices () AsciiSPrint (SlotDevice->SlotName, 31, "AirPort"); SlotDevice->SlotID = 0; SlotDevice->SlotType = SlotTypePciExpressX1; - DBG(" - WIFI: Vendor=", Pci.Hdr.VendorId); + DBG(" - WIFI: Vendor=%d", Pci.Hdr.VendorId); switch (Pci.Hdr.VendorId) { case 0x11ab: DBG("Marvell\n"); @@ -7265,7 +7265,7 @@ GetDevices () DBG(" - [!] too many LAN card in the system (upto 4 limit exceeded), overriding the last one\n"); nLanCards = 3; // last one will be rewritten } - DBG(" - LAN: %d Vendor=", nLanCards-1); + DBG(" - LAN: %llu Vendor=", nLanCards-1); switch (Pci.Hdr.VendorId) { case 0x11ab: DBG("Marvell\n"); @@ -7393,7 +7393,7 @@ SetDevices (LOADER_ENTRY *Entry) continue; } device = devprop_add_device_pci(device_inject_string, NULL, Prop->DevicePath); - DBG("add device: %s\n", DevicePathToStr(Prop->DevicePath)); + DBG("add device: %ls\n", DevicePathToStr(Prop->DevicePath)); Prop2 = Prop->Child; while (Prop2) { if (Prop2->MenuItem.BValue) { @@ -7402,15 +7402,15 @@ SetDevices (LOADER_ENTRY *Entry) CopyMem((UINT8*)&gSettings.IgPlatform, (UINT8*)Prop2->Value, Prop2->ValueLen); } devprop_add_value(device, Prop2->Key, (UINT8*)&gSettings.IgPlatform, 4); - DBG(" Add key=%a valuelen=%d\n", Prop2->Key, Prop2->ValueLen); + DBG(" Add key=%s valuelen=%llu\n", Prop2->Key, Prop2->ValueLen); } else if ((AsciiStrStr(Prop2->Key, "override-no-edid") || AsciiStrStr(Prop2->Key, "override-no-connect")) && gSettings.InjectEDID && gSettings.CustomEDID) { // special case for EDID properties devprop_add_value(device, Prop2->Key, gSettings.CustomEDID, 128); - DBG(" Add key=%a from custom EDID\n", Prop2->Key); + DBG(" Add key=%s from custom EDID\n", Prop2->Key); } else { devprop_add_value(device, Prop2->Key, (UINT8*)Prop2->Value, Prop2->ValueLen); - DBG(" Add key=%a valuelen=%d\n", Prop2->Key, Prop2->ValueLen); + DBG(" Add key=%s valuelen=%llu\n", Prop2->Key, Prop2->ValueLen); } } @@ -7483,7 +7483,7 @@ SetDevices (LOADER_ENTRY *Entry) } //------------------ if (PCIdevice.used) { - DBG("custom properties for device %02x:%02x.%02x injected\n", Bus, Device, Function); + DBG("custom properties for device %02llX:%02llX.%02llX injected\n", Bus, Device, Function); //continue; } //} @@ -7524,7 +7524,7 @@ SetDevices (LOADER_ENTRY *Entry) *(UINT32*)(gGraphics[j].Mmio + 0x6800) = 1; //EVERGREEN_GRPH_ENABLE *(UINT32*)(gGraphics[j].Mmio + 0x6EF8) = 0; //EVERGREEN_MASTER_UPDATE_MODE //*(UINT32*)(gGraphics[j].Mmio + R600_BIOS_0_SCRATCH) = 0x00810000; - DBG("Device %d deinited\n", j); + DBG("Device %llu deinited\n", j); } } } @@ -7534,7 +7534,7 @@ SetDevices (LOADER_ENTRY *Entry) if (gSettings.InjectIntel) { TmpDirty = setup_gma_devprop(Entry, &PCIdevice); StringDirty |= TmpDirty; - MsgLog ("Intel GFX revision = 0x%x\n", PCIdevice.revision); + MsgLog ("Intel GFX revision = 0x%X\n", PCIdevice.revision); } else { MsgLog ("Intel GFX injection not set\n"); } @@ -7621,8 +7621,8 @@ SetDevices (LOADER_ENTRY *Entry) 1, &PCHL ); - MsgLog (" LEV2 = 0x%x, LEVL = 0x%x, P0BL = 0x%x, GRAN = 0x%x\n", LEV2, LEVL, P0BL, GRAN); - MsgLog (" LEVW = 0x%x, LEVX = 0x%x, LEVD = 0x%x, PCHL = 0x%x\n", LEVW, LEVX, LEVD, PCHL); + MsgLog (" LEV2 = 0x%X, LEVL = 0x%X, P0BL = 0x%X, GRAN = 0x%X\n", LEV2, LEVL, P0BL, GRAN); + MsgLog (" LEVW = 0x%X, LEVX = 0x%X, LEVD = 0x%X, PCHL = 0x%X\n", LEVW, LEVX, LEVD, PCHL); // Maximum brightness level of each framebuffers // Sandy Bridge/Ivy Bridge: 0x0710 @@ -7863,7 +7863,7 @@ SetDevices (LOADER_ENTRY *Entry) // Write LEVW if (LEVW != SYSLEVW) { - MsgLog (" Found invalid LEVW, set System LEVW: 0x%x\n", SYSLEVW); + MsgLog (" Found invalid LEVW, set System LEVW: 0x%X\n", SYSLEVW); /*Status = */PciIo->Mem.Write( PciIo, EfiPciIoWidthUint32, @@ -7880,7 +7880,7 @@ SetDevices (LOADER_ENTRY *Entry) case CPU_MODEL_IVY_BRIDGE_E5: // if change SYS LEVW to macOS LEVW, the brightness of the pop-up may decrease or increase. // but the brightness of the monitor will not actually change. so we should not use this. - MsgLog (" Skip writing macOS LEVW: 0x%x\n", MACLEVW); + MsgLog (" Skip writing macOS LEVW: 0x%X\n", MACLEVW); break; case CPU_MODEL_HASWELL: @@ -7891,7 +7891,7 @@ SetDevices (LOADER_ENTRY *Entry) case CPU_MODEL_BROADWELL_DE: // if not change SYS LEVW to macOS LEVW, backlight will be dark and don't work keys for backlight. // so we should use this. - MsgLog (" Write macOS LEVW: 0x%x\n", MACLEVW); + MsgLog (" Write macOS LEVW: 0x%X\n", MACLEVW); /*Status = */PciIo->Mem.Write( PciIo, @@ -7905,7 +7905,7 @@ SetDevices (LOADER_ENTRY *Entry) default: if (gSettings.IntelBacklight) { - MsgLog (" Write macOS LEVW: 0x%x\n", MACLEVW); + MsgLog (" Write macOS LEVW: 0x%X\n", MACLEVW); /*Status = */PciIo->Mem.Write( PciIo, @@ -7939,23 +7939,23 @@ SetDevices (LOADER_ENTRY *Entry) if (gSettings.IntelMaxBacklight) { if (!LEVL) { LEVL = FBLEVX; - MsgLog (" Found invalid LEVL, set LEVL: 0x%x\n", LEVL); + MsgLog (" Found invalid LEVL, set LEVL: 0x%X\n", LEVL); } if (!LEVX) { ShiftLEVX = FBLEVX; - MsgLog (" Found invalid LEVX, set LEVX: 0x%x\n", ShiftLEVX); + MsgLog (" Found invalid LEVX, set LEVX: 0x%X\n", ShiftLEVX); } if (gSettings.IntelMaxValue) { FBLEVX = gSettings.IntelMaxValue; - MsgLog (" Read IntelMaxValue: 0x%x\n", FBLEVX); + MsgLog (" Read IntelMaxValue: 0x%X\n", FBLEVX); } else { - MsgLog (" Read default Framebuffer LEVX: 0x%x\n", FBLEVX); + MsgLog (" Read default Framebuffer LEVX: 0x%X\n", FBLEVX); } LEVL = (LEVL * FBLEVX) / ShiftLEVX; - MsgLog (" Write new LEVL: 0x%x\n", LEVL); + MsgLog (" Write new LEVL: 0x%X\n", LEVL); /*Status = */PciIo->Mem.Write( PciIo, @@ -7967,7 +7967,7 @@ SetDevices (LOADER_ENTRY *Entry) ); LEVX = FBLEVX | FBLEVX << 16; - MsgLog (" Write new LEVX: 0x%x\n", LEVX); + MsgLog (" Write new LEVX: 0x%X\n", LEVX); /*Status = */PciIo->Mem.Write( PciIo, @@ -7994,13 +7994,13 @@ SetDevices (LOADER_ENTRY *Entry) if (gSettings.IntelMaxBacklight) { if (gSettings.IntelMaxValue) { FBLEVX = gSettings.IntelMaxValue; - MsgLog (" Read IntelMaxValue: 0x%x\n", FBLEVX); + MsgLog (" Read IntelMaxValue: 0x%X\n", FBLEVX); } else { - MsgLog (" Read default Framebuffer LEVX: 0x%x\n", FBLEVX); + MsgLog (" Read default Framebuffer LEVX: 0x%X\n", FBLEVX); } LEVD = (UINT32)DivU64x32(MultU64x32(FBLEVX, LEVX), 0xFFFF); - MsgLog (" Write new LEVD: 0x%x\n", LEVD); + MsgLog (" Write new LEVD: 0x%X\n", LEVD); /*Status = */PciIo->Mem.Write( PciIo, @@ -8018,17 +8018,17 @@ SetDevices (LOADER_ENTRY *Entry) if (gSettings.IntelMaxBacklight) { if (gSettings.IntelMaxValue) { FBLEVX = gSettings.IntelMaxValue; - MsgLog (" Read IntelMaxValue: 0x%x\n", FBLEVX); + MsgLog (" Read IntelMaxValue: 0x%X\n", FBLEVX); LEVX = FBLEVX | FBLEVX << 16; } else if (!LEVX) { - MsgLog (" Found invalid LEVX, set LEVX: 0x%x\n", FBLEVX); + MsgLog (" Found invalid LEVX, set LEVX: 0x%X\n", FBLEVX); LEVX = FBLEVX | FBLEVX << 16; } else if (ShiftLEVX != FBLEVX) { - MsgLog (" Read default Framebuffer LEVX: 0x%x\n", FBLEVX); + MsgLog (" Read default Framebuffer LEVX: 0x%X\n", FBLEVX); LEVX = (((LEVX & 0xFFFF) * FBLEVX / ShiftLEVX) | FBLEVX << 16); } - MsgLog (" Write new LEVX: 0x%x\n", LEVX); + MsgLog (" Write new LEVX: 0x%X\n", LEVX); /*Status = */PciIo->Mem.Write( PciIo, @@ -8096,7 +8096,7 @@ SetDevices (LOADER_ENTRY *Entry) { if (gSettings.LpcTune) { Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint16, GEN_PMCON_1, 1, &PmCon); - MsgLog ("Initial PmCon value=%x\n", PmCon); + MsgLog ("Initial PmCon value=%X\n", PmCon); if (gSettings.EnableC6) { PmCon |= 1 << 11; @@ -8133,7 +8133,7 @@ SetDevices (LOADER_ENTRY *Entry) PciIo->Pci.Write (PciIo, EfiPciIoWidthUint16, GEN_PMCON_1, 1, &PmCon); Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint16,GEN_PMCON_1, 1, &PmCon); - MsgLog ("Set PmCon value=%x\n", PmCon); + MsgLog ("Set PmCon value=%X\n", PmCon); } Rcba = 0; @@ -8172,11 +8172,11 @@ SetDevices (LOADER_ENTRY *Entry) if (gSettings.DisableFunctions){ UINT32 FD = REG32 ((UINTN)Rcba, 0x3418); - DBG ("Initial value of FD register 0x%x\n", FD); + DBG ("Initial value of FD register 0x%X\n", FD); FD |= gSettings.DisableFunctions; REG32 ((UINTN)Rcba, 0x3418) = FD; FD = REG32 ((UINTN)Rcba, 0x3418); - DBG (" recheck value after patch 0x%x\n", FD); + DBG (" recheck value after patch 0x%X\n", FD); } } } @@ -8258,7 +8258,7 @@ SetDevices (LOADER_ENTRY *Entry) } } - MsgLog ("CurrentMode: Width=%d Height=%d\n", UGAWidth, UGAHeight); + MsgLog ("CurrentMode: Width=%lld Height=%lld\n", UGAWidth, UGAHeight); } EFI_STATUS @@ -8362,7 +8362,7 @@ CHAR16 if (OSVersion != NULL) { AsciiStrnCpyS(FixedVersion, 16, OSVersion, 5); - // DBG("%a\n", FixedVersion); + // DBG("%s\n", FixedVersion); // OSVersion may contain minor version too (can be 10.x or 10.x.y) if ((DotPtr = AsciiStrStr (FixedVersion, ".")) != NULL) { DotPtr = AsciiStrStr (DotPtr+1, "."); // second dot @@ -8373,7 +8373,7 @@ CHAR16 } } - //MsgLog ("OS=%s\n", OSTypeStr); + //MsgLog ("OS=%ls\n", OSTypeStr); // find source injection folder with kexts // note: we are just checking for existance of particular folder, not checking if it is empty or not diff --git a/rEFIt_UEFI/Platform/StartupSound.cpp b/rEFIt_UEFI/Platform/StartupSound.cpp index 2d9d18e86..23056e1a6 100644 --- a/rEFIt_UEFI/Platform/StartupSound.cpp +++ b/rEFIt_UEFI/Platform/StartupSound.cpp @@ -71,7 +71,7 @@ StartupSoundPlay(EFI_FILE *Dir, CONST CHAR16* SoundFile) if (SoundFile) { Status = egLoadFile(Dir, SoundFile, &FileData, &FileDataLength); if (EFI_ERROR(Status)) { - DBG("file sound read: %s %r\n", SoundFile, Status); + DBG("file sound read: %ls %s\n", SoundFile, strerror(Status)); return Status; } } else { @@ -83,7 +83,7 @@ StartupSoundPlay(EFI_FILE *Dir, CONST CHAR16* SoundFile) WaveData.Samples = NULL; Status = WaveGetFileData(FileData, (UINT32)FileDataLength, &WaveData); if (EFI_ERROR(Status)) { - MsgLog(" wrong sound file, wave status=%r\n", Status); + MsgLog(" wrong sound file, wave status=%s\n", strerror(Status)); return Status; } MsgLog(" Channels: %u Sample rate: %u Hz Bits: %u\n", WaveData.Format->Channels, WaveData.Format->SamplesPerSec, WaveData.Format->BitsPerSample); @@ -200,24 +200,24 @@ StartupSoundPlay(EFI_FILE *Dir, CONST CHAR16* SoundFile) Status = AudioIo->SetupPlayback(AudioIo, (UINT8)(AudioList[OutputIndex].Index), OutputVolume, freq, bits, (UINT8)(WaveData.Format->Channels)); if (EFI_ERROR(Status)) { - MsgLog("StartupSound: Error setting up playback: %r\n", Status); + MsgLog("StartupSound: Error setting up playback: %s\n", strerror(Status)); goto DONE_ERROR; } // DBG("playback set\n"); // Start playback. if (gSettings.PlayAsync) { Status = AudioIo->StartPlaybackAsync(AudioIo, (UINT8*)TempData, WaveData.SamplesLength, 0, NULL, NULL); - DBG("async started, status=%r\n", Status); + DBG("async started, status=%s\n", strerror(Status)); } else { Status = AudioIo->StartPlayback(AudioIo, (UINT8*)TempData, WaveData.SamplesLength, 0); -// DBG("sync started, status=%r\n", Status); +// DBG("sync started, status=%s\n", strerror(Status)); if (!EFI_ERROR(Status)) { FreePool(TempData); } } if (EFI_ERROR(Status)) { - MsgLog("StartupSound: Error starting playback: %r\n", Status); + MsgLog("StartupSound: Error starting playback: %s\n", strerror(Status)); } DONE_ERROR: @@ -225,7 +225,7 @@ DONE_ERROR: DBG("free sound\n"); FreePool(FileData); } - DBG("sound play end with status=%r\n", Status); + DBG("sound play end with status=%s\n", strerror(Status)); return Status; } @@ -256,10 +256,10 @@ GetStoredOutput() // Get Audio I/O protocols. Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiAudioIoProtocolGuid, NULL, &AudioIoHandleCount, &AudioIoHandles); if (EFI_ERROR(Status)) { - MsgLog("No AudioIoProtocol, status=%r\n", Status); + MsgLog("No AudioIoProtocol, status=%s\n", strerror(Status)); goto DONE; } - DBG("found %d handles with audio\n", AudioIoHandleCount); + DBG("found %llu handles with audio\n", AudioIoHandleCount); // Get stored device path size. First from AppleBootGuid StoredDevicePath = (__typeof__(StoredDevicePath))GetNvramVariable(L"Clover.SoundDevice", &gEfiAppleBootGuid, NULL, &StoredDevicePathSize); if (!StoredDevicePath) { @@ -276,7 +276,7 @@ GetStoredOutput() if ((StoredDevicePath[0] != 2) && (StoredDevicePath[1] != 1)) { StoredDevicePathStr = PoolPrint(L"%s", (CHAR16*)StoredDevicePath); FreePool(StoredDevicePath); - DBG("stored device=%s\n", StoredDevicePathStr); + DBG("stored device=%ls\n", StoredDevicePathStr); StoredDevicePath = (UINT8*)ConvertTextToDevicePath((CHAR16*)StoredDevicePathStr); FreePool(StoredDevicePathStr); StoredDevicePathStr = NULL; @@ -288,7 +288,7 @@ GetStoredOutput() // Open Device Path protocol. Status = gBS->HandleProtocol(AudioIoHandles[h], &gEfiDevicePathProtocolGuid, (VOID**)&DevicePath); if (EFI_ERROR(Status)) { - DBG("no DevicePath at %d handle AudioIo\n", h); + DBG("no DevicePath at %llu handle AudioIo\n", h); continue; } @@ -319,14 +319,14 @@ GetStoredOutput() Status = gRT->GetVariable(BOOT_CHIME_VAR_INDEX, &gBootChimeVendorVariableGuid, NULL, &OutputPortIndexSize, &OutputPortIndex); if (EFI_ERROR(Status)) { - MsgLog("Bad output index, status=%r, set 0\n", Status); + MsgLog("Bad output index, status=%s, set 0\n", strerror(Status)); OutputPortIndex = 0; } } OutputPortIndex &= 0x2F; - DBG("got index=%d\n", OutputPortIndex); + DBG("got index=%llu\n", OutputPortIndex); if (OutputPortIndex > AudioNum) { - DBG("... but max=%d, so reset to 0\n", AudioNum); + DBG("... but max=%llu, so reset to 0\n", AudioNum); OutputPortIndex = 0; } // Get stored volume. If this fails, just use the max. @@ -404,7 +404,7 @@ VOID GetOutputs() // Get Audio I/O protocols. Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiAudioIoProtocolGuid, NULL, &AudioIoHandleCount, &AudioIoHandles); if (EFI_ERROR(Status)) { - MsgLog("No AudioIoProtocols, status=%r\n", Status); + MsgLog("No AudioIoProtocols, status=%s\n", strerror(Status)); return; } @@ -412,7 +412,7 @@ VOID GetOutputs() UINTN i; Status = gBS->HandleProtocol(AudioIoHandles[h], &gEfiAudioIoProtocolGuid, (VOID**)&AudioIoTmp); if (EFI_ERROR(Status)) { - DBG("dont handle AudioIo at %d\n", h); + DBG("dont handle AudioIo at %llu\n", h); continue; } // Get output ports. diff --git a/rEFIt_UEFI/Platform/StateGenerator.cpp b/rEFIt_UEFI/Platform/StateGenerator.cpp index e1f015ad5..e6d63ac82 100644 --- a/rEFIt_UEFI/Platform/StateGenerator.cpp +++ b/rEFIt_UEFI/Platform/StateGenerator.cpp @@ -128,18 +128,18 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number) AsmWriteMsr64(MSR_IA32_EXT_CONFIG, (AsmReadMsr64(MSR_IA32_EXT_CONFIG) | (1 << 28))); gBS->Stall(10); cpu_dynamic_fsb = (AsmReadMsr64(MSR_IA32_EXT_CONFIG) & (1 << 28))?1:0; - DBG("DynamicFSB: %a\n", cpu_dynamic_fsb?"yes":"no"); + DBG("DynamicFSB: %s\n", cpu_dynamic_fsb?"yes":"no"); } cpu_noninteger_bus_ratio = ((AsmReadMsr64(MSR_IA32_PERF_STATUS) & (1ULL << 46)) != 0)?1:0; initial.Control.Control = (UINT16)AsmReadMsr64(MSR_IA32_PERF_STATUS); - DBG("Initial control=0x%x\n", initial.Control); + DBG("Initial control=0x%X\n", initial.Control.Control); maximum.Control.Control = (RShiftU64(AsmReadMsr64(MSR_IA32_PERF_STATUS), 32) & 0x1F3F) | (0x4000 * cpu_noninteger_bus_ratio); - DBG("Maximum control=0x%x\n", maximum.Control.Control); + DBG("Maximum control=0x%X\n", maximum.Control.Control); if (gSettings.Turbo) { maximum.Control.VID_FID.FID++; - MsgLog("Turbo FID=0x%x\n", maximum.Control.VID_FID.FID); + MsgLog("Turbo FID=0x%X\n", maximum.Control.VID_FID.FID); } MsgLog("UnderVoltStep=%d\n", gSettings.UnderVoltStep); MsgLog("PLimitDict=%d\n", gSettings.PLimitDict); @@ -245,12 +245,12 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number) } realMax = maximum.Control.Control; - DBG("Maximum control=0x%x\n", realMax); + DBG("Maximum control=0x%X\n", realMax); if (gSettings.Turbo) { realTurbo = (gCPUStructure.Turbo4 > gCPUStructure.Turbo1) ? (gCPUStructure.Turbo4 / 10) : (gCPUStructure.Turbo1 / 10); maximum.Control.Control = realTurbo; - MsgLog("Turbo control=0x%x\n", realTurbo); + MsgLog("Turbo control=0x%X\n", realTurbo); } Apsn = (realTurbo > realMax)?(realTurbo - realMax):0; realMin = RShiftU64(AsmReadMsr64(MSR_PLATFORM_INFO), 40) & 0xff; @@ -261,7 +261,7 @@ SSDT_TABLE *generate_pss_ssdt(UINTN Number) minimum.Control.Control = realMin; } - MsgLog("P-States: min 0x%x, max 0x%x\n", minimum.Control.Control, maximum.Control.Control); + MsgLog("P-States: min 0x%X, max 0x%X\n", minimum.Control.Control, maximum.Control.Control); // Sanity check if (maximum.Control.Control < minimum.Control.Control) { diff --git a/rEFIt_UEFI/Platform/ati.cpp b/rEFIt_UEFI/Platform/ati.cpp index 0d8ae3036..124de0c3c 100644 --- a/rEFIt_UEFI/Platform/ati.cpp +++ b/rEFIt_UEFI/Platform/ati.cpp @@ -1605,19 +1605,19 @@ BOOLEAN validate_rom(option_rom_header_t *rom_header, pci_dt_t *pci_dev) option_rom_pci_header_t *rom_pci_header; if (rom_header->signature != 0xaa55) { - DBG("invalid ROM signature %x\n", rom_header->signature); + DBG("invalid ROM signature %X\n", rom_header->signature); return FALSE; } rom_pci_header = (option_rom_pci_header_t *)((UINT8 *)rom_header + rom_header->pci_header_offset); if (rom_pci_header->signature != 0x52494350) { - DBG("invalid ROM header %x\n", rom_pci_header->signature); + DBG("invalid ROM header %X\n", rom_pci_header->signature); return FALSE; } if (rom_pci_header->vendor_id != pci_dev->vendor_id || rom_pci_header->device_id != pci_dev->device_id){ - DBG("invalid ROM vendor=%04x deviceID=%04x\n", rom_pci_header->vendor_id, rom_pci_header->device_id); + DBG("invalid ROM vendor=%04X deviceID=%04X\n", rom_pci_header->vendor_id, rom_pci_header->device_id); return FALSE; } @@ -1633,13 +1633,13 @@ BOOLEAN load_vbios_file(UINT16 vendor_id, UINT16 device_id) UnicodeSPrint(FileName, 128, L"\\ROM\\%04x_%04x.rom", vendor_id, device_id); if (FileExists(OEMDir, FileName)) { - DBG("Found generic VBIOS ROM file (%04x_%04x.rom)\n", vendor_id, device_id); + DBG("Found generic VBIOS ROM file (%04X_%04X.rom)\n", vendor_id, device_id); Status = egLoadFile(OEMDir, FileName, &buffer, &bufferLen); } if (EFI_ERROR(Status)) { UnicodeSPrint(FileName, 128, L"\\EFI\\CLOVER\\ROM\\%04x_%04x.rom", vendor_id, device_id); if (FileExists(SelfRootDir, FileName)){ - DBG("Found generic VBIOS ROM file (%04x_%04x.rom)\n", vendor_id, device_id); + DBG("Found generic VBIOS ROM file (%04X_%04X.rom)\n", vendor_id, device_id); Status = egLoadFile(SelfRootDir, FileName, &buffer, &bufferLen); } } @@ -1650,7 +1650,7 @@ BOOLEAN load_vbios_file(UINT16 vendor_id, UINT16 device_id) card->rom = 0; return FALSE; } - DBG("Loaded ROM len=%d\n", bufferLen); + DBG("Loaded ROM len=%llu\n", bufferLen); card->rom_size = (UINT32)bufferLen; card->rom = (__typeof__(card->rom))AllocateZeroPool(bufferLen); if (!card->rom) { @@ -1684,14 +1684,14 @@ void get_vram_size(void) card->vram_size = 128 << 20; //default 128Mb, this is minimum for OS if (gSettings.VRAM != 0) { card->vram_size = gSettings.VRAM << 20; - DBG("Set VRAM from config=%luMb\n", gSettings.VRAM); + DBG("Set VRAM from config=%lluMb\n", gSettings.VRAM); // WRITEREG32(card->mmio, RADEON_CONFIG_MEMSIZE, card->vram_size); } else { if (chip_family >= CHIP_FAMILY_CEDAR) { // size in MB on evergreen // XXX watch for overflow!!! card->vram_size = ((UINT64)REG32(card->mmio, R600_CONFIG_MEMSIZE)) << 20; -// DBG("Set VRAM for %a =%luMb\n", chip_family_name[card->info->chip_family], (UINT64)RShiftU64(card->vram_size, 20)); +// DBG("Set VRAM for %s =%luMb\n", chip_family_name[card->info->chip_family], (UINT64)RShiftU64(card->vram_size, 20)); } else if (chip_family >= CHIP_FAMILY_R600) { card->vram_size = (UINT64)REG32(card->mmio, R600_CONFIG_MEMSIZE); } else { @@ -1703,11 +1703,11 @@ void get_vram_size(void) WRITEREG32(card->mmio, RADEON_CONFIG_MEMSIZE, (UINT32)card->vram_size); } } - DBG("Set VRAM for %a =%luMb\n", chip_family_name[card->info->chip_family], (UINT64)RShiftU64(card->vram_size, 20)); + DBG("Set VRAM for %s =%lluMb\n", chip_family_name[card->info->chip_family], (UINT64)RShiftU64(card->vram_size, 20)); } gSettings.VRAM = (UINT64)RShiftU64(card->vram_size, 20); - DBG("ATI: get_vram_size returned 0x%x\n", card->vram_size); + DBG("ATI: get_vram_size returned 0x%llX\n", card->vram_size); } BOOLEAN read_vbios(BOOLEAN from_pci) @@ -1716,13 +1716,13 @@ BOOLEAN read_vbios(BOOLEAN from_pci) if (from_pci) { rom_addr = (option_rom_header_t *)(UINTN)(pci_config_read32(card->pci_dev, PCI_EXPANSION_ROM_BASE) & ~0x7ff); - DBG(" @0x%x\n", rom_addr); + DBG(" @0x%llX\n", (uintptr_t)rom_addr); } else { rom_addr = (option_rom_header_t *)(UINTN)0xc0000; } if (!validate_rom(rom_addr, card->pci_dev)) { - DBG("There is no ROM @0x%x\n", rom_addr); + DBG("There is no ROM @0x%llX\n", (uintptr_t)rom_addr); // gBS->Stall(3000000); return FALSE; } @@ -1862,36 +1862,36 @@ BOOLEAN radeon_card_posted(VOID) #if 1 //dump radeon registers after BIOS POST reg = (UINTN)REG32(card->mmio, RADEON_BIOS_0_SCRATCH); - DBG("BIOS_0_SCRATCH=0x%08x, ", reg); + DBG("BIOS_0_SCRATCH=0x%08llX, ", reg); reg = (UINTN)REG32(card->mmio, RADEON_BIOS_1_SCRATCH); - DBG("1=0x%08x, ", reg); + DBG("1=0x%08llX, ", reg); reg = (UINTN)REG32(card->mmio, RADEON_BIOS_2_SCRATCH); - DBG("2=0x%08x, ", reg); + DBG("2=0x%08llX, ", reg); reg = (UINTN)REG32(card->mmio, RADEON_BIOS_3_SCRATCH); - DBG("3=0x%08x, ", reg); + DBG("3=0x%08llX, ", reg); reg = (UINTN)REG32(card->mmio, RADEON_BIOS_4_SCRATCH); - DBG("4=0x%08x, ", reg); + DBG("4=0x%08llX, ", reg); reg = (UINTN)REG32(card->mmio, RADEON_BIOS_5_SCRATCH); - DBG("5=0x%08x, ", reg); + DBG("5=0x%08llX, ", reg); reg = (UINTN)REG32(card->mmio, RADEON_BIOS_6_SCRATCH); - DBG("6=0x%08x\n", reg); + DBG("6=0x%08llX\n", reg); #endif // first check CRTCs reg = (UINTN)REG32(card->mmio, RADEON_CRTC_GEN_CNTL) | REG32(card->mmio, RADEON_CRTC2_GEN_CNTL); - DBG("RADEON_CRTC2_GEN_CNTL == 0x%08x\n", REG32(card->mmio, RADEON_CRTC2_GEN_CNTL)); + DBG("RADEON_CRTC2_GEN_CNTL == 0x%08X\n", REG32(card->mmio, RADEON_CRTC2_GEN_CNTL)); if ((reg & 0xFFFFFFFF) == 0xFFFFFFFF) { DBG(" card not posted because GEN_CNTL = -1\n"); return FALSE; } if (reg & RADEON_CRTC_EN) { - DBG(" card posted because CRTC_EN, GEN_CNTL=%x\n", reg); + DBG(" card posted because CRTC_EN, GEN_CNTL=%llX\n", reg); return TRUE; } // then check MEM_SIZE, in case something turned the crtcs off reg = (UINTN)REG32(card->mmio, R600_CONFIG_MEMSIZE); if (reg) { - DBG(" card posted because CONFIG_MEMSIZE=0x%x\n", reg); + DBG(" card posted because CONFIG_MEMSIZE=0x%llX\n", reg); return TRUE; } return FALSE; @@ -1957,8 +1957,8 @@ static BOOLEAN init_card(pci_dt_t *pci_dev) } if (!card->info || !card->info->device_id || !card->info->cfg_name) { - DBG("Unsupported ATI card! Device ID: [%04x:%04x] Subsystem ID: [%08x] \n", - pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id); + DBG("Unsupported ATI card! Device ID: [%04X:%04X] Subsystem ID: [%08X] \n", + pci_dev->vendor_id, pci_dev->device_id, pci_dev->subsys_id.subsys_id); DBG("search for brothers family\n"); for (i = 0; radeon_cards[i].device_id ; i++) { if ((radeon_cards[i].device_id & ~0xf) == (pci_dev->device_id & ~0xf)) { @@ -1980,9 +1980,9 @@ static BOOLEAN init_card(pci_dt_t *pci_dev) card->io = (UINT8 *)(UINTN)(pci_config_read32(pci_dev, PCI_BASE_ADDRESS_4) & ~0x03); Reg5 = (UINTN)(pci_config_read32(pci_dev, PCI_BASE_ADDRESS_5) & ~0x0f); ExpansionRom = pci_config_read32(pci_dev, PCI_EXPANSION_ROM_BASE); //0x30 as Chimera - DBG("Framebuffer @0x%08X MMIO @0x%08X I/O Port @0x%08X ROM Addr @0x%08X\n", + DBG("Framebuffer @0x%8s MMIO @0x%8s I/O Port @0x%8s ROM Addr @0x%08llX\n", card->fb, card->mmio, card->io, ExpansionRom); - DBG("PCI region 1 = 0x%8X, region3 = 0x%8X, region5 = 0x%8X\n", Reg1, Reg3, Reg5); + DBG("PCI region 1 = 0x%8llX, region3 = 0x%8llX, region5 = 0x%8llX\n", Reg1, Reg3, Reg5); if (card->info->chip_family >= CHIP_FAMILY_HAINAN && Reg5 != 0) { card->mmio = (UINT8 *)Reg5; DBG("Use region5 as MMIO space\n"); @@ -1990,14 +1990,14 @@ static BOOLEAN init_card(pci_dt_t *pci_dev) pci_dev->regs = card->mmio; card->posted = radeon_card_posted(); - DBG("ATI card %a, ", card->posted ? "POSTed" : "non-POSTed"); + DBG("ATI card %s, ", card->posted ? "POSTed" : "non-POSTed"); DBG("\n"); get_vram_size(); if (add_vbios) { load_vbios_file(pci_dev->vendor_id, pci_dev->device_id); if (!card->rom) { - DBG("reading VBIOS from %a", card->posted ? "legacy space" : "PCI ROM"); + DBG("reading VBIOS from %s", card->posted ? "legacy space" : "PCI ROM"); if (card->posted) { // && ExpansionRom != 0) read_vbios(FALSE); } else { @@ -2026,20 +2026,20 @@ static BOOLEAN init_card(pci_dt_t *pci_dev) if (NameLen > 2) { //fool proof: cfg_name is 3 character or more. CfgName = (__typeof__(CfgName))AllocateZeroPool(NameLen); UnicodeStrToAsciiStrS((CHAR16*)&gSettings.FBName[0], CfgName, 16); - DBG("Users config name %a\n", CfgName); + DBG("Users config name %s\n", CfgName); card->cfg_name = CfgName; } else { // use cfg_name on radeon_cards, to retrive the default name from card_configs, card->cfg_name = card_configs[card->info->cfg_name].name; n_ports = card_configs[card->info->cfg_name].ports; // which means one of the fb's or kNull - DBG("Framebuffer set to device's default: %a\n", card->cfg_name); - DBG(" N ports defaults to %d\n", n_ports); + DBG("Framebuffer set to device's default: %s\n", card->cfg_name); + DBG(" N ports defaults to %lld\n", n_ports); } if (gSettings.VideoPorts != 0) { n_ports = gSettings.VideoPorts; - DBG(" use N ports setting from config.plist: %d\n", n_ports); + DBG(" use N ports setting from config.plist: %lld\n", n_ports); } if (n_ports > 0) { @@ -2144,19 +2144,19 @@ BOOLEAN setup_ati_devprop(LOADER_ENTRY *Entry, pci_dt_t *ati_dev) } if (!gSettings.AddProperties[i].MenuItem.BValue) { - //DBG(" disabled property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" disabled property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } else { devprop_add_value(card->device, gSettings.AddProperties[i].Key, (UINT8*)gSettings.AddProperties[i].Value, gSettings.AddProperties[i].ValueLen); - //DBG(" added property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" added property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } } } - DBG("ATI %a %a %dMB (%a) [%04x:%04x] (subsys [%04x:%04x]):: %a\n", + DBG("ATI %s %s %dMB (%s) [%04X:%04X] (subsys [%04X:%04X]):: %s\n", chip_family_name[card->info->chip_family], card->info->model_name, (UINT32)RShiftU64(card->vram_size, 20), card->cfg_name, ati_dev->vendor_id, ati_dev->device_id, diff --git a/rEFIt_UEFI/Platform/card_vlist.cpp b/rEFIt_UEFI/Platform/card_vlist.cpp index ec779802d..e4c1b44f9 100644 --- a/rEFIt_UEFI/Platform/card_vlist.cpp +++ b/rEFIt_UEFI/Platform/card_vlist.cpp @@ -153,7 +153,7 @@ VOID FillCardList(TagPtr CfgDict) LoadVBios = TRUE; } - DBG("FillCardList :: %a : \"%a\" (%08x, %08x)\n", key, model_name, dev_id, subdev_id); + DBG("FillCardList :: %s : \"%s\" (%08X, %08X)\n", key, model_name, dev_id, subdev_id); AddCard(model_name, dev_id, subdev_id, VramSize, VideoPorts, LoadVBios); } diff --git a/rEFIt_UEFI/Platform/cpu.cpp b/rEFIt_UEFI/Platform/cpu.cpp index 73e006b59..557c331c5 100644 --- a/rEFIt_UEFI/Platform/cpu.cpp +++ b/rEFIt_UEFI/Platform/cpu.cpp @@ -160,7 +160,7 @@ VOID GetCPUProperties (VOID) } DoCpuid(1, gCPUStructure.CPUID[CPUID_1]); gCPUStructure.Signature = gCPUStructure.CPUID[CPUID_1][EAX]; - DBG("CPU Vendor = %x Model=%x\n", gCPUStructure.Vendor, gCPUStructure.Signature); + DBG("CPU Vendor = %X Model=%X\n", gCPUStructure.Vendor, gCPUStructure.Signature); if (gCPUStructure.Vendor == CPU_VENDOR_INTEL) { msr = AsmReadMsr64(MSR_IA32_BIOS_SIGN_ID); gCPUStructure.MicroCode = RShiftU64(msr, 32); @@ -184,7 +184,7 @@ VOID GetCPUProperties (VOID) gCPUStructure.Features = quad(gCPUStructure.CPUID[CPUID_1][ECX], gCPUStructure.CPUID[CPUID_1][EDX]); gCPUStructure.ExtFeatures = quad(gCPUStructure.CPUID[CPUID_81][ECX], gCPUStructure.CPUID[CPUID_81][EDX]); - DBG(" The CPU%a supported SSE4.1\n", (gCPUStructure.Features & CPUID_FEATURE_SSE4_1)?"":" not"); + DBG(" The CPU%s supported SSE4.1\n", (gCPUStructure.Features & CPUID_FEATURE_SSE4_1)?"":" not"); /* Pack CPU Family and Model */ if (gCPUStructure.Family == 0x0f) { gCPUStructure.Family += gCPUStructure.Extfamily; @@ -215,7 +215,7 @@ VOID GetCPUProperties (VOID) gCPUStructure.BrandString[0] = '\0'; } gCPUStructure.BrandString[47] = '\0'; - DBG("BrandString = %a\n", gCPUStructure.BrandString); + DBG("BrandString = %s\n", gCPUStructure.BrandString); } //Calculate Nr of Cores @@ -228,11 +228,11 @@ VOID GetCPUProperties (VOID) DoCpuid(4, gCPUStructure.CPUID[CPUID_4]); if (gCPUStructure.CPUID[CPUID_4][EAX]) { gCPUStructure.CoresPerPackage = (UINT32)bitfield(gCPUStructure.CPUID[CPUID_4][EAX], 31, 26) + 1; //Atom330 = 2 - DBG("CPUID_4_eax=%x\n", gCPUStructure.CPUID[CPUID_4][EAX]); + DBG("CPUID_4_eax=%X\n", gCPUStructure.CPUID[CPUID_4][EAX]); DoCpuid(4, gCPUStructure.CPUID[CPUID_4]); - DBG("CPUID_4_eax=%x\n", gCPUStructure.CPUID[CPUID_4][EAX]); + DBG("CPUID_4_eax=%X\n", gCPUStructure.CPUID[CPUID_4][EAX]); DoCpuid(4, gCPUStructure.CPUID[CPUID_4]); - DBG("CPUID_4_eax=%x\n", gCPUStructure.CPUID[CPUID_4][EAX]); + DBG("CPUID_4_eax=%X\n", gCPUStructure.CPUID[CPUID_4][EAX]); } else { gCPUStructure.CoresPerPackage = (UINT32)bitfield(gCPUStructure.CPUID[CPUID_1][EBX], 18, 16); if (gCPUStructure.CoresPerPackage) { @@ -283,7 +283,7 @@ VOID GetCPUProperties (VOID) // Determine turbo boost support DoCpuid(6, gCPUStructure.CPUID[CPUID_6]); gCPUStructure.Turbo = ((gCPUStructure.CPUID[CPUID_6][EAX] & (1 << 1)) != 0); - DBG(" The CPU%a supported turbo\n", gCPUStructure.Turbo?"":" not"); + DBG(" The CPU%s supported turbo\n", gCPUStructure.Turbo?"":" not"); //get cores and threads switch (gCPUStructure.Model) { @@ -316,7 +316,7 @@ VOID GetCPUProperties (VOID) case CPU_MODEL_KABYLAKE1: case CPU_MODEL_KABYLAKE2: msr = AsmReadMsr64(MSR_CORE_THREAD_COUNT); //0x35 - DBG("MSR 0x35 %16x\n", msr); + DBG("MSR 0x35 %16llX\n", msr); gCPUStructure.Cores = (UINT8)bitfield((UINT32)msr, 31, 16); gCPUStructure.Threads = (UINT8)bitfield((UINT32)msr, 15, 0); break; @@ -430,12 +430,12 @@ VOID GetCPUProperties (VOID) msr = AsmReadMsr64(MSR_FLEX_RATIO); if ((RShiftU64(msr, 16) & 0x01) != 0) { UINT8 flex_ratio = RShiftU64(msr, 8) & 0xff; - MsgLog("non-usable FLEX_RATIO = %x\n", msr); + MsgLog("non-usable FLEX_RATIO = %llX\n", msr); if (flex_ratio == 0) { AsmWriteMsr64(MSR_FLEX_RATIO, (msr & 0xFFFFFFFFFFFEFFFFULL)); gBS->Stall(10); msr = AsmReadMsr64(MSR_FLEX_RATIO); - MsgLog("corrected FLEX_RATIO = %x\n", msr); + MsgLog("corrected FLEX_RATIO = %llX\n", msr); } } // @@ -496,26 +496,26 @@ VOID GetCPUProperties (VOID) //----test C3 patch msr = AsmReadMsr64(MSR_PKG_CST_CONFIG_CONTROL); //0xE2 - MsgLog("MSR 0xE2 before patch %08x\n", msr); + MsgLog("MSR 0xE2 before patch %08llX\n", msr); if (msr & 0x8000) { MsgLog("MSR 0xE2 is locked, PM patches will be turned on\n"); NeedPMfix = TRUE; } // AsmWriteMsr64(MSR_PKG_CST_CONFIG_CONTROL, (msr & 0x8000000ULL)); // msr = AsmReadMsr64(MSR_PKG_CST_CONFIG_CONTROL); - // MsgLog("MSR 0xE2 after patch %08x\n", msr); + // MsgLog("MSR 0xE2 after patch %08X\n", msr); // msr = AsmReadMsr64(MSR_PMG_IO_CAPTURE_BASE); - // MsgLog("MSR 0xE4 %08x\n", msr); + // MsgLog("MSR 0xE4 %08X\n", msr); //------------ msr = AsmReadMsr64(MSR_PLATFORM_INFO); //0xCE - MsgLog("MSR 0xCE %08x_%08x\n", (msr>>32), msr); + MsgLog("MSR 0xCE %08llX_%08llX\n", (msr>>32), msr); gCPUStructure.MaxRatio = (UINT8)RShiftU64(msr, 8) & 0xff; gCPUStructure.MinRatio = (UINT8)MultU64x32(RShiftU64(msr, 40) & 0xff, 10); //--- Check if EIST locked msr = AsmReadMsr64(MSR_IA32_MISC_ENABLE); //0x1A0 if (msr & _Bit(20)) { - MsgLog("MSR 0x1A0 %08x\n", msr); - MsgLog(" EIST is locked and %a\n", (msr & _Bit(16))?"enabled":"disabled"); + MsgLog("MSR 0x1A0 %08llX\n", msr); + MsgLog(" EIST is locked and %s\n", (msr & _Bit(16))?"enabled":"disabled"); } if (gCPUStructure.Model != CPU_MODEL_GOLDMONT && gCPUStructure.Model != CPU_MODEL_AIRMONT && @@ -524,18 +524,18 @@ VOID GetCPUProperties (VOID) if ((RShiftU64(msr, 16) & 0x01) != 0) { // bcc9 patch UINT8 flex_ratio = RShiftU64(msr, 8) & 0xff; - // MsgLog("non-usable FLEX_RATIO = %x\n", msr); + // MsgLog("non-usable FLEX_RATIO = %X\n", msr); if (flex_ratio == 0) { AsmWriteMsr64(MSR_FLEX_RATIO, (msr & 0xFFFFFFFFFFFEFFFFULL)); gBS->Stall(10); msr = AsmReadMsr64(MSR_FLEX_RATIO); - MsgLog("corrected FLEX_RATIO = %x\n", msr); + MsgLog("corrected FLEX_RATIO = %llX\n", msr); } } } if ((gCPUStructure.CPUID[CPUID_6][ECX] & (1 << 3)) != 0) { msr = AsmReadMsr64(IA32_ENERGY_PERF_BIAS); //0x1B0 - MsgLog("MSR 0x1B0 %08x\n", msr); + MsgLog("MSR 0x1B0 %08llX\n", msr); } if(gCPUStructure.MaxRatio) { @@ -590,7 +590,7 @@ VOID GetCPUProperties (VOID) gCPUStructure.MaxRatio = (UINT32)(RShiftU64(msr, 8)) & 0x1f; TurboMsr = (UINT32)(RShiftU64(msr, 40)) & 0x1f; if ((TurboMsr > gCPUStructure.MaxRatio) && (gCPUStructure.Model == CPU_MODEL_MEROM)) { - DBG(" CPU works at low speed, MaxRatio=%d CurrRatio=%d\n", TurboMsr, + DBG(" CPU works at low speed, MaxRatio=%llu CurrRatio=%d\n", TurboMsr, gCPUStructure.MaxRatio); gCPUStructure.MaxRatio = (UINT32)TurboMsr; } @@ -617,8 +617,8 @@ VOID GetCPUProperties (VOID) gCPUStructure.Turbo4 = (UINT16)(gCPUStructure.MaxRatio + 10); } DBG("MSR dumps:\n"); - DBG("\t@0x00CD=%lx\n", msr); - DBG("\t@0x0198=%lx\n", AsmReadMsr64(MSR_IA32_PERF_STATUS)); + DBG("\t@0x00CD=%llx\n", msr); + DBG("\t@0x0198=%llx\n", AsmReadMsr64(MSR_IA32_PERF_STATUS)); break; default: gCPUStructure.TSCFrequency = MultU64x32(gCPUStructure.CurrentSpeed, Mega); //MHz -> Hz @@ -666,7 +666,7 @@ VOID GetCPUProperties (VOID) gCPUStructure.TSCFrequency = MultU64x32(gCPUStructure.CurrentSpeed, Mega); //MHz -> Hz - DBG("CurrentSpeed: %d\n", DivU64x32(gCPUStructure.TSCFrequency, Mega)); + DBG("CurrentSpeed: %llu\n", DivU64x32(gCPUStructure.TSCFrequency, Mega)); switch (gCPUStructure.Family) { @@ -1051,7 +1051,7 @@ VOID GetCPUProperties (VOID) tmpU = gCPUStructure.FSBFrequency; // DBG("divide by 1000\n"); BusSpeed = (UINT32)DivU64x32(tmpU, kilo); //Hz -> kHz - DBG ("FSBFrequency = %d MHz, DMI FSBFrequency = %d MHz, ", DivU64x32 (tmpU + Mega - 1, Mega), DivU64x32 (ExternalClock + 499, kilo)); + DBG ("FSBFrequency = %llu MHz, DMI FSBFrequency = %llu MHz, ", DivU64x32 (tmpU + Mega - 1, Mega), DivU64x32 (ExternalClock + 499, kilo)); //now check if SMBIOS has ExternalClock = 4xBusSpeed if ((BusSpeed > 50*kilo) && ((ExternalClock > BusSpeed * 3) || (ExternalClock < 50*kilo))) { //khz @@ -1061,7 +1061,7 @@ VOID GetCPUProperties (VOID) gCPUStructure.FSBFrequency = tmpU; } tmpU = gCPUStructure.FSBFrequency; - DBG("Corrected FSBFrequency = %d MHz\n", DivU64x32(tmpU, Mega)); + DBG("Corrected FSBFrequency = %llu MHz\n", DivU64x32(tmpU, Mega)); if ((gCPUStructure.Vendor == CPU_VENDOR_INTEL) && (gCPUStructure.Model == CPU_MODEL_NEHALEM)) { //Slice - for Nehalem we can do more calculation as in Cham @@ -1096,7 +1096,7 @@ VOID GetCPUProperties (VOID) //Slice - why 2:1? Intel spec said 3:4 - QCLK_RATIO at offset 0x50 // && (Device == 2) && (Function == 1)) { && (Device == 3) && (Function == 4)) { - DBG("Found QCLK_RATIO at bus 0x%02x dev=%x funs=%x\n", Bus, Device, Function); + DBG("Found QCLK_RATIO at bus 0x%02llX dev=%llX funs=%llX\n", Bus, Device, Function); Status = PciIo->Mem.Read ( PciIo, EfiPciIoWidthUint32, @@ -1105,7 +1105,7 @@ VOID GetCPUProperties (VOID) 1, &qpimult ); - DBG("qpi read from PCI %x\n", qpimult & 0x1F); + DBG("qpi read from PCI %X\n", qpimult & 0x1F); if (EFI_ERROR(Status)) continue; qpimult &= 0x1F; //bits 0:4 break; @@ -1116,7 +1116,7 @@ VOID GetCPUProperties (VOID) DBG("qpimult %d\n", qpimult); qpibusspeed = MultU64x32(gCPUStructure.ExternalClock, qpimult * 2); //kHz - DBG("qpibusspeed %dkHz\n", qpibusspeed); + DBG("qpibusspeed %llukHz\n", qpibusspeed); gCPUStructure.ProcessorInterconnectSpeed = DivU64x32(qpibusspeed, kilo); //kHz->MHz // set QPI for Nehalem gSettings.QPI = (UINT16)gCPUStructure.ProcessorInterconnectSpeed; @@ -1126,11 +1126,11 @@ VOID GetCPUProperties (VOID) } gCPUStructure.MaxSpeed = (UINT32)(DivU64x32(MultU64x64(gCPUStructure.FSBFrequency, gCPUStructure.MaxRatio), Mega * 10)); //kHz->MHz -// DBG("Vendor/Model/Stepping: 0x%x/0x%x/0x%x\n", gCPUStructure.Vendor, gCPUStructure.Model, gCPUStructure.Stepping); -// DBG("Family/ExtFamily: 0x%x/0x%x\n", gCPUStructure.Family, gCPUStructure.Extfamily); +// DBG("Vendor/Model/Stepping: 0x%X/0x%X/0x%X\n", gCPUStructure.Vendor, gCPUStructure.Model, gCPUStructure.Stepping); +// DBG("Family/ExtFamily: 0x%X/0x%X\n", gCPUStructure.Family, gCPUStructure.Extfamily); DBG("MaxDiv/MinDiv: %d.%d/%d\n", gCPUStructure.MaxRatio/10, gCPUStructure.MaxRatio%10 , gCPUStructure.MinRatio/10); DBG("Turbo: %d/%d/%d/%d\n", gCPUStructure.Turbo4/10, gCPUStructure.Turbo3/10, gCPUStructure.Turbo2/10, gCPUStructure.Turbo1/10); - DBG("Features: 0x%08x\n",gCPUStructure.Features); + DBG("Features: 0x%08llX\n",gCPUStructure.Features); DBG("Threads: %d\n",gCPUStructure.Threads); DBG("Cores: %d\n",gCPUStructure.Cores); DBG("FSB: %d MHz\n", (INT32)(DivU64x32(gCPUStructure.FSBFrequency, Mega))); @@ -1155,7 +1155,7 @@ VOID SetCPUProperties (VOID) msr = gSettings.SavingMode; AsmWriteMsr64(IA32_ENERGY_PERF_BIAS, msr); msr = AsmReadMsr64(IA32_ENERGY_PERF_BIAS); //0x1B0 - MsgLog("MSR 0x1B0 set to %08x\n", msr); + MsgLog("MSR 0x1B0 set to %08llX\n", msr); } } diff --git a/rEFIt_UEFI/Platform/device_inject.cpp b/rEFIt_UEFI/Platform/device_inject.cpp index 114b3ff55..02db56bdc 100644 --- a/rEFIt_UEFI/Platform/device_inject.cpp +++ b/rEFIt_UEFI/Platform/device_inject.cpp @@ -106,7 +106,7 @@ UINT32 pci_config_read32(pci_dt_t *PciDt, UINT8 reg) &res ); if (EFI_ERROR(Status)) { - DBG("pci_config_read32 failed %r\n", Status); + DBG("pci_config_read32 failed %s\n", strerror(Status)); return 0; } return res; @@ -133,7 +133,7 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt, if (!DevicePath && (PciDt != 0)) { DevicePath = DevicePathFromHandle(PciDt->DeviceHandle); } - // DBG("devprop_add_device_pci %s ", DevicePathToStr(DevicePath)); + // DBG("devprop_add_device_pci %ls ", DevicePathToStr(DevicePath)); if (!DevicePath) return NULL; @@ -155,7 +155,7 @@ DevPropDevice *devprop_add_device_pci(DevPropString *StringBuf, pci_dt_t *PciDt, device->acpi_dev_path._HID = 0x0a0341d0; device->acpi_dev_path._UID = (((ACPI_HID_DEVICE_PATH*)DevicePath)->UID)?0x80:0; -// DBG("ACPI HID=%x, UID=%x ", device->acpi_dev_path._HID, device->acpi_dev_path._UID); +// DBG("ACPI HID=%X, UID=%X ", device->acpi_dev_path._HID, device->acpi_dev_path._UID); } else { // DBG("not ACPI\n"); FreePool(device); @@ -169,7 +169,7 @@ 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 "); @@ -222,7 +222,7 @@ BOOLEAN devprop_add_value(DevPropDevice *device, CONST CHAR8 *nm, UINT8 *vl, UIN if(!device || !nm || !vl /*|| !len*/) //rehabman: allow zero length data return FALSE; - /* DBG("devprop_add_value %a=", nm); + /* DBG("devprop_add_value %s=", nm); for (i=0; ivendor_id, eth_dev->device_id, devicepath); +// DBG("LAN Controller [%04X:%04X] :: %s\n", eth_dev->vendor_id, eth_dev->device_id, devicepath); if (eth_dev->vendor_id != 0x168c && builtin_set == 0) { builtin_set = 1; builtin = 0x01; @@ -388,13 +388,13 @@ BOOLEAN set_eth_props(pci_dt_t *eth_dev) Injected = TRUE; if (!gSettings.AddProperties[i].MenuItem.BValue) { - //DBG(" disabled property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" disabled property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } else { devprop_add_value(device, gSettings.AddProperties[i].Key, (UINT8*)gSettings.AddProperties[i].Value, gSettings.AddProperties[i].ValueLen); - //DBG(" added property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" added property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } } } @@ -403,7 +403,7 @@ BOOLEAN set_eth_props(pci_dt_t *eth_dev) // return TRUE; } - // DBG("Setting dev.prop built-in=0x%x\n", builtin); + // DBG("Setting dev.prop built-in=0x%X\n", builtin); // devprop_add_value(device, "device_type", (UINT8*)"Ethernet", 9); if (gSettings.FakeLAN) { UINT32 FakeID = gSettings.FakeLAN >> 16; @@ -460,8 +460,8 @@ BOOLEAN set_usb_props(pci_dt_t *usb_dev) return FALSE; } // ------------------------------------------------- - // DBG("USB Controller [%04x:%04x] :: %a\n", usb_dev->vendor_id, usb_dev->device_id, devicepath); - // DBG("Setting dev.prop built-in=0x%x\n", builtin); + // 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); if (gSettings.NrAddProperties != 0xFFFE) { for (i = 0; i < gSettings.NrAddProperties; i++) { @@ -471,13 +471,13 @@ BOOLEAN set_usb_props(pci_dt_t *usb_dev) Injected = TRUE; if (!gSettings.AddProperties[i].MenuItem.BValue) { - //DBG(" disabled property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" disabled property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } else { devprop_add_value(device, gSettings.AddProperties[i].Key, (UINT8*)gSettings.AddProperties[i].Value, gSettings.AddProperties[i].ValueLen); - //DBG(" added property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" added property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } } } diff --git a/rEFIt_UEFI/Platform/gma.cpp b/rEFIt_UEFI/Platform/gma.cpp index d3d55c5ed..90b7ca30b 100755 --- a/rEFIt_UEFI/Platform/gma.cpp +++ b/rEFIt_UEFI/Platform/gma.cpp @@ -984,9 +984,9 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev) break; } } - //DBG("Finally model=%a\n", model); + //DBG("Finally model=%s\n", model); - MsgLog("%a [%04x:%04x] :: %a\n", + MsgLog("%s [%04X:%04X] :: %s\n", model, gma_dev->vendor_id, gma_dev->device_id, devicepath); // Resolution @@ -1385,13 +1385,13 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev) Injected = TRUE; if (!gSettings.AddProperties[i].MenuItem.BValue) { - //DBG(" disabled property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" disabled property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } else { devprop_add_value(device, gSettings.AddProperties[i].Key, (UINT8*)gSettings.AddProperties[i].Value, gSettings.AddProperties[i].ValueLen); - //DBG(" added property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" added property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } } } @@ -1511,7 +1511,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev) FakeID = gSettings.FakeIntel & 0xFFFF; devprop_add_value(device, "vendor-id", (UINT8*)&FakeID, 4); SetFake = TRUE; - MsgLog(" FakeID Intel GFX = 0x%08lx\n", gSettings.FakeIntel); + MsgLog(" FakeID Intel GFX = 0x%08x\n", gSettings.FakeIntel); } else { DBG(" FakeID Intel GFX: not set\n"); } @@ -1527,7 +1527,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev) case 0x0126: // "Intel HD Graphics 3000" if (gSettings.IgPlatform != 0) { devprop_add_value(device, "AAPL,snb-platform-id", (UINT8*)&gSettings.IgPlatform, 4); - MsgLog(" snb-platform-id = 0x%08lx\n", gSettings.IgPlatform); + MsgLog(" snb-platform-id = 0x%08x\n", gSettings.IgPlatform); SetSnb = TRUE; } else { DBG(" snb-platform-id: not set\n"); @@ -1536,7 +1536,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev) default: if (gSettings.IgPlatform != 0) { devprop_add_value(device, "AAPL,ig-platform-id", (UINT8*)&gSettings.IgPlatform, 4); - MsgLog(" ig-platform-id = 0x%08lx\n", gSettings.IgPlatform); + MsgLog(" ig-platform-id = 0x%08x\n", gSettings.IgPlatform); SetIg = TRUE; } else { DBG(" ig-platform-id: not set\n"); @@ -3384,7 +3384,7 @@ BOOLEAN setup_gma_devprop(LOADER_ENTRY *Entry, pci_dt_t *gma_dev) default: - DBG(" Intel card id=%x unsupported, please report to the clover thread\n", gma_dev->device_id); + DBG(" Intel card id=%X unsupported, please report to the clover thread\n", gma_dev->device_id); return FALSE; } diff --git a/rEFIt_UEFI/Platform/hda.cpp b/rEFIt_UEFI/Platform/hda.cpp index 7dcd4dbe1..4b8273ae1 100644 --- a/rEFIt_UEFI/Platform/hda.cpp +++ b/rEFIt_UEFI/Platform/hda.cpp @@ -89,21 +89,21 @@ UINT32 HDA_IC_sendVerb(EFI_PCI_IO_PROTOCOL *PciIo, UINT32 codecAdr, UINT32 nodeI // poll ICS[0] to become 0 Status = PciIo->PollMem(PciIo, EfiPciIoWidthUint16, 0/*bar*/, HDA_ICS/*offset*/, 0x1/*mask*/, 0/*value*/, 100000/*delay in 100ns*/, &data64); ics = (UINT16)(data64 & 0xFFFF); - //DBG("poll ICS[0] == 0: Status=%r, ICS=%x, ICS[0]=%d\n", Status, ics, (ics & 0x0001)); + //DBG("poll ICS[0] == 0: Status=%s, ICS=%X, ICS[0]=%d\n", strerror(Status), ics, (ics & 0x0001)); if (EFI_ERROR(Status)) return 0; // prepare and write verb to ICO data32 = codecAdr << 28 | ((nodeId & 0xFF)<<20) | (verb & 0xFFFFF); Status = PciIo->Mem.Write(PciIo, EfiPciIoWidthUint32, 0, HDA_ICO, 1, &data32); - //DBG("ICO write verb Codec=%x, Node=%x, verb=%x, command verb=%x: Status=%r\n", codecAdr, nodeId, verb, data32, Status); + //DBG("ICO write verb Codec=%X, Node=%X, verb=%X, command verb=%X: Status=%s\n", codecAdr, nodeId, verb, data32, strerror(Status)); if (EFI_ERROR(Status)) return 0; // write 11b to ICS[1:0] to send command ics |= 0x3; Status = PciIo->Mem.Write(PciIo, EfiPciIoWidthUint16, 0, HDA_ICS, 1, &ics); - //DBG("ICS[1:0] = 11b: Status=%r\n", Status); + //DBG("ICS[1:0] = 11b: Status=%s\n", strerror(Status)); if (EFI_ERROR(Status)) return 0; // poll ICS[1:0] to become 10b Status = PciIo->PollMem(PciIo, EfiPciIoWidthUint16, 0/*bar*/, HDA_ICS/*offset*/, 0x3/*mask*/, 0x2/*value*/, 100000/*delay in 100ns*/, &data64); - //DBG("poll ICS[0] == 0: Status=%r\n", Status); + //DBG("poll ICS[0] == 0: Status=%s\n", strerror(Status)); if (EFI_ERROR(Status)) return 0; // read IRI for VendorId/DeviceId Status = PciIo->Mem.Read(PciIo, EfiPciIoWidthUint32, 0, HDA_IRI, 1, &data32); @@ -179,13 +179,13 @@ BOOLEAN setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, CHAR8 * Injected = TRUE; if (!gSettings.AddProperties[i].MenuItem.BValue) { - //DBG(" disabled property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" disabled property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } else { devprop_add_value(device, gSettings.AddProperties[i].Key, (UINT8*)gSettings.AddProperties[i].Value, gSettings.AddProperties[i].ValueLen); - //DBG(" added property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" added property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } } } @@ -216,7 +216,7 @@ BOOLEAN setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, CHAR8 * if (gSettings.HDALayoutId > 0) { // layoutId is specified - use it layoutId = (UINT32)gSettings.HDALayoutId; - DBG(" setting specified layout-id=%d (0x%x)\n", layoutId, layoutId); + DBG(" setting specified layout-id=%d (0x%X)\n", layoutId, layoutId); } else { layoutId = 12; } @@ -228,13 +228,13 @@ BOOLEAN setup_hda_devprop(EFI_PCI_IO_PROTOCOL *PciIo, pci_dt_t *hda_dev, CHAR8 * Injected = TRUE; if (!gSettings.AddProperties[i].MenuItem.BValue) { - //DBG(" disabled property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" disabled property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } else { devprop_add_value(device, gSettings.AddProperties[i].Key, (UINT8*)gSettings.AddProperties[i].Value, gSettings.AddProperties[i].ValueLen); - //DBG(" added property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" added property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } } } diff --git a/rEFIt_UEFI/Platform/kernel_patcher.cpp b/rEFIt_UEFI/Platform/kernel_patcher.cpp index 0ec722a56..c65f07254 100644 --- a/rEFIt_UEFI/Platform/kernel_patcher.cpp +++ b/rEFIt_UEFI/Platform/kernel_patcher.cpp @@ -319,7 +319,7 @@ VOID KernelPatcher_32(VOID* kernelData, CHAR8 *OSVersion) bytes[i+8] == 0x00 && bytes[i+9] == 0x00 && bytes[i+10] == 0xC7 && bytes[i+11] == 0x05 && bytes[i-5] == 0xE8) { patchLocation = i-5; - DBG("Found _cpuid_set_info _panic address at 0x%08x\n",patchLocation); + DBG("Found _cpuid_set_info _panic address at 0x%08X\n",patchLocation); break; } } @@ -338,7 +338,7 @@ VOID KernelPatcher_32(VOID* kernelData, CHAR8 *OSVersion) bytes[i+3] == 0x54 && bytes[i+4] == 0x0E && bytes[i+5] == 0x59 && bytes[i+6] == 0x00) { patchLocation1 = i+7; - DBG("Found _tsc_init _panic address at 0x%08x\n",patchLocation1); + DBG("Found _tsc_init _panic address at 0x%08X\n",patchLocation1); break; } } @@ -861,11 +861,11 @@ BOOLEAN (*EnableExtCpuXCPM)(VOID *kernelData, LOADER_ENTRY *Entry, BOOLEAN use_x // static inline VOID applyKernPatch(UINT8 *kern, UINT8 *find, UINTN size, UINT8 *repl, const CHAR8 *comment) { - DBG("Searching %a...\n", comment); + DBG("Searching %s...\n", comment); if (SearchAndReplace(kern, KERNEL_MAX_SIZE, find, size, repl, 0)) { - DBG("Found %a\nApplied %a patch\n", comment, comment); + DBG("Found %s\nApplied %s patch\n", comment, comment); } else { - DBG("%a no found, patched already?\n", comment); + DBG("%s no found, patched already?\n", comment); } } @@ -1405,7 +1405,7 @@ VOID Patcher_SSE3_6(VOID* kernelData) bytes[i-1664-32] == 0x55 ) { patchLocation1 = i-1664-32; - DBG("Found SSE3 data address at 0x%08x\n",patchLocation1); + DBG("Found SSE3 data address at 0x%08X\n",patchLocation1); } // hasSSE2+..... title @@ -1414,14 +1414,14 @@ VOID Patcher_SSE3_6(VOID* kernelData) bytes[i+6] == 0xFF && bytes[i+7] == 0xFF && bytes[i+8] == 0x24 && bytes[i+9] == 0x01) { patchLocation2 = i; - DBG("Found SSE3 Title address at 0x%08x\n",patchLocation2); + DBG("Found SSE3 Title address at 0x%08X\n",patchLocation2); break; } i++; } if (!patchLocation1 || !patchLocation2) { - DBG("Can't found SSE3 data addres or Title address at 0x%08x 0x%08x\n", patchLocation1, patchLocation2); + DBG("Can't found SSE3 data addres or Title address at 0x%08X 0x%08X\n", patchLocation1, patchLocation2); return; } @@ -1431,14 +1431,14 @@ VOID Patcher_SSE3_6(VOID* kernelData) while(TRUE) { if (bytes[i] == 0x90 && bytes[i+1] == 0x90 && bytes[i+2] == 0x55 ) { patchlast = (i+1) - patchLocation1; - DBG("Found SSE3 last data addres at 0x%08x\n", patchlast); + DBG("Found SSE3 last data addres at 0x%08X\n", patchlast); break; } i++; } if (!patchlast) { - DBG("Can't found SSE3 data last addres at 0x%08x\n", patchlast); + DBG("Can't found SSE3 data last addres at 0x%08X\n", patchlast); return; } // patch sse3_64 data @@ -1475,7 +1475,7 @@ VOID Patcher_SSE3_5(VOID* kernelData) bytes[i+3] == 0x44 && bytes[i+4] == 0x0E && bytes[i+5] == 0xF1 && bytes[i-1680-32] == 0x55) { patchLocation1 = i-1680-32; - DBG("Found SSE3 data address at 0x%08x\n",patchLocation1); + DBG("Found SSE3 data address at 0x%08X\n",patchLocation1); } // khasSSE2+..... title @@ -1484,13 +1484,13 @@ VOID Patcher_SSE3_5(VOID* kernelData) bytes[i+6] == 0xFF && bytes[i+7] == 0xFF && bytes[i+8] == 0x24 && bytes[i+9] == 0x01) { patchLocation2 = i; - DBG("Found SSE3 Title address at 0x%08x\n",patchLocation2); + DBG("Found SSE3 Title address at 0x%08X\n",patchLocation2); break; } } if (!patchLocation1 || !patchLocation2) { - DBG("Can't found SSE3 data addres or Title address at 0x%08x 0x%08x\n", patchLocation1, patchLocation2); + DBG("Can't found SSE3 data addres or Title address at 0x%08X 0x%08X\n", patchLocation1, patchLocation2); return; } @@ -1499,13 +1499,13 @@ VOID Patcher_SSE3_5(VOID* kernelData) for (i=(patchLocation1+1500);icmd) { case LC_SEGMENT_64: segCmd64 = (struct segment_command_64 *)loadCommand; - //DBG("segCmd64->segname = %a\n",segCmd64->segname); - //DBG("segCmd64->vmaddr = 0x%08x\n",segCmd64->vmaddr) - //DBG("segCmd64->vmsize = 0x%08x\n",segCmd64->vmsize); + //DBG("segCmd64->segname = %s\n",segCmd64->segname); + //DBG("segCmd64->vmaddr = 0x%08X\n",segCmd64->vmaddr) + //DBG("segCmd64->vmsize = 0x%08X\n",segCmd64->vmsize); if (AsciiStrCmp(segCmd64->segname, kPrelinkTextSegment) == 0) { DBG("Found PRELINK_TEXT, 64bit\n"); if (segCmd64->vmsize > 0) { @@ -1572,34 +1572,34 @@ VOID Get_PreLink() PrelinkTextLoadCmdAddr = (UINT32)(UINTN)segCmd64; } DBG("at %p: vmaddr = 0x%lx, vmsize = 0x%lx\n", segCmd64, segCmd64->vmaddr, segCmd64->vmsize); - DBG("PrelinkTextLoadCmdAddr = 0x%x, PrelinkTextAddr = 0x%x, PrelinkTextSize = 0x%x\n", + DBG("PrelinkTextLoadCmdAddr = 0x%X, PrelinkTextAddr = 0x%X, PrelinkTextSize = 0x%X\n", PrelinkTextLoadCmdAddr, PrelinkTextAddr, PrelinkTextSize); - //DBG("cmd = 0x%08x\n",segCmd64->cmd); - //DBG("cmdsize = 0x%08x\n",segCmd64->cmdsize); - //DBG("vmaddr = 0x%08x\n",segCmd64->vmaddr); - //DBG("vmsize = 0x%08x\n",segCmd64->vmsize); - //DBG("fileoff = 0x%08x\n",segCmd64->fileoff); - //DBG("filesize = 0x%08x\n",segCmd64->filesize); - //DBG("maxprot = 0x%08x\n",segCmd64->maxprot); - //DBG("initprot = 0x%08x\n",segCmd64->initprot); - //DBG("nsects = 0x%08x\n",segCmd64->nsects); - //DBG("flags = 0x%08x\n",segCmd64->flags); + //DBG("cmd = 0x%08X\n",segCmd64->cmd); + //DBG("cmdsize = 0x%08X\n",segCmd64->cmdsize); + //DBG("vmaddr = 0x%08X\n",segCmd64->vmaddr); + //DBG("vmsize = 0x%08X\n",segCmd64->vmsize); + //DBG("fileoff = 0x%08X\n",segCmd64->fileoff); + //DBG("filesize = 0x%08X\n",segCmd64->filesize); + //DBG("maxprot = 0x%08X\n",segCmd64->maxprot); + //DBG("initprot = 0x%08X\n",segCmd64->initprot); + //DBG("nsects = 0x%08X\n",segCmd64->nsects); + //DBG("flags = 0x%08X\n",segCmd64->flags); } if (AsciiStrCmp(segCmd64->segname, kPrelinkInfoSegment) == 0) { UINT32 sectionIndex; struct section_64 *sect; DBG("Found PRELINK_INFO, 64bit\n"); - //DBG("cmd = 0x%08x\n",segCmd64->cmd); - //DBG("cmdsize = 0x%08x\n",segCmd64->cmdsize); - DBG("vmaddr = 0x%08x\n",segCmd64->vmaddr); - DBG("vmsize = 0x%08x\n",segCmd64->vmsize); - //DBG("fileoff = 0x%08x\n",segCmd64->fileoff); - //DBG("filesize = 0x%08x\n",segCmd64->filesize); - //DBG("maxprot = 0x%08x\n",segCmd64->maxprot); - //DBG("initprot = 0x%08x\n",segCmd64->initprot); - //DBG("nsects = 0x%08x\n",segCmd64->nsects); - //DBG("flags = 0x%08x\n",segCmd64->flags); + //DBG("cmd = 0x%08X\n",segCmd64->cmd); + //DBG("cmdsize = 0x%08X\n",segCmd64->cmdsize); + DBG("vmaddr = 0x%08X\n",segCmd64->vmaddr); + DBG("vmsize = 0x%08X\n",segCmd64->vmsize); + //DBG("fileoff = 0x%08X\n",segCmd64->fileoff); + //DBG("filesize = 0x%08X\n",segCmd64->filesize); + //DBG("maxprot = 0x%08X\n",segCmd64->maxprot); + //DBG("initprot = 0x%08X\n",segCmd64->initprot); + //DBG("nsects = 0x%08X\n",segCmd64->nsects); + //DBG("flags = 0x%08X\n",segCmd64->flags); sectionIndex = sizeof(struct segment_command_64); while(sectionIndex < segCmd64->cmdsize) { @@ -1615,7 +1615,7 @@ VOID Get_PreLink() PrelinkInfoSize = (UINT32)sect->size; } DBG("__info found at %p: addr = 0x%lx, size = 0x%lx\n", sect, sect->addr, sect->size); - DBG("PrelinkInfoLoadCmdAddr = 0x%x, PrelinkInfoAddr = 0x%x, PrelinkInfoSize = 0x%x\n", + DBG("PrelinkInfoLoadCmdAddr = 0x%X, PrelinkInfoAddr = 0x%X, PrelinkInfoSize = 0x%X\n", PrelinkInfoLoadCmdAddr, PrelinkInfoAddr, PrelinkInfoSize); } } @@ -1624,9 +1624,9 @@ VOID Get_PreLink() case LC_SEGMENT: segCmd = (struct segment_command *)loadCommand; - //DBG("segCmd->segname = %a\n",segCmd->segname); - //DBG("segCmd->vmaddr = 0x%08x\n",segCmd->vmaddr) - //DBG("segCmd->vmsize = 0x%08x\n",segCmd->vmsize); + //DBG("segCmd->segname = %s\n",segCmd->segname); + //DBG("segCmd->vmaddr = 0x%08X\n",segCmd->vmaddr) + //DBG("segCmd->vmsize = 0x%08X\n",segCmd->vmsize); if (AsciiStrCmp(segCmd->segname, kPrelinkTextSegment) == 0) { DBG("Found PRELINK_TEXT, 32bit\n"); if (segCmd->vmsize > 0) { @@ -1636,7 +1636,7 @@ VOID Get_PreLink() PrelinkTextLoadCmdAddr = (UINT32)(UINTN)segCmd; } DBG("at %p: vmaddr = 0x%lx, vmsize = 0x%lx\n", segCmd, segCmd->vmaddr, segCmd->vmsize); - DBG("PrelinkTextLoadCmdAddr = 0x%x, PrelinkTextAddr = 0x%x, PrelinkTextSize = 0x%x\n", + DBG("PrelinkTextLoadCmdAddr = 0x%X, PrelinkTextAddr = 0x%X, PrelinkTextSize = 0x%X\n", PrelinkTextLoadCmdAddr, PrelinkTextAddr, PrelinkTextSize); //gBS->Stall(30*1000000); } @@ -1645,16 +1645,16 @@ VOID Get_PreLink() struct section *sect; DBG("Found PRELINK_INFO, 32bit\n"); - //DBG("cmd = 0x%08x\n",segCmd->cmd); - //DBG("cmdsize = 0x%08x\n",segCmd->cmdsize); - DBG("vmaddr = 0x%08x\n",segCmd->vmaddr); - DBG("vmsize = 0x%08x\n",segCmd->vmsize); - //DBG("fileoff = 0x%08x\n",segCmd->fileoff); - //DBG("filesize = 0x%08x\n",segCmd->filesize); - //DBG("maxprot = 0x%08x\n",segCmd->maxprot); - //DBG("initprot = 0x%08x\n",segCmd->initprot); - //DBG("nsects = 0x%08x\n",segCmd->nsects); - //DBG("flags = 0x%08x\n",segCmd->flags); + //DBG("cmd = 0x%08X\n",segCmd->cmd); + //DBG("cmdsize = 0x%08X\n",segCmd->cmdsize); + DBG("vmaddr = 0x%08X\n",segCmd->vmaddr); + DBG("vmsize = 0x%08X\n",segCmd->vmsize); + //DBG("fileoff = 0x%08X\n",segCmd->fileoff); + //DBG("filesize = 0x%08X\n",segCmd->filesize); + //DBG("maxprot = 0x%08X\n",segCmd->maxprot); + //DBG("initprot = 0x%08X\n",segCmd->initprot); + //DBG("nsects = 0x%08X\n",segCmd->nsects); + //DBG("flags = 0x%08X\n",segCmd->flags); sectionIndex = sizeof(struct segment_command); while(sectionIndex < segCmd->cmdsize) { @@ -1669,7 +1669,7 @@ VOID Get_PreLink() PrelinkInfoSize = (UINT32)sect->size; } DBG("__info found at %p: addr = 0x%lx, size = 0x%lx\n", sect, sect->addr, sect->size); - DBG("PrelinkInfoLoadCmdAddr = 0x%x, PrelinkInfoAddr = 0x%x, PrelinkInfoSize = 0x%x\n", + DBG("PrelinkInfoLoadCmdAddr = 0x%X, PrelinkInfoAddr = 0x%X, PrelinkInfoSize = 0x%X\n", PrelinkInfoLoadCmdAddr, PrelinkInfoAddr, PrelinkInfoSize); //gBS->Stall(30*1000000); } @@ -1714,8 +1714,8 @@ FindBootArgs(IN LOADER_ENTRY *Entry) KernelSlide = bootArgs2->kslide; DBG_RT(Entry, "Found bootArgs2 at 0x%08x, DevTree at %p\n", ptr, dtRoot); - //DBG("bootArgs2->kaddr = 0x%08x and bootArgs2->ksize = 0x%08x\n", bootArgs2->kaddr, bootArgs2->ksize); - //DBG("bootArgs2->efiMode = 0x%02x\n", bootArgs2->efiMode); + //DBG("bootArgs2->kaddr = 0x%08X and bootArgs2->ksize = 0x%08X\n", bootArgs2->kaddr, bootArgs2->ksize); + //DBG("bootArgs2->efiMode = 0x%02X\n", bootArgs2->efiMode); DBG_RT(Entry, "bootArgs2->CommandLine = %a\n", bootArgs2->CommandLine); DBG_RT(Entry, "bootArgs2->flags = 0x%x\n", bootArgs2->flags); DBG_RT(Entry, "bootArgs2->kslide = 0x%x\n", bootArgs2->kslide); @@ -1743,8 +1743,8 @@ FindBootArgs(IN LOADER_ENTRY *Entry) dtLength = &bootArgs1->deviceTreeLength; DBG_RT(Entry, "Found bootArgs1 at 0x%08x, DevTree at %p\n", ptr, dtRoot); - //DBG("bootArgs1->kaddr = 0x%08x and bootArgs1->ksize = 0x%08x\n", bootArgs1->kaddr, bootArgs1->ksize); - //DBG("bootArgs1->efiMode = 0x%02x\n", bootArgs1->efiMode); + //DBG("bootArgs1->kaddr = 0x%08X and bootArgs1->ksize = 0x%08X\n", bootArgs1->kaddr, bootArgs1->ksize); + //DBG("bootArgs1->efiMode = 0x%02X\n", bootArgs1->efiMode); // disable other pointer bootArgs2 = NULL; diff --git a/rEFIt_UEFI/Platform/kext_inject.cpp b/rEFIt_UEFI/Platform/kext_inject.cpp index 3aa3553a0..c5cf73293 100644 --- a/rEFIt_UEFI/Platform/kext_inject.cpp +++ b/rEFIt_UEFI/Platform/kext_inject.cpp @@ -150,20 +150,20 @@ EFI_STATUS EFIAPI LoadKext(IN LOADER_ENTRY *Entry, IN EFI_FILE *RootDir, IN CHAR Status = egLoadFile(RootDir, TempName, &infoDictBuffer, &infoDictBufferLength); FreePool(TempName); if (EFI_ERROR(Status)) { - MsgLog("Failed to load extra kext (Info.plist not found): %s\n", FileName); + MsgLog("Failed to load extra kext (Info.plist not found): %ls\n", FileName); return EFI_NOT_FOUND; } NoContents = TRUE; } if(ParseXML((CHAR8*)infoDictBuffer,&dict,(UINT32)infoDictBufferLength)!=0) { FreePool(infoDictBuffer); - MsgLog("Failed to load extra kext (failed to parse Info.plist): %s\n", FileName); + MsgLog("Failed to load extra kext (failed to parse Info.plist): %ls\n", FileName); return EFI_NOT_FOUND; } inject = checkOSBundleRequired(Entry->LoaderType, dict); if(!inject) { - MsgLog("Skipping kext injection by OSBundleRequired : %s\n", FileName); + MsgLog("Skipping kext injection by OSBundleRequired : %ls\n", FileName); return EFI_UNSUPPORTED; } @@ -183,14 +183,14 @@ EFI_STATUS EFIAPI LoadKext(IN LOADER_ENTRY *Entry, IN EFI_FILE *RootDir, IN CHAR FreePool(TempName); if (EFI_ERROR(Status)) { FreePool(infoDictBuffer); - MsgLog("Failed to load extra kext (executable not found): %s\n", FileName); + MsgLog("Failed to load extra kext (executable not found): %ls\n", FileName); return EFI_NOT_FOUND; } executableBuffer = executableFatBuffer; if (ThinFatFile(&executableBuffer, &executableBufferLength, archCpuType)) { FreePool(infoDictBuffer); FreePool(executableBuffer); - MsgLog("Thinning failed: %s\n", FileName); + MsgLog("Thinning failed: %ls\n", FileName); return EFI_NOT_FOUND; } } @@ -281,7 +281,7 @@ VOID LoadPlugInKexts(IN LOADER_ENTRY *Entry, IN EFI_FILE *RootDir, IN CHAR16 *Di continue; // skip this FileName = PoolPrint(L"%s\\%s", DirName, PlugInFile->FileName); // UnicodeSPrint(FileName, 512, L"%s\\%s", DirName, PlugInFile->FileName); - MsgLog(" %s PlugIn kext: %s\n", Force ? L"Force" : L"Extra", FileName); + MsgLog(" %ls PlugIn kext: %ls\n", Force ? L"Force" : L"Extra", FileName); AddKext(Entry, RootDir, FileName, archCpuType); FreePool(FileName); } @@ -296,16 +296,16 @@ VOID AddKexts(IN LOADER_ENTRY *Entry, CONST CHAR16 *SrcDir, CONST CHAR16 *Path/* SIDELOAD_KEXT *CurrentPlugInKext; EFI_STATUS Status; - MsgLog("Preparing kexts injection for arch=%s from %s\n", (archCpuType==CPU_TYPE_X86_64)?L"x86_64":(archCpuType==CPU_TYPE_I386)?L"i386":L"", SrcDir); + MsgLog("Preparing kexts injection for arch=%ls from %ls\n", (archCpuType==CPU_TYPE_X86_64)?L"x86_64":(archCpuType==CPU_TYPE_I386)?L"i386":L"", SrcDir); CurrentKext = InjectKextList; while (CurrentKext) { - DBG(" current kext name=%s path=%s, match against=%s\n", CurrentKext->FileName, CurrentKext->KextDirNameUnderOEMPath, Path); + DBG(" current kext name=%ls path=%ls, match against=%ls\n", CurrentKext->FileName, CurrentKext->KextDirNameUnderOEMPath, Path); if (StrCmp(CurrentKext->KextDirNameUnderOEMPath, Path) == 0) { FileName = PoolPrint(L"%s\\%s", SrcDir, CurrentKext->FileName); // UnicodeSPrint(FileName, 512, L"%s\\%s", SrcDir, CurrentKext->FileName); if (!(CurrentKext->MenuItem.BValue)) { // inject require - MsgLog("->Extra kext: %s (v.%s)\n", FileName, CurrentKext->Version); + MsgLog("->Extra kext: %ls (v.%ls)\n", FileName, CurrentKext->Version); Status = AddKext(Entry, SelfVolume->RootDir, FileName, archCpuType); if(!EFI_ERROR(Status)) { // decide which plugins to inject @@ -315,10 +315,10 @@ VOID AddKexts(IN LOADER_ENTRY *Entry, CONST CHAR16 *SrcDir, CONST CHAR16 *Path/* // UnicodeSPrint(PlugInName, 512, L"%s\\%s\\%s", FileName, L"Contents\\PlugIns", CurrentPlugInKext->FileName); if (!(CurrentPlugInKext->MenuItem.BValue)) { // inject PlugIn require - MsgLog(" |-- PlugIn kext: %s (v.%s)\n", PlugInName, CurrentPlugInKext->Version); + MsgLog(" |-- PlugIn kext: %ls (v.%ls)\n", PlugInName, CurrentPlugInKext->Version); AddKext(Entry, SelfVolume->RootDir, PlugInName, archCpuType); } else { - MsgLog(" |-- Disabled plug-in kext: %s (v.%s)\n", PlugInName, CurrentPlugInKext->Version); + MsgLog(" |-- Disabled plug-in kext: %ls (v.%ls)\n", PlugInName, CurrentPlugInKext->Version); } FreePool(PlugInName); CurrentPlugInKext = CurrentPlugInKext->Next; @@ -327,7 +327,7 @@ VOID AddKexts(IN LOADER_ENTRY *Entry, CONST CHAR16 *SrcDir, CONST CHAR16 *Path/* } else { // disable current kext injection if (!StriStr(SrcDir, L"Off")) { - MsgLog("Disabled kext: %s (v.%s)\n", FileName, CurrentKext->Version); + MsgLog("Disabled kext: %ls (v.%ls)\n", FileName, CurrentKext->Version); } } FreePool(FileName); @@ -388,7 +388,7 @@ EFI_STATUS LoadKexts(IN LOADER_ENTRY *Entry) (Entry->KernelAndKextPatches->ForceKexts != NULL)) { INT32 i = 0; for (; i < Entry->KernelAndKextPatches->NrForceKexts; ++i) { - MsgLog(" Force kext: %s\n", Entry->KernelAndKextPatches->ForceKexts[i]); + MsgLog(" Force kext: %ls\n", Entry->KernelAndKextPatches->ForceKexts[i]); if (Entry->Volume && Entry->Volume->RootDir) { // Check if the entry is a directory if (StrStr(Entry->KernelAndKextPatches->ForceKexts[i], L".kext") == NULL) { @@ -398,7 +398,7 @@ EFI_STATUS LoadKexts(IN LOADER_ENTRY *Entry) continue; // skip this FileName = PoolPrint(L"%s\\%s", Entry->KernelAndKextPatches->ForceKexts[i], PlugInFile->FileName); // UnicodeSPrint(FileName, 512, L"%s\\%s", Entry->KernelAndKextPatches->ForceKexts[i], PlugInFile->FileName); - MsgLog(" Force kext: %s\n", FileName); + MsgLog(" Force kext: %ls\n", FileName); AddKext(Entry, Entry->Volume->RootDir, FileName, archCpuType); PlugIns = PoolPrint(L"%s\\Contents\\PlugIns", FileName); // UnicodeSPrint(PlugIns, 512, L"%s\\Contents\\PlugIns", FileName); @@ -420,7 +420,7 @@ EFI_STATUS LoadKexts(IN LOADER_ENTRY *Entry) CHAR16 UniOSVersion[16]; AsciiStrToUnicodeStrS(Entry->OSVersion, UniOSVersion, 16); - DBG("UniOSVersion == %s\n", UniOSVersion); + DBG("UniOSVersion == %ls\n", UniOSVersion); CHAR16 UniShortOSVersion[6]; CHAR8 ShortOSVersion[6]; @@ -432,8 +432,8 @@ EFI_STATUS LoadKexts(IN LOADER_ENTRY *Entry) AsciiStrnCpyS(ShortOSVersion, 6, Entry->OSVersion, 5); AsciiStrToUnicodeStrS(Entry->OSVersion, UniShortOSVersion, 6); } - DBG("ShortOSVersion == %a\n", ShortOSVersion); - DBG("UniShortOSVersion == %s\n", UniShortOSVersion); + DBG("ShortOSVersion == %s\n", ShortOSVersion); + DBG("UniShortOSVersion == %ls\n", UniShortOSVersion); // syscl - allow specific load inject kext // Clover/Kexts/Other is for general injection thus we need to scan both Other and OSVersion folder diff --git a/rEFIt_UEFI/Platform/kext_patcher.cpp b/rEFIt_UEFI/Platform/kext_patcher.cpp index c93cafe56..f4eae68fc 100644 --- a/rEFIt_UEFI/Platform/kext_patcher.cpp +++ b/rEFIt_UEFI/Platform/kext_patcher.cpp @@ -293,8 +293,8 @@ VOID ATIConnectorsPatchInit(LOADER_ENTRY *Entry) ATIConnectorsPatchInited = TRUE; - //DBG(L"Bundle1: %a\n", ATIKextBundleId[0]); - //DBG(L"Bundle2: %a\n", ATIKextBundleId[1]); + //DBG(L"Bundle1: %s\n", ATIKextBundleId[0]); + //DBG(L"Bundle2: %s\n", ATIKextBundleId[1]); //gBS->Stall(10000000); } @@ -1153,7 +1153,7 @@ UINT64 GetPlistHexValue(CONST CHAR8 *Plist, CONST CHAR8 *Key, CONST CHAR8 *Whole // search for Key Value = AsciiStrStr(Plist, Key); if (Value == NULL) { - //DBG(L"\nNo key: %a\n", Key); + //DBG(L"\nNo key: %s\n", Key); return 0; } @@ -1193,7 +1193,7 @@ UINT64 GetPlistHexValue(CONST CHAR8 *Plist, CONST CHAR8 *Key, CONST CHAR8 *Whole /* if (DbgCount < 3) { AsciiStrnCpy(Buffer, Value, sizeof(Buffer) - 1); - DBG(L"\nRef: '%a'\n", Buffer); + DBG(L"\nRef: '%s'\n", Buffer); } */ if (IDLen > 8) { @@ -1205,14 +1205,14 @@ UINT64 GetPlistHexValue(CONST CHAR8 *Plist, CONST CHAR8 *Key, CONST CHAR8 *Whole AsciiStrCatS(Buffer, 48, "\""); /* if (DbgCount < 3) { - DBG(L"Searching: '%a'\n", Buffer); + DBG(L"Searching: '%s'\n", Buffer); } */ // and search whole plist for ID IntTag = AsciiStrStr(WholePlist, Buffer); if (IntTag == NULL) { - DBG(L"\nNo %a\n", Buffer); + DBG(L"\nNo %s\n", Buffer); return 0; } @@ -1220,7 +1220,7 @@ UINT64 GetPlistHexValue(CONST CHAR8 *Plist, CONST CHAR8 *Key, CONST CHAR8 *Whole /* if (DbgCount < 3) { AsciiStrnCpy(Buffer, IntTag, sizeof(Buffer) - 1); - DBG(L"Found: '%a'\n", Buffer); + DBG(L"Found: '%s'\n", Buffer); } */ Value = AsciiStrStr(IntTag, ">"); @@ -1239,7 +1239,7 @@ UINT64 GetPlistHexValue(CONST CHAR8 *Plist, CONST CHAR8 *Key, CONST CHAR8 *Whole /* if (DbgCount < 3) { AsciiStrnCpy(Buffer, IntTag, sizeof(Buffer) - 1); - DBG(L"Found num: %x\n", NumValue); + DBG(L"Found num: %X\n", NumValue); gBS->Stall(10000000); } DbgCount++; @@ -1340,8 +1340,8 @@ VOID PatchPrelinkedKexts(LOADER_ENTRY *Entry) /*if (DbgCount < 3 || DbgCount == 100 || DbgCount == 101 || DbgCount == 102 ) { - DBG(L"\n\nKext: St = %x, Size = %x\n", KextAddr, KextSize); - DBG(L"Info: St = %p, End = %p\n%a\n", InfoPlistStart, InfoPlistEnd, InfoPlistStart); + DBG(L"\n\nKext: St = %X, Size = %X\n", KextAddr, KextSize); + DBG(L"Info: St = %p, End = %p\n%s\n", InfoPlistStart, InfoPlistEnd, InfoPlistStart); gBS->Stall(20000000); } */ @@ -1393,11 +1393,11 @@ VOID PatchLoadedKexts(LOADER_ENTRY *Entry) if (!EFI_ERROR(DTLookupEntry(NULL,"/chosen/memory-map", &MMEntry))) { if (!EFI_ERROR(DTCreatePropertyIterator(MMEntry, PropIter))) { while (!EFI_ERROR(DTIterateProperties(PropIter, &PropName))) { - //DBG(L"Prop: %a\n", PropName); + //DBG(L"Prop: %s\n", PropName); if (AsciiStrStr(PropName,"Driver-")) { // PropEntry _DeviceTreeBuffer is the value of Driver-XXXXXX property PropEntry = (_DeviceTreeBuffer*)(((UINT8*)PropIter->CurrentProperty) + sizeof(DeviceTreeNodeProperty)); - //if (DbgCount < 3) DBG(L"%a: paddr = %x, length = %x\n", PropName, PropEntry->paddr, PropEntry->length); + //if (DbgCount < 3) DBG(L"%s: paddr = %X, length = %X\n", PropName, PropEntry->paddr, PropEntry->length); // PropEntry->paddr points to _BooterKextFileInfo KextFileInfo = (_BooterKextFileInfo *)(UINTN)PropEntry->paddr; @@ -1419,7 +1419,7 @@ VOID PatchLoadedKexts(LOADER_ENTRY *Entry) } //if(AsciiStrStr(PropName,"DriversPackage-")!=0) //{ - // DBG(L"Found %a\n", PropName); + // DBG(L"Found %s\n", PropName); // break; //} } diff --git a/rEFIt_UEFI/Platform/nvidia.cpp b/rEFIt_UEFI/Platform/nvidia.cpp index 5a41d0d4a..497a4c585 100644 --- a/rEFIt_UEFI/Platform/nvidia.cpp +++ b/rEFIt_UEFI/Platform/nvidia.cpp @@ -1824,7 +1824,7 @@ static INT32 patch_nvidia_rom(UINT8 *rom) // DBG("patch_nvidia_rom\n"); if (!rom || (rom[0] != 0x55 && rom[1] != 0xaa)) { - DBG("FALSE ROM signature: 0x%02x%02x\n", rom[0], rom[1]); + DBG("FALSE ROM signature: 0x%02X%02X\n", rom[0], rom[1]); return PATCH_ROM_FAILED; } @@ -1835,7 +1835,7 @@ static INT32 patch_nvidia_rom(UINT8 *rom) return PATCH_ROM_FAILED; } // else - // DBG("dcb table at offset 0x%04x\n", dcbptr); + // DBG("dcb table at offset 0x%04X\n", dcbptr); dcbtable = &rom[dcbptr]; dcbtable_version = dcbtable[0]; @@ -1854,7 +1854,7 @@ static INT32 patch_nvidia_rom(UINT8 *rom) } if (sig != 0x4edcbdcb) { - DBG("Bad display config block signature (0x%8x)\n", sig); //Azi: issue #48 + DBG("Bad display config block signature (0x%8X)\n", sig); //Azi: issue #48 return PATCH_ROM_FAILED; } } else if (dcbtable_version >= 0x14) { /* some NV15/16, and NV11+ */ @@ -1865,7 +1865,7 @@ static INT32 patch_nvidia_rom(UINT8 *rom) recordlength = 10; if (AsciiStrCmp(sig, "DEV_REC")) { - DBG("Bad Display Configuration Block signature (%a)\n", sig); + DBG("Bad Display Configuration Block signature (%s)\n", sig); return PATCH_ROM_FAILED; } } else { @@ -2007,10 +2007,10 @@ static INT32 patch_nvidia_rom(UINT8 *rom) CONST CHAR8 *get_nvidia_model(UINT32 device_id, UINT32 subsys_id, CARDLIST * nvcard) { UINTN i, j; - //DBG("get_nvidia_model for (%08x, %08x)\n", device_id, subsys_id); + //DBG("get_nvidia_model for (%08X, %08X)\n", device_id, subsys_id); //ErmaC added selector for nVidia "old" style in System Profiler - //DBG("NvidiaGeneric = %s\n", gSettings.NvidiaGeneric?L"YES":L"NO"); + //DBG("NvidiaGeneric = %ls\n", gSettings.NvidiaGeneric?L"YES":L"NO"); if (gSettings.NvidiaGeneric == FALSE) { // First check in the plist, (for e.g this can override any hardcoded devices) //CARDLIST * nvcard = FindCardWithIds(device_id, subsys_id); @@ -2075,7 +2075,7 @@ static INT32 devprop_add_nvidia_template(DevPropDevice *device, INTN n_ports) for (pnum = 0; pnum < n_ports; pnum++) { AsciiSPrint(nkey, 24, "@%d,name", pnum); AsciiSPrint(nval, 24, "NVDA,Display-%c", (65+pnum)); - //DBG("Nvidia: insert [%a : %a]\n", nkey, nval); + //DBG("Nvidia: insert [%s : %s]\n", nkey, nval); devprop_add_value(device, nkey, (UINT8*)nval, 14); AsciiSPrint(nkey, 24, "@%d,compatible", pnum); @@ -2164,7 +2164,7 @@ UINT64 mem_detect(UINT16 nvCardType, pci_dt_t *nvda_dev) default: break; } - DBG("mem_detected %ldMb\n", (vram_size >> 20)); + DBG("mem_detected %lluMb\n", (vram_size >> 20)); return vram_size; } @@ -2258,13 +2258,13 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) UnicodeSPrint(FileName, 128, L"ROM\\10de_%04x_%04x_%04x.rom", nvda_dev->device_id, nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id); if (FileExists(OEMDir, FileName)) { - DBG("Found specific VBIOS ROM file (10de_%04x_%04x_%04x.rom)\n", nvda_dev->device_id, nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id); + DBG("Found specific VBIOS ROM file (10de_%04X_%04X_%04X.rom)\n", nvda_dev->device_id, nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id); Status = egLoadFile(OEMDir, FileName, &buffer, &bufferLen); } else { UnicodeSPrint(FileName, 128, L"ROM\\10de_%04x.rom", nvda_dev->device_id); if (FileExists(OEMDir, FileName)) { - DBG("Found generic VBIOS ROM file (10de_%04x.rom)\n", nvda_dev->device_id); + DBG("Found generic VBIOS ROM file (10de_%04X.rom)\n", nvda_dev->device_id); Status = egLoadFile(OEMDir, FileName, &buffer, &bufferLen); } @@ -2273,14 +2273,14 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) UnicodeSPrint(FileName, 128, L"\\EFI\\CLOVER\\ROM\\10de_%04x_%04x_%04x.rom", nvda_dev->device_id, nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id); if (EFI_ERROR(Status)) { if (FileExists(SelfRootDir, FileName)) { - DBG("Found specific VBIOS ROM file (10de_%04x_%04x_%04x.rom)\n", nvda_dev->device_id, nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id); + DBG("Found specific VBIOS ROM file (10de_%04X_%04X_%04X.rom)\n", nvda_dev->device_id, nvda_dev->subsys_id.subsys.vendor_id, nvda_dev->subsys_id.subsys.device_id); Status = egLoadFile(SelfRootDir, FileName, &buffer, &bufferLen); } else { UnicodeSPrint(FileName, 128, L"\\EFI\\CLOVER\\ROM\\10de_%04x.rom", nvda_dev->device_id); if (FileExists(SelfRootDir, FileName)) { - DBG("Found generic VBIOS ROM file (10de_%04x.rom)\n", nvda_dev->device_id); + DBG("Found generic VBIOS ROM file (10de_%04X.rom)\n", nvda_dev->device_id); Status = egLoadFile(SelfRootDir, FileName, &buffer, &bufferLen); } @@ -2293,7 +2293,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) // PRAMIN first read_nVidia_PRAMIN(nvda_dev, rom, nvCardType); - //DBG("%x%x\n", rom[0], rom[1]); + //DBG("%X%X\n", rom[0], rom[1]); rom_pci_header = NULL; if (rom[0] != 0x55 || rom[1] != 0xaa) { @@ -2312,9 +2312,9 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) //DBG("buffer->size: %d\n", bufferLen); i = 0; while (i < bufferLen) { - //DBG("%x%x\n", buffer[i], buffer[i+1]); + //DBG("%X%X\n", buffer[i], buffer[i+1]); if (buffer[i] == 0x55 && buffer[i+1] == 0xaa) { - DBG(" header found at: %d\n", i); + DBG(" header found at: %llu\n", i); bufferLen -= i; rom = (__typeof__(rom))AllocateZeroPool(bufferLen); for (j = 0; j < bufferLen; j++) { @@ -2349,7 +2349,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) // DBG(model); } } else { - DBG("nVidia incorrect PCI ROM signature: 0x%x\n", rom_pci_header->signature); + DBG("nVidia incorrect PCI ROM signature: 0x%X\n", rom_pci_header->signature); } // get bios version @@ -2377,7 +2377,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) *s1++ = *s++; } *s1 = 0; - DBG("version %a\n", version_str); + DBG("version %s\n", version_str); break; } } @@ -2389,8 +2389,8 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) AsciiSPrint(version_str, sizeof(version_str), "1.0"); } - DBG("nVidia %a ", model); - DBG(" %dMB NV%02x [%04x:%04x] :: %a => device #%d\n", (UINT32)(RShiftU64(videoRam, 20)), + DBG("nVidia %s ", model); + DBG(" %dMB NV%02X [%04X:%04X] :: %s => device #%d\n", (UINT32)(RShiftU64(videoRam, 20)), nvCardType, nvda_dev->vendor_id, nvda_dev->device_id, devicepath, devices_number); @@ -2405,13 +2405,13 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) DBG("Nvidia: VideoPorts:"); if (n_ports > 0) { - DBG(" user defined (GUI-menu): %d\n", n_ports); + DBG(" user defined (GUI-menu): %llu\n", n_ports); } else if (gSettings.VideoPorts > 0) { n_ports = gSettings.VideoPorts; - DBG(" user defined from config.plist: %d\n", n_ports); + DBG(" user defined from config.plist: %llu\n", n_ports); } else { n_ports = 2; //default - DBG(" undefined, default to: %d\n", n_ports); + DBG(" undefined, default to: %llu\n", n_ports); } if (gSettings.NvidiaNoEFI) { @@ -2432,13 +2432,13 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) Injected = TRUE; if (!gSettings.AddProperties[i].MenuItem.BValue) { - //DBG(" disabled property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" disabled property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } else { devprop_add_value(device, gSettings.AddProperties[i].Key, (UINT8*)gSettings.AddProperties[i].Value, gSettings.AddProperties[i].ValueLen); - //DBG(" added property Key: %a, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); + //DBG(" added property Key: %s, len: %d\n", gSettings.AddProperties[i].Key, gSettings.AddProperties[i].ValueLen); } } if (Injected) { @@ -2449,7 +2449,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) if (gSettings.FakeNVidia) { UINT32 FakeID = gSettings.FakeNVidia >> 16; - DBG("NVidia: FakeID %x:%x\n",gSettings.FakeNVidia & 0xFFFF, FakeID); + DBG("NVidia: FakeID %X:%X\n",gSettings.FakeNVidia & 0xFFFF, FakeID); devprop_add_value(device, "device-id", (UINT8*)&FakeID, 4); FakeID = gSettings.FakeNVidia & 0xFFFF; devprop_add_value(device, "vendor-id", (UINT8*)&FakeID, 4); @@ -2457,7 +2457,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) if (gSettings.NVCAP[0] != 0) { devprop_add_value(device, "NVCAP", &gSettings.NVCAP[0], NVCAP_LEN); - DBG("set NVCAP: %02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x-%02x%02x%02x%02x\n", + DBG("set NVCAP: %02X%02X%02X%02X-%02X%02X%02X%02X-%02X%02X%02X%02X-%02X%02X%02X%02X-%02X%02X%02X%02X\n", gSettings.NVCAP[0], gSettings.NVCAP[1], gSettings.NVCAP[2], gSettings.NVCAP[3], gSettings.NVCAP[4], gSettings.NVCAP[5], gSettings.NVCAP[6], gSettings.NVCAP[7], gSettings.NVCAP[8], gSettings.NVCAP[9], gSettings.NVCAP[10], gSettings.NVCAP[11], @@ -2487,7 +2487,7 @@ BOOLEAN setup_nvidia_devprop(pci_dt_t *nvda_dev) // if not set this is default property devprop_add_value(device, "@0,AAPL,boot-display", (UINT8*)&boot_display, 4); }/* else { - DBG("Nvidia: BootDisplay: %x\n", gSettings.BootDisplay); + DBG("Nvidia: BootDisplay: %X\n", gSettings.BootDisplay); }*/ if (gSettings.UseIntelHDMI) { diff --git a/rEFIt_UEFI/Platform/platformdata.cpp b/rEFIt_UEFI/Platform/platformdata.cpp index 4442b112d..f996154cb 100644 --- a/rEFIt_UEFI/Platform/platformdata.cpp +++ b/rEFIt_UEFI/Platform/platformdata.cpp @@ -1390,7 +1390,7 @@ VOID GetDefaultSettings() //gSettings.EnableISS = FALSE; //((gCPUStructure.CPUID[CPUID_1][ECX] & (1<<7)) != 0); gSettings.Turbo = gCPUStructure.Turbo; gSettings.SavingMode = 0xFF; //means not set - //MsgLog ("Turbo default value: %a\n", gCPUStructure.Turbo ? "Yes" : "No"); + //MsgLog ("Turbo default value: %s\n", gCPUStructure.Turbo ? "Yes" : "No"); //msr = AsmReadMsr64(MSR_IA32_MISC_ENABLE); //force enable EIST //msr |= (1<<16); diff --git a/rEFIt_UEFI/Platform/plist.cpp b/rEFIt_UEFI/Platform/plist.cpp index 438793dc8..0d6318967 100755 --- a/rEFIt_UEFI/Platform/plist.cpp +++ b/rEFIt_UEFI/Platform/plist.cpp @@ -334,7 +334,7 @@ EFI_STATUS XMLParseNextTag(CHAR8* buffer, TagPtr* tag, UINT32* lenPtr) Status = GetNextTag((UINT8*)buffer, &tagName, 0, &length); if (EFI_ERROR(Status)) { - DBG("NextTag error %r\n", Status); + DBG("NextTag error %s\n", strerror(Status)); return Status; } @@ -473,7 +473,7 @@ EFI_STATUS ParseTagList( CHAR8* buffer, TagPtr* tag, UINT32 type, UINT32 empty, while (TRUE) { Status = XMLParseNextTag(buffer + pos, &tmpTag, &length); if (EFI_ERROR(Status)) { - DBG("error XMLParseNextTag in array: %r\n", Status); + DBG("error XMLParseNextTag in array: %s\n", strerror(Status)); break; } @@ -533,7 +533,7 @@ EFI_STATUS ParseTagKey( char * buffer, TagPtr* tag, UINT32* lenPtr) TagPtr subTag = NULL; Status = FixDataMatchingTag(buffer, kXMLTagKey, &length); - DBG("fixing key len=%d status=%r\n", length, Status); + DBG("fixing key len=%d status=%s\n", length, strerror(Status)); if (EFI_ERROR(Status)){ return Status; } @@ -563,7 +563,7 @@ EFI_STATUS ParseTagKey( char * buffer, TagPtr* tag, UINT32* lenPtr) *tag = tmpTag; *lenPtr = length + length2; - DBG("parse key '%a' success len=%d\n", tmpString, *lenPtr); + DBG("parse key '%s' success len=%d\n", tmpString, *lenPtr); return EFI_SUCCESS; } @@ -602,7 +602,7 @@ EFI_STATUS ParseTagString(CHAR8* buffer, TagPtr * tag,UINT32* lenPtr) tmpTag->offset = (UINT32)(buffer_start ? buffer - buffer_start: 0); *tag = tmpTag; *lenPtr = length; - DBG(" parse string %a\n", tmpString); + DBG(" parse string %s\n", tmpString); return EFI_SUCCESS; } @@ -655,7 +655,7 @@ EFI_STATUS ParseTagInteger(CHAR8* buffer, TagPtr * tag,UINT32* lenPtr) integer = (integer * 16) + (*val++ - 'a' + 10); } else { - MsgLog("ParseTagInteger hex error (0x%x) in buffer %a\n", *val, buffer); + MsgLog("ParseTagInteger hex error (0x%X) in buffer %s\n", *val, buffer); // getchar(); FreeTag(tmpTag); return EFI_UNSUPPORTED; @@ -672,7 +672,7 @@ EFI_STATUS ParseTagInteger(CHAR8* buffer, TagPtr * tag,UINT32* lenPtr) for (integer = 0; size > 0; size--) { if(*val) { // UGLY HACK, fix me. if (*val < '0' || *val > '9') { - MsgLog("ParseTagInteger decimal error (0x%x) in buffer %a\n", *val, buffer); + MsgLog("ParseTagInteger decimal error (0x%X) in buffer %s\n", *val, buffer); // getchar(); FreeTag(tmpTag); return EFI_UNSUPPORTED; diff --git a/rEFIt_UEFI/Platform/smbios.cpp b/rEFIt_UEFI/Platform/smbios.cpp index b98028f22..18c08ad86 100644 --- a/rEFIt_UEFI/Platform/smbios.cpp +++ b/rEFIt_UEFI/Platform/smbios.cpp @@ -741,7 +741,7 @@ VOID PatchTableType4() CopyMem(BrandStr, gCPUStructure.BrandString, 48); BrandStr[47] = '\0'; - // DBG("BrandString=%a\n", BrandStr); + // DBG("BrandString=%s\n", BrandStr); for (CpuNumber = 0; CpuNumber < gCPUStructure.Cores; CpuNumber++) { // Get Table Type4 SmbiosTable = GetSmbiosTableFromType (EntryPoint, EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION, CpuNumber); @@ -935,12 +935,12 @@ VOID PatchTableType6() mInstalled[Index] = 0; } else mInstalled[Index] = 4096ULL * (1024ULL * 1024ULL); - MsgLog("Table 6 MEMORY_MODULE %d Installed %x ", Index, mInstalled[Index]); + MsgLog("Table 6 MEMORY_MODULE %llu Installed %llX ", Index, mInstalled[Index]); if (SizeField >= 0x7D) { mEnabled[Index] = 0; } else mEnabled[Index] = LShiftU64(1ULL, 20 + ((UINT8)SmbiosTable.Type6->EnabledSize.InstalledOrEnabledSize & 0x7F)); - MsgLog("... enabled %x \n", mEnabled[Index]); + MsgLog("... enabled %llX \n", mEnabled[Index]); LogSmbiosTable(SmbiosTable); } @@ -1052,7 +1052,7 @@ VOID PatchTableType9() // Dev = SlotDevices[Index].DevFuncNum >> 3; Func = SlotDevices[Index].DevFuncNum & 7; - DBG("insert table 9 for dev %x:%x\n", Dev, Func); + DBG("insert table 9 for dev %llX:%llX\n", Dev, Func); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type9->SlotDesignation, SlotDevices[Index].SlotName); LogSmbiosTable(newSmbiosTable); } @@ -1130,7 +1130,7 @@ VOID GetTableType16() // DBG("SmbiosTable: Type 16 (Physical Memory Array) not found!\n"); continue; } - DBG("Type 16 Index = %d\n", Index); + DBG("Type 16 Index = %llu\n", Index); TotalCount += SmbiosTable.Type16->NumberOfMemoryDevices; } if (!TotalCount) { @@ -1183,7 +1183,7 @@ VOID GetTableType17() // DBG("SmbiosTable: Type 17 (Memory Device number %d) not found!\n", Index); continue; } - DBG("Type 17 Index = %d\n", Index); + DBG("Type 17 Index = %llu\n", Index); //gDMI->CntMemorySlots++; if (SmbiosTable.Type17->MemoryErrorInformationHandle < 0xFFFE) { DBG("Table has error information, checking\n"); //why skipping? @@ -1200,7 +1200,7 @@ VOID GetTableType17() } if (newSmbiosTable.Type18->Hdr.Handle == SmbiosTable.Type17->MemoryErrorInformationHandle) { Found = TRUE; - DBG("Found memory information in table 18/%d, type=0x%x, operation=0x%x syndrome=0x%x\n", Index2, + DBG("Found memory information in table 18/%lld, type=0x%X, operation=0x%X syndrome=0x%X\n", Index2, newSmbiosTable.Type18->ErrorType, newSmbiosTable.Type18->ErrorOperation, newSmbiosTable.Type18->VendorSyndrome); @@ -1258,10 +1258,10 @@ VOID GetTableType17() // DBG("gDMI->MemoryModules = %d\n", gDMI->MemoryModules) DBG("SmbiosTable.Type17->Speed = %dMHz\n", gRAM.SMBIOS[Index].Frequency); DBG("SmbiosTable.Type17->Size = %dMB\n", gRAM.SMBIOS[Index].ModuleSize); - DBG("SmbiosTable.Type17->Bank/Device = %a %a\n", GetSmbiosString(SmbiosTable, SmbiosTable.Type17->BankLocator), GetSmbiosString(SmbiosTable, SmbiosTable.Type17->DeviceLocator)); - DBG("SmbiosTable.Type17->Vendor = %a\n", gRAM.SMBIOS[Index].Vendor); - DBG("SmbiosTable.Type17->SerialNumber = %a\n", gRAM.SMBIOS[Index].SerialNo); - DBG("SmbiosTable.Type17->PartNumber = %a\n", gRAM.SMBIOS[Index].PartNo); + DBG("SmbiosTable.Type17->Bank/Device = %s %s\n", GetSmbiosString(SmbiosTable, SmbiosTable.Type17->BankLocator), GetSmbiosString(SmbiosTable, SmbiosTable.Type17->DeviceLocator)); + DBG("SmbiosTable.Type17->Vendor = %s\n", gRAM.SMBIOS[Index].Vendor); + DBG("SmbiosTable.Type17->SerialNumber = %s\n", gRAM.SMBIOS[Index].SerialNo); + DBG("SmbiosTable.Type17->PartNumber = %s\n", gRAM.SMBIOS[Index].PartNo); /* if ((SmbiosTable.Type17->Size & 0x8000) == 0) { @@ -1382,12 +1382,12 @@ VOID PatchTableType17() (newSmbiosTable.Type17->MemoryType != MemoryTypeDdr)) { newSmbiosTable.Type17->MemoryType = MemoryTypeDdr3; } - DBG("%a %a %dMHz %dMB(Ext:%dMB)\n", bankLocator, deviceLocator, newSmbiosTable.Type17->Speed, + DBG("%s %s %dMHz %dMB(Ext:%dMB)\n", bankLocator, deviceLocator, newSmbiosTable.Type17->Speed, newSmbiosTable.Type17->Size, newSmbiosTable.Type17->ExtendedSize); mMemory17[gRAMCount] = (UINT16)mTotalSystemMemory; // DBG("mTotalSystemMemory = %d\n", mTotalSystemMemory); } else { - DBG("%a %a EMPTY\n", bankLocator, deviceLocator); + DBG("%s %s EMPTY\n", bankLocator, deviceLocator); } newSmbiosTable.Type17->MemoryErrorInformationHandle = 0xFFFF; mHandle17[gRAMCount++] = LogSmbiosTable(newSmbiosTable); @@ -1601,7 +1601,7 @@ VOID PatchTableType17() if (iStrLen(gRAM.SMBIOS[SMBIOSIndex].PartNo, 64) > 0) { UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->PartNumber, gRAM.SMBIOS[SMBIOSIndex].PartNo); AsciiSPrint(gSettings.MemoryPartNumber, 64, "%a", gRAM.SMBIOS[SMBIOSIndex].PartNo); - DBG(" partNum=%a\n", gRAM.SMBIOS[SMBIOSIndex].PartNo); + DBG(" partNum=%s\n", gRAM.SMBIOS[SMBIOSIndex].PartNo); } else { // newSmbiosTable.Type17->PartNumber = 0; CHAR8 unknown[] = "unknown"; @@ -1668,7 +1668,7 @@ VOID PatchTableType17() if (trustSMBIOS && gRAM.SMBIOS[SMBIOSIndex].InUse && (iStrLen(gRAM.SMBIOS[SMBIOSIndex].Vendor, 64) > 0) && (AsciiStrnCmp(gRAM.SPD[SPDIndex].Vendor, "NoName", 6) == 0)) { - DBG("Type17->Manufacturer corrected by SMBIOS from NoName to %a\n", gRAM.SMBIOS[SMBIOSIndex].Vendor); + DBG("Type17->Manufacturer corrected by SMBIOS from NoName to %s\n", gRAM.SMBIOS[SMBIOSIndex].Vendor); CHAR8* vendor = (CHAR8*)AllocatePool(AsciiStrLen(gRAM.SMBIOS[SMBIOSIndex].Vendor)+1); // this will never be freed. WIll be solved when using a string object. AsciiStrCpyS(vendor, 64, gRAM.SMBIOS[SMBIOSIndex].Vendor); UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->Manufacturer, vendor); @@ -1698,13 +1698,13 @@ VOID PatchTableType17() } else { UpdateSmbiosString(newSmbiosTable, &newSmbiosTable.Type17->BankLocator, (CHAR8*)&bankLocator[0]); } - DBG("SMBIOS Type 17 Index = %d => %d %d:\n", gRAMCount, SMBIOSIndex, SPDIndex); + DBG("SMBIOS Type 17 Index = %d => %llu %llu:\n", gRAMCount, SMBIOSIndex, SPDIndex); if (newSmbiosTable.Type17->Size == 0) { - DBG("%a %a EMPTY\n", bankLocator, deviceLocator); + DBG("%s %s EMPTY\n", bankLocator, deviceLocator); newSmbiosTable.Type17->MemoryType = 0; //MemoryTypeUnknown; } else { insertingEmpty = FALSE; - DBG("%a %a %dMHz %dMB(Ext:%dMB)\n", bankLocator, deviceLocator, newSmbiosTable.Type17->Speed, + DBG("%s %s %dMHz %dMB(Ext:%dMB)\n", bankLocator, deviceLocator, newSmbiosTable.Type17->Speed, newSmbiosTable.Type17->Size, newSmbiosTable.Type17->ExtendedSize); if (newSmbiosTable.Type17->Size == 0x7FFF) { mTotalSystemMemory += newSmbiosTable.Type17->ExtendedSize; //Mb @@ -1796,9 +1796,9 @@ VOID PatchTableType20 () newSmbiosTable.Type20->MemoryDeviceHandle = mHandle17[j]; k = newSmbiosTable.Type20->EndingAddress; m += mMemory17[j]; - DBG("Type20[%d]->End = 0x%x, Type17[%d] = 0x%x\n", + DBG("Type20[%llu]->End = 0x%llX, Type17[%llu] = %llX\n", Index, k, j, m); - // DBG(" MemoryDeviceHandle = 0x%x\n", newSmbiosTable.Type20->MemoryDeviceHandle); + // DBG(" MemoryDeviceHandle = 0x%X\n", newSmbiosTable.Type20->MemoryDeviceHandle); mMemory17[j] = 0; // used break; } @@ -1902,8 +1902,8 @@ VOID PatchTableType131() // Get Table Type131 SmbiosTable = GetSmbiosTableFromType (EntryPoint, 131, 0); if (SmbiosTable.Raw != NULL) { - MsgLog("Table 131 is present, CPUType=%x\n", SmbiosTable.Type131->ProcessorType); - MsgLog("Change to: %x\n", gSettings.CpuType); + MsgLog("Table 131 is present, CPUType=%X\n", SmbiosTable.Type131->ProcessorType); + MsgLog("Change to: %X\n", gSettings.CpuType); } ZeroMem((VOID*)newSmbiosTable.Type131, MAX_TABLE_SIZE); @@ -1926,8 +1926,8 @@ VOID PatchTableType132() // Get Table Type132 SmbiosTable = GetSmbiosTableFromType (EntryPoint, 132, 0); if (SmbiosTable.Raw != NULL) { - MsgLog("Table 132 is present, QPI=%x\n", SmbiosTable.Type132->ProcessorBusSpeed); - MsgLog("Change to: %x\n", gSettings.QPI); + MsgLog("Table 132 is present, QPI=%X\n", SmbiosTable.Type132->ProcessorBusSpeed); + MsgLog("Change to: %X\n", gSettings.QPI); } ZeroMem((VOID*)newSmbiosTable.Type132, MAX_TABLE_SIZE); @@ -1954,8 +1954,8 @@ VOID PatchTableType133() // Get Table Type133 SmbiosTable = GetSmbiosTableFromType (EntryPoint, 133, 0); if (SmbiosTable.Raw != NULL) { - MsgLog("Table 133 is present, PlatformFeature=%x\n", SmbiosTable.Type133->PlatformFeature); - MsgLog("Change to: %x\n", gPlatformFeature); + MsgLog("Table 133 is present, PlatformFeature=%llX\n", SmbiosTable.Type133->PlatformFeature); + MsgLog("Change to: %llX\n", gPlatformFeature); } ZeroMem((VOID*)newSmbiosTable.Type133, MAX_TABLE_SIZE); newSmbiosTable.Type133->Hdr.Type = 133; @@ -1978,7 +1978,7 @@ EFI_STATUS PrepatchSmbios() // Get SMBIOS Tables Smbios = FindOemSMBIOSPtr(); // DBG("OEM SMBIOS EPS=%p\n", Smbios); - // DBG("OEM Tables = %x\n", ((SMBIOS_TABLE_ENTRY_POINT*)Smbios)->TableAddress); + // DBG("OEM Tables = %X\n", ((SMBIOS_TABLE_ENTRY_POINT*)Smbios)->TableAddress); if (!Smbios) { Status = EFI_NOT_FOUND; // DBG("Original SMBIOS System Table not found! Getting from Hob...\n"); @@ -2055,7 +2055,7 @@ EFI_STATUS PrepatchSmbios() GetTableType16(); GetTableType17(); GetTableType32(); //get BootStatus here to decide what to do - MsgLog("Boot status=%x\n", gBootStatus); + MsgLog("Boot status=%X\n", gBootStatus); //for example the bootloader may go to Recovery is BootStatus is Fail return Status; } diff --git a/rEFIt_UEFI/Platform/spd.cpp b/rEFIt_UEFI/Platform/spd.cpp index efb2f0492..cc642c21c 100644 --- a/rEFIt_UEFI/Platform/spd.cpp +++ b/rEFIt_UEFI/Platform/spd.cpp @@ -624,7 +624,7 @@ STATIC VOID read_smb(EFI_PCI_IO_PROTOCOL *PciIo, UINT16 vid, UINT16 did) &Command ); - DBG("SMBus CmdReg: 0x%x\n", Command); + DBG("SMBus CmdReg: 0x%X\n", Command); /*Status = */PciIo->Pci.Read ( PciIo, @@ -665,7 +665,7 @@ STATIC VOID read_smb(EFI_PCI_IO_PROTOCOL *PciIo, UINT16 vid, UINT16 did) ); - MsgLog("Scanning SMBus [%04x:%04x], mmio: 0x%x, ioport: 0x%x, hostc: 0x%x\n", + MsgLog("Scanning SMBus [%04X:%04X], mmio: 0x%X, ioport: 0x%X, hostc: 0x%X\n", vid, did, mmio, base, hostc); // needed at least for laptops @@ -691,13 +691,13 @@ STATIC VOID read_smb(EFI_PCI_IO_PROTOCOL *PciIo, UINT16 vid, UINT16 did) } else if (spdbuf[SPD_MEMORY_TYPE] == 0) { // First 0x40 bytes of DDR4 spd second page is 0. Maybe we need to change page, so do that and retry. - DBG("SPD[%d]: Got invalid type %d @0x%x. Will set page and retry.\n", i, spdbuf[SPD_MEMORY_TYPE], 0x50 + i); + DBG("SPD[%d]: Got invalid type %d @0x%X. Will set page and retry.\n", i, spdbuf[SPD_MEMORY_TYPE], 0x50 + i); smbPage = 0xFF; // force page to be set READ_SPD(spdbuf, base, i, SPD_MEMORY_TYPE); } // Copy spd data into buffer - DBG("SPD[%d]: Type %d @0x%x\n", i, spdbuf[SPD_MEMORY_TYPE], 0x50 + i); + DBG("SPD[%d]: Type %d @0x%X\n", i, spdbuf[SPD_MEMORY_TYPE], 0x50 + i); switch (spdbuf[SPD_MEMORY_TYPE]) { case SPD_MEMORY_TYPE_SDRAM_DDR: init_spd(spd_indexes_ddr, spdbuf, base, i); @@ -835,7 +835,7 @@ STATIC VOID read_smb(EFI_PCI_IO_PROTOCOL *PciIo, UINT16 vid, UINT16 did) } #endif - MsgLog("Slot: %d Type %d %dMB %dMHz Vendor=%a PartNo=%a SerialNo=%a\n", + MsgLog("Slot: %d Type %d %dMB %dMHz Vendor=%s PartNo=%s SerialNo=%s\n", i, (int)gRAM.SPD[i].Type, gRAM.SPD[i].ModuleSize, @@ -898,7 +898,7 @@ VOID ScanSPD() //SmBus controller has class = 0x0c0500 if ((gPci.Hdr.ClassCode[2] == 0x0c) && (gPci.Hdr.ClassCode[1] == 5) && (gPci.Hdr.ClassCode[0] == 0) && (gPci.Hdr.VendorId == 0x8086 || gPci.Hdr.VendorId == 0x10DE)) { - DBG ("SMBus device : %04x %04x class=%02x%02x%02x status=%r\n", + DBG ("SMBus device : %04X %04X class=%02X%02X%02X status=%r\n", gPci.Hdr.VendorId, gPci.Hdr.DeviceId, gPci.Hdr.ClassCode[2], diff --git a/rEFIt_UEFI/Platform/usbfix.cpp b/rEFIt_UEFI/Platform/usbfix.cpp index cad046a71..53fe95ccf 100644 --- a/rEFIt_UEFI/Platform/usbfix.cpp +++ b/rEFIt_UEFI/Platform/usbfix.cpp @@ -106,7 +106,7 @@ FixOwnership(VOID) Base = 0; Status = PciIo->Pci.Read(PciIo, EfiPciIoWidthUint32, 0x20, 1, &Base); PortBase = (Base >> 5) & 0x07ff; - DBG("USB UHCI Base=%x PortBase=%x\n", Base, PortBase); + DBG("USB UHCI Base=%X PortBase=%X\n", Base, PortBase); Command = 0x8f00; Status = PciIo->Pci.Write (PciIo, EfiPciIoWidthUint16, 0xC0, 1, &Command); if (PortBase) { @@ -117,7 +117,7 @@ FixOwnership(VOID) IoWrite16 (PortBase, 0); } - MsgLog("USB UHCI reset for device %04x\n", Pci.Hdr.DeviceId); + MsgLog("USB UHCI reset for device %04X\n", Pci.Hdr.DeviceId); break; /* case PCI_IF_OHCI: @@ -127,7 +127,7 @@ FixOwnership(VOID) Command = *(UINT32 *)(UINTN)(Base + OHCI_CONTROL); *(UINT32 *)(UINTN)(Base + OHCI_CONTROL) = Command & OHCI_CTRL_MASK; Command = *(UINT32 *)(UINTN)(Base + OHCI_CONTROL); - MsgLog("USB OHCI reset for device %04x control=0x%x\n", Pci.Hdr.DeviceId, Command); + MsgLog("USB OHCI reset for device %04X control=0x%X\n", Pci.Hdr.DeviceId, Command); break;*/ case PCI_IF_EHCI: //Slice - the algo is reworked from Chameleon @@ -159,13 +159,13 @@ FixOwnership(VOID) ); ExtendCap = (HcCapParams >> 8) & 0xFF; - DBG("Base=%x Oper=%x eecp=%x\n", Base, opaddr, ExtendCap); + DBG("Base=%X Oper=%X eecp=%X\n", Base, opaddr, ExtendCap); 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); + DBG("usbcmd=%08X usbsts=%08X usbintr=%08X\n", usbcmd, usbsts, usbintr); // read PCI Config 32bit USBLEGSUP (eecp+0) Status = PciIo->Pci.Read(PciIo, EfiPciIoWidthUint32, ExtendCap, 1, &usblegsup); @@ -176,7 +176,7 @@ FixOwnership(VOID) // read PCI Config 32bit USBLEGCTLSTS (eecp+4) PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, ExtendCap + 0x4, 1, &usblegctlsts); - DBG("usblegsup=%08x isOSowned=%d isBIOSowned=%d usblegctlsts=%08x\n", usblegsup, isOSowned, isBIOSowned, usblegctlsts); + DBG("usblegsup=%08X isOSowned=%d isBIOSowned=%d usblegctlsts=%08X\n", usblegsup, isOSowned, isBIOSowned, usblegctlsts); // // Disable the SMI in USBLEGCTLSTS firstly // @@ -191,7 +191,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); + DBG("usbcmd=%08X usbsts=%08X usbintr=%08X\n", usbcmd, usbsts, usbintr); // clear registers to default usbcmd = (usbcmd & 0xffffff00); @@ -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); + DBG("usbcmd=%08X usbsts=%08X usbintr=%08X\n", usbcmd, usbsts, usbintr); // read 32bit USBLEGSUP (eecp+0) PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, ExtendCap, 1, &usblegsup); @@ -216,7 +216,7 @@ FixOwnership(VOID) // read 32bit USBLEGCTLSTS (eecp+4) PciIo->Pci.Read (PciIo, EfiPciIoWidthUint32, ExtendCap + 0x4, 1, &usblegctlsts); - DBG("usblegsup=%08x isOSowned=%d isBIOSowned=%d usblegctlsts=%08x\n", usblegsup, isOSowned, isBIOSowned, usblegctlsts); + DBG("usblegsup=%08X isOSowned=%d isBIOSowned=%d usblegctlsts=%08X\n", usblegsup, isOSowned, isBIOSowned, usblegctlsts); MsgLog("Legacy USB Off Done\n"); @@ -282,7 +282,7 @@ FixOwnership(VOID) Status = EFI_NOT_FOUND; //Slice - why? :) break; } - MsgLog("USB EHCI Ownership for device %04x value=%x\n", Pci.Hdr.DeviceId, Value); + MsgLog("USB EHCI Ownership for device %04X value=%X\n", Pci.Hdr.DeviceId, Value); break; case PCI_IF_XHCI: diff --git a/rEFIt_UEFI/cpp_foundation/XStringW.cpp b/rEFIt_UEFI/cpp_foundation/XStringW.cpp index 136ba6a9f..436400f97 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringW.cpp +++ b/rEFIt_UEFI/cpp_foundation/XStringW.cpp @@ -52,7 +52,7 @@ DBG("Construteur\n"); XStringW::XStringW(const XStringW &aString) { -DBG("Constructor(const XStringW &aString) : %s\n", aString.data()); +DBG("Constructor(const XStringW &aString) : %ls\n", aString.data()); Init(aString.length()); StrnCpy(aString.data(), aString.length()); } @@ -63,14 +63,14 @@ DBG("Constructor(const XStringW &aString) : %s\n", aString.data()); // DebugLog(2, "XStringW(const wchar_t *S) called with NULL. Use setEmpty()\n"); // panic(); // } -//DBG("Constructor(const wchar_t *S) : %s, StrLen(S)=%d\n", S, StrLen(S)); +//DBG("Constructor(const wchar_t *S) : %ls, StrLen(S)=%d\n", S, StrLen(S)); // Init(StrLen(S)); // StrCpy(S); //} // //XStringW::XStringW(const wchar_t *S, UINTN count) //{ -//DBG("Constructor(const wchar_t *S, UINTN count) : %s, %d\n", S, count); +//DBG("Constructor(const wchar_t *S, UINTN count) : %ls, %d\n", S, count); // Init(count); // StrnCpy(S, count); //} @@ -124,7 +124,7 @@ const XStringW& XStringW::takeValueFrom(const char* S) XStringW::~XStringW() { -DBG("Destructor :%s\n", data()); +DBG("Destructor :%ls\n", data()); free((void*)m_data); } diff --git a/rEFIt_UEFI/cpp_foundation/XStringWP.cpp b/rEFIt_UEFI/cpp_foundation/XStringWP.cpp index d789f4628..d3185990c 100755 --- a/rEFIt_UEFI/cpp_foundation/XStringWP.cpp +++ b/rEFIt_UEFI/cpp_foundation/XStringWP.cpp @@ -35,7 +35,7 @@ XStringWP::XStringWP(const wchar_t *S) DebugLog(2, "XStringWP(const wchar_t *S) called with NULL. Use setEmpty()\n"); panic(); } -DBG("Constructor(const wchar_t *S) : %s, StrLen(S)=%d\n", S, StrLen(S)); +DBG("Constructor(const wchar_t *S) : %ls, StrLen(S)=%d\n", S, StrLen(S)); Init(wcslen(S)); StrCpy(S); } diff --git a/rEFIt_UEFI/cpp_foundation/XUINTN.cpp b/rEFIt_UEFI/cpp_foundation/XUINTN.cpp index c1aea7bda..4d98a9cc9 100755 --- a/rEFIt_UEFI/cpp_foundation/XUINTN.cpp +++ b/rEFIt_UEFI/cpp_foundation/XUINTN.cpp @@ -29,7 +29,7 @@ // //XStringW::XStringW(const XStringW &aString) //{ -//DBG("Constructor(const XStringW &aString) : %s\n", aString.data()); +//DBG("Constructor(const XStringW &aString) : %ls\n", aString.data()); // Init(aString.length()); // StrnCpy(aString.data(), aString.length()); //} @@ -40,14 +40,14 @@ //// DebugLog(2, "XStringW(const wchar_t *S) called with NULL. Use setEmpty()\n"); //// panic(); //// } -////DBG("Constructor(const wchar_t *S) : %s, StrLen(S)=%d\n", S, StrLen(S)); +////DBG("Constructor(const wchar_t *S) : %ls, StrLen(S)=%d\n", S, StrLen(S)); //// Init(StrLen(S)); //// StrCpy(S); ////} //// ////XStringW::XStringW(const wchar_t *S, UINTN count) ////{ -////DBG("Constructor(const wchar_t *S, UINTN count) : %s, %d\n", S, count); +////DBG("Constructor(const wchar_t *S, UINTN count) : %ls, %d\n", S, count); //// Init(count); //// StrnCpy(S, count); ////} diff --git a/rEFIt_UEFI/cpp_unit_test/XString_test.cpp b/rEFIt_UEFI/cpp_unit_test/XString_test.cpp index a0032c24b..b12ea2624 100755 --- a/rEFIt_UEFI/cpp_unit_test/XString_test.cpp +++ b/rEFIt_UEFI/cpp_unit_test/XString_test.cpp @@ -121,17 +121,17 @@ int XString_tests() str3.takeValueFrom(L"Выход"); if ( str3 != "Выход" ) return 500; #endif -//MsgLog("Test MsgLog ascii=%s ucs-2=%s\n", "a string", L"ascii char in ucs-2 string\n"); -//MsgLog("Test MsgLog ascii=%s ucs-2=%s\n", "a string", "ascii char in ucs-2 string\n"); -//MsgLog("Test MsgLog ascii=%s ucs-2=%s\n", "a string", "ascii char in ucs-2 string\n"); +//MsgLog("Test MsgLog ascii=%ls ucs-2=%ls\n", "a string", L"ascii char in ucs-2 string\n"); +//MsgLog("Test MsgLog ascii=%ls ucs-2=%ls\n", "a string", "ascii char in ucs-2 string\n"); +//MsgLog("Test MsgLog ascii=%ls ucs-2=%ls\n", "a string", "ascii char in ucs-2 string\n"); // -//MsgLog("Test MsgLog ascii=%s ucs-2=%s\n", "a string", L"Выход из подменю, обновление главного меню\n"); -//MsgLog("Test MsgLog ascii=%s ucs-2=%s\n", "a string", "Выход из подменю, обновление главного меню\n"); -//MsgLog("Test MsgLog ascii=%s ucs-2=%s\n", "a string", "Выход из подменю, обновление главного меню\n"); +//MsgLog("Test MsgLog ascii=%ls ucs-2=%ls\n", "a string", L"Выход из подменю, обновление главного меню\n"); +//MsgLog("Test MsgLog ascii=%ls ucs-2=%ls\n", "a string", "Выход из подменю, обновление главного меню\n"); +//MsgLog("Test MsgLog ascii=%ls ucs-2=%ls\n", "a string", "Выход из подменю, обновление главного меню\n"); // -//DBG("Test ascii=%s ucs-2=%s\n", "a string", L"Выход из подменю, обновление главного меню\n"); -//DBG("Test ascii=%s ucs-2=%s\n", "a string", "Выход из подменю, обновление главного меню\n"); -//DBG("Test ascii=%s ucs-2=%s\n", "a string", "Выход из подменю, обновление главного меню\n"); +//DBG("Test ascii=%ls ucs-2=%ls\n", "a string", L"Выход из подменю, обновление главного меню\n"); +//DBG("Test ascii=%ls ucs-2=%ls\n", "a string", "Выход из подменю, обновление главного меню\n"); +//DBG("Test ascii=%ls ucs-2=%ls\n", "a string", "Выход из подменю, обновление главного меню\n"); return 0; } diff --git a/rEFIt_UEFI/cpp_unit_test/all_tests.cpp b/rEFIt_UEFI/cpp_unit_test/all_tests.cpp index 30612e385..11b43eb3d 100644 --- a/rEFIt_UEFI/cpp_unit_test/all_tests.cpp +++ b/rEFIt_UEFI/cpp_unit_test/all_tests.cpp @@ -14,12 +14,26 @@ #include "strlen_test.h" #include // Only use angled for Platform, else, xcode project won't compile #include "printf_lite-test.h" +#include "poolprint-test.h" +#include "printlib-test.h" bool all_tests() { bool all_ok = true; int ret; +#ifdef JIEF_DEBUG + ret = printlib_tests(); + if ( ret != 0 ) { + DebugLog(2, "printf_lite_tests() failed at test %d\n", ret); + all_ok = false; + } + ret = poolprint_tests(); + if ( ret != 0 ) { + DebugLog(2, "printf_lite_tests() failed at test %d\n", ret); + all_ok = false; + } +#endif ret = printf_lite_tests(); if ( ret != 0 ) { DebugLog(2, "printf_lite_tests() failed at test %d\n", ret); diff --git a/rEFIt_UEFI/cpp_unit_test/poolprint-test-cpp_conf.h b/rEFIt_UEFI/cpp_unit_test/poolprint-test-cpp_conf.h new file mode 100644 index 000000000..ff8429ed5 --- /dev/null +++ b/rEFIt_UEFI/cpp_unit_test/poolprint-test-cpp_conf.h @@ -0,0 +1,13 @@ + +#include "../../Include/Library/printf_lite.h" +#define F(x) x +#define LF(x) L##x +#define PRIF "%a" +#define PRILF "%s" + +#define loggf(...) DebugLog(2, __VA_ARGS__) +//#define loggf(...) printf(__VA_ARGS__) + +#define DISPLAY_ONLY_FAILED +//#define DISPLAY_START_INFO + diff --git a/rEFIt_UEFI/cpp_unit_test/poolprint-test.cpp b/rEFIt_UEFI/cpp_unit_test/poolprint-test.cpp new file mode 100644 index 000000000..6206fff6c --- /dev/null +++ b/rEFIt_UEFI/cpp_unit_test/poolprint-test.cpp @@ -0,0 +1,251 @@ +// +// main.cpp +// Printf-UnitTests +// +// Created by Jief on 29/08/17. +// Copyright © 2017 Jief. All rights reserved. +// + +#include +#include +#include "unicode_conversions.h" +#include "poolprint-test-cpp_conf.h" +#include "poolprint-test.h" + +static int nbTestFailed = 0; +#ifdef DISPLAY_ONLY_FAILED +static bool displayOnlyFailed = true; +#else +static bool displayOnlyFailed = false; +#endif + +/* + * Print wchar string as a utf8 string. + * This eliminate all problems about wprintf and compilation with short-wchar or long-wchar I had on macOs (2020-03) + */ +static void print_wchar_string(const wchar_t* s) +{ +// char utf8[wchar_len(s)*4+1]; +// some compiler doesn't like variable length array. +// use a fixed length instead. + char utf8[200]; + utf8_string_from_wchar_string(utf8, sizeof(utf8), s); + if ( strlen(utf8) > sizeof(utf8)-2 ) { + loggf("fixed size buf not big enough"); + abort(); + } + loggf("%s", utf8); +} + + +VOID +EFIAPI +_PoolCatPrint ( + IN CONST CHAR16 *fmt, + IN VA_LIST args, + IN OUT POOL_PRINT *spc, + IN EFI_STATUS + (EFIAPI + *Output) + ( + POOL_PRINT *context, + CHAR16 *str + ) + ); + +static int testWPrintf(const char* label, const wchar_t* expectResult, int expectedRet, const wchar_t* format, ...) /*__attribute__((format(printf, 4, 5)))*/; + +static int testWPrintf(const char* label, const wchar_t* expectResult, int expectedRet, const wchar_t* format, ...) +{ + POOL_PRINT spc; + + ZeroMem (&spc, sizeof (spc)); + + va_list valist; + va_start(valist, format); +// int vsnwprintf_ret = PRINTF_FUNCTION_NAME(PRINTF_CFUNCTION_PREFIX, vsnwprint, PRINTF_CFUNCTION_SUFFIX)(wbuf, sizeof(wbuf)/sizeof(wchar_t), format, valist); + _PoolCatPrint (format, valist, &spc, _PoolPrint); + wchar_t* wbuf = spc.Str; + va_end(valist); +//delay_ms(10); + if ( memcmp(wbuf, expectResult, wchar_len(expectResult)*sizeof(expectResult[0])) != 0 ) { +// loggf(F(" -> ERROR. Expect " PRILF " and get %ls\n"), expectResult, buf); +// not using wprintf, it crashes sometimes, it doesn't work for short-wchar + loggf(F("%s -> ERROR. Expect "), label); + print_wchar_string(expectResult); + loggf(F(" and get ")); + print_wchar_string(wbuf); + loggf("\n"); + nbTestFailed += 1; + va_start(valist, format); + _PoolCatPrint (format, valist, &spc, _PoolPrint); // for stepping with a debugger. + va_end(valist); + }else if ( !displayOnlyFailed ) { + loggf(F("%s : "), label); + print_wchar_string(wbuf); + loggf(F(" -> OK\n")); + } +//delay_ms(10); + return 1; +} + + + +#define Test1arg(expectResult,format,c) \ +{ \ + char label[1024]; \ + snprintf(label, sizeof(label), F("Test swprintf(%s, %s)"), F(#format), F(#c)); \ + testWPrintf(label,L##expectResult,(int)wcslen(L##expectResult),L##format,c); \ +} + +#define Test2arg(expectResult,format,c,d) \ +{ \ + char label[1024]; \ + snprintf(label, sizeof(label), F("Test swprintf(%s, %s, %s)"), F(#format), F(#c), F(#d)); \ + testWPrintf(label,L##expectResult,(int)wcslen(L##expectResult),L##format,c,d); \ +} + +#define Test5arg(expectResult,format,c,d,e,f,g) \ +{ \ + char label[1024]; \ + snprintf(label, sizeof(label), F("Test swprintf(%s, %s, %s, %s, %s, %s)"), F(#format), F(#c), F(#d), F(#e), F(#f), F(#g)); \ + testWPrintf(label,L##expectResult,(int)wcslen(L##expectResult),L##format,c,d,e,f,g); \ +} + + +int poolprint_tests(void) +{ +#ifdef DISPLAY_START_INFO + loggf(F("\n")); + loggf(F("Printf unit test\n")); + loggf(F("\n")); + loggf(F("\n")); + + // These depends on the plateform. They are not printf unit test, but it's nice to check size of builtin type. + loggf(F("sizeof(float)=%lu\n"), sizeof(float)); + loggf(F("sizeof(double)=%zu\n"), sizeof(double)); + loggf(F("sizeof(short int)=%zu\n"), sizeof(short int)); + loggf(F("sizeof(int)=%zu\n"), sizeof(int)); + loggf(F("sizeof(long int)=%zu\n"), sizeof(long int));// long is 64 bits + loggf(F("sizeof(long long int)=%zu\n"), sizeof(long long int)); + loggf(F("sizeof(size_t)=%zu=%zu\n"), sizeof(size_t), sizeof(size_t)); + loggf(F("sizeof(size_t)=%zu=%zu\n"), sizeof(size_t), sizeof(size_t)); + loggf(F("sizeof(void*)=%zu\n"), sizeof(void*)); + loggf(F("UINT64_MAX=%llu\n"), UINT64_MAX); + loggf(F("SIZE_T_MAX=%zu\n"), SIZE_T_MAX); + loggf(F("\n")); + + loggf(F("PRId16=%a\n"), PRId16); + loggf(F("PRIu16=%a\n"), PRIu16); + loggf(F("PRId32=%a\n"), PRId32); + loggf(F("PRIu32=%a\n"), PRIu32); + loggf(F("PRId32=%a\n"), PRId32); + loggf(F("PRIu32=%a\n"), PRIu32); + loggf(F("PRId64=%a\n"), PRId64); + loggf(F("PRIu64=%a\n"), PRIu64); + loggf(F("\n")); +#endif + + +// char buf[256]; +// snprintf(buf, sizeof(buf), "test %a", "ascii"); + +// wprintf(L"%llS", (int)4); doesn't check format +// printf("%ls", (char32_t)4); + + // in testPrintf functions, buffer is only 40 bytes, to be able to test vsnwprintf truncate correctly. + // +// const char* utf8 = "Āࠀ𐀀Выходиз"; +// const wchar_t* unicode = L"Āࠀ𐀀Выходиз"; + +//printf("%ls %r\n", "foo", 1); + +//testWPrintf("", F(L"Āࠀ𐀀🧊Выход'utf16'из"), F("Āࠀ𐀀🧊Выход'%a'из"), "utf16"); + + Test1arg(F("'utf8-string'"), F("'%a'"), "utf8-string"); + Test1arg(F("'utf16-string'"), F("'%ls'"), L"utf16-string"); + Test1arg(F("Āࠀ𐀀🧊Выход'utf8'из"), F("Āࠀ𐀀🧊Выход'%a'из"), "utf8"); + Test1arg(F("Āࠀ𐀀🧊Выход'utf16'из"), F("Āࠀ𐀀🧊Выход'%ls'из"), L"utf16"); +// Test1arg(F("Āࠀ𐀀🧊Выхо'ыход'из"), F("Āࠀ𐀀🧊Выхо'%a'из"), "ыход"); // utf8 chars seems not working with PoolPrint + Test1arg(F("Āࠀ𐀀🧊Выхо'ыход'из"), F("Āࠀ𐀀🧊Выхо'%ls'из"), L"ыход"); + + + // These must always works. It also test that integer type are well defined + Test1arg(F("sizeof(uint8_t)=1"), F("sizeof(uint8_t)=%d"), sizeof(uint8_t)); // %zu not supported by PoolPrint + Test1arg(F("sizeof(uint16_t)=2"), F("sizeof(uint16_t)=%d"), sizeof(uint16_t)); + Test1arg(F("sizeof(uint32_t)=4"), F("sizeof(uint32_t)=%d"), sizeof(uint32_t)); + Test1arg(F("sizeof(uint64_t)=8"), F("sizeof(uint64_t)=%d"), sizeof(uint64_t)); + Test1arg(F("sizeof(int8_t)=1"), F("sizeof(int8_t)=%d"), sizeof(int8_t)); + Test1arg(F("sizeof(int16_t)=2"), F("sizeof(int16_t)=%d"), sizeof(int16_t)); + Test1arg(F("sizeof(int32_t)=4"), F("sizeof(int32_t)=%d"), sizeof(int32_t)); + Test1arg(F("sizeof(int64_t)=8"), F("sizeof(int64_t)=%d"), sizeof(int64_t)); +// loggf(F("\n")); + + + +// Test5arg(F("12 34 56.67 hi X"), F("%d %u %.2lf %a %c"), 12, 34, 56.67, "hi", 'X'); // %f, %u not supported by PoolPrint + Test5arg(F("12 34 hi X 0"), F("%d %d %a %c %d"), 12, 34, "hi", 'X', 0); // %f, %u not supported by PoolPrint + + // %u not supported by PoolPrint + // %f not supported by PoolPrint + + + // test format + Test1arg(F("12"), F("%d"), 12); + Test1arg(F("|A|"), F("|%x|"), 0xA); // %x for PoolPrint is %X for printf + Test1arg(F("|AB|"), F("|%x|"), 0xAB); // %x for PoolPrint is %X for printf + Test1arg(F("|ABF|"), F("|%x|"), 0xABF); // %x for PoolPrint is %X for printf + Test1arg(F("|ABFE|"), F("|%x|"), 0xABFE); // %x for PoolPrint is %X for printf + Test1arg(F("|ABFED|"), F("|%x|"), 0xABFED); // %x for PoolPrint is %X for printf + Test1arg(F("|00000ABF|"), F("|%X|"), 0xABF); // %X for PoolPrint is %08X for printf, length specifier is ignored + + // test with specifier, space as pad char + Test1arg(F("| 0|"), F("|%5d|"), 0); + Test1arg(F("| 0|"), F("|%5x|"), 0); // %x for PoolPrint is %X for printf + Test1arg(F("|00000000|"), F("|%5X|"), 0); // %X means %08X, length specifier is ignored + + // test with specifier too small, space as pad char + Test1arg(F("|1234|"), F("|%2d|"), 1234); // keep under 16 bit value, if not, on 16 bits CPU, the constant become long int and doesn't match %d + Test1arg(F("|ABFE|"), F("|%2x|"), 0xABFE); // %x for PoolPrint is %X for printf + Test1arg(F("|0000ABFE|"), F("|%2X|"), 0xABFE); // %X for PoolPrint is %08X for printf, length specifier is ignored + + // test test with specifier, space as pad char + Test1arg(F("| 12|"), F("|%5d|"), 12); + Test1arg(F("| C|"), F("|%5x|"), 12); // %x for PoolPrint is %X for printf + Test1arg(F("|0000000C|"), F("|%5X|"), 12); // %X for PoolPrint is %08X for printf, length specifier is ignored + + // test with specifier, 0 as pad char + Test1arg(F("|00012|"), F("|%05d|"), 12); + Test1arg(F("|0000C|"), F("|%05x|"), 12); // %x for PoolPrint is %X for printf + Test1arg(F("|0000000C|"), F("|%05X|"), 12); // %X for PoolPrint is %08X for printf, length specifier is ignored + + + // Test %F format + Test2arg(F("Flash string |string1| |striiiing2|"), F("Flash string |" PRIF "| |" PRIF "|"), F("string1"), F("striiiing2")); + + // test limits + int16_t i; + i = INT16_MAX; Test1arg(F("INT16_MAX=32767"), F("INT16_MAX=%d"), i); + i = INT16_MIN; Test1arg(F("INT16_MIN=-32768"), F("INT16_MIN=%d"), i); + + uint16_t ui16; + ui16 = UINT16_MAX; Test1arg(F("UINT16_MAX=65535"), F("UINT16_MAX=%d"), ui16); + + int32_t i32; + i32 = INT32_MAX; Test1arg(F("INT32_MAX=2147483647"), F("INT32_MAX=%d"), i32); + i32 = INT32_MIN; Test1arg(F("INT32_MIN=-2147483648"), F("INT32_MIN=%d"), i32); + +// uint32_t ui32; +// ui32 = UINT32_MAX; Test1arg(F("UINT32_MAX=4294967295"), F("UINT32_MAX=%ld"), ui32); // PoolPrint print -1 +// +// int64_t i64; +// i64 = INT64_MAX; Test1arg(F("INT64_MAX=9223372036854775807"), F("INT64_MAX=%ld"), i64); // PoolPrint print -1 +// i64 = INT64_MIN; Test1arg(F("INT64_MIN=-9223372036854775808"), F("INT64_MIN=%ld"), i64); // PoolPrint print 0 +// +// uint64_t ui64; +// ui64 = UINT64_MAX; Test1arg(F("UINT64_MAX=18446744073709551615"), F("UINT64_MAX=%ld" ), ui64); // PoolPrint print -1 + + + return nbTestFailed; +} + diff --git a/rEFIt_UEFI/cpp_unit_test/poolprint-test.h b/rEFIt_UEFI/cpp_unit_test/poolprint-test.h new file mode 100644 index 000000000..0f35a1ee7 --- /dev/null +++ b/rEFIt_UEFI/cpp_unit_test/poolprint-test.h @@ -0,0 +1 @@ +int poolprint_tests(); diff --git a/rEFIt_UEFI/cpp_unit_test/printf_lite-test.cpp b/rEFIt_UEFI/cpp_unit_test/printf_lite-test.cpp index 009e3754f..3b6699846 100644 --- a/rEFIt_UEFI/cpp_unit_test/printf_lite-test.cpp +++ b/rEFIt_UEFI/cpp_unit_test/printf_lite-test.cpp @@ -10,12 +10,13 @@ #include #include "unicode_conversions.h" #include "printf_lite-test-cpp_conf.h" +#include "printf_lite-test.h" -int nbTestFailed = 0; +static int nbTestFailed = 0; #ifdef DISPLAY_ONLY_FAILED -bool displayOnlyFailed = true; +static bool displayOnlyFailed = true; #else -bool displayOnlyFailed = false; +static bool displayOnlyFailed = false; #endif /* @@ -36,9 +37,9 @@ static void print_wchar_string(const wchar_t* s) loggf("%s", utf8); } -int testPrintf(const char* label, const char* expectResult, int expectedRet, const char* format, ...) __attribute__((format(printf, 4, 5))); +static int testPrintf(const char* label, const char* expectResult, int expectedRet, const char* format, ...) __attribute__((format(printf, 4, 5))); -int testPrintf(const char* label, const char* expectResult, int expectedRet, const char* format, ...) +static int testPrintf(const char* label, const char* expectResult, int expectedRet, const char* format, ...) { char buf[40]; va_list valist; @@ -59,9 +60,9 @@ int testPrintf(const char* label, const char* expectResult, int expectedRet, co } -int testWPrintf(const char* label, const wchar_t* expectResult, int expectedRet, const char* format, ...) __attribute__((format(printf, 4, 5))); +static int testWPrintf(const char* label, const wchar_t* expectResult, int expectedRet, const char* format, ...) __attribute__((format(printf, 4, 5))); -int testWPrintf(const char* label, const wchar_t* expectResult, int expectedRet, const char* format, ...) +static int testWPrintf(const char* label, const wchar_t* expectResult, int expectedRet, const char* format, ...) { wchar_t wbuf[40]; #if VSNWPRINTF_RETURN_MINUS1_ON_OVERFLOW == 1 @@ -187,9 +188,9 @@ int printf_lite_tests(void) //testWPrintf("", F(L"Āࠀ𐀀🧊Выход'utf16'из"), F("Āࠀ𐀀🧊Выход'%s'из"), "utf16"); - Test1arg(F("'utf16-string'"), F("'%s'"), "utf16-string"); + Test1arg(F("'utf8-string'"), F("'%s'"), "utf8-string"); Test1arg(F("'utf16-string'"), F("'%ls'"), L"utf16-string"); - Test1arg(F("Āࠀ𐀀🧊Выход'utf16'из"), F("Āࠀ𐀀🧊Выход'%s'из"), "utf16"); + Test1arg(F("Āࠀ𐀀🧊Выход'utf8'из"), F("Āࠀ𐀀🧊Выход'%s'из"), "utf8"); Test1arg(F("Āࠀ𐀀🧊Выход'utf16'из"), F("Āࠀ𐀀🧊Выход'%ls'из"), L"utf16"); Test1arg(F("Āࠀ𐀀🧊Выхо'ыход'из"), F("Āࠀ𐀀🧊Выхо'%s'из"), "ыход"); Test1arg(F("Āࠀ𐀀🧊Выхо'ыход'из"), F("Āࠀ𐀀🧊Выхо'%ls'из"), L"ыход"); diff --git a/rEFIt_UEFI/cpp_unit_test/printlib-test-cpp_conf.h b/rEFIt_UEFI/cpp_unit_test/printlib-test-cpp_conf.h new file mode 100644 index 000000000..32e8def4a --- /dev/null +++ b/rEFIt_UEFI/cpp_unit_test/printlib-test-cpp_conf.h @@ -0,0 +1,13 @@ + +#include "../../Include/Library/printf_lite.h" +#define F(x) x +#define LF(x) L##x +#define PRIF "%s" +#define PRILF "%ls" + +#define loggf(...) DebugLog(2, __VA_ARGS__) +//#define loggf(...) printf(__VA_ARGS__) + +#define DISPLAY_ONLY_FAILED +//#define DISPLAY_START_INFO + diff --git a/rEFIt_UEFI/cpp_unit_test/printlib-test.cpp b/rEFIt_UEFI/cpp_unit_test/printlib-test.cpp new file mode 100644 index 000000000..e294819f5 --- /dev/null +++ b/rEFIt_UEFI/cpp_unit_test/printlib-test.cpp @@ -0,0 +1,275 @@ +// +// main.cpp +// Printf-UnitTests +// +// Created by Jief on 29/08/17. +// Copyright © 2017 Jief. All rights reserved. +// + +#include +#include +#include "unicode_conversions.h" +#include "printlib-test-cpp_conf.h" +#include "printlib-test.h" + +static int nbTestFailed = 0; +#ifdef DISPLAY_ONLY_FAILED +static bool displayOnlyFailed = true; +#else +static bool displayOnlyFailed = false; +#endif + +/* + * Print wchar string as a utf8 string. + * This eliminate all problems about wprintf and compilation with short-wchar or long-wchar I had on macOs (2020-03) + */ +static void print_wchar_string(const wchar_t* s) +{ +// char utf8[wchar_len(s)*4+1]; +// some compiler doesn't like variable length array. +// use a fixed length instead. + char utf8[200]; + utf8_string_from_wchar_string(utf8, sizeof(utf8), s); + if ( strlen(utf8) > sizeof(utf8)-2 ) { + loggf("fixed size buf not big enough"); + abort(); + } + loggf("%s", utf8); +} + + +static int testPrintf(const char* label, const char* expectResult, int expectedRet, const char* format, ...) /*__attribute__((format(printf, 4, 5)))*/; + +static int testPrintf(const char* label, const char* expectResult, int expectedRet, const char* format, ...) +{ + char buf[40]; + va_list valist; + va_start(valist, format); +// const char* c = #PRINTF_CFUNCTION_PREFIX; + int vsnprintf_ret = (int)AsciiVSPrint(buf, sizeof(buf), format, valist); + va_end(valist); + if ( strcmp(buf, (char*)expectResult) != 0 ) { + loggf(F("%s -> ERROR. Expect " PRIF " and get %s\n"), label, expectResult, buf); + nbTestFailed += 1; + }else if ( vsnprintf_ret != expectedRet ) { + loggf(F("%s -> ERROR. Expect return value %d and get %d\n"), label, expectedRet, vsnprintf_ret); + nbTestFailed += 1; + }else if ( !displayOnlyFailed ) { + loggf(F("%s : %s -> OK\n"), label, buf); + } + return 1; +} + + +static int testWPrintf(const char* label, const wchar_t* expectResult, int expectedRet, const wchar_t* format, ...) /*__attribute__((format(printf, 4, 5)))*/; + +static int testWPrintf(const char* label, const wchar_t* expectResult, int expectedRet, const wchar_t* format, ...) +{ + wchar_t wbuf[40]; +#if VSNWPRINTF_RETURN_MINUS1_ON_OVERFLOW == 1 + if ( expectedRet >= (int)(sizeof(wbuf)/sizeof(wchar_t)) ) expectedRet = -1; +#endif + + va_list valist; + va_start(valist, format); +// int vsnwprintf_ret = PRINTF_FUNCTION_NAME(PRINTF_CFUNCTION_PREFIX, vsnwprint, PRINTF_CFUNCTION_SUFFIX)(wbuf, sizeof(wbuf)/sizeof(wchar_t), format, valist); +// _PoolCatPrint (format, valist, &spc, _PoolPrint); + UnicodeVSPrint(wbuf, sizeof(wbuf), format, valist); + va_end(valist); +//delay_ms(10); + if ( memcmp(wbuf, expectResult, wchar_len(expectResult)*sizeof(expectResult[0])) != 0 ) { +// loggf(F(" -> ERROR. Expect " PRILF " and get %ls\n"), expectResult, buf); +// not using wprintf, it crashes sometimes, it doesn't work for short-wchar + loggf(F("%s -> ERROR. Expect "), label); + print_wchar_string(expectResult); + loggf(F(" and get ")); + print_wchar_string(wbuf); + loggf("\n"); + nbTestFailed += 1; + va_start(valist, format); + UnicodeVSPrint(wbuf, sizeof(wbuf), format, valist); // for stepping with a debugger. + va_end(valist); + }else if ( !displayOnlyFailed ) { + loggf(F("%s : "), label); + print_wchar_string(wbuf); + loggf(F(" -> OK\n")); + } +//delay_ms(10); + return 1; +} + + + +#define Test1arg(expectResult,format,c) \ +{ \ + char label[1024]; \ + snprintf(label, sizeof(label), F("Test sprintf(%s, %s)"), F(#format), F(#c)); \ + testPrintf(label,expectResult,(int)strlen(expectResult),format,c); \ + snprintf(label, sizeof(label), F("Test swprintf(%s, %s)"), F(#format), F(#c)); \ + testWPrintf(label,L##expectResult,(int)wcslen(L##expectResult),L##format,c); \ +} + +#define Test2arg(expectResult,format,c,d) \ +{ \ + char label[1024]; \ + snprintf(label, sizeof(label), F("Test sprintf(%s, %s, %s)"), F(#format), F(#c), F(#d)); \ + testPrintf(label,expectResult,(int)strlen(expectResult),format,c,d); \ + snprintf(label, sizeof(label), F("Test swprintf(%s, %s, %s)"), F(#format), F(#c), F(#d)); \ + testWPrintf(label,L##expectResult,(int)wcslen(L##expectResult),L##format,c,d); \ +} + +#define Test5arg(expectResult,format,c,d,e,f,g) \ +{ \ + char label[1024]; \ + snprintf(label, sizeof(label), F("Test sprintf(%s, %s, %s, %s, %s, %s)"), F(#format), F(#c), F(#d), F(#e), F(#f), F(#g)); \ + testPrintf(label,expectResult,(int)strlen(expectResult),format,c,d,e,f,g); \ + snprintf(label, sizeof(label), F("Test swprintf(%s, %s, %s, %s, %s, %s)"), F(#format), F(#c), F(#d), F(#e), F(#f), F(#g)); \ + testWPrintf(label,L##expectResult,(int)wcslen(L##expectResult),L##format,c,d,e,f,g); \ +} + +#define TestLen5arg(expectResult,expectedRet,format,c,d,e,f,g) \ +{ \ + char label[1024]; \ + snprintf(label, sizeof(label), F("Test sprintf(%s, %s, %s, %s, %s, %s)"), F(#format), F(#c), F(#d), F(#e), F(#f), F(#g)); \ + testPrintf(label,expectResult,expectedRet,format,c,d,e,f,g); \ + snprintf(label, sizeof(label), F("Test swprintf(%s, %s, %s, %s, %s, %s)"), F(#format), F(#c), F(#d), F(#e), F(#f), F(#g)); \ + testWPrintf(label,L##expectResult,expectedRet,L##format,c,d,e,f,g); \ +} + + + +int printlib_tests(void) +{ +#ifdef DISPLAY_START_INFO + loggf(F("\n")); + loggf(F("Printf unit test\n")); + loggf(F("\n")); + loggf(F("\n")); + + // These depends on the plateform. They are not printf unit test, but it's nice to check size of builtin type. + loggf(F("sizeof(float)=%lu\n"), sizeof(float)); + loggf(F("sizeof(double)=%zu\n"), sizeof(double)); + loggf(F("sizeof(short int)=%zu\n"), sizeof(short int)); + loggf(F("sizeof(int)=%zu\n"), sizeof(int)); + loggf(F("sizeof(long int)=%zu\n"), sizeof(long int));// long is 64 bits + loggf(F("sizeof(long long int)=%zu\n"), sizeof(long long int)); + loggf(F("sizeof(size_t)=%zu=%zu\n"), sizeof(size_t), sizeof(size_t)); + loggf(F("sizeof(size_t)=%zu=%zu\n"), sizeof(size_t), sizeof(size_t)); + loggf(F("sizeof(void*)=%zu\n"), sizeof(void*)); + loggf(F("UINT64_MAX=%llu\n"), UINT64_MAX); + loggf(F("SIZE_T_MAX=%zu\n"), SIZE_T_MAX); + loggf(F("\n")); + + loggf(F("PRId16=%a\n"), PRId16); + loggf(F("PRIu16=%a\n"), PRIu16); + loggf(F("PRId32=%a\n"), PRId32); + loggf(F("PRIu32=%a\n"), PRIu32); + loggf(F("PRId32=%a\n"), PRId32); + loggf(F("PRIu32=%a\n"), PRIu32); + loggf(F("PRId64=%a\n"), PRId64); + loggf(F("PRIu64=%a\n"), PRIu64); + loggf(F("\n")); +#endif + + +// char buf[256]; +// snprintf(buf, sizeof(buf), "test %a", "ascii"); + +// wprintf(L"%llS", (int)4); doesn't check format +// printf("%ls", (char32_t)4); + + // in testPrintf functions, buffer is only 40 bytes, to be able to test vsnwprintf truncate correctly. + // +// const char* utf8 = "Āࠀ𐀀Выходиз"; +// const wchar_t* unicode = L"Āࠀ𐀀Выходиз"; + +//printf("%ls %r\n", "foo", 1); + +//testWPrintf("", F(L"Āࠀ𐀀🧊Выход'utf16'из"), F("Āࠀ𐀀🧊Выход'%a'из"), "utf16"); + + Test1arg(F("'utf8-string'"), F("'%a'"), "utf8-string"); + Test1arg(F("'utf16-string'"), F("'%s'"), L"utf16-string"); + Test1arg(F("Āࠀ𐀀🧊Выход'utf8'из"), F("Āࠀ𐀀🧊Выход'%a'из"), "utf8"); + Test1arg(F("Āࠀ𐀀🧊Выход'utf16'из"), F("Āࠀ𐀀🧊Выход'%s'из"), L"utf16"); +// Test1arg(F("Āࠀ𐀀🧊Выхо'ыход'из"), F("Āࠀ𐀀🧊Выхо'%a'из"), "ыход"); // utf8 chars seems not working with PrintLib +// Test1arg(F("Āࠀ𐀀🧊Выхо'ыход'из"), F("Āࠀ𐀀🧊Выхо'%s'из"), L"ыход"); // utf16 chars seems not working with PrintLib + + + // These must always works. It also test that integer type are well defined + Test1arg(F("sizeof(uint8_t)=1"), F("sizeof(uint8_t)=%d"), sizeof(uint8_t)); // %zu, %zd not supported by PrintLib + Test1arg(F("sizeof(uint16_t)=2"), F("sizeof(uint16_t)=%d"), sizeof(uint16_t)); + Test1arg(F("sizeof(uint32_t)=4"), F("sizeof(uint32_t)=%d"), sizeof(uint32_t)); + Test1arg(F("sizeof(uint64_t)=8"), F("sizeof(uint64_t)=%d"), sizeof(uint64_t)); + Test1arg(F("sizeof(int8_t)=1"), F("sizeof(int8_t)=%d"), sizeof(int8_t)); + Test1arg(F("sizeof(int16_t)=2"), F("sizeof(int16_t)=%d"), sizeof(int16_t)); + Test1arg(F("sizeof(int32_t)=4"), F("sizeof(int32_t)=%d"), sizeof(int32_t)); + Test1arg(F("sizeof(int64_t)=8"), F("sizeof(int64_t)=%d"), sizeof(int64_t)); +// loggf(F("\n")); + + + +// Test5arg(F("12 34 56.67 hi X"), F("%d %u %.2lf %a %c"), 12, 34, 56.67, "hi", 'X'); // %f, %u not supported by PoolPrint + Test5arg(F("12 34 hi X 0"), F("%d %d %a %c %d"), 12, 34, "hi", 'X', 0); // %f, %u not supported by PoolPrint + + // %f not supported by PrintLib + + + // test format + Test1arg(F("12"), F("%d"), 12); + Test1arg(F("|A|"), F("|%x|"), 0xA); // %x for PrintLib is %X for printf + Test1arg(F("|AB|"), F("|%x|"), 0xAB); // %x for PrintLib is %X for printf + Test1arg(F("|ABF|"), F("|%x|"), 0xABF); // %x for PrintLib is %X for printf + Test1arg(F("|ABFE|"), F("|%x|"), 0xABFE); // %x for PrintLib is %X for printf + Test1arg(F("|ABFED|"), F("|%x|"), 0xABFED); // %x for PrintLib is %X for printf + Test1arg(F("|ABF|"), F("|%X|"), 0xABF); + + // test with specifier, space as pad char + Test1arg(F("| 0|"), F("|%5d|"), 0); + Test1arg(F("| 0|"), F("|%5u|"), 0); + Test1arg(F("| 0|"), F("|%5x|"), 0); // %x for PrintLib is %X for printf + Test1arg(F("|00000|"), F("|%5X|"), 0); + + // test with specifier too small, space as pad char + Test1arg(F("|1234|"), F("|%2d|"), 1234); // keep under 16 bit value, if not, on 16 bits CPU, the constant become long int and doesn't match %d + Test1arg(F("|1234|"), F("|%2u|"), 1234); // keep under 16 bit value, if not, on 16 bits CPU, the constant become long int and doesn't match %d + Test1arg(F("|ABFE|"), F("|%2x|"), 0xABFE); // %x for PrintLib is %X for printf + Test1arg(F("|ABFE|"), F("|%2X|"), 0xABFE); + + // test test with specifier, space as pad char + Test1arg(F("| 12|"), F("|%5d|"), 12); + Test1arg(F("| 12|"), F("|%5u|"), 12); + Test1arg(F("| C|"), F("|%5x|"), 12); // %x for PrintLib is %X for printf + Test1arg(F("|0000C|"), F("|%5X|"), 12); + + // test with specifier, 0 as pad char + Test1arg(F("|00012|"), F("|%05d|"), 12); + Test1arg(F("|00012|"), F("|%05u|"), 12); + Test1arg(F("|0000C|"), F("|%05x|"), 12); // %x for PrintLib is %X for printf + Test1arg(F("|0000C|"), F("|%05X|"), 12); + + // test limits + int16_t i; + i = INT16_MAX; Test1arg(F("INT16_MAX=32767"), F("INT16_MAX=%d"), i); + i = INT16_MIN; Test1arg(F("INT16_MIN=-32768"), F("INT16_MIN=%d"), i); + + uint16_t ui16; + ui16 = UINT16_MAX; Test1arg(F("UINT16_MAX=65535"), F("UINT16_MAX=%u"), ui16); + + int32_t i32; + i32 = INT32_MAX; Test1arg(F("INT32_MAX=2147483647"), F("INT32_MAX=%d"), i32); + i32 = INT32_MIN; Test1arg(F("INT32_MIN=-2147483648"), F("INT32_MIN=%d"), i32); + + uint32_t ui32; + ui32 = UINT32_MAX; Test1arg(F("UINT32_MAX=4294967295"), F("UINT32_MAX=%u"), ui32); + + int64_t i64; + i64 = INT64_MAX; Test1arg(F("INT64_MAX=9223372036854775807"), F("INT64_MAX=%ld"), i64); + i64 = INT64_MIN; Test1arg(F("INT64_MIN=-9223372036854775808"), F("INT64_MIN=%ld"), i64); + + uint64_t ui64; + ui64 = UINT64_MAX; Test1arg(F("UINT64_MAX=18446744073709551615"), F("UINT64_MAX=%lu" ), ui64); + + + return nbTestFailed; +} + diff --git a/rEFIt_UEFI/cpp_unit_test/printlib-test.h b/rEFIt_UEFI/cpp_unit_test/printlib-test.h new file mode 100644 index 000000000..653b0fff4 --- /dev/null +++ b/rEFIt_UEFI/cpp_unit_test/printlib-test.h @@ -0,0 +1 @@ +int printlib_tests(); diff --git a/rEFIt_UEFI/cpp_util/globals_ctor.cpp b/rEFIt_UEFI/cpp_util/globals_ctor.cpp index ff6310e19..1e65b953a 100644 --- a/rEFIt_UEFI/cpp_util/globals_ctor.cpp +++ b/rEFIt_UEFI/cpp_util/globals_ctor.cpp @@ -35,7 +35,7 @@ void construct_globals_objects() // DOS image header is present, so read the PE header after the DOS image header PeCoffHeaderOffset = DosHdr->e_lfanew; } - DBG("ImageContext.PeCoffHeaderOffset: %08x %d\n", PeCoffHeaderOffset, PeCoffHeaderOffset); + DBG("ImageContext.PeCoffHeaderOffset: %08X %d\n", PeCoffHeaderOffset, PeCoffHeaderOffset); EFI_IMAGE_OPTIONAL_HEADER_UNION* ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *) ((UINTN) (SelfLoadedImage->ImageBase) + PeCoffHeaderOffset); @@ -43,10 +43,10 @@ void construct_globals_objects() for (int Index = 0; Index < ImgHdr->Pe32.FileHeader.NumberOfSections; Index++, SectionHeader++) { - DBG("SectionHeader->Name=%a\n", SectionHeader->Name); -// DBG("SectionHeader->PointerToRawData=%8x\n", SectionHeader->PointerToRawData); -// DBG("SectionHeader->SizeOfRawData=%8x\n", SectionHeader->SizeOfRawData); - DBG("SectionHeader->VirtualSize=%8x\n", SectionHeader->Misc.VirtualSize); + DBG("SectionHeader->Name=%s\n", SectionHeader->Name); +// DBG("SectionHeader->PointerToRawData=%8X\n", SectionHeader->PointerToRawData); +// DBG("SectionHeader->SizeOfRawData=%8X\n", SectionHeader->SizeOfRawData); + DBG("SectionHeader->VirtualSize=%8X\n", SectionHeader->Misc.VirtualSize); if (AsciiStrCmp((CONST CHAR8*) SectionHeader->Name, ".ctorss") == 0) { @@ -54,8 +54,8 @@ void construct_globals_objects() ctor_ptr* ctorend = (ctor_ptr*) (((UINTN) (SelfLoadedImage->ImageBase)) + SectionHeader->PointerToRawData + SectionHeader->Misc.VirtualSize); while (currentCtor < ctorend) { - DBG("¤tCtor %x %d\n", (UINTN) (currentCtor), (UINTN) (currentCtor)); - DBG("currentCtor %x %d\n", (UINTN) (*currentCtor), (UINTN) (*currentCtor)); + DBG("¤tCtor %X %d\n", (UINTN) (currentCtor), (UINTN) (currentCtor)); + DBG("currentCtor %X %d\n", (UINTN) (*currentCtor), (UINTN) (*currentCtor)); if (*currentCtor != NULL) (*currentCtor)(); currentCtor++; } @@ -74,19 +74,19 @@ ctor_ptr* pend = (ctor_ptr*)&__end_of_section_ctors; void construct_globals_objects() { - DBG("CTOR %x %d\n", (UINTN)p, (UINTN)p); -// DBG("CTOR %x %d\n", (UINTN)p[0], (UINTN)p[0]); + DBG("CTOR %X %d\n", (UINTN)p, (UINTN)p); +// DBG("CTOR %X %d\n", (UINTN)p[0], (UINTN)p[0]); while ( p < pend ) { - DBG("CTOR %x %d\n", (UINTN)p[0], (UINTN)p[0]); + DBG("CTOR %X %d\n", (UINTN)p[0], (UINTN)p[0]); (*p)(); p++; } -// DBG("CTOR %x %d\n", (UINTN)__CTOR_LIST__, (UINTN)__CTOR_LIST__); +// DBG("CTOR %X %d\n", (UINTN)__CTOR_LIST__, (UINTN)__CTOR_LIST__); // __do_init(); // const size_t n = __CTOR_LIST_END__ - __CTOR_LIST__ - 1; // size_t n = 10; // for (size_t i = 0; i < n; i++) { -// DBG("CTOR %x %d\n", (UINTN)__CTOR_LIST__[i], (UINTN)__CTOR_LIST__[i]); +// DBG("CTOR %X %d\n", (UINTN)__CTOR_LIST__[i], (UINTN)__CTOR_LIST__[i]); // } // __CTOR_LIST__[0](); } @@ -102,7 +102,7 @@ void construct_globals_objects() // DOS image header is present, so read the PE header after the DOS image header PeCoffHeaderOffset = DosHdr->e_lfanew; } - DBG("ImageContext.PeCoffHeaderOffset: %08x %d\n", PeCoffHeaderOffset, PeCoffHeaderOffset); + DBG("ImageContext.PeCoffHeaderOffset: %08X %d\n", PeCoffHeaderOffset, PeCoffHeaderOffset); EFI_IMAGE_OPTIONAL_HEADER_UNION* ImgHdr = (EFI_IMAGE_OPTIONAL_HEADER_UNION *) ((UINTN) (SelfLoadedImage->ImageBase) + PeCoffHeaderOffset); @@ -110,10 +110,10 @@ void construct_globals_objects() for (int Index = 0; Index < ImgHdr->Pe32.FileHeader.NumberOfSections; Index++, SectionHeader++) { - DBG("SectionHeader->Name=%a\n", SectionHeader->Name); - // DBG("SectionHeader->PointerToRawData=%8x\n", SectionHeader->PointerToRawData); - // DBG("SectionHeader->SizeOfRawData=%8x\n", SectionHeader->SizeOfRawData); - DBG("SectionHeader->VirtualSize=%8x\n", SectionHeader->Misc.VirtualSize); + DBG("SectionHeader->Name=%s\n", SectionHeader->Name); + // DBG("SectionHeader->PointerToRawData=%8X\n", SectionHeader->PointerToRawData); + // DBG("SectionHeader->SizeOfRawData=%8X\n", SectionHeader->SizeOfRawData); + DBG("SectionHeader->VirtualSize=%8X\n", SectionHeader->Misc.VirtualSize); if (AsciiStrCmp((CONST CHAR8*) SectionHeader->Name, ".CRT") == 0) { @@ -121,8 +121,8 @@ void construct_globals_objects() ctor_ptr* ctorend = (ctor_ptr*) (((UINTN) (SelfLoadedImage->ImageBase)) + SectionHeader->PointerToRawData + SectionHeader->Misc.VirtualSize); while (currentCtor < ctorend) { - DBG("¤tCtor %x %d\n", (UINTN) (currentCtor), (UINTN) (currentCtor)); - DBG("currentCtor %x %d\n", (UINTN) (*currentCtor), (UINTN) (*currentCtor)); + DBG("¤tCtor %X %d\n", (UINTN) (currentCtor), (UINTN) (currentCtor)); + DBG("currentCtor %X %d\n", (UINTN) (*currentCtor), (UINTN) (*currentCtor)); if (*currentCtor != NULL) (*currentCtor)(); currentCtor++; } diff --git a/rEFIt_UEFI/cpp_util/operatorNewDelete.cpp b/rEFIt_UEFI/cpp_util/operatorNewDelete.cpp index 54c6f0666..2f2ca34ba 100755 --- a/rEFIt_UEFI/cpp_util/operatorNewDelete.cpp +++ b/rEFIt_UEFI/cpp_util/operatorNewDelete.cpp @@ -14,7 +14,7 @@ void* operator new (unsigned long count) { void* ptr = AllocatePool(count); if ( !ptr ) { - DebugLog(2, "AllocatePool(%d) returned NULL. Cpu halted\n", count); + DebugLog(2, "AllocatePool(%lu) returned NULL. Cpu halted\n", count); CpuDeadLoop(); } return ptr; diff --git a/rEFIt_UEFI/cpp_util/panic.cpp b/rEFIt_UEFI/cpp_util/panic.cpp index d5299492b..6cfa067e1 100644 --- a/rEFIt_UEFI/cpp_util/panic.cpp +++ b/rEFIt_UEFI/cpp_util/panic.cpp @@ -15,11 +15,11 @@ bool i_have_panicked = false; void panic_(const char* s) { if ( stop_at_panic ) { - if ( s ) DebugLog(2, "%a\n", s); + if ( s ) DebugLog(2, "%s\n", s); DebugLog(2, "A fatal error happened. System halted\n"); CpuDeadLoop(); }else{ -// if ( s ) DebugLog(2, "%a\n", s); +// if ( s ) DebugLog(2, "%s\n", s); // DebugLog(2, "A fatal error happened. Continue for testing\n"); i_have_panicked = true; } diff --git a/rEFIt_UEFI/entry_scan/common.cpp b/rEFIt_UEFI/entry_scan/common.cpp index c13b14a9a..9fbed7295 100644 --- a/rEFIt_UEFI/entry_scan/common.cpp +++ b/rEFIt_UEFI/entry_scan/common.cpp @@ -163,7 +163,7 @@ CHAR16 *RemoveLoadOption(IN CONST CHAR16 *LoadOptions, IN CONST CHAR16 *LoadOpti CHAR16 *NewLoadOptions; UINTN Length, Offset, OptionLength; - //DBG("LoadOptions: '%s', remove LoadOption: '%s'\n", LoadOptions, LoadOption); + //DBG("LoadOptions: '%ls', remove LoadOption: '%ls'\n", LoadOptions, LoadOption); // If there are no options then nothing to do if (LoadOptions == NULL) return NULL; // If there is no option to remove then duplicate original diff --git a/rEFIt_UEFI/entry_scan/legacy.cpp b/rEFIt_UEFI/entry_scan/legacy.cpp index 0d05a3de2..1b02a32d2 100644 --- a/rEFIt_UEFI/entry_scan/legacy.cpp +++ b/rEFIt_UEFI/entry_scan/legacy.cpp @@ -110,13 +110,13 @@ BOOLEAN AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle, ShortcutLetter = LoaderTitle[0]; } else LoaderTitle = EfiStrDuplicate( L"Legacy OS"); -// DBG("LoaderTitle=%s\n", LoaderTitle); +// DBG("LoaderTitle=%ls\n", LoaderTitle); } if (Volume->VolName != NULL) VolDesc = Volume->VolName; else VolDesc = (Volume->DiskKind == DISK_KIND_OPTICAL) ? L"CD" : L"HD"; -//DBG("VolDesc=%s\n", VolDesc); +//DBG("VolDesc=%ls\n", VolDesc); // prepare the menu entry // Entry = (__typeof__(Entry))AllocateZeroPool(sizeof(LEGACY_ENTRY)); Entry = new LEGACY_ENTRY(); @@ -129,7 +129,7 @@ BOOLEAN AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle, Entry->Title.SPrintf("Boot %ls from %ls", LoaderTitle, VolDesc); } } -// DBG("Title=%s\n", Entry->Title); +// DBG("Title=%ls\n", Entry->Title); // Entry->Tag = TAG_LEGACY; Entry->Row = 0; Entry->ShortcutLetter = (Hotkey == 0) ? ShortcutLetter : Hotkey; @@ -138,10 +138,10 @@ BOOLEAN AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle, } else { Entry->Image = LoadOSIcon(Volume->LegacyOS->IconName, L"legacy", 128, FALSE, TRUE); } -// DBG("IconName=%s\n", Volume->LegacyOS->IconName); +// DBG("IconName=%ls\n", Volume->LegacyOS->IconName); Entry->DriveImage = (DriveImage != NULL) ? DriveImage : ScanVolumeDefaultIcon(Volume, Volume->LegacyOS->Type, Volume->DevicePath); - // DBG("HideBadges=%d Volume=%s\n", GlobalConfig.HideBadges, Volume->VolName); - // DBG("Title=%s OSName=%s OSIconName=%s\n", LoaderTitle, Volume->OSName, Volume->OSIconName); + // DBG("HideBadges=%d Volume=%ls\n", GlobalConfig.HideBadges, Volume->VolName); + // DBG("Title=%ls OSName=%ls OSIconName=%ls\n", LoaderTitle, Volume->OSName, Volume->OSIconName); //actions Entry->AtClick = ActionSelect; Entry->AtDoubleClick = ActionEnter; @@ -189,7 +189,7 @@ BOOLEAN AddLegacyEntry(IN CONST CHAR16 *FullTitle, IN CONST CHAR16 *LoaderTitle, SubScreen->AddMenuEntry(&MenuEntryReturn, false); Entry->SubScreen = SubScreen; MainMenu.AddMenuEntry(Entry, true); -// DBG(" added '%s' OSType=%d Icon=%s\n", Entry->Title, Volume->LegacyOS->Type, Volume->LegacyOS->IconName); +// DBG(" added '%ls' OSType=%d Icon=%ls\n", Entry->Title, Volume->LegacyOS->Type, Volume->LegacyOS->IconName); return true; } @@ -211,10 +211,10 @@ VOID ScanLegacy(VOID) continue; } -// DBG("%2d: '%s' (%s)", VolumeIndex, Volume->VolName, Volume->LegacyOS->IconName); +// DBG("%2d: '%ls' (%ls)", VolumeIndex, Volume->VolName, Volume->LegacyOS->IconName); #if 0 // REFIT_DEBUG > 0 - DBG(" %d %s\n %d %d %s %d %s\n", + DBG(" %d %ls\n %d %d %ls %d %ls\n", VolumeIndex, FileDevicePathToStr(Volume->DevicePath), Volume->DiskKind, Volume->MbrPartitionIndex, Volume->IsAppleLegacy ? L"AL" : L"--", Volume->HasBootCode, @@ -238,7 +238,7 @@ VOID ScanLegacy(VOID) HideIfOthersFound = TRUE; } else if (Volume->HasBootCode) { ShowVolume = TRUE; -// DBG("Volume %d will be shown BlockIo=%x WholeIo=%x\n", +// DBG("Volume %d will be shown BlockIo=%X WholeIo=%X\n", // VolumeIndex, Volume->BlockIO, Volume->WholeDiskBlockIO); if ((Volume->WholeDiskBlockIO == 0) && Volume->BlockIOOffset == 0 /* && @@ -291,20 +291,20 @@ VOID AddCustomLegacy(VOID) // Traverse the custom entries for (Custom = gSettings.CustomLegacy; Custom; ++i, Custom = Custom->Next) { if (OSFLAG_ISSET(Custom->Flags, OSFLAG_DISABLED)) { - DBG("Custom legacy %d skipped because it is disabled.\n", i); + DBG("Custom legacy %llu skipped because it is disabled.\n", i); continue; } if (!gSettings.ShowHiddenEntries && OSFLAG_ISSET(Custom->Flags, OSFLAG_HIDDEN)) { - DBG("Custom legacy %d skipped because it is hidden.\n", i); + DBG("Custom legacy %llu skipped because it is hidden.\n", i); continue; } if (Custom->Volume) { - DBG("Custom legacy %d matching \"%s\" ...\n", i, Custom->Volume); + DBG("Custom legacy %llu matching \"%ls\" ...\n", i, Custom->Volume); } for (VolumeIndex = 0; VolumeIndex < Volumes.size(); ++VolumeIndex) { Volume = &Volumes[VolumeIndex]; - DBG(" Checking volume \"%s\" (%s) ... ", Volume->VolName, Volume->DevicePathString); + DBG(" Checking volume \"%ls\" (%ls) ... ", Volume->VolName, Volume->DevicePathString); // skip volume if its kind is configured as disabled if ((Volume->DiskKind == DISK_KIND_OPTICAL && (GlobalConfig.DisableFlags & VOLTYPE_OPTICAL)) || diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index 08f02f80f..79659f015 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -374,7 +374,7 @@ STATIC EFI_STATUS GetOSXVolumeName(LOADER_ENTRY *Entry) //Create null terminated string targetString = (CHAR8*) AllocateZeroPool(fileLen+1); CopyMem( (VOID*)targetString, (VOID*)fileBuffer, fileLen); - DBG("found disk_label with contents:%a\n", targetString); + DBG("found disk_label with contents:%s\n", targetString); // NOTE: Sothor - This was never run. If we need this correct it and uncomment it. // if (Entry->LoaderType == OSTYPE_OSX) { @@ -394,7 +394,7 @@ STATIC EFI_STATUS GetOSXVolumeName(LOADER_ENTRY *Entry) AsciiStrToUnicodeStrS(targetString, tmpName, fileLen); Entry->VolName = EfiStrDuplicate(tmpName); - DBG("Created name:%s\n", Entry->VolName); + DBG("Created name:%ls\n", Entry->VolName); FreePool(tmpName); FreePool(fileBuffer); @@ -451,7 +451,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, INTN Comparison = StriCmp(FilePathAsString, LoaderDevicePathString); FreePool(FilePathAsString); if (Comparison == 0) { - DBG("%a skipped because path `%s` is self path!\n", indent, LoaderDevicePathString); + DBG("%s skipped because path `%ls` is self path!\n", indent, LoaderDevicePathString); FreePool(LoaderDevicePathString); return NULL; } @@ -468,7 +468,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, // Only want loaders if (MainEntry.getLOADER_ENTRY()) { if (StriCmp(MainEntry.getLOADER_ENTRY()->DevicePathString, LoaderDevicePathString) == 0) { - DBG("%a skipped because path `%s` already exists for another entry!\n", indent, LoaderDevicePathString); + DBG("%s skipped because path `%ls` already exists for another entry!\n", indent, LoaderDevicePathString); FreePool(LoaderDevicePathString); return NULL; } @@ -518,32 +518,32 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, if (volume_match == -1 || volume_type_match == -1 || path_match == -1 || type_match == -1 ) { UINTN add_comma = 0; - DBG ("%aNot match custom entry %d: ", indent, CustomIndex); + DBG ("%sNot match custom entry %llu: ", indent, CustomIndex); if (volume_match != 0) { - DBG("Volume: %s", volume_match == 1 ? L"match" : L"not match"); + DBG("Volume: %ls", volume_match == 1 ? L"match" : L"not match"); add_comma++; } if (path_match != 0) { - DBG("%sPath: %s", + DBG("%lsPath: %ls", (add_comma ? L", " : L""), path_match == 1 ? L"match" : L"not match"); add_comma++; } if (volume_type_match != 0) { - DBG("%sVolumeType: %s", + DBG("%lsVolumeType: %ls", (add_comma ? L", " : L""), volume_type_match == 1 ? L"match" : L"not match"); add_comma++; } if (type_match != 0) { - DBG("%sType: %s", + DBG("%lsType: %ls", (add_comma ? L", " : L""), type_match == 1 ? L"match" : L"not match"); } DBG("\n"); } else { // Custom entry match - DBG("%aSkipped because matching custom entry %d!\n", indent, CustomIndex); + DBG("%sSkipped because matching custom entry %llu!\n", indent, CustomIndex); FreePool(LoaderDevicePathString); return NULL; } @@ -657,7 +657,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, } if ( Entry->Title.isEmpty() && ((Entry->VolName == NULL) || (StrLen(Entry->VolName) == 0)) ) { - //DBG("encounter Entry->VolName ==%s and StrLen(Entry->VolName) ==%d\n",Entry->VolName, StrLen(Entry->VolName)); + //DBG("encounter Entry->VolName ==%ls and StrLen(Entry->VolName) ==%d\n",Entry->VolName, StrLen(Entry->VolName)); if (GlobalConfig.BootCampStyle) { Entry->Title.takeValueFrom(((LoaderTitle != NULL) ? LoaderTitle : Basename(Volume->DevicePathString))); } else { @@ -666,7 +666,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, } } if ( Entry->Title.isEmpty() ) { - //DBG("encounter LoaderTitle ==%s and Entry->VolName ==%s\n", LoaderTitle, Entry->VolName); + //DBG("encounter LoaderTitle ==%ls and Entry->VolName ==%ls\n", LoaderTitle, Entry->VolName); if (GlobalConfig.BootCampStyle) { if ((StriCmp(LoaderTitle, L"macOS") == 0) || (StriCmp(LoaderTitle, L"Recovery") == 0)) { Entry->Title.takeValueFrom(Entry->VolName); @@ -678,7 +678,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, Entry->VolName); } } - //DBG("Entry->Title =%s\n", Entry->Title); + //DBG("Entry->Title =%ls\n", Entry->Title); // just an example that UI can show hibernated volume to the user // should be better to show it on entry image if (OSFLAG_ISSET(Entry->Flags, OSFLAG_HIBERNATED)) { @@ -711,7 +711,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, // Load DriveImage Entry->DriveImage = (DriveImage != NULL) ? DriveImage : ScanVolumeDefaultIcon(Volume, Entry->LoaderType, Volume->DevicePath); - // DBG("HideBadges=%d Volume=%s ", GlobalConfig.HideBadges, Volume->VolName); + // DBG("HideBadges=%d Volume=%ls ", GlobalConfig.HideBadges, Volume->VolName); #if USE_XTHEME if (ThemeX.HideBadges & HDBADGES_SHOW) { if (ThemeX.HideBadges & HDBADGES_SWAP) { @@ -741,7 +741,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST CHAR16 *LoaderPath, #ifdef DUMP_KERNEL_KEXT_PATCHES DumpKernelAndKextPatches(Entry->KernelAndKextPatches); #endif -// DBG("%aLoader entry created for '%s'\n", indent, Entry->DevicePathString); +// DBG("%sLoader entry created for '%ls'\n", indent, Entry->DevicePathString); return Entry; } @@ -792,7 +792,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry) Guid = FindGPTPartitionGuidInDevicePath(Volume->DevicePath); if (Guid) { CHAR8 *GuidStr = (__typeof__(GuidStr))AllocateZeroPool(50); - AsciiSPrint(GuidStr, 50, "%g", Guid); + AsciiSPrint(GuidStr, 50, "%s", strguid(Guid)); SubScreen->AddMenuInfoLine(PoolPrint(L"UUID: %a", GuidStr)); FreePool(GuidStr); } @@ -995,7 +995,7 @@ STATIC VOID AddDefaultMenu(IN LOADER_ENTRY *Entry) SubScreen->AddMenuEntry(&MenuEntryReturn, false); Entry->SubScreen = SubScreen; - // DBG(" Added '%s': OSType='%d', OSVersion='%a'\n", Entry->Title, Entry->LoaderType, Entry->OSVersion); + // DBG(" Added '%ls': OSType='%d', OSVersion='%s'\n", Entry->Title, Entry->LoaderType, Entry->OSVersion); } STATIC BOOLEAN AddLoaderEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *LoaderOptions, @@ -1010,7 +1010,7 @@ STATIC BOOLEAN AddLoaderEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *Load return FALSE; } - DBG(" AddLoaderEntry for Volume Name=%s\n", Volume->VolName); + DBG(" AddLoaderEntry for Volume Name=%ls\n", Volume->VolName); if (OSFLAG_ISSET(Flags, OSFLAG_DISABLED)) { DBG(" skipped because entry is disabled\n"); return FALSE; @@ -1023,7 +1023,7 @@ STATIC BOOLEAN AddLoaderEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *Load if (!gSettings.ShowHiddenEntries) { for (HVi = 0; HVi < gSettings.HVCount; HVi++) { if (StriStr(LoaderPath, gSettings.HVHideStrings[HVi])) { - DBG(" hiding entry: %s\n", LoaderPath); + DBG(" hiding entry: %ls\n", LoaderPath); return FALSE; } } @@ -1110,7 +1110,7 @@ VOID ScanLoader(VOID) //DBG(", no file system\n", VolumeIndex); continue; } - DBG("- [%02d]: '%s'", VolumeIndex, Volume->VolName); + DBG("- [%02llu]: '%ls'", VolumeIndex, Volume->VolName); if (Volume->VolName == NULL) { Volume->VolName = L"Unknown"; } @@ -1275,7 +1275,7 @@ VOID ScanLoader(VOID) // Get the partition UUID and make sure it's lower case CHAR16 PartUUID[40]; ZeroMem(&PreviousTime, sizeof(EFI_TIME)); - UnicodeSPrint(PartUUID, sizeof(PartUUID), L"%g", PartGUID); + UnicodeSPrint(PartUUID, sizeof(PartUUID), L"%s", strguid(PartGUID)); StrToLower(PartUUID); // open the /boot directory (or whatever directory path) DirIterOpen(Volume->RootDir, LINUX_BOOT_PATH, &Iter); @@ -1532,7 +1532,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, } if (FindCustomPath && (Custom->Type != OSTYPE_LINEFI)) { - DBG("Custom %sentry %d skipped because it didn't have a ", IsSubEntry ? L"sub " : L"", CustomIndex); + DBG("Custom %lsentry %llu skipped because it didn't have a ", IsSubEntry ? L"sub " : L"", CustomIndex); if (Custom->Type == 0) { DBG("Type.\n"); } else { @@ -1542,30 +1542,30 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, } if (OSFLAG_ISSET(Custom->Flags, OSFLAG_DISABLED)) { - DBG("Custom %sentry %d skipped because it is disabled.\n", IsSubEntry ? L"sub " : L"", CustomIndex); + DBG("Custom %lsentry %llu skipped because it is disabled.\n", IsSubEntry ? L"sub " : L"", CustomIndex); return; } if (!gSettings.ShowHiddenEntries && OSFLAG_ISSET(Custom->Flags, OSFLAG_HIDDEN)) { - DBG("Custom %sentry %d skipped because it is hidden.\n", IsSubEntry ? L"sub " : L"", CustomIndex); + DBG("Custom %lsentry %llu skipped because it is hidden.\n", IsSubEntry ? L"sub " : L"", CustomIndex); return; } - DBG("Custom %sentry %d ", IsSubEntry ? L"sub " : L"", CustomIndex); + DBG("Custom %lsentry %llu ", IsSubEntry ? L"sub " : L"", CustomIndex); if (Custom->Title) { - DBG("Title:\"%s\" ", Custom->Title); + DBG("Title:\"%ls\" ", Custom->Title); } if (Custom->FullTitle) { - DBG("FullTitle:\"%s\" ", Custom->FullTitle); + DBG("FullTitle:\"%ls\" ", Custom->FullTitle); } if (CustomPath) { - DBG("Path:\"%s\" ", CustomPath); + DBG("Path:\"%ls\" ", CustomPath); } if (Custom->Options != NULL) { - DBG("Options:\"%s\" ", Custom->Options); + DBG("Options:\"%ls\" ", Custom->Options); } DBG("Type:%d Flags:0x%X matching ", Custom->Type, Custom->Flags); if (Custom->Volume) { - DBG("Volume:\"%s\"\n", Custom->Volume); + DBG("Volume:\"%ls\"\n", Custom->Volume); } else { DBG("all volumes\n"); } @@ -1585,7 +1585,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, Volume->VolName = L"Unknown"; } - DBG(" Checking volume \"%s\" (%s) ... ", Volume->VolName, Volume->DevicePathString); + DBG(" Checking volume \"%ls\" (%ls) ... ", Volume->VolName, Volume->DevicePathString); // skip volume if its kind is configured as disabled if ((Volume->DiskKind == DISK_KIND_OPTICAL && (GlobalConfig.DisableFlags & VOLTYPE_OPTICAL)) || @@ -1650,7 +1650,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, DBG("skipped because volume does not have partition uuid\n"); continue; } - UnicodeSPrint(PartUUID, sizeof(PartUUID), L"%g", Guid); + UnicodeSPrint(PartUUID, sizeof(PartUUID), L"%s", strguid(Guid)); StrToLower(PartUUID); // open the /boot directory (or whatever directory path) DirIterOpen(Volume->RootDir, LINUX_BOOT_PATH, Iter); @@ -1974,7 +1974,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, } } if (BetterMatch) { - DBG("skipped because custom entry %d is a better match and will produce a duplicate entry\n", i); + DBG("skipped because custom entry %llu is a better match and will produce a duplicate entry\n", i); continue; } } @@ -1982,7 +1982,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, // Create an entry for this volume Entry = CreateLoaderEntry(CustomPath, CustomOptions, Custom->FullTitle, Custom->Title, Volume, Image, DriveImage, Custom->Type, Custom->Flags, Custom->Hotkey, Custom->BootBgColor, Custom->CustomBoot, Custom->CustomLogo, /*(KERNEL_AND_KEXT_PATCHES *)(((UINTN)Custom) + OFFSET_OF(CUSTOM_LOADER_ENTRY, KernelAndKextPatches))*/ NULL, TRUE); if (Entry != NULL) { - DBG("Custom settings: %s.plist will %a be applied\n", + DBG("Custom settings: %ls.plist will %s be applied\n", Custom->Settings, Custom->CommonSettings?"not":""); if (!Custom->CommonSettings) { Entry->Settings = Custom->Settings; @@ -2010,7 +2010,7 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex, SubScreen->AddMenuInfoLine(FileDevicePathToStr(Entry->DevicePath)); if (Guid) { CHAR8 *GuidStr = (__typeof__(GuidStr))AllocateZeroPool(50); - AsciiSPrint(GuidStr, 50, "%g", Guid); + AsciiSPrint(GuidStr, 50, "%s", strguid(Guid)); SubScreen->AddMenuInfoLine(PoolPrint(L"UUID: %a", GuidStr)); FreePool(GuidStr); } diff --git a/rEFIt_UEFI/entry_scan/lockedgraphics.cpp b/rEFIt_UEFI/entry_scan/lockedgraphics.cpp index 65fc9ccdb..36f34f4db 100644 --- a/rEFIt_UEFI/entry_scan/lockedgraphics.cpp +++ b/rEFIt_UEFI/entry_scan/lockedgraphics.cpp @@ -152,10 +152,10 @@ static EFI_STATUS AddLockedGraphicsGOP(IN EFI_HANDLE Handle, IN EFI_HANDLE Agent GOPInterface->Mode->MaxMode = 1; GOPInterface->Mode->Mode = 0; GOPInterface->Mode->SizeOfInfo = sizeof(EFI_GRAPHICS_OUTPUT_MODE_INFORMATION); - DBG("Custom boot framebuffer 0x%X 0x%X\n", GOPInterface->Mode->FrameBufferBase, GOPInterface->Mode->FrameBufferSize); + DBG("Custom boot framebuffer 0x%llX 0x%llX\n", (uintptr_t)GOPInterface->Mode->FrameBufferBase, GOPInterface->Mode->FrameBufferSize); GOPInterface->Mode->FrameBufferBase = (EFI_PHYSICAL_ADDRESS)(UINTN)(GOPInterface->Mode->FrameBufferBase + GOPInterface->Mode->FrameBufferSize); GOPInterface->Mode->FrameBufferSize = BufferSize; - DBG("Custom boot GOP: 0x%X @0x%X 0x%X", GOPInterface, GOPInterface->Mode->FrameBufferBase, BufferSize); + DBG("Custom boot GOP: 0x%llX @0x%llX 0x%llX", (uintptr_t)GOPInterface, (uintptr_t)GOPInterface->Mode->FrameBufferBase, BufferSize); if (GOPInterface->Mode->Info != NULL) { // /* GOPInterface->Mode->Info->Version = 0; diff --git a/rEFIt_UEFI/entry_scan/secureboot.cpp b/rEFIt_UEFI/entry_scan/secureboot.cpp index 9238fa7af..ab280a349 100644 --- a/rEFIt_UEFI/entry_scan/secureboot.cpp +++ b/rEFIt_UEFI/entry_scan/secureboot.cpp @@ -68,7 +68,7 @@ VOID EnableSecureBoot(VOID) } // Ask user if they want to use default keys WantDefaultKeys = YesNoMessage(L"Secure Boot", L"Enroll the default keys too?"); - DBG("Enabling secure boot with%a default keys\n", WantDefaultKeys ? "" : "out"); + DBG("Enabling secure boot with%s default keys\n", WantDefaultKeys ? "" : "out"); // Get this image's certificate if (SelfFullDevicePath != NULL) { UINT32 AuthenticationStatus = 0; @@ -95,7 +95,7 @@ VOID EnableSecureBoot(VOID) if ((FileBuffer == NULL) || (FileSize == 0)) { CHAR16 *FilePath = FileDevicePathToStr(SelfFullDevicePath); if (FilePath != NULL) { - DBG("Failed to load Clover image from %s\n", FilePath); + DBG("Failed to load Clover image from %ls\n", FilePath); FreePool(FilePath); } else { DBG("Failed to load Clover image\n"); @@ -127,7 +127,7 @@ VOID EnableSecureBoot(VOID) AlertMessage(L"Enable Secure Boot", Str); FreePool(Str); } - DBG("Enabling secure boot failed because %s! Status: %r\n", ErrorString, Status); + DBG("Enabling secure boot failed because %ls! Status: %s\n", ErrorString, strerror(Status)); DisableSecureBoot(); } } @@ -154,11 +154,11 @@ STATIC VOID PrintSecureBootInfo(VOID) { // Nothing to do if secure boot is disabled or in setup mode if (!gSettings.SecureBoot) { - DBG("Secure Boot: %a\n", (gSettings.SecureBootSetupMode ? "Setup" : "Disabled")); + DBG("Secure Boot: %s\n", (gSettings.SecureBootSetupMode ? "Setup" : "Disabled")); } else { // Secure boot is enabled - DBG("Secure Boot: %a\n", (gSettings.SecureBootSetupMode ? "Forced" : "Enabled")); - DBG("Boot Policy: %s\n", SecureBootPolicyToStr(gSettings.SecureBootPolicy)); + DBG("Secure Boot: %s\n", (gSettings.SecureBootSetupMode ? "Forced" : "Enabled")); + DBG("Boot Policy: %ls\n", SecureBootPolicyToStr(gSettings.SecureBootPolicy)); } } @@ -174,11 +174,11 @@ STATIC VOID DisableMessage(IN EFI_STATUS Status, Str = PoolPrint(L"%s\n%r", String, Status); } if (Str != NULL) { - DBG("Secure Boot: %s", Str); + DBG("Secure Boot: %ls", Str); AlertMessage(L"Disable Secure Boot", Str); FreePool(Str); } else { - DBG("Secure Boot: %s", String); + DBG("Secure Boot: %ls", String); AlertMessage(L"Disable Secure Boot", String); } } @@ -310,7 +310,7 @@ CheckSecureBootPolicy(IN OUT EFI_STATUS *AuthenticationStatu case SECURE_BOOT_POLICY_USER: // Query user to allow image or deny image or insert image signature UserResponse = QuerySecureBootUser(DevicePath); - DBG("VerifySecureBootImage: User selected policy: %s\n", SecureBootPolicyToStr(UserResponse)); + DBG("VerifySecureBootImage: User selected policy: %ls\n", SecureBootPolicyToStr(UserResponse)); // Perform user action switch (UserResponse) { case SECURE_BOOT_POLICY_ALLOW: @@ -367,7 +367,7 @@ InternalFileAuthentication(IN CONST EFI_SECURITY_ARCH_PROTOCOL *This, if (EFI_ERROR(Status)) { CHAR16 *DevicePathStr = FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL *)DevicePath); if (DevicePathStr) { - DBG("VerifySecureBootImage(1): %r %s\n", Status, DevicePathStr); + DBG("VerifySecureBootImage(1): %s %ls\n", strerror(Status), DevicePathStr); FreePool(DevicePathStr); } } @@ -394,7 +394,7 @@ Internal2FileAuthentication(IN CONST EFI_SECURITY2_ARCH_PROTOCOL *This, if (EFI_ERROR(Status)) { CHAR16 *DevicePathStr = FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL *)DevicePath); if (DevicePathStr) { - DBG("VerifySecureBootImage(2): %r %s\n", Status, DevicePathStr); + DBG("VerifySecureBootImage(2): %s %ls\n", strerror(Status), DevicePathStr); FreePool(DevicePathStr); } } @@ -413,7 +413,7 @@ EFI_STATUS VerifySecureBootImage(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath) if (EFI_ERROR(Status)) { CHAR16 *DevicePathStr = FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL *)DevicePath); if (DevicePathStr) { - DBG("VerifySecureBootImage: %r %s\n", Status, DevicePathStr); + DBG("VerifySecureBootImage: %s %ls\n", strerror(Status), DevicePathStr); FreePool(DevicePathStr); } } diff --git a/rEFIt_UEFI/entry_scan/securehash.cpp b/rEFIt_UEFI/entry_scan/securehash.cpp index ef257829e..b2ba75182 100644 --- a/rEFIt_UEFI/entry_scan/securehash.cpp +++ b/rEFIt_UEFI/entry_scan/securehash.cpp @@ -862,7 +862,7 @@ VOID *GetImageSignatureDatabase(IN VOID *FileBuffer, } // Append the signature if valid if ((SigGuid != NULL) && (Signature != NULL) && (SigSize > 0)) { - DBG("Found signature certificate: 0x%X (0x%X) %g\n", Signature, SigSize, SigGuid); + DBG("Found signature certificate: 0x%X (0x%X) %s\n", Signature, SigSize, strguid(SigGuid)); if (EFI_ERROR(AppendSignatureToDatabase(&Database, &Size, SigGuid, Signature, SigSize))) { break; } diff --git a/rEFIt_UEFI/entry_scan/securemenu.cpp b/rEFIt_UEFI/entry_scan/securemenu.cpp index 20d68cae0..692eb6f57 100644 --- a/rEFIt_UEFI/entry_scan/securemenu.cpp +++ b/rEFIt_UEFI/entry_scan/securemenu.cpp @@ -139,7 +139,7 @@ UINTN QuerySecureBootUser(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath) QueryUserMenu.InfoLines = Information; QueryUserMenu.Entries.size() = gSettings.SecureBootSetupMode ? 2 : 3; // Debug message - DBG("VerifySecureBootImage: Query user for authentication action for %s\n", Information[1]); + DBG("VerifySecureBootImage: Query user for authentication action for %ls\n", Information[1]); // Because we may if (!gGuiIsReady) { InitScreen(FALSE); @@ -485,7 +485,7 @@ BOOLEAN ConfigureSecureBoot(VOID) case SECURE_BOOT_POLICY_USER: // Set a new policy gSettings.SecureBootPolicy = (UINT8)ChosenEntry->Tag; - DBG("User changed secure boot policy: %s\n", SecureBootPolicyToStr(gSettings.SecureBootPolicy)); + DBG("User changed secure boot policy: %ls\n", SecureBootPolicyToStr(gSettings.SecureBootPolicy)); default: MenuExit = MENU_EXIT_ESCAPE; diff --git a/rEFIt_UEFI/entry_scan/securevars.cpp b/rEFIt_UEFI/entry_scan/securevars.cpp index d9caaf696..41aa160e6 100644 --- a/rEFIt_UEFI/entry_scan/securevars.cpp +++ b/rEFIt_UEFI/entry_scan/securevars.cpp @@ -118,7 +118,7 @@ EFI_STATUS EnrollSecureBootKeys(IN VOID *AuthorizedDatabase, if (Database != NULL) { FreePool(Database); } - DBG("Failed to modify authorized database with Canonical key! %r\n", Status); + DBG("Failed to modify authorized database with Canonical key! %s\n", strerror(Status)); return Status; } Status = AppendSignatureToDatabase(&Database, &DatabaseSize, &gEfiCertX509Guid, (VOID *)gSecureBootMSPCADatabaseKey, sizeof(gSecureBootMSPCADatabaseKey)); @@ -126,7 +126,7 @@ EFI_STATUS EnrollSecureBootKeys(IN VOID *AuthorizedDatabase, if (Database != NULL) { FreePool(Database); } - DBG("Failed to modify authorized database with MS PCA key! %r\n", Status); + DBG("Failed to modify authorized database with MS PCA key! %s\n", strerror(Status)); return Status; } Status = AppendSignatureToDatabase(&Database, &DatabaseSize, &gEfiCertX509Guid, (VOID *)gSecureBootMSUEFICADatabaseKey, sizeof(gSecureBootMSUEFICADatabaseKey)); @@ -134,7 +134,7 @@ EFI_STATUS EnrollSecureBootKeys(IN VOID *AuthorizedDatabase, if (Database != NULL) { FreePool(Database); } - DBG("Failed to modify authorized database with MS UEFICA key! %r\n", Status); + DBG("Failed to modify authorized database with MS UEFICA key! %s\n", strerror(Status)); return Status; } } @@ -148,7 +148,7 @@ EFI_STATUS EnrollSecureBootKeys(IN VOID *AuthorizedDatabase, // Append keys if needed... } if (EFI_ERROR(Status)) { - DBG("Failed to set the authorized database! %r\n", Status); + DBG("Failed to set the authorized database! %s\n", strerror(Status)); return Status; } // We set the unauthorized database @@ -168,7 +168,7 @@ EFI_STATUS EnrollSecureBootKeys(IN VOID *AuthorizedDatabase, FreePool(Database); DatabaseSize = 0; if (EFI_ERROR(Status)) { - DBG("Failed to set the unauthorized database! %r\n", Status); + DBG("Failed to set the unauthorized database! %s\n", strerror(Status)); return Status; } } @@ -194,7 +194,7 @@ EFI_STATUS EnrollSecureBootKeys(IN VOID *AuthorizedDatabase, if (Database != NULL) { FreePool(Database); } - DBG("Failed to modify exchange database with MS exchange key! %r\n", Status); + DBG("Failed to modify exchange database with MS exchange key! %s\n", strerror(Status)); return Status; } } @@ -207,7 +207,7 @@ EFI_STATUS EnrollSecureBootKeys(IN VOID *AuthorizedDatabase, if (Database != NULL) { FreePool(Database); } - DBG("Failed to modify exchange database! %r\n", Status); + DBG("Failed to modify exchange database! %s\n", strerror(Status)); return Status; } DBG("Setting the exchange database ...\n"); @@ -216,7 +216,7 @@ EFI_STATUS EnrollSecureBootKeys(IN VOID *AuthorizedDatabase, DatabaseSize = 0; Database = NULL; if (EFI_ERROR(Status)) { - DBG("Failed to set exchange database key! %r\n", Status); + DBG("Failed to set exchange database key! %s\n", strerror(Status)); return Status; } // Unsure if default platform database should be enrolled.....??? @@ -389,7 +389,7 @@ EFI_STATUS SetSignedVariable(IN CHAR16 *DatabaseName, if ((DatabaseName == NULL) || (DatabaseGuid == NULL)) { return EFI_INVALID_PARAMETER; } - DBG("Setting secure variable: %g %s 0x%X (0x%X)\n", DatabaseGuid, DatabaseName, Database, DatabaseSize); + DBG("Setting secure variable: %s %ls 0x%X (0x%X)\n", strguid(DatabaseGuid), DatabaseName, Database, DatabaseSize); NameLen = StrLen(DatabaseName); if (NameLen == 0) { return EFI_INVALID_PARAMETER; diff --git a/rEFIt_UEFI/entry_scan/tool.cpp b/rEFIt_UEFI/entry_scan/tool.cpp index 5727adeed..64e44c4f7 100644 --- a/rEFIt_UEFI/entry_scan/tool.cpp +++ b/rEFIt_UEFI/entry_scan/tool.cpp @@ -108,7 +108,7 @@ STATIC BOOLEAN AddToolEntry(IN CONST CHAR16 *LoaderPath, IN CONST CHAR16 *FullTi Entry->AtDoubleClick = ActionEnter; Entry->AtRightClick = ActionHelp; - DBG("found tool %s\n", LoaderPath); + DBG("found tool %ls\n", LoaderPath); MainMenu.AddMenuEntry(Entry, true); return TRUE; } @@ -228,7 +228,7 @@ VOID ScanTool(VOID) Status = gBS->HandleProtocol (Volume->DeviceHandle, &gEfiPartTypeSystemPartGuid, &Interface); if (Status == EFI_SUCCESS) { - DBG("Checking EFI partition Volume %d for Clover\n", VolumeIndex); + DBG("Checking EFI partition Volume %llu for Clover\n", VolumeIndex); // OSX adds label "EFI" to EFI volumes and some UEFIs see that // as a file. This file then blocks access to the /EFI directory. @@ -262,21 +262,21 @@ VOID AddCustomTool(VOID) // Traverse the custom entries for (Custom = gSettings.CustomTool; Custom; ++i, Custom = Custom->Next) { if (OSFLAG_ISSET(Custom->Flags, OSFLAG_DISABLED)) { - DBG("Custom tool %d skipped because it is disabled.\n", i); + DBG("Custom tool %llu skipped because it is disabled.\n", i); continue; } if (!gSettings.ShowHiddenEntries && OSFLAG_ISSET(Custom->Flags, OSFLAG_HIDDEN)) { - DBG("Custom tool %d skipped because it is hidden.\n", i); + DBG("Custom tool %llu skipped because it is hidden.\n", i); continue; } if (Custom->Volume) { - DBG("Custom tool %d matching \"%s\" ...\n", i, Custom->Volume); + DBG("Custom tool %llu matching \"%ls\" ...\n", i, Custom->Volume); } for (VolumeIndex = 0; VolumeIndex < Volumes.size(); ++VolumeIndex) { Volume = &Volumes[VolumeIndex]; - DBG(" Checking volume \"%s\" (%s) ... ", Volume->VolName, Volume->DevicePathString); + DBG(" Checking volume \"%ls\" (%ls) ... ", Volume->VolName, Volume->DevicePathString); // Skip Whole Disc Boot if (Volume->RootDir == NULL) { diff --git a/rEFIt_UEFI/libeg/VectorGraphics.cpp b/rEFIt_UEFI/libeg/VectorGraphics.cpp index 9b9e71e6d..85b07ecc8 100755 --- a/rEFIt_UEFI/libeg/VectorGraphics.cpp +++ b/rEFIt_UEFI/libeg/VectorGraphics.cpp @@ -90,8 +90,8 @@ EFI_STATUS ParseSVGXIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float S if (group) { //the shape is in the group // keep this sample for debug purpose -/* DBG("found shape %a", shape->id); - DBG(" from group %a\n", group->id); +/* DBG("found shape %s", shape->id); + DBG(" from group %s\n", group->id); if ((Id == BUILTIN_SELECTION_BIG) || (Id == BUILTIN_ICON_BACKGROUND) || (Id == BUILTIN_ICON_BANNER)) { @@ -167,13 +167,13 @@ EFI_STATUS ParseSVGXIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float S group = group->parent; } if (group) { - DBG("found clipPaths for %a\n", IconName); + DBG("found clipPaths for %s\n", IconName); IconImage->clipPaths = SVGimage->clipPaths; break; } clipPaths = clipNext; } - // DBG("found %d clips for %a\n", ClipCount, IconName); + // DBG("found %d clips for %s\n", ClipCount, IconName); // if (ClipCount) { //Id == BUILTIN_ICON_BANNER) { // IconImage->clipPaths = SVGimage->clipPaths; // } @@ -194,7 +194,7 @@ EFI_STATUS ParseSVGXIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float S float Height = IconImage->height * Scale; float Width = IconImage->width * Scale; - // DBG("icon %a width=%s height=%s\n", IconName, PoolPrintFloat(Width), PoolPrintFloat(Height)); + // DBG("icon %s width=%ls height=%ls\n", IconName, PoolPrintFloat(Width), PoolPrintFloat(Height)); int iWidth = (int)(Width + 0.5f); int iHeight = (int)(Height + 0.5f); // EG_IMAGE *NewImage = egCreateFilledImage(iWidth, iHeight, TRUE, &MenuBackgroundPixel); @@ -204,7 +204,7 @@ EFI_STATUS ParseSVGXIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float S return Status; } - // DBG("begin rasterize %a\n", IconName); + // DBG("begin rasterize %s\n", IconName); float tx = 0.f, ty = 0.f; if ((Id != BUILTIN_ICON_BACKGROUND) && (Id != BUILTIN_ICON_ANIME) && @@ -216,7 +216,7 @@ EFI_STATUS ParseSVGXIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float S } nsvgRasterize(rast, IconImage, tx,ty,Scale,Scale, (UINT8*)NewImage.GetPixelPtr(0,0), iWidth, iHeight, iWidth*4); - // DBG("%a rastered, blt\n", IconImage); + // DBG("%s rastered, blt\n", IconImage); nsvgDeleteRasterizer(rast); // nsvg__deleteParser(p2); @@ -257,8 +257,8 @@ EFI_STATUS ParseSVGIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float Sc if (group) { //the shape is in the group // keep this sample for debug purpose -/* DBG("found shape %a", shape->id); - DBG(" from group %a\n", group->id); +/* DBG("found shape %s", shape->id); + DBG(" from group %s\n", group->id); if ((Id == BUILTIN_SELECTION_BIG) || (Id == BUILTIN_ICON_BACKGROUND) || (Id == BUILTIN_ICON_BANNER)) { @@ -276,13 +276,13 @@ EFI_STATUS ParseSVGIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float Sc } // if (Id == BUILTIN_ICON_BACKGROUND || Id == BUILTIN_ICON_BANNER) { // DBG("IconImage size [%d,%d]\n", (int)IconImage->width, (int)IconImage->height); - // DBG("IconImage left corner x=%s y=%s\n", PoolPrintFloat(IconImage->realBounds[0]), PoolPrintFloat(IconImage->realBounds[1])); + // DBG("IconImage left corner x=%ls y=%ls\n", PoolPrintFloat(IconImage->realBounds[0]), PoolPrintFloat(IconImage->realBounds[1])); // DumpFloat2("IconImage real bounds", IconImage->realBounds, 4); // } if ((strstr(IconName, "selection_big") != NULL) && (!GlobalConfig.SelectionOnTop)) { GlobalConfig.MainEntriesSize = (int)(IconImage->width * Scale); //xxx row0TileSize = GlobalConfig.MainEntriesSize + (int)(16.f * Scale); - DBG("main entry size = %d\n", GlobalConfig.MainEntriesSize); + DBG("main entry size = %lld\n", GlobalConfig.MainEntriesSize); } if ((strstr(IconName, "selection_small") != NULL) && (!GlobalConfig.SelectionOnTop)) { row1TileSize = (int)(IconImage->width * Scale); @@ -336,13 +336,13 @@ EFI_STATUS ParseSVGIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float Sc group = group->parent; } if (group) { - DBG("found clipPaths for %a\n", IconName); + DBG("found clipPaths for %s\n", IconName); IconImage->clipPaths = SVGimage->clipPaths; break; } clipPaths = clipNext; } -// DBG("found %d clips for %a\n", ClipCount, IconName); +// DBG("found %d clips for %s\n", ClipCount, IconName); // if (ClipCount) { //Id == BUILTIN_ICON_BANNER) { // IconImage->clipPaths = SVGimage->clipPaths; // } @@ -359,12 +359,12 @@ EFI_STATUS ParseSVGIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float Sc if ((Id == BUILTIN_ICON_BANNER) && (strstr(IconName, "Banner") != NULL)) { GlobalConfig.BannerPosX = (int)(bounds[0] * Scale - GlobalConfig.CentreShift); GlobalConfig.BannerPosY = (int)(bounds[1] * Scale); - DBG("Banner position at parse [%d,%d]\n", GlobalConfig.BannerPosX, GlobalConfig.BannerPosY); + DBG("Banner position at parse [%lld,%lld]\n", GlobalConfig.BannerPosX, GlobalConfig.BannerPosY); } float Height = IconImage->height * Scale; float Width = IconImage->width * Scale; -// DBG("icon %a width=%s height=%s\n", IconName, PoolPrintFloat(Width), PoolPrintFloat(Height)); +// DBG("icon %s width=%ls height=%ls\n", IconName, PoolPrintFloat(Width), PoolPrintFloat(Height)); int iWidth = (int)(Width + 0.5f); int iHeight = (int)(Height + 0.5f); EG_IMAGE *NewImage = egCreateFilledImage(iWidth, iHeight, TRUE, &MenuBackgroundPixel); @@ -374,7 +374,7 @@ EFI_STATUS ParseSVGIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float Sc return Status; } -// DBG("begin rasterize %a\n", IconName); +// DBG("begin rasterize %s\n", IconName); float tx = 0.f, ty = 0.f; if ((Id != BUILTIN_ICON_BACKGROUND) && (Id != BUILTIN_ICON_ANIME) && @@ -386,7 +386,7 @@ EFI_STATUS ParseSVGIcon(NSVGparser *p, INTN Id, CONST CHAR8 *IconName, float Sc } nsvgRasterize(rast, IconImage, tx,ty,Scale,Scale, (UINT8*)NewImage->PixelData, iWidth, iHeight, iWidth*4); -// DBG("%a rastered, blt\n", IconImage); +// DBG("%s rastered, blt\n", IconImage); #if 0 BltImageAlpha(NewImage, (int)(UGAWidth - NewImage->Width) / 2, @@ -422,19 +422,19 @@ EFI_STATUS ParseSVGTheme(CONST CHAR8* buffer, TagPtr * dict) // must be svg view-box float vbx = mainParser->viewWidth; float vby = mainParser->viewHeight; - DBG("Theme view-bounds: w=%d h=%d units=%a\n", (int)vbx, (int)vby, "px"); + DBG("Theme view-bounds: w=%d h=%d units=%s\n", (int)vbx, (int)vby, "px"); if (vby > 1.0f) { SVGimage->height = vby; } else { SVGimage->height = 768.f; //default height } Scale = UGAHeight / SVGimage->height; - DBG("using scale %s\n", PoolPrintFloat(Scale)); + DBG("using scale %ls\n", PoolPrintFloat(Scale)); GlobalConfig.Scale = Scale; GlobalConfig.CentreShift = (vbx * Scale - (float)UGAWidth) * 0.5f; if (mainParser->font) { - DBG("theme contains font-family=%a\n", mainParser->font->fontFamily); + DBG("theme contains font-family=%s\n", mainParser->font->fontFamily); } #if 0 @@ -442,14 +442,14 @@ EFI_STATUS ParseSVGTheme(CONST CHAR8* buffer, TagPtr * dict) if (fontSVG) { if (p->font) { FontHeight = (int)(textFace[2].size * Scale); //as in MenuRows - DBG("Menu font scaled height=%d color=%x\n", FontHeight, textFace[2].color); + DBG("Menu font scaled height=%d color=%X\n", FontHeight, textFace[2].color); } if (!FontHeight) FontHeight = 16; //xxx if (fontSVG->fontFamily[0] < 0x30) { AsciiStrCpyS(fontSVG->fontFamily, 64, fontSVG->id); } RenderSVGfont(fontSVG, p->fontColor); - DBG("font %a parsed\n", fontSVG->fontFamily); + DBG("font %s parsed\n", fontSVG->fontFamily); } #endif @@ -484,7 +484,7 @@ EFI_STATUS ParseSVGTheme(CONST CHAR8* buffer, TagPtr * dict) BuiltinIconTable[BUILTIN_ICON_BANNER].Image = Banner; BanHeight = (int)(Banner->Height * Scale + 1.f); - DBG("parsed banner->width=%d\n", Banner->Width); + DBG("parsed banner->width=%lld\n", Banner->Width); // --- Make other icons INTN i = BUILTIN_ICON_FUNC_ABOUT; @@ -495,18 +495,18 @@ EFI_STATUS ParseSVGTheme(CONST CHAR8* buffer, TagPtr * dict) continue; } CONST CHAR16 *IconPath = BuiltinIconTable[i].Path; -// DBG("next table icon=%s\n", IconPath); +// DBG("next table icon=%ls\n", IconPath); CONST CHAR16 *ptr = StrStr(IconPath, L"\\"); if (!ptr) { ptr = IconPath; } else { ptr++; } - // DBG("next icon=%s Len=%d\n", ptr, StrLen(ptr)); + // DBG("next icon=%ls Len=%d\n", ptr, StrLen(ptr)); UINTN Size = StrLen(ptr)+1; IconName = (__typeof__(IconName))AllocateZeroPool(Size); UnicodeStrToAsciiStrS(ptr, IconName, Size); -// DBG("search for icon name %a\n", IconName); +// DBG("search for icon name %s\n", IconName); CHAR8 IconNight[64]; AsciiStrCpyS(IconNight, 64, IconName); AsciiStrCatS(IconNight, 64, "_night"); @@ -518,7 +518,7 @@ EFI_STATUS ParseSVGTheme(CONST CHAR8* buffer, TagPtr * dict) Status = ParseSVGIcon(mainParser, i, IconName, Scale, &BuiltinIconTable[i].Image); } if (EFI_ERROR(Status)) { - DBG(" icon %d not parsed take common %s\n", i, BuiltinIconTable[i].Path); + DBG(" icon %lld not parsed take common %ls\n", i, BuiltinIconTable[i].Path); if ((i >= BUILTIN_ICON_VOL_EXTERNAL) && (i <= BUILTIN_ICON_VOL_INTERNAL_REC)) { if (BuiltinIconTable[BUILTIN_ICON_VOL_INTERNAL].Image) { BuiltinIconTable[i].Image = egCopyImage(BuiltinIconTable[BUILTIN_ICON_VOL_INTERNAL].Image); @@ -526,7 +526,7 @@ EFI_STATUS ParseSVGTheme(CONST CHAR8* buffer, TagPtr * dict) } } if (i == BUILTIN_SELECTION_BIG) { - DBG("icon main size=[%d,%d]\n", BuiltinIconTable[i].Image->Width, + DBG("icon main size=[%lld,%lld]\n", BuiltinIconTable[i].Image->Width, BuiltinIconTable[i].Image->Height); } i++; @@ -540,7 +540,7 @@ EFI_STATUS ParseSVGTheme(CONST CHAR8* buffer, TagPtr * dict) AsciiStrCpyS(IconNight, 64, OSIconsTable[i].name); AsciiStrCatS(IconNight, 64, "_night"); OSIconsTable[i].image = NULL; - // DBG("search for %a\n", OSIconsTable[i].name); + // DBG("search for %s\n", OSIconsTable[i].name); Status = EFI_NOT_FOUND; if (!DayLight) { Status = ParseSVGIcon(mainParser, i, IconNight, Scale, &OSIconsTable[i].image); @@ -549,7 +549,7 @@ EFI_STATUS ParseSVGTheme(CONST CHAR8* buffer, TagPtr * dict) Status = ParseSVGIcon(mainParser, i, OSIconsTable[i].name, Scale, &OSIconsTable[i].image); } if (EFI_ERROR(Status)) { - DBG("OSicon %a not parsed\n", OSIconsTable[i].name); + DBG("OSicon %s not parsed\n", OSIconsTable[i].name); if ((i > 0) && (i < 13)) { if (OSIconsTable[0].image) { OSIconsTable[i].image = egCopyImage(OSIconsTable[0].image); @@ -606,7 +606,7 @@ EFI_STATUS ParseSVGTheme(CONST CHAR8* buffer, TagPtr * dict) while (fontChain) { fontSVG = fontChain->font; if (fontSVG) { - DBG("probe fontFamily=%a fontStyle=%c\n", fontSVG->fontFamily, fontSVG->fontStyle); + DBG("probe fontFamily=%s fontStyle=%c\n", fontSVG->fontFamily, fontSVG->fontStyle); } else { DBG("nextChain is empty\n"); @@ -638,7 +638,7 @@ EFI_STATUS ParseSVGXTheme(CONST CHAR8* buffer, TagPtr * dict) // must be svg view-box float vbx = mainParser->viewWidth; float vby = mainParser->viewHeight; - DBG("Theme view-bounds: w=%d h=%d units=%a\n", (int)vbx, (int)vby, "px"); + DBG("Theme view-bounds: w=%d h=%d units=%s\n", (int)vbx, (int)vby, "px"); if (vby > 1.0f) { SVGimage->height = vby; } @@ -646,12 +646,12 @@ EFI_STATUS ParseSVGXTheme(CONST CHAR8* buffer, TagPtr * dict) SVGimage->height = 768.f; //default height } float Scale = UGAHeight / SVGimage->height; - DBG("using scale %s\n", PoolPrintFloat(Scale)); + DBG("using scale %ls\n", PoolPrintFloat(Scale)); ThemeX.Scale = Scale; ThemeX.CentreShift = (vbx * Scale - (float)UGAWidth) * 0.5f; if (mainParser->font) { - DBG("theme contains font-family=%a\n", mainParser->font->fontFamily); + DBG("theme contains font-family=%s\n", mainParser->font->fontFamily); } ThemeX.Background = XImage(UGAWidth, UGAHeight); @@ -680,7 +680,7 @@ EG_IMAGE * LoadSvgFrame(INTN i) AsciiSPrint(FrameName, 63, "frame_%d", i+1); Status = ParseSVGIcon(mainParser, BUILTIN_ICON_ANIME, FrameName, GlobalConfig.Scale, &Frame); if (EFI_ERROR(Status)) { - DBG("icon '%a' not loaded, status=%r\n", FrameName, Status); + DBG("icon '%s' not loaded, status=%s\n", FrameName, strerror(Status)); } return Frame; } @@ -702,7 +702,7 @@ VOID RenderSVGfont(NSVGfont *fontSVG, UINT32 color) FontImage = NULL; } INTN Height = FontHeight + 4; -// DBG("load font %a\n", fontSVG->fontFamily); +// DBG("load font %s\n", fontSVG->fontFamily); if (fontSVG->unitsPerEm < 1.f) { fontSVG->unitsPerEm = 1000.f; } @@ -711,7 +711,7 @@ VOID RenderSVGfont(NSVGfont *fontSVG, UINT32 color) fH = fontSVG->unitsPerEm; } FontScale = (float)FontHeight / fH; - DBG("font scale %s\n", PoolPrintFloat(FontScale)); + DBG("font scale %ls\n", PoolPrintFloat(FontScale)); FontWidth = (int)(fontSVG->horizAdvX * FontScale); INTN Width = FontWidth * (AsciiPageSize + GlobalConfig.CodepageSize); FontImage = egCreateImage(Width, Height, TRUE); @@ -732,8 +732,8 @@ VOID RenderSVGfont(NSVGfont *fontSVG, UINT32 color) text->font = fontSVG; text->fontColor = color; -// DBG("RenderSVGfont: fontID=%a\n", text->font->id); -// DBG("RenderSVGfont: family=%a\n", text->font->fontFamily); +// DBG("RenderSVGfont: fontID=%s\n", text->font->id); +// DBG("RenderSVGfont: family=%s\n", text->font->fontFamily); //add to head text->next = p->text; p->text = text; @@ -836,7 +836,7 @@ INTN renderSVGtext(XImage& TextBufferXY, INTN posX, INTN posY, INTN textType, XS } float fH = fontSVG->bbox[3] - fontSVG->bbox[1]; //1250 if (fH == 0.f) { - DBG("wrong font: %s\n", PoolPrintFloat(fontSVG->unitsPerEm)); + DBG("wrong font: %ls\n", PoolPrintFloat(fontSVG->unitsPerEm)); DumpFloat2("Font bbox", fontSVG->bbox, 4); fH = fontSVG->unitsPerEm?fontSVG->unitsPerEm:1000.0f; //1000 } @@ -850,7 +850,7 @@ INTN renderSVGtext(XImage& TextBufferXY, INTN posX, INTN posY, INTN textType, XS if (!letter) { break; } - // DBG("add letter 0x%x\n", letter); + // DBG("add letter 0x%X\n", letter); if (i == Cursor) { addLetter(p, 0x5F, x, y, sy, color); } @@ -932,7 +932,7 @@ INTN renderSVGtext(EG_IMAGE* TextBufferXY, INTN posX, INTN posY, INTN textType, } float fH = fontSVG->bbox[3] - fontSVG->bbox[1]; //1250 if (fH == 0.f) { - DBG("wrong font: %s\n", PoolPrintFloat(fontSVG->unitsPerEm)); + DBG("wrong font: %ls\n", PoolPrintFloat(fontSVG->unitsPerEm)); DumpFloat2("Font bbox", fontSVG->bbox, 4); fH = fontSVG->unitsPerEm?fontSVG->unitsPerEm:1000.0f; //1000 } @@ -946,30 +946,30 @@ INTN renderSVGtext(EG_IMAGE* TextBufferXY, INTN posX, INTN posY, INTN textType, y = (float)posY + fontSVG->bbox[1] * Scale; p->isText = TRUE; -//DBG("renderSVGtext -> Enter. Text=%a\n", XString(string).c); +//DBG("renderSVGtext -> Enter. Text=%s\n", XString(string).c); for (i=0; i < len; i++) { CHAR16 letter = string[i]; if (!letter) { break; } -// DBG("add letter 0x%x\n", letter); +// DBG("add letter 0x%X\n", letter); if (i == Cursor) { addLetter(p, 0x5F, x, y, sy, color); } x = addLetter(p, letter, x, y, sy, color); -// DBG("next x=%s\n", PoolPrintFloat(x)); +// DBG("next x=%ls\n", PoolPrintFloat(x)); } //end of string p->image->realBounds[0] = fontSVG->bbox[0] * Scale; p->image->realBounds[1] = fontSVG->bbox[1] * Scale; p->image->realBounds[2] = fontSVG->bbox[2] * Scale + x; //last bound p->image->realBounds[3] = fontSVG->bbox[3] * Scale; -// DBG("internal Scale=%s\n", PoolPrintFloat(Scale)); +// DBG("internal Scale=%ls\n", PoolPrintFloat(Scale)); // DumpFloat2("text bounds", p->image->realBounds, 4); //We made an image, then rasterize it rast = nsvgCreateRasterizer(); -// DBG("begin raster text, scale=%s\n", PoolPrintFloat(Scale)); +// DBG("begin raster text, scale=%ls\n", PoolPrintFloat(Scale)); nsvgRasterize(rast, p->image, 0, 0, 1.f, 1.f, (UINT8*)TextBufferXY->PixelData, (int)TextBufferXY->Width, (int)TextBufferXY->Height, (int)(Width*4)); float RealWidth = p->image->realBounds[2] - p->image->realBounds[0]; @@ -1029,7 +1029,7 @@ VOID testSVG() pixel.r = 0x0; pixel.g = 0x0; // if (i==1) { -// DBG("r=%x g=%x\n", pixel.r, pixel.g); +// DBG("r=%X g=%X\n", pixel.r, pixel.g); // } RndImage->PixelData[i * 256 + j] = pixel; } @@ -1076,7 +1076,7 @@ VOID testSVG() Scale = (ScaleX > ScaleY)?ScaleY:ScaleX; float tx = 0; //-SVGimage->realBounds[0] * Scale; float ty = 0; //-SVGimage->realBounds[1] * Scale; - DBG("timing rasterize start tx=%s ty=%s\n", PoolPrintFloat(tx), PoolPrintFloat(ty)); + DBG("timing rasterize start tx=%ls ty=%ls\n", PoolPrintFloat(tx), PoolPrintFloat(ty)); nsvgRasterize(rast, SVGimage, tx,ty,Scale,Scale, (UINT8*)NewImage->PixelData, (int)Width, (int)Height, (int)Width*4); DBG("timing rasterize end\n"); //now show it! @@ -1110,7 +1110,7 @@ VOID testSVG() EG_IMAGE* TextBufferXY = egCreateFilledImage(Width, Height, TRUE, &MenuBackgroundPixel); #endif Status = egLoadFile(SelfRootDir, L"Font.svg", &FileData, &FileDataLength); - DBG("test Font.svg loaded status=%r\n", Status); + DBG("test Font.svg loaded status=%s\n", strerror(Status)); if (!EFI_ERROR(Status)) { p = nsvgParse((CHAR8*)FileData, 72, 1.f); if (!p) { @@ -1121,7 +1121,7 @@ VOID testSVG() textFace[3].font = p->font; textFace[3].color = NSVG_RGBA(0x80, 0xFF, 0, 255); textFace[3].size = Height; -// DBG("font parsed family=%a\n", p->font->fontFamily); +// DBG("font parsed family=%s\n", p->font->fontFamily); FreePool(FileData); // Scale = Height / fontSVG->unitsPerEm; #if USE_XTHEME diff --git a/rEFIt_UEFI/libeg/XImage.cpp b/rEFIt_UEFI/libeg/XImage.cpp index c9363c601..1e8223357 100644 --- a/rEFIt_UEFI/libeg/XImage.cpp +++ b/rEFIt_UEFI/libeg/XImage.cpp @@ -579,7 +579,7 @@ EFI_STATUS XImage::LoadXImage(EFI_FILE *BaseDir, const XStringW& IconName) // decode it Status = FromPNG(FileData, FileDataLength); if (EFI_ERROR(Status)) { - DBG("%s not decoded\n", IconName.data()); + DBG("%ls not decoded\n", IconName.data()); } FreePool(FileData); return Status; diff --git a/rEFIt_UEFI/libeg/image.cpp b/rEFIt_UEFI/libeg/image.cpp index 8d439dbc5..6a6d55fd1 100644 --- a/rEFIt_UEFI/libeg/image.cpp +++ b/rEFIt_UEFI/libeg/image.cpp @@ -408,7 +408,7 @@ EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *File if (BaseDir == NULL) { Status = egFindESP(&BaseDir); if (EFI_ERROR(Status)) { - DBG("no ESP %r\n", Status); + DBG("no ESP %s\n", strerror(Status)); return Status; } } @@ -425,10 +425,10 @@ EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *File if (EFI_ERROR(Status)) { // make dir -// DBG("no dir %r\n", Status); +// DBG("no dir %s\n", strerror(Status)); Status = BaseDir->Open(BaseDir, &FileHandle, DirName, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE, EFI_FILE_DIRECTORY); -// DBG("cant make dir %r\n", Status); +// DBG("cant make dir %s\n", strerror(Status)); } // end of folder checking @@ -440,7 +440,7 @@ EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *File if (Status == EFI_WARN_DELETE_FAILURE) { //This is READ_ONLY file system CreateNew = FALSE; // will write into existing file -// DBG("RO FS %r\n", Status); +// DBG("RO FS %s\n", strerror(Status)); } } @@ -449,7 +449,7 @@ EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *File Status = BaseDir->Open(BaseDir, &FileHandle, FileName, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE, 0); if (EFI_ERROR(Status)) { -// DBG("no write %r\n", Status); +// DBG("no write %s\n", strerror(Status)); return Status; } } else { @@ -457,7 +457,7 @@ EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *File EFI_FILE_INFO *Info = EfiLibFileInfo(FileHandle); if (Info) { if (Info->FileSize < FileDataLength) { -// DBG("no old file %r\n", Status); +// DBG("no old file %s\n", strerror(Status)); return EFI_NOT_FOUND; } FreePool(Info); @@ -465,14 +465,14 @@ EFI_STATUS egSaveFile(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CONST CHAR16 *File } if (!FileHandle) { -// DBG("no FileHandle %r\n", Status); +// DBG("no FileHandle %s\n", strerror(Status)); return EFI_DEVICE_ERROR; } BufferSize = FileDataLength; Status = FileHandle->Write(FileHandle, &BufferSize, (VOID*)FileData); // CONST missing in EFI_FILE_HANDLE->write FileHandle->Close(FileHandle); -// DBG("not written %r\n", Status); +// DBG("not written %s\n", strerror(Status)); return Status; } @@ -482,12 +482,12 @@ EFI_STATUS egMkDir(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CHAR16 *DirName) EFI_STATUS Status; EFI_FILE_HANDLE FileHandle; - //DBG("Looking up dir assets (%s):", DirName); + //DBG("Looking up dir assets (%ls):", DirName); if (BaseDir == NULL) { Status = egFindESP(&BaseDir); if (EFI_ERROR(Status)) { - //DBG(" %r\n", Status); + //DBG(" %s\n", strerror(Status)); return Status; } } @@ -497,12 +497,12 @@ EFI_STATUS egMkDir(IN EFI_FILE_HANDLE BaseDir OPTIONAL, IN CHAR16 *DirName) if (EFI_ERROR(Status)) { // Write new dir - //DBG("%r, attempt to create one:", Status); + //DBG("%s, attempt to create one:", strerror(Status)); Status = BaseDir->Open(BaseDir, &FileHandle, DirName, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE | EFI_FILE_MODE_CREATE, EFI_FILE_DIRECTORY); } - //DBG(" %r\n", Status); + //DBG(" %s\n", strerror(Status)); return Status; } @@ -531,7 +531,7 @@ EG_IMAGE * egLoadImage(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN NewImage = egDecodePNG(FileData, FileDataLength, WantAlpha); if (!NewImage) { - DBG("%s not decoded\n", FileName); + DBG("%ls not decoded\n", FileName); } FreePool(FileData); return NewImage; @@ -568,7 +568,7 @@ EG_IMAGE * egLoadIcon(IN EFI_FILE_HANDLE BaseDir, IN CONST CHAR16 *FileName, IN while (OSIconsTable[i].name) { if (AsciiStrCmp(OSIconsTable[i].name, IconName) == 0) { -// DBG("theme defined %a\n", IconName); +// DBG("theme defined %s\n", IconName); // DBG(" icon size=[%d,%d]\n", OSIconsTable[i].image->Width, OSIconsTable[i].image->Height); FreePool(IconName); return OSIconsTable[i].image; @@ -867,13 +867,13 @@ EG_IMAGE * egDecodePNG(IN UINT8 *FileData, IN UINTN FileDataLength, IN BOOLEAN W * Error 28 incorrect PNG signature ok, because also called on ICNS files */ if (Error != 28U) { - DBG("egDecodePNG(%p, %lu, %c): eglodepng_decode failed with error %lu\n", + DBG("egDecodePNG(%p, %llu, %c): eglodepng_decode failed with error %llu\n", FileData, FileDataLength, WantAlpha?'Y':'N', Error); } return NULL; } if (!PixelData || Width > 4096U || Height > 4096U) { - DBG("egDecodePNG(%p, %lu, %c): eglodepng_decode returned suspect values, PixelData %p, Width %lu, Height %lu\n", + DBG("egDecodePNG(%p, %llu, %c): eglodepng_decode returned suspect values, PixelData %p, Width %llu, Height %llu\n", FileData, FileDataLength, WantAlpha?'Y':'N', PixelData, Width, Height); } diff --git a/rEFIt_UEFI/libeg/libscreen.cpp b/rEFIt_UEFI/libeg/libscreen.cpp index 8813f10e4..750fb622d 100644 --- a/rEFIt_UEFI/libeg/libscreen.cpp +++ b/rEFIt_UEFI/libeg/libscreen.cpp @@ -115,7 +115,7 @@ VOID egDumpGOPVideoModes(VOID) MaxMode = GraphicsOutput->Mode->MaxMode; Mode = GraphicsOutput->Mode->Mode; // MsgLog("Available graphics modes for refit.conf screen_resolution:\n"); -// MsgLog("Curr. Mode = %d, Modes = %d, FB = %lx, FB size=0x%x\n", +// MsgLog("Curr. Mode = %d, Modes = %d, FB = %lx, FB size=0x%X\n", // Mode, MaxMode, GraphicsOutput->Mode->FrameBufferBase, GraphicsOutput->Mode->FrameBufferSize); for (Mode = 0; Mode < MaxMode; Mode++) { @@ -144,10 +144,10 @@ VOID egDumpGOPVideoModes(VOID) break; } - MsgLog("- Mode %d: %dx%d PixFmt = %s, PixPerScanLine = %d\n", + MsgLog("- Mode %d: %dx%d PixFmt = %ls, PixPerScanLine = %d\n", Mode, Info->HorizontalResolution, Info->VerticalResolution, PixelFormatDesc, Info->PixelsPerScanLine); } else { - MsgLog("- Mode %d: %r\n", Mode, Status); + MsgLog("- Mode %d: %s\n", Mode, strerror(Status)); } } @@ -169,9 +169,9 @@ VOID egDumpSetConsoleVideoModes(VOID) for (i=1; i <= (UINTN)gST->ConOut->Mode->MaxMode; i++) { Status = gST->ConOut->QueryMode(gST->ConOut, i-1, &Width, &Height); if (Status == EFI_SUCCESS) { - //MsgLog(" Mode %d: %dx%d%s\n", i, Width, Height, (i-1==(UINTN)gST->ConOut->Mode->Mode)?L" (current mode)":L""); + //MsgLog(" Mode %d: %dx%d%ls\n", i, Width, Height, (i-1==(UINTN)gST->ConOut->Mode->Mode)?L" (current mode)":L""); if (!Once) { - MsgLog(" - [%02d]: %dx%d%s\n", i, Width, Height, (i-1==(UINTN)gST->ConOut->Mode->Mode)?L" (current mode)":L""); + MsgLog(" - [%02llu]: %llux%llu%ls\n", i, Width, Height, (i-1==(UINTN)gST->ConOut->Mode->Mode)?L" (current mode)":L""); } // Select highest mode (-1) or lowest mode (-2) as/if requested if ((GlobalConfig.ConsoleMode == -1 && (BestMode == 0 || Width > BestWidth || (Width == BestWidth && Height > BestHeight))) || @@ -197,12 +197,12 @@ VOID egDumpSetConsoleVideoModes(VOID) // Mode is valid if (BestMode-1 != (UINTN)gST->ConOut->Mode->Mode) { Status = gST->ConOut->SetMode(gST->ConOut, BestMode-1); - MsgLog(" Setting mode (%d): %r\n", BestMode, Status); + MsgLog(" Setting mode (%llu): %s\n", BestMode, strerror(Status)); } else { - MsgLog(" Selected mode (%d) is already set\n", BestMode); + MsgLog(" Selected mode (%llu) is already set\n", BestMode); } } else if (BestMode != 0) { - MsgLog(" Selected mode (%d) is not valid\n", BestMode); + MsgLog(" Selected mode (%llu) is not valid\n", BestMode); } } @@ -253,7 +253,7 @@ EFI_STATUS egSetMaxResolution() MsgLog(" - set\n"); } else { // we can not set BestMode - search for first one that we can - MsgLog(" - %r\n", Status); + MsgLog(" - %s\n", strerror(Status)); Status = egSetMode(1); } } @@ -281,11 +281,11 @@ EFI_STATUS egSetMode(INT32 Next) Mode = (Mode >= (INT32)MaxMode)?0:Mode; Mode = (Mode < 0)?((INT32)MaxMode - 1):Mode; Status = GraphicsOutput->QueryMode(GraphicsOutput, (UINT32)Mode, &SizeOfInfo, &Info); - MsgLog("QueryMode %d Status=%r\n", Mode, Status); + MsgLog("QueryMode %d Status=%s\n", Mode, strerror(Status)); if (Status == EFI_SUCCESS) { //Status = GraphicsOutput->SetMode(GraphicsOutput, (UINT32)Mode); Status = GopSetModeAndReconnectTextOut((UINT32)Mode); - //MsgLog("SetMode %d Status=%r\n", Mode, Status); + //MsgLog("SetMode %d Status=%s\n", Mode, strerror(Status)); egScreenWidth = GraphicsOutput->Mode->Info->HorizontalResolution; egScreenHeight = GraphicsOutput->Mode->Info->VerticalResolution; } @@ -313,7 +313,7 @@ EFI_STATUS egSetScreenResolution(IN CHAR16 *WidthHeight) if (WidthHeight == NULL) { return EFI_INVALID_PARAMETER; } - MsgLog("SetScreenResolution: %s", WidthHeight); + MsgLog("SetScreenResolution: %ls", WidthHeight); // we are expecting WidthHeight=L"1024x768" // parse Width and Height HeightP = WidthHeight; @@ -632,7 +632,7 @@ EFI_STATUS egScreenShot(VOID) EFI_STATUS Status = EFI_NOT_READY; //take screen XImage Screen(egScreenWidth, egScreenHeight); - MsgLog("Make screenshot W=%d H=%d\n", egScreenWidth, egScreenHeight); + MsgLog("Make screenshot W=%llu H=%llu\n", egScreenWidth, egScreenHeight); Screen.GetArea(0, 0, egScreenWidth, egScreenHeight); //convert to PNG UINT8 *FileData = NULL; @@ -679,7 +679,7 @@ static EFI_STATUS GopSetModeAndReconnectTextOut(IN UINT32 ModeNumber) } Status = GraphicsOutput->SetMode(GraphicsOutput, ModeNumber); - MsgLog("Video mode change to mode #%d: %r\n", ModeNumber, Status); + MsgLog("Video mode change to mode #%d: %s\n", ModeNumber, strerror(Status)); if (gFirmwareClover && !EFI_ERROR (Status)) { // When we change mode on GOP, we need to reconnect the drivers which produce simple text out diff --git a/rEFIt_UEFI/libeg/nanosvg.cpp b/rEFIt_UEFI/libeg/nanosvg.cpp index 1fdcc6968..1edcc96f4 100644 --- a/rEFIt_UEFI/libeg/nanosvg.cpp +++ b/rEFIt_UEFI/libeg/nanosvg.cpp @@ -107,7 +107,7 @@ void DumpFloat2 (CONST char* s, float* t, int N) { #if DEBUG_SVG int i; - DBG("%a: ", s); + DBG("%s: ", s); for(i=0; i' && state == NSVG_XML_TAG) { // Start of a content or new tag. *s++ = '\0'; // nsvg__parseContent(mark, contentCb, ud); -// DBG("nsvg__parseElement %a\n", mark); +// DBG("nsvg__parseElement %s\n", mark); nsvg__parseElement(mark, startelCb, endelCb, ud); -// DBG(" element %a parsed\n", mark); +// DBG(" element %s parsed\n", mark); mark = s; state = NSVG_XML_CONTENT; } else { @@ -547,14 +547,14 @@ void nsvg__deleteFont(NSVGfont* font) return; } if (font->missingGlyph) { -// DBG("missing glyph=%a\n", font->missingGlyph->name); +// DBG("missing glyph=%s\n", font->missingGlyph->name); nsvg__deletePaths(font->missingGlyph->path); FreePool(font->missingGlyph); font->missingGlyph = NULL; } glyphs = font->glyphs; while (glyphs) { -// DBG(" glyph=%a\n", glyphs->name); +// DBG(" glyph=%s\n", glyphs->name); next = glyphs->next; nsvg__deletePaths(glyphs->path); FreePool(glyphs); @@ -969,7 +969,7 @@ static void nsvg__addShape(NSVGparser* p) memcpy(shape->id, attr->id, sizeof shape->id); memcpy(shape->title, attr->title, sizeof shape->title); - // DBG("shapeID=%a\n", shape->id); + // DBG("shapeID=%s\n", shape->id); shape->group = attr->group; scale = nsvg__getAverageScale(attr->xform); //ssss shape->strokeWidth = attr->strokeWidth * scale; @@ -1310,7 +1310,7 @@ static unsigned int nsvg__parseColorRGB(const char* str) str = s1 + 1; } else { //error - DBG("StrFloat error:%a\n", str); + DBG("StrFloat error:%s\n", str); return NSVG_RGB(0,0,0); } AsciiStrToFloat(str, &s1, &fg); @@ -1322,7 +1322,7 @@ static unsigned int nsvg__parseColorRGB(const char* str) str = s1 + 1; } else { //error - DBG("StrFloat error:%a\n", str); + DBG("StrFloat error:%s\n", str); return NSVG_RGB(0,0,0); } AsciiStrToFloat(str, &s1, &fb); @@ -1903,7 +1903,7 @@ static void nsvg__parseStyle(NSVGparser* p, const char* str); static int nsvg__parseAttr(NSVGparser* p, const char* name, const char* value) { float xform[6]; - // DBG("parse Name:%a Value:%a\n", name, value); + // DBG("parse Name:%s Value:%s\n", name, value); NSVGattrib* attr = nsvg__getAttr(p); if (!attr) return 0; if (strcmp(name, "style") == 0) { @@ -2001,7 +2001,7 @@ static int nsvg__parseAttr(NSVGparser* p, const char* name, const char* value) CHAR8* apo = strstr(++value, "'"); if (apo) apo[0] = '\0'; } - // DBG("reduced font-family:%a\n", value); + // DBG("reduced font-family:%s\n", value); strncpy(attr->fontFace->fontFamily, value, 63); attr->fontFace->fontFamily[63] = '\0'; } @@ -2016,7 +2016,7 @@ static int nsvg__parseAttr(NSVGparser* p, const char* name, const char* value) attr->fontFace->fontWeight = fontWeight; } } else if (strcmp(name, "font-style") == 0) { - DBG("attr=%a value=%a\n", name, value); + DBG("attr=%s value=%s\n", name, value); if (!attr->fontFace) { attr->fontFace = (NSVGfont*)AllocateZeroPool(sizeof(NSVGfont)); } @@ -2753,17 +2753,17 @@ static void nsvg__parseTextSpan(NSVGparser* p, const char** dict) if (strcmp(dict[i], "x") == 0) { x = nsvg__parseCoordinate(p, dict[i+1], nsvg__actualOrigX(p), nsvg__actualWidth(p)); text->x = x; -// DBG("span posX=%s\n", PoolPrintFloat(x)); +// DBG("span posX=%ls\n", PoolPrintFloat(x)); } else if (strcmp(dict[i], "y") == 0) { y = nsvg__parseCoordinate(p, dict[i+1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); text->y = y; -// DBG("span posY=%s\n", PoolPrintFloat(y)); +// DBG("span posY=%ls\n", PoolPrintFloat(y)); } else if (strcmp(dict[i], "font-size") == 0) { r = nsvg__parseCoordinate(p, dict[i+1], 0.0f, nsvg__actualHeight(p)); text->fontSize = r; -// DBG("span fontSize=%s from=%a\n", PoolPrintFloat(r), dict[i+1]); +// DBG("span fontSize=%ls from=%s\n", PoolPrintFloat(r), dict[i+1]); } else if (strcmp(dict[i], "font-style") == 0) { -// DBG("span: attr=%a value=%a\n", dict[i], dict[i+1]); +// DBG("span: attr=%s value=%s\n", dict[i], dict[i+1]); if (strstr(dict[i+1], "italic") != NULL) { text->fontStyle = 'i'; } else if (strstr(dict[i+1], "bold") != NULL) { @@ -2818,11 +2818,11 @@ static void nsvg__parseText(NSVGparser* p, const char** dict) } else if (strcmp(dict[i], "y") == 0) { y = nsvg__parseCoordinate(p, dict[i+1], nsvg__actualOrigY(p), nsvg__actualHeight(p)); } else { -// DBG("%d: attr=%a value=%a\n", i, dict[i], dict[i+1]); +// DBG("%d: attr=%s value=%s\n", i, dict[i], dict[i+1]); nsvg__parseAttr(p, dict[i], dict[i + 1]); } } - DBG("text: x=%s y=%s attr:Style=%x, size=%s, id=%a\n", PoolPrintFloat(x), PoolPrintFloat(y), attr->fontFace->fontStyle, PoolPrintFloat(attr->fontFace->fontSize), attr->id); + DBG("text: x=%ls y=%ls attr:Style=%X, size=%ls, id=%s\n", PoolPrintFloat(x), PoolPrintFloat(y), attr->fontFace->fontStyle, PoolPrintFloat(attr->fontFace->fontSize), attr->id); text->x = x; text->y = y; text->fontSize = attr->fontFace->fontSize; @@ -2841,7 +2841,7 @@ static void nsvg__parseText(NSVGparser* p, const char** dict) if (text->fontStyle < 0x30) { text->fontStyle = 'n'; } - DBG("required font %a required style=%c\n", text->fontFace->fontFamily, text->fontStyle); + DBG("required font %s required style=%c\n", text->fontFace->fontFamily, text->fontStyle); //if the font is not registered then we have to load new one NSVGfont *fontSVG = NULL; NSVGfontChain *fontChain = fontsDB; @@ -2849,10 +2849,10 @@ static void nsvg__parseText(NSVGparser* p, const char** dict) while (fontChain) { fontSVG = fontChain->font; if (fontSVG) { - DBG("probe fontFamily=%a fontStyle=%c\n", fontSVG->fontFamily, fontSVG->fontStyle); + DBG("probe fontFamily=%s fontStyle=%c\n", fontSVG->fontFamily, fontSVG->fontStyle); if (strcmp(fontSVG->fontFamily, text->fontFace->fontFamily) == 0) { fontChainSimilar = fontChain; - DBG("font %a found\n", fontSVG->fontFamily); + DBG("font %s found\n", fontSVG->fontFamily); if (fontSVG->fontStyle == text->fontStyle) { break; } @@ -2871,16 +2871,16 @@ static void nsvg__parseText(NSVGparser* p, const char** dict) UINTN FileDataLength = 0; NSVGparser *p1 = NULL; EFI_STATUS Status; - DBG("required font %a not found, try to load external\n", text->fontFace->fontFamily); + DBG("required font %s not found, try to load external\n", text->fontFace->fontFamily); Status = egLoadFile(ThemeDir, PoolPrint(L"%a.svg", text->fontFace->fontFamily), &FileData, &FileDataLength); - DBG("font %a loaded status=%r\n", text->fontFace->fontFamily, Status); + DBG("font %s loaded status=%s\n", text->fontFace->fontFamily, strerror(Status)); if (!EFI_ERROR(Status)) { p1 = nsvgParse((CHAR8*)FileData, 72, 1.0f); //later we will free parser p1 if (!p1) { - DBG("font %a not parsed\n", text->fontFace->fontFamily); + DBG("font %s not parsed\n", text->fontFace->fontFamily); } else { /* fontSVG = (__typeof__(fontSVG))AllocateCopyPool(sizeof(NSVGfont), p1->font); - DBG("font family %a parsed\n", fontSVG->fontFamily); + DBG("font family %s parsed\n", fontSVG->fontFamily); fontChain = (__typeof__(fontChain))AllocatePool(sizeof(*fontChain)); fontChain->font = fontSVG; fontChain->next = fontsDB; @@ -2896,7 +2896,7 @@ static void nsvg__parseText(NSVGparser* p, const char** dict) text->font = p->font; //else embedded if present which is also double fontChain } } else { - DBG("set found font %a\n", fontSVG->fontFamily); + DBG("set found font %s\n", fontSVG->fontFamily); text->font = fontSVG; //the font found in fontChain } @@ -2914,7 +2914,7 @@ static void nsvg__parseText(NSVGparser* p, const char** dict) textFace[1].size = (INTN)text->fontSize; textFace[1].color = text->fontColor; textFace[1].valid = TRUE; - DBG("set message->font=%a color=%x size=%s as in MessageRow\n", fontSVG->fontFamily, text->fontColor, PoolPrintFloat(text->fontSize)); + DBG("set message->font=%s color=%X size=%ls as in MessageRow\n", fontSVG->fontFamily, text->fontColor, PoolPrintFloat(text->fontSize)); } break; } else if (!DayLight && strcmp(group->id, "MessageRow_night") == 0) { @@ -2926,7 +2926,7 @@ static void nsvg__parseText(NSVGparser* p, const char** dict) textFace[1].size = (INTN)text->fontSize; textFace[1].color = text->fontColor; textFace[1].valid = TRUE; - DBG("set message->font=%a color=%x size=%s as in MessageRow\n", fontSVG->fontFamily, text->fontColor, PoolPrintFloat(text->fontSize)); + DBG("set message->font=%s color=%X size=%ls as in MessageRow\n", fontSVG->fontFamily, text->fontColor, PoolPrintFloat(text->fontSize)); break; } else if (strcmp(group->id, "MenuRows") == 0) { if (!textFace[2].valid) { @@ -2934,7 +2934,7 @@ static void nsvg__parseText(NSVGparser* p, const char** dict) textFace[2].size = (INTN)text->fontSize; textFace[2].color = text->fontColor; textFace[2].valid = TRUE; - DBG("set menu->font=%a color=%x size=%s as in MenuRows\n", fontSVG->fontFamily, text->fontColor, PoolPrintFloat(text->fontSize)); + DBG("set menu->font=%s color=%X size=%ls as in MenuRows\n", fontSVG->fontFamily, text->fontColor, PoolPrintFloat(text->fontSize)); } break; } else if (!DayLight && strcmp(group->id, "MenuRows_night") == 0) { @@ -2949,7 +2949,7 @@ static void nsvg__parseText(NSVGparser* p, const char** dict) textFace[0].size = (INTN)text->fontSize; textFace[0].color = text->fontColor; textFace[0].valid = TRUE; - DBG("set help->font=%a color=%x size=%s as in HelpRows\n", fontSVG->fontFamily, text->fontColor, PoolPrintFloat(text->fontSize)); + DBG("set help->font=%s color=%X size=%ls as in HelpRows\n", fontSVG->fontFamily, text->fontColor, PoolPrintFloat(text->fontSize)); } break; } else if (!DayLight && strstr(group->id, "HelpRows_night") != NULL) { @@ -2957,7 +2957,7 @@ static void nsvg__parseText(NSVGparser* p, const char** dict) textFace[0].size = (INTN)text->fontSize; textFace[0].color = text->fontColor; textFace[0].valid = TRUE; - DBG("set help->font=%a color=%x size=%s as in HelpRows\n", fontSVG->fontFamily, text->fontColor, PoolPrintFloat(text->fontSize)); + DBG("set help->font=%s color=%X size=%ls as in HelpRows\n", fontSVG->fontFamily, text->fontColor, PoolPrintFloat(text->fontSize)); break; } group = group->next; @@ -3133,7 +3133,7 @@ static void nsvg__parsePoly(NSVGparser* p, const char** attr, int closeFlag) memcpy(shape->id, attr->id, sizeof shape->id); memcpy(shape->title, attr->title, sizeof shape->title); - // DBG("shapeID=%a\n", shape->id); + // DBG("shapeID=%s\n", shape->id); shape->group = attr->group; scale = nsvg__getAverageScale(attr->xform); shape->opacity = attr->opacity; @@ -3458,7 +3458,7 @@ static void nsvg__parseGroup(NSVGparser* p, const char** dict) } else nsvg__parseAttr(p, dict[i], dict[i + 1]); } AsciiStrCpyS(group->id, 64, curAttr->id); - // DBG("parsed groupID=%a\n", group->id); + // DBG("parsed groupID=%s\n", group->id); if (oldAttr != NULL) { group->next = oldAttr->group; @@ -3574,7 +3574,7 @@ static void nsvg__parseFont(NSVGparser* p, const char** dict) if (!font->horizAdvX) { font->horizAdvX = 1000; } - DBG("found font id=%a family=%a\n", font->id, font->fontFamily); + DBG("found font id=%s family=%s\n", font->id, font->fontFamily); NSVGfontChain* fontChain = (__typeof__(fontChain))AllocatePool(sizeof(*fontChain)); fontChain->font = font; @@ -3595,11 +3595,11 @@ static void nsvg__parseFontFace(NSVGparser* p, const char** dict) if (!font) { return; } -// DBG("begin parse font face, font->id=%a\n", font->id); +// DBG("begin parse font face, font->id=%s\n", font->id); for (i = 0; dict[i]; i += 2) { if (strcmp(dict[i], "font-family") == 0) { AsciiStrCpyS(font->fontFamily, 64, dict[i+1]); - DBG("font-family %a\n", font->fontFamily); + DBG("font-family %s\n", font->fontFamily); } else if (strcmp(dict[i], "font-weight") == 0) { float fontWeight = 0.0f; @@ -3779,7 +3779,7 @@ static void nsvg__parseGlyph(NSVGparser* p, const char** dict, BOOLEAN missing) p->font->glyphs = glyph; } } - // DBG("glyph %x parsed\n", glyph->unicode); + // DBG("glyph %X parsed\n", glyph->unicode); } static void nsvg__startElement(void* ud, const char* el, const char** dict) @@ -3978,7 +3978,7 @@ float addLetter(NSVGparser* p, CHAR16 letter, float x, float y, float scale, UIN /* if (shape->paths) { if (letter == L'C') { - DBG("Found glyph %x, point[0]=(%d,%d) points=%d\n", letter, + DBG("Found glyph %X, point[0]=(%d,%d) points=%d\n", letter, (int)shape->paths->pts[0], (int)shape->paths->pts[1], shape->paths->npts); shape->debug = TRUE; } @@ -3992,7 +3992,7 @@ float addLetter(NSVGparser* p, CHAR16 letter, float x, float y, float scale, UIN g = p->text->font->missingGlyph; shape->paths = g->path; // if (shape->paths) { - // DBG("Missing glyph %x, path[0]=%d\n", letter, (int)shape->paths->pts[0]); + // DBG("Missing glyph %X, path[0]=%d\n", letter, (int)shape->paths->pts[0]); // } } if (!shape->paths) { @@ -4040,11 +4040,11 @@ float addLetter(NSVGparser* p, CHAR16 letter, float x, float y, float scale, UIN /* if (letter == L'C') { - DBG("bbox0=%s ", PoolPrintFloat(p->text->font->bbox[0])); - DBG("bbox3=%s \n", PoolPrintFloat(p->text->font->bbox[3])); + DBG("bbox0=%ls ", PoolPrintFloat(p->text->font->bbox[0])); + DBG("bbox3=%ls \n", PoolPrintFloat(p->text->font->bbox[3])); DumpFloat2("glyph xform:", shape->xform, 6); - DBG("stroke-color=%x ", shape->stroke.color); - DBG("stroke-width=%s\n", PoolPrintFloat(shape->strokeWidth)); + DBG("stroke-color=%X ", shape->stroke.color); + DBG("stroke-width=%ls\n", PoolPrintFloat(shape->strokeWidth)); } */ //in glyph units @@ -4056,7 +4056,7 @@ float addLetter(NSVGparser* p, CHAR16 letter, float x, float y, float scale, UIN // DumpFloat2("glyph bounds in text", shape->bounds, 4); // } // if (color == NSVG_RGBA(0x80, 0xFF, 0, 255)) { - // DBG("glyph code=%x\n", letter); + // DBG("glyph code=%X\n", letter); // DumpFloat2("glyph xform", shape->xform, 6); // DumpFloat2("glyph bounds", shape->bounds, 4); // DBG("glyph width=%d\n", g->horizAdvX); @@ -4082,7 +4082,7 @@ static void addString(NSVGparser* p, char* s) DBG("font for the text is not loaded\n"); return; //use external fonts } - // DBG("the text %s uses font %a\n", s, p->text->fontFace->fontFamily); + // DBG("the text %ls uses font %s\n", s, p->text->fontFace->fontFamily); //calculate letter size float sy = p->text->font->bbox[3] - p->text->font->bbox[1]; @@ -4274,7 +4274,7 @@ int nsvg__shapesBound(/*NSVGimage* image,*/ NSVGshape *shapes, float* bounds) } /* if (shapeLink->isText) { //strstr(shapeLink->id, "shar")) { - DBG("take Bounds: shapeID=%a\n", shapeLink->id); + DBG("take Bounds: shapeID=%s\n", shapeLink->id); DumpFloat2(" transform", xform, 6); DumpFloat2(" shape initial bounds", shapeLink->bounds, 4); } @@ -4322,11 +4322,11 @@ NSVGparser* nsvgParse(char* input, /* const char* units,*/ float dpi, float opac } p->dpi = dpi; p->opacity = opacity; -// DBG("fontDb=%x\n", (UINTN)fontsDB); +// DBG("fontDb=%X\n", (UINTN)fontsDB); nsvg__parseXML(input, nsvg__startElement, nsvg__endElement, nsvg__content, p); -// DBG("fontDb after parse=%x\n", (UINTN)fontsDB); +// DBG("fontDb after parse=%X\n", (UINTN)fontsDB); // if (fontsDB && fontsDB->font) { -// DBG("added font=%a\n", fontsDB->font->fontFamily); //yes, fonts added here +// DBG("added font=%s\n", fontsDB->font->fontFamily); //yes, fonts added here // } //assign gradients clipPath = p->image->clipPaths; @@ -4348,7 +4348,7 @@ NSVGparser* nsvgParse(char* input, /* const char* units,*/ float dpi, float opac p->image->width = bounds[2] - bounds[0]; p->image->height = bounds[3] - bounds[1]; #endif - DBG("scaled width=%s height=%s\n", PoolPrintFloat(p->image->width), + DBG("scaled width=%ls height=%ls\n", PoolPrintFloat(p->image->width), PoolPrintFloat(p->image->height)); return p; } diff --git a/rEFIt_UEFI/libeg/nanosvgrast.cpp b/rEFIt_UEFI/libeg/nanosvgrast.cpp index 4a21b4d96..8dd7711b2 100644 --- a/rEFIt_UEFI/libeg/nanosvgrast.cpp +++ b/rEFIt_UEFI/libeg/nanosvgrast.cpp @@ -72,7 +72,7 @@ void DumpFloat (char* s, float* t, int N) { #if DEBUG_SVG int i; - DBG("%a: ", s); + DBG("%s: ", s); for(i=0; icoarse; c = cache->colors[dither(nsvg__clampf(gd*(255.0f-level*2), 0, (254.99f-level*2)), level)]; cr = (c) & 0xff; @@ -1486,7 +1486,7 @@ static void nsvg__initPaint(NSVGcachedPaint* cache, NSVGpaint* paint, NSVGshape* cache->type = paint->type; - // DBG("shape=%a, paint-type=%d\n", shape->id, cache->type); + // DBG("shape=%s, paint-type=%d\n", shape->id, cache->type); if (cache->type == NSVG_PAINT_COLOR) { cache->colors[0] = nsvg__applyOpacity(paint->paint.color, opacity); @@ -1557,7 +1557,7 @@ static void nsvg__initPaint(NSVGcachedPaint* cache, NSVGpaint* paint, NSVGshape* } } // if (shape->debug) { - // DBG("Color cache [0,50,100,150,200,250]:%x,%x,%x,%x,%x,%x\n", + // DBG("Color cache [0,50,100,150,200,250]:%X,%X,%X,%X,%X,%X\n", // cache->colors[0], cache->colors[50], cache->colors[100], cache->colors[150], // cache->colors[200], cache->colors[250]); // } @@ -1775,7 +1775,7 @@ void nsvgRasterize(NSVGrasterizer* r, tx -= image->realBounds[0] * scalex; ty -= image->realBounds[1] * scaley; -// DBG(" image will be shifted by [%s,%s]\n", PoolPrintFloat(tx), PoolPrintFloat(ty)); +// DBG(" image will be shifted by [%ls,%ls]\n", PoolPrintFloat(tx), PoolPrintFloat(ty)); // DumpFloat(" image real bounds ", image->realBounds, 4); nsvg__rasterizeClipPaths(r, image, w, h, tx, ty, scalex, scaley); diff --git a/rEFIt_UEFI/libeg/text.cpp b/rEFIt_UEFI/libeg/text.cpp index 1d73c31fe..cafbb3ddd 100644 --- a/rEFIt_UEFI/libeg/text.cpp +++ b/rEFIt_UEFI/libeg/text.cpp @@ -100,11 +100,11 @@ EG_IMAGE * egLoadFontImage(IN BOOLEAN UseEmbedded, IN INTN Rows, IN INTN Cols) if (IsEmbeddedTheme() && !isKorean) { //or initial screen before theme init NewImage = egDecodePNG(ACCESS_EMB_DATA(emb_font_data), ACCESS_EMB_SIZE(emb_font_data), TRUE); - MsgLog("Using embedded font: %a\n", NewImage ? "Success" : "Error"); + MsgLog("Using embedded font: %s\n", NewImage ? "Success" : "Error"); } else { if (!GlobalConfig.TypeSVG) { NewImage = egLoadImage(ThemeDir, isKorean ? L"FontKorean.png" : GlobalConfig.FontFileName, TRUE); - MsgLog("Loading font from ThemeDir: %a\n", NewImage ? "Success" : "Error"); + MsgLog("Loading font from ThemeDir: %s\n", NewImage ? "Success" : "Error"); } else { MsgLog("Using SVG font\n"); return FontImage; @@ -120,7 +120,7 @@ EG_IMAGE * egLoadFontImage(IN BOOLEAN UseEmbedded, IN INTN Rows, IN INTN Cols) if (UseEmbedded) { NewImage = egDecodePNG(ACCESS_EMB_DATA(emb_font_data), ACCESS_EMB_SIZE(emb_font_data), TRUE); } else { - MsgLog("Font %s is not loaded\n", fontFilePath); + MsgLog("Font %ls is not loaded\n", fontFilePath); FreePool(fontFilePath); return NULL; } diff --git a/rEFIt_UEFI/refit/IO.cpp b/rEFIt_UEFI/refit/IO.cpp index 17ba75129..ec1f9d261 100644 --- a/rEFIt_UEFI/refit/IO.cpp +++ b/rEFIt_UEFI/refit/IO.cpp @@ -1896,7 +1896,7 @@ UINT32 hex2bin(IN CHAR8 *hex, OUT UINT8 *bin, UINT32 len) //assume len = number break; } if (!IsHexDigit(p[0]) || !IsHexDigit(p[1])) { - MsgLog("[ERROR] bin2hex '%a' syntax error\n", hex); + MsgLog("[ERROR] bin2hex '%s' syntax error\n", hex); return 0; } buf[0] = *p++; diff --git a/rEFIt_UEFI/refit/icns.cpp b/rEFIt_UEFI/refit/icns.cpp index bbf46b5eb..833b0193e 100644 --- a/rEFIt_UEFI/refit/icns.cpp +++ b/rEFIt_UEFI/refit/icns.cpp @@ -153,7 +153,7 @@ EG_IMAGE * BuiltinIcon(IN UINTN Id) Path = GetIconsExt(BuiltinIconTable[Id].Path, BuiltinIconTable[Id].Format); BuiltinIconTable[Id].Image = LoadIcnsFallback(ThemeDir, Path, Size); if (!BuiltinIconTable[Id].Image) { - DebugLog(1, " [!] Icon %d (%s) not found (path: %s)\n", Id, Path, ThemePath); + DebugLog(1, " [!] Icon %llu (%ls) not found (path: %ls)\n", Id, Path, ThemePath); if (Id >= BUILTIN_ICON_VOL_INTERNAL) { FreePool(Path); Path = GetIconsExt(BuiltinIconTable[BUILTIN_ICON_VOL_INTERNAL].Path, BuiltinIconTable[BUILTIN_ICON_VOL_INTERNAL].Format); @@ -264,7 +264,7 @@ EG_IMAGE * BuiltinIcon(IN UINTN Id) DEC_BUILTIN_ICON(Id, emb_selection_big); break; } } -// DBG("Icon %d decoded, pointer %x\n", Id, (UINTN)(BuiltinIconTable[Id].Image)); +// DBG("Icon %d decoded, pointer %X\n", Id, (UINTN)(BuiltinIconTable[Id].Image)); if (!BuiltinIconTable[Id].Image) { TextBuffer = egCreateFilledImage(Size, Size, TRUE, &MenuBackgroundPixel); //new pointer @@ -286,7 +286,7 @@ EG_IMAGE * BuiltinIcon(IN UINTN Id) #endif - DebugLog(1, " [!] Icon %d: Text <%s> rendered\n", Id, Text); + DebugLog(1, " [!] Icon %llu: Text <%ls> rendered\n", Id, Text); FreePool(Text); } diff --git a/rEFIt_UEFI/refit/lib.cpp b/rEFIt_UEFI/refit/lib.cpp index 3560b9d73..785f2f93b 100644 --- a/rEFIt_UEFI/refit/lib.cpp +++ b/rEFIt_UEFI/refit/lib.cpp @@ -169,7 +169,7 @@ EFI_STATUS GetRootFromPath(IN EFI_DEVICE_PATH_PROTOCOL* DevicePath, OUT EFI_FILE Status = gBS->LocateDevicePath (&gEfiSimpleFileSystemProtocolGuid, &TmpDevicePath, &NewHandle); - // DBG("volume handle found =%x\n", NewHandle); + // DBG("volume handle found =%X\n", NewHandle); CheckError(Status, L"while reopening volume handle"); *Root = EfiLibOpenRoot(NewHandle); if (*Root == NULL) { @@ -207,7 +207,7 @@ EFI_STATUS InitRefitLib(IN EFI_HANDLE ImageHandle) SelfDevicePath = (__typeof__(SelfDevicePath))AllocateAlignedPages(EFI_SIZE_TO_PAGES(DevicePathSize), 64); CopyMem(SelfDevicePath, TmpDevicePath, DevicePathSize); - DBG("SelfDevicePath=%s @%x\n", FileDevicePathToStr(SelfDevicePath), SelfDeviceHandle); + DBG("SelfDevicePath=%ls @%llX\n", FileDevicePathToStr(SelfDevicePath), (uintptr_t)SelfDeviceHandle); // find the current directory FilePathAsString = FileDevicePathToStr(SelfLoadedImage->FilePath); @@ -225,7 +225,7 @@ EFI_STATUS InitRefitLib(IN EFI_HANDLE ImageHandle) } SelfDirPath = FilePathAsString; - DBG("SelfDirPath = %s\n", SelfDirPath); + DBG("SelfDirPath = %ls\n", SelfDirPath); return FinishInitRefitLib(); } @@ -284,7 +284,7 @@ EFI_STATUS ReinitSelfLib(VOID) } TmpDevicePath = DuplicateDevicePath(SelfDevicePath); - DBG("reinit: self device path=%s\n", FileDevicePathToStr(TmpDevicePath)); + DBG("reinit: self device path=%ls\n", FileDevicePathToStr(TmpDevicePath)); if(TmpDevicePath == NULL) return EFI_NOT_FOUND; @@ -293,7 +293,7 @@ EFI_STATUS ReinitSelfLib(VOID) &TmpDevicePath, &NewSelfHandle); CheckError(Status, L"while reopening our self handle"); - DBG("new SelfHandle=%x\n", NewSelfHandle); + DBG("new SelfHandle=%llX\n", (uintptr_t)NewSelfHandle); SelfRootDir = EfiLibOpenRoot(NewSelfHandle); if (SelfRootDir == NULL) { @@ -503,7 +503,7 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl Volume->HasBootCode = TRUE; //we assume that all CD are bootable /* DBG("check SectorBuffer\n"); for (i=0; i<32; i++) { - DBG("%2x ", SectorBuffer[i]); + DBG("%2X ", SectorBuffer[i]); } DBG("\n"); */ VCrc32 = GetCrc32(SectorBuffer, 512 * 2); @@ -522,7 +522,7 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl default: break; } - DBG("Volume kind=%s CRC=0x%x\n", kind, VCrc32); */ + DBG("Volume kind=%ls CRC=0x%X\n", kind, VCrc32); */ if (Volume->DiskKind == DISK_KIND_OPTICAL) { //CDROM CHAR8* p = (CHAR8*)&SectorBuffer[8]; while (*p == 0x20) { @@ -537,7 +537,7 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl // if (*p != 0) { AsciiStrToUnicodeStrS((CHAR8*)&tmp[0], volumeName, 255); // } - DBG("Detected name %s\n", volumeName); + DBG("Detected name %ls\n", volumeName); Volume->VolName = PoolPrint(L"%s", volumeName); for (i=8; i<2000; i++) { //vendor search if (SectorBuffer[i] == 'A') { @@ -704,7 +704,7 @@ static VOID ScanVolumeBootcode(IN OUT REFIT_VOLUME *Volume, OUT BOOLEAN *Bootabl // need to fix AddLegacyEntry in main.c. #if REFIT_DEBUG > 0 - DBG(" Result of bootcode detection: %s %s (%s)\n", + DBG(" Result of bootcode detection: %ls %ls (%ls)\n", Volume->HasBootCode ? L"bootable" : L"non-bootable", Volume->LegacyOS->Name ? Volume->LegacyOS->Name: L"unknown", Volume->LegacyOS->IconName ? Volume->LegacyOS->IconName: L"legacy"); @@ -775,7 +775,7 @@ static EFI_STATUS ScanVolume(IN OUT REFIT_VOLUME *Volume) // Volume->DevicePath = DuplicateDevicePath(DevicePathFromHandle(Volume->DeviceHandle)); #if REFIT_DEBUG > 0 if (Volume->DevicePath != NULL) { - DBG(" %s\n", FileDevicePathToStr(Volume->DevicePath)); + DBG(" %ls\n", FileDevicePathToStr(Volume->DevicePath)); //#if REFIT_DEBUG >= 2 // DumpHex(1, 0, GetDevicePathSize(Volume->DevicePath), Volume->DevicePath); //#endif @@ -912,25 +912,25 @@ static EFI_STATUS ScanVolume(IN OUT REFIT_VOLUME *Volume) CopyMem(DiskDevicePath, Volume->DevicePath, PartialLength); CopyMem((UINT8 *)DiskDevicePath + PartialLength, DevicePath, sizeof(EFI_DEVICE_PATH)); //EndDevicePath // Print(L"WholeDevicePath %s\n", DevicePathToStr(DiskDevicePath)); - // DBG("WholeDevicePath %s\n", DevicePathToStr(DiskDevicePath)); + // DBG("WholeDevicePath %ls\n", DevicePathToStr(DiskDevicePath)); RemainingDevicePath = DiskDevicePath; Status = gBS->LocateDevicePath(&gEfiDevicePathProtocolGuid, &RemainingDevicePath, &WholeDiskHandle); if (EFI_ERROR(Status)) { - DBG("Can't find WholeDevicePath: %r\n", Status); + DBG("Can't find WholeDevicePath: %s\n", strerror(Status)); } else { Volume->WholeDiskDeviceHandle = WholeDiskHandle; Volume->WholeDiskDevicePath = DuplicateDevicePath(RemainingDevicePath); // look at the BlockIO protocol Status = gBS->HandleProtocol(WholeDiskHandle, &gEfiBlockIoProtocolGuid, (VOID **) &Volume->WholeDiskBlockIO); if (!EFI_ERROR(Status)) { - // DBG("WholeDiskBlockIO %x BlockSize=%d\n", Volume->WholeDiskBlockIO, Volume->WholeDiskBlockIO->Media->BlockSize); + // DBG("WholeDiskBlockIO %X BlockSize=%d\n", Volume->WholeDiskBlockIO, Volume->WholeDiskBlockIO->Media->BlockSize); // check the media block size if (Volume->WholeDiskBlockIO->Media->BlockSize == 2048) Volume->DiskKind = DISK_KIND_OPTICAL; } else { Volume->WholeDiskBlockIO = NULL; - // DBG("no WholeDiskBlockIO: %r\n", Status); + // DBG("no WholeDiskBlockIO: %s\n", strerror(Status)); //CheckError(Status, L"from HandleProtocol"); } @@ -1003,7 +1003,7 @@ static EFI_STATUS ScanVolume(IN OUT REFIT_VOLUME *Volume) if (!Volume->VolName) { FileSystemInfoPtr = EfiLibFileSystemInfo(Volume->RootDir); if (FileSystemInfoPtr) { - //DBG(" Volume name from FileSystem: '%s'\n", FileSystemInfoPtr->VolumeLabel); + //DBG(" Volume name from FileSystem: '%ls'\n", FileSystemInfoPtr->VolumeLabel); Volume->VolName = EfiStrDuplicate(FileSystemInfoPtr->VolumeLabel); FreePool(FileSystemInfoPtr); } @@ -1011,7 +1011,7 @@ static EFI_STATUS ScanVolume(IN OUT REFIT_VOLUME *Volume) if (!Volume->VolName) { VolumeInfo = EfiLibFileSystemVolumeLabelInfo(Volume->RootDir); if (VolumeInfo) { - //DBG(" Volume name from VolumeLabel: '%s'\n", VolumeInfo->VolumeLabel); + //DBG(" Volume name from VolumeLabel: '%ls'\n", VolumeInfo->VolumeLabel); Volume->VolName = EfiStrDuplicate(VolumeInfo->VolumeLabel); FreePool(VolumeInfo); } @@ -1019,7 +1019,7 @@ static EFI_STATUS ScanVolume(IN OUT REFIT_VOLUME *Volume) if (!Volume->VolName) { RootInfo = EfiLibFileInfo (Volume->RootDir); if (RootInfo) { - //DBG(" Volume name from RootFile: '%s'\n", RootInfo->FileName); + //DBG(" Volume name from RootFile: '%ls'\n", RootInfo->FileName); Volume->VolName = EfiStrDuplicate(RootInfo->FileName); FreePool(RootInfo); } @@ -1143,7 +1143,7 @@ VOID ScanVolumes(VOID) Status = gBS->LocateHandleBuffer(ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &HandleCount, &Handles); if (Status == EFI_NOT_FOUND) return; - DBG("Found %d volumes with blockIO\n", HandleCount); + DBG("Found %llu volumes with blockIO\n", HandleCount); // first pass: collect information about all handles for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) { @@ -1154,7 +1154,7 @@ VOID ScanVolumes(VOID) SelfVolume = Volume; } - DBG("- [%02d]: Volume:", HandleIndex); + DBG("- [%02llu]: Volume:", HandleIndex); Volume->Hidden = FALSE; // default to not hidden @@ -1177,14 +1177,14 @@ VOID ScanVolumes(VOID) if (!Volume->LegacyOS->IconName) { Volume->LegacyOS->IconName = L"legacy"; } -// DBG(" Volume '%s', LegacyOS '%s', LegacyIcon(s) '%s', GUID = %g\n", -// Volume->VolName, Volume->LegacyOS->Name ? Volume->LegacyOS->Name : L"", Volume->LegacyOS->IconName, Guid); +// DBG(" Volume '%ls', LegacyOS '%ls', LegacyIcon(s) '%ls', GUID = %s\n", +// Volume->VolName, Volume->LegacyOS->Name ? Volume->LegacyOS->Name : L"", Volume->LegacyOS->IconName, strguid(Guid)); if (SelfVolume == Volume) { DBG(" This is SelfVolume !!\n"); } } else { - DBG(" wrong volume Nr%d?!\n", HandleIndex); + DBG(" wrong volume Nr%llu?!\n", HandleIndex); FreePool(Volume); } } @@ -1213,7 +1213,7 @@ VOID ScanVolumes(VOID) if (Volume->BlockIO != NULL && Volume->WholeDiskBlockIO != NULL && Volume->BlockIO == Volume->WholeDiskBlockIO && Volume->BlockIOOffset == 0 && Volume->MbrPartitionTable != NULL) { - DBG(" Volume %d has MBR\n", VolumeIndex); + DBG(" Volume %llu has MBR\n", VolumeIndex); MbrTable = Volume->MbrPartitionTable; for (PartitionIndex = 0; PartitionIndex < 4; PartitionIndex++) { if (IS_EXTENDED_PART_TYPE(MbrTable[PartitionIndex].Type)) { @@ -1314,8 +1314,8 @@ VOID ReinitVolumes(VOID) if (!Volume) { continue; } - DBG("Volume %d at reinit found:\n", VolumeIndex); - DBG("Volume->DevicePath=%s\n", FileDevicePathToStr(Volume->DevicePath)); + DBG("Volume %llu at reinit found:\n", VolumeIndex); + DBG("Volume->DevicePath=%ls\n", FileDevicePathToStr(Volume->DevicePath)); VolumesFound++; if (Volume->DevicePath != NULL) { // get the handle for that path @@ -1404,10 +1404,10 @@ BOOLEAN DeleteFile(IN EFI_FILE *Root, IN CONST CHAR16 *RelativePath) EFI_FILE *File; EFI_FILE_INFO *FileInfo; - //DBG("DeleteFile: %s\n", RelativePath); + //DBG("DeleteFile: %ls\n", RelativePath); // open file for read/write to see if it exists, need write for delete Status = Root->Open(Root, &File, RelativePath, EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE, 0); - //DBG(" Open: %r\n", Status); + //DBG(" Open: %s\n", strerror(Status)); if (Status == EFI_SUCCESS) { // exists - check if it is a file FileInfo = EfiLibFileInfo(File); @@ -1417,7 +1417,7 @@ BOOLEAN DeleteFile(IN EFI_FILE *Root, IN CONST CHAR16 *RelativePath) File->Close(File); return FALSE; } - //DBG(" FileInfo attr: %x\n", FileInfo->Attribute); + //DBG(" FileInfo attr: %X\n", FileInfo->Attribute); if ((FileInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY) { // it's directory - return error //DBG(" File is DIR\n"); @@ -1429,7 +1429,7 @@ BOOLEAN DeleteFile(IN EFI_FILE *Root, IN CONST CHAR16 *RelativePath) // it's a file - delete it //DBG(" File is file\n"); Status = File->Delete(File); - //DBG(" Delete: %r\n", Status); + //DBG(" Delete: %s\n", strerror(Status)); return Status == EFI_SUCCESS; } @@ -1459,11 +1459,11 @@ EFI_STATUS DirNextEntry(IN EFI_FILE *Directory, IN OUT EFI_FILE_INFO **DirEntry, if (Status != EFI_BUFFER_TOO_SMALL || IterCount >= 4) break; if (BufferSize <= LastBufferSize) { - DBG("FS Driver requests bad buffer size %d (was %d), using %d instead\n", BufferSize, LastBufferSize, LastBufferSize * 2); + DBG("FS Driver requests bad buffer size %llu (was %llu), using %llu instead\n", BufferSize, LastBufferSize, LastBufferSize * 2); BufferSize = LastBufferSize * 2; #if REFIT_DEBUG > 0 } else { - DBG("Reallocating buffer from %d to %d\n", LastBufferSize, BufferSize); + DBG("Reallocating buffer from %llu to %llu\n", LastBufferSize, BufferSize); #endif } Buffer = (__typeof__(Buffer))EfiReallocatePool(Buffer, LastBufferSize, BufferSize); @@ -1730,17 +1730,17 @@ BOOLEAN DumpVariable(CHAR16* Name, EFI_GUID* Guid, INTN DevicePathAt) data = (__typeof__(data))AllocateZeroPool(dataSize); Status = gRT->GetVariable (Name, Guid, NULL, &dataSize, data); if (EFI_ERROR(Status)) { - DBG("Can't get %s, size=%d\n", Name, dataSize); + DBG("Can't get %ls, size=%llu\n", Name, dataSize); FreePool(data); data = NULL; } else { - DBG("%s var size=%d\n", Name, dataSize); + DBG("%ls var size=%llu\n", Name, dataSize); for (i = 0; i < dataSize; i++) { - DBG("%02x ", data[i]); + DBG("%02X ", data[i]); } DBG("\n"); if (DevicePathAt >= 0) { - DBG("%s: %s\n", Name, FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL*)&data[DevicePathAt])); + DBG("%ls: %ls\n", Name, FileDevicePathToStr((EFI_DEVICE_PATH_PROTOCOL*)&data[DevicePathAt])); } } } @@ -1760,7 +1760,7 @@ VOID DbgHeader(CONST CHAR8 *str) SetMem(&strLog[end], len , '='); strLog[49] = '\0'; - DebugLog (1, "%a\n", strLog); + DebugLog (1, "%s\n", strLog); } // EOF diff --git a/rEFIt_UEFI/refit/main.cpp b/rEFIt_UEFI/refit/main.cpp index 1b7eebe04..97f1c1fb6 100644 --- a/rEFIt_UEFI/refit/main.cpp +++ b/rEFIt_UEFI/refit/main.cpp @@ -143,7 +143,7 @@ static EFI_STATUS LoadEFIImageList(IN EFI_DEVICE_PATH **DevicePaths, UINTN DevicePathIndex; CHAR16 ErrorInfo[256]; - DBG("Loading %s", ImageTitle); + DBG("Loading %ls", ImageTitle); if (ErrorInStep != NULL) { *ErrorInStep = 0; } @@ -155,7 +155,7 @@ static EFI_STATUS LoadEFIImageList(IN EFI_DEVICE_PATH **DevicePaths, ReturnStatus = Status = EFI_NOT_FOUND; // in case the list is empty for (DevicePathIndex = 0; DevicePaths[DevicePathIndex] != NULL; DevicePathIndex++) { ReturnStatus = Status = gBS->LoadImage(FALSE, SelfImageHandle, DevicePaths[DevicePathIndex], NULL, 0, &ChildImageHandle); - DBG(" status=%r", Status); + DBG(" status=%s", strerror(Status)); if (ReturnStatus != EFI_NOT_FOUND) break; } @@ -174,7 +174,7 @@ static EFI_STATUS LoadEFIImageList(IN EFI_DEVICE_PATH **DevicePaths, #ifdef JIEF_DEBUG EFI_LOADED_IMAGE_PROTOCOL* loadedBootImage = NULL; if (!EFI_ERROR(Status = gBS->HandleProtocol(ChildImageHandle, &gEfiLoadedImageProtocolGuid, (void**)(&loadedBootImage)))) { - DBG("%S : Image base = 0x%lx", ImageTitle, loadedBootImage->ImageBase); // Jief : Do not change this, it's used by grep to feed the debugger + DBG("%S : Image base = 0x%llx", ImageTitle, (uintptr_t)loadedBootImage->ImageBase); // Jief : Do not change this, it's used by grep to feed the debugger }else{ DBG("Can't get loaded image protocol"); } @@ -200,7 +200,7 @@ static EFI_STATUS StartEFILoadedImage(IN EFI_HANDLE ChildImageHandle, CHAR16 ErrorInfo[256]; CHAR16 *FullLoadOptions = NULL; -// DBG("Starting %s\n", ImageTitle); +// DBG("Starting %ls\n", ImageTitle); if (ErrorInStep != NULL) { *ErrorInStep = 0; } @@ -229,7 +229,7 @@ static EFI_STATUS StartEFILoadedImage(IN EFI_HANDLE ChildImageHandle, ChildLoadedImage->LoadOptions = (VOID *)LoadOptions; ChildLoadedImage->LoadOptionsSize = (UINT32)StrSize(LoadOptions); //((UINT32)StrLen(LoadOptions) + 1) * sizeof(CHAR16); -// DBG("Using load options '%s'\n", LoadOptions); +// DBG("Using load options '%ls'\n", LoadOptions); } //DBG("Image loaded at: %p\n", ChildLoadedImage->ImageBase); //PauseForKey(L"continue"); @@ -379,14 +379,14 @@ VOID DumpKernelAndKextPatches(KERNEL_AND_KEXT_PATCHES *Patches) DBG("\tAppleRTC: %c\n", Patches->KPAppleRTC ? 'y' : 'n'); // Dell smbios truncate fix DBG("\tDellSMBIOSPatch: %c\n", Patches->KPDELLSMBIOS ? 'y' : 'n'); - DBG("\tFakeCPUID: 0x%x\n", Patches->FakeCPUID); - DBG("\tATIController: %s\n", (Patches->KPATIConnectorsController == NULL) ? L"null": Patches->KPATIConnectorsController); + DBG("\tFakeCPUID: 0x%X\n", Patches->FakeCPUID); + DBG("\tATIController: %ls\n", (Patches->KPATIConnectorsController == NULL) ? L"null": Patches->KPATIConnectorsController); DBG("\tATIDataLength: %d\n", Patches->KPATIConnectorsDataLen); DBG("\t%d Kexts to load\n", Patches->NrForceKexts); if (Patches->ForceKexts) { INTN i = 0; for (; i < Patches->NrForceKexts; ++i) { - DBG("\t KextToLoad[%d]: %s\n", i, Patches->ForceKexts[i]); + DBG("\t KextToLoad[%d]: %ls\n", i, Patches->ForceKexts[i]); } } DBG("\t%d Kexts to patch\n", Patches->NrKexts); @@ -394,9 +394,9 @@ VOID DumpKernelAndKextPatches(KERNEL_AND_KEXT_PATCHES *Patches) INTN i = 0; for (; i < Patches->NrKexts; ++i) { if (Patches->KextPatches[i].IsPlistPatch) { - DBG("\t KextPatchPlist[%d]: %d bytes, %a\n", i, Patches->KextPatches[i].DataLen, Patches->KextPatches[i].Name); + DBG("\t KextPatchPlist[%d]: %d bytes, %s\n", i, Patches->KextPatches[i].DataLen, Patches->KextPatches[i].Name); } else { - DBG("\t KextPatch[%d]: %d bytes, %a\n", i, Patches->KextPatches[i].DataLen, Patches->KextPatches[i].Name); + DBG("\t KextPatch[%d]: %d bytes, %s\n", i, Patches->KextPatches[i].DataLen, Patches->KextPatches[i].Name); } } } @@ -408,7 +408,7 @@ VOID FilterKextPatches(IN LOADER_ENTRY *Entry) //zzzz INTN i; DBG("Filtering KextPatches:\n"); for (i = 0; i < Entry->KernelAndKextPatches->NrKexts; i++) { - DBG(" - [%02d]: %a :: %a :: [OS: %a | MatchOS: %a | MatchBuild: %a]", + DBG(" - [%02lld]: %s :: %s :: [OS: %s | MatchOS: %s | MatchBuild: %s]", i, Entry->KernelAndKextPatches->KextPatches[i].Label, Entry->KernelAndKextPatches->KextPatches[i].IsPlistPatch ? "PlistPatch" : "BinPatch", @@ -423,12 +423,12 @@ VOID FilterKextPatches(IN LOADER_ENTRY *Entry) //zzzz if ((Entry->BuildVersion != NULL) && (Entry->KernelAndKextPatches->KextPatches[i].MatchBuild != NULL)) { Entry->KernelAndKextPatches->KextPatches[i].MenuItem.BValue = IsPatchEnabled(Entry->KernelAndKextPatches->KextPatches[i].MatchBuild, Entry->BuildVersion); - DBG(" ==> %a\n", Entry->KernelAndKextPatches->KextPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); + DBG(" ==> %s\n", Entry->KernelAndKextPatches->KextPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); continue; } Entry->KernelAndKextPatches->KextPatches[i].MenuItem.BValue = IsPatchEnabled(Entry->KernelAndKextPatches->KextPatches[i].MatchOS, Entry->OSVersion); - DBG(" ==> %a\n", Entry->KernelAndKextPatches->KextPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); + DBG(" ==> %s\n", Entry->KernelAndKextPatches->KextPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); } } } @@ -439,7 +439,7 @@ VOID FilterKernelPatches(IN LOADER_ENTRY *Entry) INTN i = 0; DBG("Filtering KernelPatches:\n"); for (; i < Entry->KernelAndKextPatches->NrKernels; ++i) { - DBG(" - [%02d]: %a :: [OS: %a | MatchOS: %a | MatchBuild: %a]", + DBG(" - [%02lld]: %s :: [OS: %s | MatchOS: %s | MatchBuild: %s]", i, Entry->KernelAndKextPatches->KernelPatches[i].Label, Entry->OSVersion, @@ -453,12 +453,12 @@ VOID FilterKernelPatches(IN LOADER_ENTRY *Entry) if ((Entry->BuildVersion != NULL) && (Entry->KernelAndKextPatches->KernelPatches[i].MatchBuild != NULL)) { Entry->KernelAndKextPatches->KernelPatches[i].MenuItem.BValue = IsPatchEnabled(Entry->KernelAndKextPatches->KernelPatches[i].MatchBuild, Entry->BuildVersion); - DBG(" ==> %a by build\n", Entry->KernelAndKextPatches->KernelPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); + DBG(" ==> %s by build\n", Entry->KernelAndKextPatches->KernelPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); continue; } Entry->KernelAndKextPatches->KernelPatches[i].MenuItem.BValue = IsPatchEnabled(Entry->KernelAndKextPatches->KernelPatches[i].MatchOS, Entry->OSVersion); - DBG(" ==> %a by OS\n", Entry->KernelAndKextPatches->KernelPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); + DBG(" ==> %s by OS\n", Entry->KernelAndKextPatches->KernelPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); } } } @@ -469,7 +469,7 @@ VOID FilterBootPatches(IN LOADER_ENTRY *Entry) INTN i = 0; DBG("Filtering BootPatches:\n"); for (; i < Entry->KernelAndKextPatches->NrBoots; ++i) { - DBG(" - [%02d]: %a :: [OS: %a | MatchOS: %a | MatchBuild: %a]", + DBG(" - [%02lld]: %s :: [OS: %s | MatchOS: %s | MatchBuild: %s]", i, Entry->KernelAndKextPatches->BootPatches[i].Label, Entry->OSVersion, @@ -483,12 +483,12 @@ VOID FilterBootPatches(IN LOADER_ENTRY *Entry) if ((Entry->BuildVersion != NULL) && (Entry->KernelAndKextPatches->BootPatches[i].MatchBuild != NULL)) { Entry->KernelAndKextPatches->BootPatches[i].MenuItem.BValue = IsPatchEnabled(Entry->KernelAndKextPatches->BootPatches[i].MatchBuild, Entry->BuildVersion); - DBG(" ==> %a by build\n", Entry->KernelAndKextPatches->BootPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); + DBG(" ==> %s by build\n", Entry->KernelAndKextPatches->BootPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); continue; } Entry->KernelAndKextPatches->BootPatches[i].MenuItem.BValue = IsPatchEnabled(Entry->KernelAndKextPatches->BootPatches[i].MatchOS, Entry->OSVersion); - DBG(" ==> %a by OS\n", Entry->KernelAndKextPatches->BootPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); + DBG(" ==> %s by OS\n", Entry->KernelAndKextPatches->BootPatches[i].MenuItem.BValue ? "allowed" : "not allowed"); } } @@ -521,7 +521,7 @@ VOID ReadSIPCfg() StrCatS(csrLog, SVALUE_MAX_SIZE/2, PoolPrint(L"%a%a", StrLen(csrLog) ? " | " : "", "CSR_ALLOW_UNAPPROVED_KEXTS")); if (StrLen(csrLog)) { - DBG("CSR_CFG: %s\n", csrLog); + DBG("CSR_CFG: %ls\n", csrLog); } FreePool(csrLog); @@ -570,14 +570,14 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry) // DBG("StartLoader() start\n"); DbgHeader("StartLoader"); if (Entry->Settings) { - DBG("Entry->Settings: %s\n", Entry->Settings); + DBG("Entry->Settings: %ls\n", Entry->Settings); Status = LoadUserSettings(SelfRootDir, Entry->Settings, &dict); if (!EFI_ERROR(Status)) { - DBG(" - found custom settings for this entry: %s\n", Entry->Settings); + DBG(" - found custom settings for this entry: %ls\n", Entry->Settings); gBootChanged = TRUE; Status = GetUserSettings(SelfRootDir, dict); if (EFI_ERROR(Status)) { - DBG(" - ... but: %r\n", Status); + DBG(" - ... but: %s\n", strerror(Status)); } else { if ((gSettings.CpuFreqMHz > 100) && (gSettings.CpuFreqMHz < 20000)) { gCPUStructure.MaxSpeed = gSettings.CpuFreqMHz; @@ -588,19 +588,19 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry) //DBG("Custom KernelAndKextPatches copyed to started entry\n"); } } else { - DBG(" - [!] LoadUserSettings failed: %r\n", Status); + DBG(" - [!] LoadUserSettings failed: %s\n", strerror(Status)); } } - DBG("Finally: ExternalClock=%ldMHz BusSpeed=%ldkHz CPUFreq=%ldMHz", + DBG("Finally: ExternalClock=%lluMHz BusSpeed=%llukHz CPUFreq=%uMHz", DivU64x32(gCPUStructure.ExternalClock + kilo - 1, kilo), DivU64x32(gCPUStructure.FSBFrequency + kilo - 1, kilo), gCPUStructure.MaxSpeed); if (gSettings.QPI) { - DBG(" QPI: hw.busfrequency=%ldHz\n", MultU64x32(gSettings.QPI, Mega)); + DBG(" QPI: hw.busfrequency=%lluHz\n", MultU64x32(gSettings.QPI, Mega)); } else { // to match the value of hw.busfrequency in the terminal - DBG(" PIS: hw.busfrequency=%ldHz\n", MultU64x32(LShiftU64(DivU64x32(gCPUStructure.ExternalClock + kilo - 1, kilo), 2), Mega)); + DBG(" PIS: hw.busfrequency=%lluHz\n", MultU64x32(LShiftU64(DivU64x32(gCPUStructure.ExternalClock + kilo - 1, kilo), 2), Mega)); } //Free memory @@ -648,7 +648,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry) // Load image into memory (will be started later) Status = LoadEFIImage(Entry->DevicePath, Basename(Entry->LoaderPath), NULL, &ImageHandle); if (EFI_ERROR(Status)) { - DBG("Image is not loaded, status=%r\n", Status); + DBG("Image is not loaded, status=%s\n", strerror(Status)); return; // no reason to continue if loading image failed } @@ -709,7 +709,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry) } Entry->OSVersion = (__typeof__(Entry->OSVersion))AllocateCopyPool(AsciiStrLen(InstallerVersion)+1, InstallerVersion); Entry->OSVersion[AsciiStrLen(InstallerVersion)] = '\0'; -// DBG("Corrected OSVersion: %a\n", Entry->OSVersion); +// DBG("Corrected OSVersion: %s\n", Entry->OSVersion); } } } @@ -721,9 +721,9 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry) } if (Entry->BuildVersion != NULL) { - DBG(" %a (%a)\n", Entry->OSVersion, Entry->BuildVersion); + DBG(" %s (%s)\n", Entry->OSVersion, Entry->BuildVersion); } else { - DBG(" %a\n", Entry->OSVersion); + DBG(" %s\n", Entry->OSVersion); } if (Entry->OSVersion && (AsciiOSVersionToUint64(Entry->OSVersion) >= AsciiOSVersionToUint64("10.11"))) { @@ -841,7 +841,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry) AudioIo->StopPlayback(AudioIo); } -// DBG("Set FakeCPUID: 0x%x\n", gSettings.FakeCPUID); +// DBG("Set FakeCPUID: 0x%X\n", gSettings.FakeCPUID); // DBG("LoadKexts\n"); // LoadKexts writes to DataHub, where large writes can prevent hibernate wake (happens when several kexts present in Clover's kexts dir) if (!DoHibernateWake) { @@ -923,7 +923,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry) DBG(" Hardware signature =%08lx\n", Facs->HardwareSignature); DBG(" GlobalLock =%08lx\n", Facs->GlobalLock); DBG(" Flags =%08lx\n", Facs->Flags); - DBG(" HS at offset 0x%08x\n", OFFSET_OF(EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE, HardwareSignature)); + DBG(" HS at offset 0x%08X\n", OFFSET_OF(EFI_ACPI_4_0_FIRMWARE_ACPI_CONTROL_STRUCTURE, HardwareSignature)); // machineSignature = Facs->HardwareSignature; } } @@ -942,10 +942,10 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry) // Initialize the boot screen if (EFI_ERROR(Status = InitBootScreen(Entry))) { - if (Status != EFI_ABORTED) DBG("Failed to initialize custom boot screen: %r!\n", Status); + if (Status != EFI_ABORTED) DBG("Failed to initialize custom boot screen: %s!\n", strerror(Status)); } else if (EFI_ERROR(Status = LockBootScreen())) { - DBG("Failed to lock custom boot screen: %r!\n", Status); + DBG("Failed to lock custom boot screen: %s!\n", strerror(Status)); } } // !OSTYPE_IS_WINDOWS @@ -992,7 +992,7 @@ static VOID StartLoader(IN LOADER_ENTRY *Entry) Basename(Entry->LoaderPath), Basename(Entry->LoaderPath), NULL); // Unlock boot screen if (EFI_ERROR(Status = UnlockBootScreen())) { - DBG("Failed to unlock custom boot screen: %r!\n", Status); + DBG("Failed to unlock custom boot screen: %s!\n", strerror(Status)); } if (OSFLAG_ISSET(Entry->Flags, OSFLAG_USEGRAPHICS)) { // return back orig OutputString @@ -1074,7 +1074,7 @@ static VOID StartLegacy(IN LEGACY_ENTRY *Entry) static VOID StartTool(IN REFIT_MENU_ENTRY_LOADER_TOOL *Entry) { - DBG("Start Tool: %s\n", Entry->LoaderPath); + DBG("Start Tool: %ls\n", Entry->LoaderPath); egClearScreen(&DarkBackgroundPixel); // assumes "Start " as assigned below BeginExternalScreen(OSFLAG_ISSET(Entry->Flags, OSFLAG_USEGRAPHICS), &Entry->Title[6]); // Shouldn't we check that length of Title is at least 6 ? @@ -1198,7 +1198,7 @@ static VOID ScanDriverDir(IN CONST CHAR16 *Path, OUT EFI_HANDLE **DriversToConne DriversArrSize += 16; } DriversArr[DriversArrNum] = DriverHandle; - // DBG(" driver %s included with Binding=%x\n", FileName, DriverBinding); + // DBG(" driver %ls included with Binding=%X\n", FileName, DriverBinding); DriversArrNum++; // we'll make array terminated DriversArr[DriversArrNum] = NULL; @@ -1276,7 +1276,7 @@ VOID DisconnectInvalidDiskIoChildDrivers(VOID) (VOID **) &BlockIo ); if (EFI_ERROR (Status)) { - //DBG(" BlockIo: %r - skipping\n", Status); + //DBG(" BlockIo: %s - skipping\n", strerror(Status)); continue; } if (BlockIo->Media == NULL) { @@ -1327,8 +1327,8 @@ VOID DisconnectInvalidDiskIoChildDrivers(VOID) } Found = TRUE; Status = gBS->DisconnectController (Handles[Index], OpenInfo[OpenInfoIndex].AgentHandle, NULL); - //DBG(" BY_DRIVER Agent: %p, Disconnect: %r", OpenInfo[OpenInfoIndex].AgentHandle, Status); - DBG(" - Handle %p with DiskIo, is Partition, no Fs, BY_DRIVER Agent: %p, Disconnect: %r\n", Handles[Index], OpenInfo[OpenInfoIndex].AgentHandle, Status); + //DBG(" BY_DRIVER Agent: %p, Disconnect: %s", OpenInfo[OpenInfoIndex].AgentHandle, strerror(Status)); + DBG(" - Handle %p with DiskIo, is Partition, no Fs, BY_DRIVER Agent: %p, Disconnect: %s\n", Handles[Index], OpenInfo[OpenInfoIndex].AgentHandle, strerror(Status)); } } FreePool (OpenInfo); @@ -1373,7 +1373,7 @@ VOID DisconnectSomeDevices(VOID) if (BlockIo->Media->BlockSize == 2048) { // disconnect CD controller Status = gBS->DisconnectController(Handles[Index], NULL, NULL); - DBG("CD disconnect %r", Status); + DBG("CD disconnect %s", strerror(Status)); } } /* for (Index = 0; Index < HandleCount; Index++) { @@ -1401,7 +1401,7 @@ VOID DisconnectSomeDevices(VOID) for (Index2 = 0; Index2 < ControllerHandleCount; Index2++) { Status = gBS->DisconnectController(ControllerHandles[Index2], NULL, NULL); - DBG("Driver [%d] disconnect %r\n", Index2, Status); + DBG("Driver [%d] disconnect %s\n", Index2, strerror(Status)); } } */ @@ -1420,7 +1420,7 @@ VOID DisconnectSomeDevices(VOID) EFI_OPEN_PROTOCOL_GET_PROTOCOL); if (EFI_ERROR(Status)) { -// DBG("CompName %r\n", Status); +// DBG("CompName %s\n", strerror(Status)); continue; } Status = CompName->GetDriverName(CompName, "eng", &DriverName); @@ -1431,7 +1431,7 @@ VOID DisconnectSomeDevices(VOID) for (Index2 = 0; Index2 < ControllerHandleCount; Index2++) { Status = gBS->DisconnectController(ControllerHandles[Index2], Handles[Index], NULL); -// DBG("Disconnect [%s] from %x: %r\n", DriverName, ControllerHandles[Index2], Status); +// DBG("Disconnect [%ls] from %X: %s\n", DriverName, ControllerHandles[Index2], strerror(Status)); } } } @@ -1459,7 +1459,7 @@ VOID DisconnectSomeDevices(VOID) if(IS_PCI_VGA(&Pci) == TRUE) { // disconnect VGA Status = gBS->DisconnectController(Handles[Index], NULL, NULL); - DBG("disconnect %r", Status); + DBG("disconnect %s", strerror(Status)); } } } @@ -1540,7 +1540,7 @@ static VOID LoadDrivers(VOID) } if (DriversToConnectNum > 0) { - DBG("%d drivers needs connecting ...\n", DriversToConnectNum); + DBG("%llu drivers needs connecting ...\n", DriversToConnectNum); // note: our platform driver protocol // will use DriversToConnect - do not release it RegisterDriversToHighestPriority(DriversToConnect); @@ -1587,7 +1587,7 @@ INTN FindDefaultEntry(VOID) Index = FindStartupDiskVolume(&MainMenu); if (Index >= 0) { - DBG("Boot redirected to Entry %d. '%s'\n", Index, MainMenu.Entries[Index].Title.s()); + DBG("Boot redirected to Entry %lld. '%ls'\n", Index, MainMenu.Entries[Index].Title.s()); // we got boot-device-data, no need to keep emulating anymore if (gEmuVariableControl != NULL) { gEmuVariableControl->UninstallEmulation(gEmuVariableControl); @@ -1605,9 +1605,9 @@ INTN FindDefaultEntry(VOID) SearchForLoader = (gSettings.DefaultLoader != NULL && gSettings.DefaultLoader[0] != L'\0'); /* if (SearchForLoader) { - DBG("Searching for DefaultVolume '%s', DefaultLoader '%s' ...\n", gSettings.DefaultVolume, gSettings.DefaultLoader); + DBG("Searching for DefaultVolume '%ls', DefaultLoader '%ls' ...\n", gSettings.DefaultVolume, gSettings.DefaultLoader); } else { - DBG("Searching for DefaultVolume '%s' ...\n", gSettings.DefaultVolume); + DBG("Searching for DefaultVolume '%ls' ...\n", gSettings.DefaultVolume); } */ for (Index = 0; Index < (INTN)MainMenu.Entries.size() && MainMenu.Entries[Index].getLOADER_ENTRY() && MainMenu.Entries[Index].getLOADER_ENTRY()->Row == 0 ; Index++) { @@ -1628,7 +1628,7 @@ INTN FindDefaultEntry(VOID) continue; } - DBG(" - found entry %d. '%s', Volume '%s', DevicePath '%s'\n", Index, Entry.Title.s(), Volume->VolName, Entry.DevicePathString); + DBG(" - found entry %lld. '%ls', Volume '%ls', DevicePath '%ls'\n", Index, Entry.Title.s(), Volume->VolName, Entry.DevicePathString); // if first method failed and second succeeded - uninstall emulation if (gEmuVariableControl != NULL) { gEmuVariableControl->UninstallEmulation(gEmuVariableControl); @@ -1657,7 +1657,7 @@ VOID SetVariablesFromNvram() tmpString = (__typeof__(tmpString))GetNvramVariable(L"boot-args", &gEfiAppleBootGuid, NULL, &Size); if (tmpString && (Size <= 0x1000) && (Size > 0)) { - DBG("found boot-args in NVRAM:%a, size=%d\n", tmpString, Size); + DBG("found boot-args in NVRAM:%s, size=%llu\n", tmpString, Size); // use and forget old one // DeleteNvramVariable(L"boot-args", &gEfiAppleBootGuid); Size = AsciiStrLen(tmpString); // some EFI implementations include '\0' in Size, and others don't, so update Size to string length @@ -1676,7 +1676,7 @@ VOID SetVariablesFromNvram() while ((index < Size) && (tmpString[index] != 0x20) && (tmpString[index] != 0x0)) { arg[index2++] = tmpString[index++]; } - DBG("...found arg:%a\n", arg); + DBG("...found arg:%s\n", arg); } else { index++; // DBG("search quote index=%d\n", index); @@ -1686,22 +1686,22 @@ VOID SetVariablesFromNvram() if (tmpString[index] == '\"') { index++; } - DBG("...found quoted arg:\n", arg); + DBG("...found quoted arg:\n"/*, arg*/); } while (tmpString[index] == 0x20) { index++; } // For the moment only arg -s must be ignored if (AsciiStrCmp(arg, "-s") == 0) { - DBG("...ignoring arg:%a\n", arg); + DBG("...ignoring arg:%s\n", arg); continue; } if (!AsciiStrStr(gSettings.BootArgs, arg)) { //this arg is not present will add - DBG("...adding arg:%a\n", arg); + DBG("...adding arg:%s\n", arg); len = iStrLen(gSettings.BootArgs, 256); if (len + index2 > 256) { - DBG("boot-args overflow... bytes=%d+%d\n", len, index2); + DBG("boot-args overflow... bytes=%llu+%llu\n", len, index2); break; } gSettings.BootArgs[len++] = 0x20; @@ -1766,14 +1766,14 @@ BOOLEAN SetOEMPathIfExists(IN EFI_FILE *Root, IN CHAR16 *path, CONST CHAR16 *Con BOOLEAN res2 = FileExists(Root, ConfigPath); if ( res2 ) { OEMPath = path; - DBG ("CheckOEMPathExists: set OEMPath: %s\n", OEMPath); + DBG ("CheckOEMPathExists: set OEMPath: %ls\n", OEMPath); return 1; }else{ - DBG("CheckOEMPathExists tried %s. '%s.plist' not exists in dir\n", path, ConfName); + DBG("CheckOEMPathExists tried %ls. '%ls.plist' not exists in dir\n", path, ConfName); FreePool(path); } }else{ - DBG("CheckOEMPathExists tried %s. Dir not exists\n", path); + DBG("CheckOEMPathExists tried %ls. Dir not exists\n", path); FreePool(path); } return 0; @@ -1783,7 +1783,7 @@ VOID SetOEMPath(CONST CHAR16 *ConfName) { OEMPath = PoolPrint(L"%s", L"EFI\\CLOVER"); if (ConfName == NULL) { - DBG ("set OEMPath (ConfName == NULL): %s\n", OEMPath); + DBG ("set OEMPath (ConfName == NULL): %ls\n", OEMPath); } else if ( nLanCards > 0 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[0][0], gLanMac[0][1], gLanMac[0][2], gLanMac[0][3], gLanMac[0][4], gLanMac[0][5]), ConfName)) { } else if ( nLanCards > 1 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[1][0], gLanMac[1][1], gLanMac[1][2], gLanMac[1][3], gLanMac[1][4], gLanMac[1][5]), ConfName)) { } else if ( nLanCards > 2 && SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a--%02x-%02x-%02x-%02x-%02x-%02x", gSettings.OEMProduct, gLanMac[2][0], gLanMac[2][1], gLanMac[2][2], gLanMac[2][3], gLanMac[2][4], gLanMac[2][5]), ConfName)) { @@ -1794,7 +1794,7 @@ VOID SetOEMPath(CONST CHAR16 *ConfName) } else if (SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a", gSettings.OEMBoard), ConfName)) { } else if (SetOEMPathIfExists(SelfRootDir, PoolPrint(L"EFI\\CLOVER\\OEM\\%a-%d", gSettings.OEMBoard, (INT32)(DivU64x32(gCPUStructure.CPUFrequency, Mega))), ConfName) ) { } else { - DBG ("set OEMPath by default: %s\n", OEMPath); + DBG ("set OEMPath by default: %ls\n", OEMPath); } } @@ -2067,11 +2067,11 @@ RefitMain (IN EFI_HANDLE ImageHandle, MsgLog("Now is %02d.%02d.%d, %02d:%02d:%02d (GMT+%d)\n", Now.Day, Now.Month, Now.Year, Now.Hour, Now.Minute, Now.Second, GlobalConfig.Timezone); } - //MsgLog("Starting Clover rev %s on %s EFI\n", FIRMWARE_REVISION, gST->FirmwareVendor); - MsgLog("Starting %a on %s EFI\n", REVISION_STR, gST->FirmwareVendor); + //MsgLog("Starting Clover rev %ls on %ls EFI\n", FIRMWARE_REVISION, gST->FirmwareVendor); + MsgLog("Starting %s on %ls EFI\n", REVISION_STR, gST->FirmwareVendor); #ifdef BUILDINFOS_STR - DBG("Build with: [%a]\n", BUILDINFOS_STR); + DBG("Build with: [%s]\n", BUILDINFOS_STR); #endif // BUILDINFOS_STR @@ -2079,9 +2079,9 @@ RefitMain (IN EFI_HANDLE ImageHandle, if (EFI_ERROR(Status)) return Status; - DBG("Clover : Image base = 0x%x\n", SelfLoadedImage->ImageBase); // do not change, it's used by grep to feed the debugger + DBG("Clover : Image base = 0x%llX\n", (uintptr_t)SelfLoadedImage->ImageBase); // do not change, it's used by grep to feed the debugger #ifdef JIEF_DEBUG - gBS->Stall(1000000); // to give time to gdb to connect + gBS->Stall(3000000); // to give time to gdb to connect // PauseForKey(L"press\n"); #endif @@ -2093,28 +2093,28 @@ RefitMain (IN EFI_HANDLE ImageHandle, // are natural aligned i.e. pointers are 8 bytes aligned /* DBG("Settings offsets:\n"); - DBG(" OEMProduct: %x\n", OFFSET_OF(SETTINGS_DATA, OEMProduct)); - DBG(" DefaultVolume: %x\n", OFFSET_OF(SETTINGS_DATA, DefaultVolume)); - DBG(" DefaultLoader: %x\n", OFFSET_OF(SETTINGS_DATA, DefaultLoader)); - DBG(" ResetAddr: %x\n", OFFSET_OF(SETTINGS_DATA, ResetAddr)); - DBG(" FixDsdt: %x\n", OFFSET_OF(SETTINGS_DATA, FixDsdt)); - DBG(" FakeATI: %x\n", OFFSET_OF(SETTINGS_DATA, FakeATI)); - DBG(" PatchVBiosBytes:%x\n", OFFSET_OF(SETTINGS_DATA, PatchVBiosBytes)); - DBG(" VRAM: %x\n", OFFSET_OF(SETTINGS_DATA, VRAM)); - DBG(" SecureBootWhiteListCount: %x\n", OFFSET_OF(SETTINGS_DATA, SecureBootWhiteListCount)); - DBG(" LegacyBoot: %x\n", OFFSET_OF(SETTINGS_DATA, LegacyBoot)); - DBG(" HVHideStrings: %x\n", OFFSET_OF(SETTINGS_DATA, HVHideStrings)); - DBG(" PointerSpeed: %x\n", OFFSET_OF(SETTINGS_DATA, PointerSpeed)); - DBG(" RtMLB: %x\n", OFFSET_OF(SETTINGS_DATA, RtMLB)); - DBG(" ConfigName: %x\n", OFFSET_OF(SETTINGS_DATA, ConfigName)); - DBG(" PointerSpeed: %x\n", OFFSET_OF(SETTINGS_DATA, PointerSpeed)); - DBG(" PatchDsdtNum: %x\n", OFFSET_OF(SETTINGS_DATA, PatchDsdtNum)); - DBG(" LenToReplace: %x\n", OFFSET_OF(SETTINGS_DATA, LenToReplace)); - DBG(" ACPIDropTables: %x\n", OFFSET_OF(SETTINGS_DATA, ACPIDropTables)); - DBG(" CustomEntries: %x\n", OFFSET_OF(SETTINGS_DATA, CustomEntries)); - DBG(" CustomTool: %x\n", OFFSET_OF(SETTINGS_DATA, CustomTool)); - DBG(" AddProperties: %x\n", OFFSET_OF(SETTINGS_DATA, AddProperties)); - DBG(" BlockKexts: %x\n", OFFSET_OF(SETTINGS_DATA, BlockKexts)); + DBG(" OEMProduct: %X\n", OFFSET_OF(SETTINGS_DATA, OEMProduct)); + DBG(" DefaultVolume: %X\n", OFFSET_OF(SETTINGS_DATA, DefaultVolume)); + DBG(" DefaultLoader: %X\n", OFFSET_OF(SETTINGS_DATA, DefaultLoader)); + DBG(" ResetAddr: %X\n", OFFSET_OF(SETTINGS_DATA, ResetAddr)); + DBG(" FixDsdt: %X\n", OFFSET_OF(SETTINGS_DATA, FixDsdt)); + DBG(" FakeATI: %X\n", OFFSET_OF(SETTINGS_DATA, FakeATI)); + DBG(" PatchVBiosBytes:%X\n", OFFSET_OF(SETTINGS_DATA, PatchVBiosBytes)); + DBG(" VRAM: %X\n", OFFSET_OF(SETTINGS_DATA, VRAM)); + DBG(" SecureBootWhiteListCount: %X\n", OFFSET_OF(SETTINGS_DATA, SecureBootWhiteListCount)); + DBG(" LegacyBoot: %X\n", OFFSET_OF(SETTINGS_DATA, LegacyBoot)); + DBG(" HVHideStrings: %X\n", OFFSET_OF(SETTINGS_DATA, HVHideStrings)); + DBG(" PointerSpeed: %X\n", OFFSET_OF(SETTINGS_DATA, PointerSpeed)); + DBG(" RtMLB: %X\n", OFFSET_OF(SETTINGS_DATA, RtMLB)); + DBG(" ConfigName: %X\n", OFFSET_OF(SETTINGS_DATA, ConfigName)); + DBG(" PointerSpeed: %X\n", OFFSET_OF(SETTINGS_DATA, PointerSpeed)); + DBG(" PatchDsdtNum: %X\n", OFFSET_OF(SETTINGS_DATA, PatchDsdtNum)); + DBG(" LenToReplace: %X\n", OFFSET_OF(SETTINGS_DATA, LenToReplace)); + DBG(" ACPIDropTables: %X\n", OFFSET_OF(SETTINGS_DATA, ACPIDropTables)); + DBG(" CustomEntries: %X\n", OFFSET_OF(SETTINGS_DATA, CustomEntries)); + DBG(" CustomTool: %X\n", OFFSET_OF(SETTINGS_DATA, CustomTool)); + DBG(" AddProperties: %X\n", OFFSET_OF(SETTINGS_DATA, AddProperties)); + DBG(" BlockKexts: %X\n", OFFSET_OF(SETTINGS_DATA, BlockKexts)); */ // disable EFI watchdog timer @@ -2123,14 +2123,14 @@ RefitMain (IN EFI_HANDLE ImageHandle, Status = InitializeUnicodeCollationProtocol(); if (EFI_ERROR(Status)) { - DBG("UnicodeCollation Status=%r\n", Status); + DBG("UnicodeCollation Status=%s\n", strerror(Status)); } Status = gBS->HandleProtocol(ConsoleInHandle, &gEfiSimpleTextInputExProtocolGuid, (VOID **)&SimpleTextEx); if ( EFI_ERROR (Status) ) { SimpleTextEx = NULL; } - DBG("SimpleTextEx Status=%r\n", Status); + DBG("SimpleTextEx Status=%s\n", strerror(Status)); PrepatchSmbios(); @@ -2151,7 +2151,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, gSettings.OEMBoard[i] = 0x5F; } } - DBG("Running on: '%a' with board '%a'\n", gSettings.OEMProduct, gSettings.OEMBoard); + DBG("Running on: '%s' with board '%s'\n", gSettings.OEMProduct, gSettings.OEMBoard); GetCPUProperties(); GetDevices(); @@ -2173,8 +2173,8 @@ RefitMain (IN EFI_HANDLE ImageHandle, } else { SetOEMPath(ConfName); Status = LoadUserSettings(SelfRootDir, ConfName, &gConfigDict[1]); - DBG("%s\\%s.plist%s loaded with name from LoadOptions: %r\n", - OEMPath, ConfName, EFI_ERROR(Status) ? L" not" : L"", Status); + DBG("%ls\\%ls.plist%ls loaded with name from LoadOptions: %s\n", + OEMPath, ConfName, EFI_ERROR(Status) ? L" not" : L"", strerror(Status)); if (EFI_ERROR(Status)) { gConfigDict[1] = NULL; FreePool(ConfName); @@ -2190,13 +2190,13 @@ RefitMain (IN EFI_HANDLE ImageHandle, UniteConfigs = (UniteTag->type == kTagTypeTrue) || ((UniteTag->type == kTagTypeString) && ((UniteTag->string[0] == 'y') || (UniteTag->string[0] == 'Y'))); - DBG("UniteConfigs = %s", UniteConfigs ? L"TRUE\n": L"FALSE\n" ); + DBG("UniteConfigs = %ls", UniteConfigs ? L"TRUE\n": L"FALSE\n" ); } } if (!gConfigDict[1] || UniteConfigs) { SetOEMPath(L"config"); Status = LoadUserSettings(SelfRootDir, L"config", &gConfigDict[0]); - DBG("%s\\config.plist%s loaded: %r\n", OEMPath, EFI_ERROR(Status) ? L" not" : L"", Status); + DBG("%ls\\config.plist%ls loaded: %s\n", OEMPath, EFI_ERROR(Status) ? L" not" : L"", strerror(Status)); } UnicodeSPrint(gSettings.ConfigName, 64, L"%s%s%s", /* gSettings.ConfigName = PoolPrint(L"%s%s%s", */ @@ -2248,7 +2248,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, //testing place { CHAR16 *aaa = L"12345"; - DBG(" string %s, size=%d, len=%d sizeof=%d\n", aaa, StrSize(aaa), StrLen(aaa), sizeof(aaa)); + DBG(" string %ls, size=%d, len=%d sizeof=%d\n", aaa, StrSize(aaa), StrLen(aaa), sizeof(aaa)); } #endif if (!GlobalConfig.FastBoot) { @@ -2260,7 +2260,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, if (gConfigDict[i]) { /* Status = */GetEarlyUserSettings(SelfRootDir, gConfigDict[i]); // if (EFI_ERROR(Status)) { - // DBG("Error in Early settings%d: %r\n", i, Status); + // DBG("Error in Early settings%d: %s\n", i, strerror(Status)); // } } } @@ -2311,7 +2311,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, //Now we have to reinit handles Status = ReinitSelfLib(); if (EFI_ERROR(Status)){ - DebugLog(2, " %r", Status); + DebugLog(2, " %s", strerror(Status)); PauseForKey(L"Error reinit refit\n"); #ifdef ENABLE_SECURE_BOOT UninstallSecureBoot(); @@ -2346,7 +2346,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, // GetDefaultSettings(); GetAcpiTablesList(); - DBG("Calibrated TSC Frequency = %ld = %ldMHz\n", gCPUStructure.TSCCalibr, DivU64x32(gCPUStructure.TSCCalibr, Mega)); + DBG("Calibrated TSC Frequency = %llu = %lluMHz\n", gCPUStructure.TSCCalibr, DivU64x32(gCPUStructure.TSCCalibr, Mega)); if (gCPUStructure.TSCCalibr > 200000000ULL) { //200MHz gCPUStructure.TSCFrequency = gCPUStructure.TSCCalibr; } @@ -2397,7 +2397,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, if (gConfigDict[i]) { Status = GetUserSettings(SelfRootDir, gConfigDict[i]); if (EFI_ERROR(Status)) { - // DBG("Error in Second part of settings%d: %r\n", i, Status); + // DBG("Error in Second part of settings%d: %s\n", i, strerror(Status)); } } } @@ -2506,7 +2506,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, for (i = 0; i < AudioNum; i++) { if (AudioList[i].Name) { // Never change this log, otherwise clients will stop interprete the output. - MsgLog("Found Audio Device %s (%a) at index %d\n", AudioList[i].Name, AudioOutputNames[AudioList[i].Device], i); + MsgLog("Found Audio Device %ls (%s) at index %llu\n", AudioList[i].Name, AudioOutputNames[AudioList[i].Device], i); } } @@ -2523,18 +2523,18 @@ RefitMain (IN EFI_HANDLE ImageHandle, DBG("theme inited\n"); gThemeChanged = FALSE; if (GlobalConfig.Theme) { - DBG("Chosen theme %s\n", GlobalConfig.Theme); + DBG("Chosen theme %ls\n", GlobalConfig.Theme); } else { DBG("Chosen embedded theme\n"); } -// DBG("initial boot-args=%a\n", gSettings.BootArgs); +// DBG("initial boot-args=%s\n", gSettings.BootArgs); //now it is a time to set RtVariables SetVariablesFromNvram(); TmpArgs = PoolPrint(L"%a ", gSettings.BootArgs); - DBG("after NVRAM boot-args=%a\n", gSettings.BootArgs); + DBG("after NVRAM boot-args=%s\n", gSettings.BootArgs); gSettings.OptionsBits = EncodeOptions(TmpArgs); -// DBG("initial OptionsBits %x\n", gSettings.OptionsBits); +// DBG("initial OptionsBits %X\n", gSettings.OptionsBits); FreePool(TmpArgs); FillInputs(TRUE); @@ -2609,7 +2609,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, #endif DefaultIndex = FindDefaultEntry(); - DBG("DefaultIndex=%d and MainMenu.Entries.size()=%d\n", DefaultIndex, MainMenu.Entries.size()); + DBG("DefaultIndex=%lld and MainMenu.Entries.size()=%llu\n", DefaultIndex, MainMenu.Entries.size()); if ((DefaultIndex >= 0) && (DefaultIndex < (INTN)MainMenu.Entries.size())) { DefaultEntry = &MainMenu.Entries[DefaultIndex]; } else { @@ -2646,7 +2646,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, MainMenu.AnimeRun = MainAnime; MenuExit = MainMenu.RunMainMenu(DefaultIndex, &ChosenEntry); } - DBG("exit from MainMenu %d\n", MenuExit); //MENU_EXIT_ENTER=(1) MENU_EXIT_DETAILS=3 + DBG("exit from MainMenu %llu\n", MenuExit); //MENU_EXIT_ENTER=(1) MENU_EXIT_DETAILS=3 // disable default boot - have sense only in the first run GlobalConfig.Timeout = -1; if ((DefaultEntry != NULL) && (MenuExit == MENU_EXIT_TIMEOUT)) { @@ -2874,7 +2874,7 @@ RefitMain (IN EFI_HANDLE ImageHandle, (UINT16*)&BootNum ); if (!EFI_ERROR(Status)) { - DBG("Entry %d assigned option %04x\n", EntryIndex, BootNum); + DBG("Entry %lld assigned option %04llX\n", EntryIndex, BootNum); Entry->BootNum = BootNum; } FreePool(OptionalData); diff --git a/rEFIt_UEFI/refit/menu.cpp b/rEFIt_UEFI/refit/menu.cpp index 8f4349e73..15d5e055f 100644 --- a/rEFIt_UEFI/refit/menu.cpp +++ b/rEFIt_UEFI/refit/menu.cpp @@ -813,7 +813,7 @@ VOID ApplyInputs(VOID) } i++; //7 if (InputItems[i].Valid) { -// DBG("InputItems[i]: %s\n", InputItems[i].SValue); +// DBG("InputItems[i]: %ls\n", InputItems[i].SValue); gSettings.PLimitDict = (UINT8)(StrDecimalToUintn(InputItems[i].SValue) & 0x7F); // DBG("Item 7=PLimitDict %d\n", gSettings.PLimitDict); } @@ -858,7 +858,7 @@ VOID ApplyInputs(VOID) i++; //17 if (InputItems[i].Valid) { gPlatformFeature = (UINT64)StrHexToUint64(InputItems[i].SValue); - DBG("applied PlatformFeature=0x%x\n", gPlatformFeature); + DBG("applied PlatformFeature=0x%llX\n", gPlatformFeature); } i++; //18 | Download-Fritz: There is no GUI element for BacklightLevel; please revise if (InputItems[i].Valid) { @@ -898,7 +898,7 @@ VOID ApplyInputs(VOID) } else if (gGraphics[j].Vendor == Intel) { //ig-platform-id for Ivy+ and snb-platform-id for Sandy gSettings.IgPlatform = (UINT32)StrHexToUint64(InputItems[i].SValue); - DBG("applied *-platform-id=0x%x\n", gSettings.IgPlatform); + DBG("applied *-platform-id=0x%X\n", gSettings.IgPlatform); } } @@ -1018,12 +1018,12 @@ VOID ApplyInputs(VOID) i++; //62 if (InputItems[i].Valid) { gFwFeatures = (UINT32)StrHexToUint64(InputItems[i].SValue); - DBG("applied FirmwareFeatures=0x%x\n", gFwFeatures); + DBG("applied FirmwareFeatures=0x%X\n", gFwFeatures); } i++; //63 if (InputItems[i].Valid) { gFwFeaturesMask = (UINT32)StrHexToUint64(InputItems[i].SValue); - DBG("applied FirmwareFeaturesMask=0x%x\n", gFwFeaturesMask); + DBG("applied FirmwareFeaturesMask=0x%X\n", gFwFeaturesMask); } i++; //64 if (InputItems[i].Valid) { @@ -1191,7 +1191,7 @@ VOID ApplyInputs(VOID) i++; //96 if (InputItems[i].Valid) { gSettings.FakeIntel = (UINT32)StrHexToUint64(InputItems[i].SValue); - DBG("applied FakeIntel=0x%x\n", gSettings.FakeIntel); + DBG("applied FakeIntel=0x%X\n", gSettings.FakeIntel); } i++; //97 if (InputItems[i].Valid) { @@ -1229,7 +1229,7 @@ VOID ApplyInputs(VOID) i++; //104 if (InputItems[i].Valid) { gSettings.KernelAndKextPatches.FakeCPUID = (UINT32)StrHexToUint64(InputItems[i].SValue); - DBG("applied FakeCPUID=%06x\n", gSettings.KernelAndKextPatches.FakeCPUID); + DBG("applied FakeCPUID=%06X\n", gSettings.KernelAndKextPatches.FakeCPUID); gBootChanged = TRUE; } @@ -1259,7 +1259,7 @@ VOID ApplyInputs(VOID) i++; //109 if (InputItems[i].Valid) { gSettings.DualLink = (UINT32)StrHexToUint64(InputItems[i].SValue); - DBG("applied DualLink=%x\n", gSettings.DualLink); + DBG("applied DualLink=%X\n", gSettings.DualLink); } i++; //110 @@ -1307,7 +1307,7 @@ VOID ApplyInputs(VOID) if (InputItems[i].Valid) { EFI_DEVICE_PATH_PROTOCOL* DevicePath = NULL; UINT8 TmpIndex = OldChosenAudio & 0xFF; - DBG("Chosen output %d:%s_%a\n", OldChosenAudio, AudioList[OldChosenAudio].Name, AudioOutputNames[OldChosenAudio]); + DBG("Chosen output %llu:%ls_%s\n", OldChosenAudio, AudioList[OldChosenAudio].Name, AudioOutputNames[OldChosenAudio]); DevicePath = DevicePathFromHandle(AudioList[OldChosenAudio].Handle); if (DevicePath != NULL) { @@ -1347,7 +1347,7 @@ VOID ApplyInputs(VOID) VOID REFIT_MENU_SCREEN::AddMenuInfo(CONST char *Line) { -//DBG("%a, %a : Line=%a\n", __FILE__, __LINE__, XString(Line).c); +//DBG("%s, %s : Line=%s\n", __FILE__, __LINE__, XString(Line).c); REFIT_INFO_DIALOG *InputBootArgs; InputBootArgs = new REFIT_INFO_DIALOG; @@ -1359,7 +1359,7 @@ VOID REFIT_MENU_SCREEN::AddMenuInfo(CONST char *Line) VOID REFIT_MENU_SCREEN::AddMenuInfo_f(CONST char *format, ...) { -//DBG("%a, %a : Line=%a\n", __FILE__, __LINE__, XString(Line).c); +//DBG("%s, %s : Line=%s\n", __FILE__, __LINE__, XString(Line).c); REFIT_INFO_DIALOG *InputBootArgs; InputBootArgs = new REFIT_INFO_DIALOG; @@ -2487,7 +2487,7 @@ UINTN REFIT_MENU_SCREEN::InputDialog(IN MENU_STYLE_FUNC StyleFunc) Item->Valid = FALSE; FreePool(Backup); if (Item->SValue) { - MsgLog("EDITED: %s\n", Item->SValue); + MsgLog("EDITED: %ls\n", Item->SValue); } return 0; } @@ -2763,10 +2763,10 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN MENU_STYLE_FUNC StyleFunc, IN OUT INT /* just a sample code case SCAN_F7: Status = egMkDir(SelfRootDir, L"EFI\\CLOVER\\new_folder"); - DBG("create folder %r\n", Status); + DBG("create folder %s\n", strerror(Status)); if (!EFI_ERROR(Status)) { Status = egSaveFile(SelfRootDir, L"EFI\\CLOVER\\new_folder\\new_file.txt", (UINT8*)SomeText, sizeof(*SomeText)+1); - DBG("create file %r\n", Status); + DBG("create file %s\n", strerror(Status)); } break; */ @@ -2775,7 +2775,7 @@ UINTN REFIT_MENU_SCREEN::RunGenericMenu(IN MENU_STYLE_FUNC StyleFunc, IN OUT INT OldChosenAudio = 0; //security correction } Status = gBS->HandleProtocol(AudioList[OldChosenAudio].Handle, &gEfiAudioIoProtocolGuid, (VOID**)&AudioIo); - DBG("open %d audio handle status=%r\n", OldChosenAudio, Status); + DBG("open %llu audio handle status=%s\n", OldChosenAudio, strerror(Status)); if (!EFI_ERROR(Status)) { StartupSoundPlay(SelfRootDir, NULL); //play embedded sound } @@ -3154,7 +3154,7 @@ INTN DrawTextXY(IN XStringW& Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAlign) // shift 64 is prohibited XText = XPos - (TextWidth >> XAlign); //X_IS_CENTER = 1 } - // DBG("draw text %s\n", Text); + // DBG("draw text %ls\n", Text); // DBG("pos=%d width=%d xtext=%d Height=%d Y=%d\n", XPos, TextWidth, XText, Height, YPos); // BltImageAlpha(TextBufferXY, XText, YPos, &MenuBackgroundPixel, 16); // egFreeImage(TextBufferXY); @@ -3211,7 +3211,7 @@ INTN DrawTextXY(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAli // shift 64 is prohibited XText = XPos - (TextWidth >> XAlign); //X_IS_CENTER = 1 } -// DBG("draw text %s\n", Text); +// DBG("draw text %ls\n", Text); // DBG("pos=%d width=%d xtext=%d Height=%d Y=%d\n", XPos, TextWidth, XText, Height, YPos); BltImageAlpha(TextBufferXY, XText, YPos, &MenuBackgroundPixel, 16); egFreeImage(TextBufferXY); @@ -3794,7 +3794,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa Entry->Place.YPos, 0xFFFF); ThemeX.Buttons[(Entry->Row == OldChosenItem)?1:0].Draw(ctrlX, ctrlY); } else { - //DBG("paint entry %d title=%s\n", i, Entries[i]->Title); + //DBG("paint entry %d title=%ls\n", i, Entries[i]->Title); DrawMenuText(ResultString, (i == ScrollState.CurrentSelection) ? MenuWidth : 0, EntriesPosX, Entry->Place.YPos, 0xFFFF); @@ -4130,7 +4130,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa ctrlY, &MenuBackgroundPixel, 16); } else { - //DBG("paint entry %d title=%s\n", i, Entries[i]->Title); + //DBG("paint entry %d title=%ls\n", i, Entries[i]->Title); DrawMenuText(ResultString, (i == ScrollState.CurrentSelection) ? MenuWidth : 0, EntriesPosX, Entry->Place.YPos, 0xFFFF); @@ -4327,7 +4327,7 @@ VOID DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, BOOLEAN selected, INTN NewImageCreated = true; } } - // DBG("Entry title=%s; Width=%d\n", Entry->Title, MainImage->Width); + // DBG("Entry title=%ls; Width=%d\n", Entry->Title, MainImage->Width); float fScale; if (ThemeX.TypeSVG) { fScale = (selected ? 1.f : -1.f); @@ -4401,7 +4401,7 @@ VOID DrawMainMenuEntry(REFIT_ABSTRACT_MENU_ENTRY *Entry, BOOLEAN selected, INTN NewImageCreated = true; } } - // DBG("Entry title=%s; Width=%d\n", Entry->Title, MainImage->Width); + // DBG("Entry title=%ls; Width=%d\n", Entry->Title, MainImage->Width); if (GlobalConfig.TypeSVG) { Scale = 16 * (selected ? 1 : -1); @@ -4632,7 +4632,7 @@ VOID DrawTextCorner(UINTN TextC, UINT8 Align) if ( Text ) FreePool(Text); return; } - // DBG("draw text %s at (%d, %d)\n", Text, Xpos, UGAHeight - 5 - TextHeight), + // DBG("draw text %ls at (%d, %d)\n", Text, Xpos, UGAHeight - 5 - TextHeight), // clovy DrawTextXY(Text, Xpos, UGAHeight - 5 - TextHeight, Align); DrawTextXY(Text, Xpos, UGAHeight - (INTN)(TextHeight * 1.5f), Align); if ( Text ) FreePool(Text); @@ -4984,7 +4984,7 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT DrawTextCorner(TEXT_CORNER_REVISION, X_IS_RIGHT); Status = MouseBirth(); if(EFI_ERROR(Status)) { - DBG("can't bear mouse at all! Status=%r\n", Status); + DBG("can't bear mouse at all! Status=%s\n", strerror(Status)); } break; @@ -5034,7 +5034,7 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT DrawTextCorner(TEXT_CORNER_REVISION, X_IS_RIGHT); Status = MouseBirth(); if(EFI_ERROR(Status)) { - DBG("can't bear mouse at sel! Status=%r\n", Status); + DBG("can't bear mouse at sel! Status=%s\n", strerror(Status)); } break; #if USE_XTHEME @@ -5052,7 +5052,7 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT DrawTextCorner(TEXT_CORNER_REVISION, X_IS_RIGHT); Status = MouseBirth(); if(EFI_ERROR(Status)) { - DBG("can't bear mouse at timeout! Status=%r\n", Status); + DBG("can't bear mouse at timeout! Status=%s\n", strerror(Status)); } break; #else @@ -5070,7 +5070,7 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT DrawTextCorner(TEXT_CORNER_REVISION, X_IS_RIGHT); Status = MouseBirth(); if(EFI_ERROR(Status)) { - DBG("can't bear mouse at timeout! Status=%r\n", Status); + DBG("can't bear mouse at timeout! Status=%s\n", strerror(Status)); } break; #endif @@ -5152,7 +5152,7 @@ VOID ModifyTitles(REFIT_ABSTRACT_MENU_ENTRY *ChosenEntry) if (ChosenEntry->SubScreen->ID == SCREEN_DSDT) { // UnicodeSPrint((CHAR16*)ChosenEntry->Title, 128, L"DSDT fix mask [0x%08x]->", gSettings.FixDsdt); // TODO jief : cast to fix ChosenEntry->Title.SPrintf("DSDT fix mask [0x%08x]->", gSettings.FixDsdt); // TODO jief : cast to fix - //MsgLog("@ESC: %s\n", (*ChosenEntry)->Title); + //MsgLog("@ESC: %ls\n", (*ChosenEntry)->Title); } else if (ChosenEntry->SubScreen->ID == SCREEN_CSR) { // CSR // UnicodeSPrint((CHAR16*)ChosenEntry->Title, 128, L"System Integrity Protection [0x%04x]->", gSettings.CsrActiveConfig); // TODO jief : cast to fix @@ -5472,7 +5472,7 @@ LOADER_ENTRY *SubMenuKextInjectMgmt(LOADER_ENTRY *Entry) NewEntry_(SubEntry, &SubScreen, ActionEnter, SCREEN_SYSTEM, "Block injected kexts->"); SubEntry->Flags = Entry->Flags; if (ChosenOS) { -// DBG("chosen os %a\n", ChosenOS); +// DBG("chosen os %s\n", ChosenOS); //shorten os version 10.11.6 -> 10.11 for (i = 0; i < 8; i++) { ShortOSVersion[i] = ChosenOS[i]; @@ -5689,7 +5689,7 @@ REFIT_ABSTRACT_MENU_ENTRY* SubMenuDropTables() while (DropTable) { CopyMem((CHAR8*)&sign, (CHAR8*)&(DropTable->Signature), 4); CopyMem((CHAR8*)&OTID, (CHAR8*)&(DropTable->TableId), 8); - //MsgLog("adding to menu %a (%x) %a (%lx) L=%d(0x%x)\n", + //MsgLog("adding to menu %s (%X) %s (%lx) L=%d(0x%X)\n", // sign, DropTable->Signature, // OTID, DropTable->TableId, // DropTable->Length, DropTable->Length); @@ -6425,16 +6425,16 @@ UINTN REFIT_MENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRAC SubMenuIndex = -1; gSettings.OptionsBits = EncodeOptions(TmpArgs); -// DBG("main OptionsBits = 0x%x\n", gSettings.OptionsBits); +// DBG("main OptionsBits = 0x%X\n", gSettings.OptionsBits); if ( MainChosenEntry->getLOADER_ENTRY() ) gSettings.OptionsBits |= EncodeOptions(MainChosenEntry->getLOADER_ENTRY()->LoadOptions); -// DBG("add OptionsBits = 0x%x\n", gSettings.OptionsBits); +// DBG("add OptionsBits = 0x%X\n", gSettings.OptionsBits); if ( MainChosenEntry->getREFIT_MENU_ITEM_BOOTNUM() ) DecodeOptions(MainChosenEntry->getREFIT_MENU_ITEM_BOOTNUM()); - // DBG(" enter menu with LoadOptions: %s\n", ((LOADER_ENTRY*)MainChosenEntry)->LoadOptions); + // DBG(" enter menu with LoadOptions: %ls\n", ((LOADER_ENTRY*)MainChosenEntry)->LoadOptions); if (MainChosenEntry->getLOADER_ENTRY()) { // Only for non-legacy entries, as LEGACY_ENTRY doesn't have Flags gSettings.FlagsBits = MainChosenEntry->getLOADER_ENTRY()->Flags; } - // DBG(" MainChosenEntry with FlagsBits = 0x%x\n", gSettings.FlagsBits); + // DBG(" MainChosenEntry with FlagsBits = 0x%X\n", gSettings.FlagsBits); if (TmpArgs) { FreePool(TmpArgs); @@ -6445,8 +6445,8 @@ UINTN REFIT_MENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRAC //running details menu SubMenuExit = MainChosenEntry->SubScreen->RunGenericMenu(Style, &SubMenuIndex, &TempChosenEntry); if ( MainChosenEntry->getREFIT_MENU_ITEM_BOOTNUM() ) DecodeOptions(MainChosenEntry->getREFIT_MENU_ITEM_BOOTNUM()); -// DBG("get OptionsBits = 0x%x\n", gSettings.OptionsBits); -// DBG(" TempChosenEntry FlagsBits = 0x%x\n", ((LOADER_ENTRY*)TempChosenEntry)->Flags); +// DBG("get OptionsBits = 0x%X\n", gSettings.OptionsBits); +// DBG(" TempChosenEntry FlagsBits = 0x%X\n", ((LOADER_ENTRY*)TempChosenEntry)->Flags); if (SubMenuExit == MENU_EXIT_ESCAPE || TempChosenEntry->getREFIT_MENU_ITEM_RETURN() ) { SubMenuExit = MENU_EXIT_ENTER; MenuExit = 0; @@ -6455,11 +6455,11 @@ UINTN REFIT_MENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRAC if (MainChosenEntry->getREFIT_MENU_ENTRY_CLOVER()) { MainChosenEntry->getREFIT_MENU_ENTRY_CLOVER()->LoadOptions = EfiStrDuplicate(((REFIT_MENU_ENTRY_CLOVER*)TempChosenEntry)->LoadOptions); } - // DBG(" exit menu with LoadOptions: %s\n", ((LOADER_ENTRY*)MainChosenEntry)->LoadOptions); + // DBG(" exit menu with LoadOptions: %ls\n", ((LOADER_ENTRY*)MainChosenEntry)->LoadOptions); if (SubMenuExit == MENU_EXIT_ENTER && MainChosenEntry->getLOADER_ENTRY() && TempChosenEntry->getLOADER_ENTRY()) { // Only for non-legacy entries, as LEGACY_ENTRY doesn't have Flags MainChosenEntry->getLOADER_ENTRY()->Flags = TempChosenEntry->getLOADER_ENTRY()->Flags; -// DBG(" get MainChosenEntry FlagsBits = 0x%x\n", ((LOADER_ENTRY*)MainChosenEntry)->Flags); +// DBG(" get MainChosenEntry FlagsBits = 0x%X\n", ((LOADER_ENTRY*)MainChosenEntry)->Flags); } if (/*MenuExit == MENU_EXIT_ENTER &&*/ MainChosenEntry->getLOADER_ENTRY()) { if (MainChosenEntry->getLOADER_ENTRY()->LoadOptions) { @@ -6467,7 +6467,7 @@ UINTN REFIT_MENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRAC } else { ZeroMem(&gSettings.BootArgs, 255); } - DBG(" boot with args: %a\n", gSettings.BootArgs); + DBG(" boot with args: %s\n", gSettings.BootArgs); } //---- Details submenu (kexts disabling etc) if (SubMenuExit == MENU_EXIT_ENTER || MenuExit == MENU_EXIT_DETAILS) { @@ -6481,7 +6481,7 @@ UINTN REFIT_MENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRAC NextMenuExit = MENU_EXIT_ENTER; break; } - // DBG(" get NextChosenEntry FlagsBits = 0x%x\n", ((LOADER_ENTRY*)NextChosenEntry)->Flags); + // DBG(" get NextChosenEntry FlagsBits = 0x%X\n", ((LOADER_ENTRY*)NextChosenEntry)->Flags); //---- Details submenu (kexts disabling etc) second level if (NextMenuExit == MENU_EXIT_ENTER || MenuExit == MENU_EXIT_DETAILS) { if (NextChosenEntry->SubScreen != NULL) { @@ -6495,7 +6495,7 @@ UINTN REFIT_MENU_SCREEN::RunMainMenu(IN INTN DefaultSelection, OUT REFIT_ABSTRAC NextMenuExit = 0; break; } - // DBG(" get DeepChosenEntry FlagsBits = 0x%x\n", ((LOADER_ENTRY*)DeepChosenEntry)->Flags); + // DBG(" get DeepChosenEntry FlagsBits = 0x%X\n", ((LOADER_ENTRY*)DeepChosenEntry)->Flags); } //while(!DeepMenuExit) } } diff --git a/rEFIt_UEFI/refit/screen.cpp b/rEFIt_UEFI/refit/screen.cpp index 7503961a3..89855b412 100644 --- a/rEFIt_UEFI/refit/screen.cpp +++ b/rEFIt_UEFI/refit/screen.cpp @@ -514,7 +514,7 @@ VOID BltClearScreen() //ShowBanner always TRUE. Called from line 400 } if (BackgroundImage == NULL) { -/* DBG("BltClearScreen(%c): calling egCreateFilledImage UGAWidth %ld, UGAHeight %ld, BlueBackgroundPixel %02x%02x%02x%02x\n", +/* DBG("BltClearScreen(%c): calling egCreateFilledImage UGAWidth %ld, UGAHeight %ld, BlueBackgroundPixel %02X%02X%02X%02X\n", ShowBanner?'Y':'N', UGAWidth, UGAHeight, BlueBackgroundPixel.r, BlueBackgroundPixel.g, BlueBackgroundPixel.b, BlueBackgroundPixel.a); */ BackgroundImage = egCreateFilledImage(UGAWidth, UGAHeight, FALSE, &BlueBackgroundPixel); @@ -574,7 +574,7 @@ VOID BltClearScreen() //ShowBanner always TRUE. Called from line 400 ShowBanner?'Y':'N', BackgroundImage); */ BltImage(BackgroundImage, 0, 0); //if NULL then do nothing } else { -/* DBG("BltClearScreen(%c): calling egClearScreen StdBackgroundPixel %02x%02x%02x%02x\n", +/* DBG("BltClearScreen(%c): calling egClearScreen StdBackgroundPixel %02X%02X%02X%02X\n", ShowBanner?'Y':'N', StdBackgroundPixel.r, StdBackgroundPixel.g, StdBackgroundPixel.b, StdBackgroundPixel.a); */ egClearScreen(&StdBackgroundPixel); } @@ -773,9 +773,9 @@ VOID BltImageCompositeBadge(IN EG_IMAGE *BaseImage, IN EG_IMAGE *TopImage, IN EG if (GlobalConfig.BadgeOffsetX != 0xFFFF) { // Check if value is between 0 and ( width of the main icon - width of badge ) if (GlobalConfig.BadgeOffsetX < 0 || GlobalConfig.BadgeOffsetX > (CompWidth - BadgeImage->Width)) { - DBG("User offset X %d is out of range\n", GlobalConfig.BadgeOffsetX); + DBG("User offset X %lld is out of range\n", GlobalConfig.BadgeOffsetX); GlobalConfig.BadgeOffsetX = CompWidth - 8 - BadgeImage->Width; - DBG(" corrected to default %d\n", GlobalConfig.BadgeOffsetX); + DBG(" corrected to default %lld\n", GlobalConfig.BadgeOffsetX); } OffsetX += GlobalConfig.BadgeOffsetX; } else { @@ -786,9 +786,9 @@ VOID BltImageCompositeBadge(IN EG_IMAGE *BaseImage, IN EG_IMAGE *TopImage, IN EG if (GlobalConfig.BadgeOffsetY != 0xFFFF) { // Check if value is between 0 and ( height of the main icon - height of badge ) if (GlobalConfig.BadgeOffsetY < 0 || GlobalConfig.BadgeOffsetY > (CompHeight - BadgeImage->Height)) { - DBG("User offset Y %d is out of range\n",GlobalConfig.BadgeOffsetY); + DBG("User offset Y %lld is out of range\n",GlobalConfig.BadgeOffsetY); GlobalConfig.BadgeOffsetY = CompHeight - 8 - BadgeImage->Height; - DBG(" corrected to default %d\n", GlobalConfig.BadgeOffsetY); + DBG(" corrected to default %lld\n", GlobalConfig.BadgeOffsetY); } OffsetY += GlobalConfig.BadgeOffsetY; } else { @@ -1048,7 +1048,7 @@ VOID REFIT_MENU_SCREEN::InitAnime() // Look through contents of the directory UINTN i; for (i = 0; i < Anime->Frames; i++) { - // DBG("Try to load file %s\n", FileName); + // DBG("Try to load file %ls\n", FileName); if (ThemeX.TypeSVG) { p = LoadSvgFrame(i); // DBG("frame %d loaded\n", i); @@ -1161,7 +1161,7 @@ VOID REFIT_MENU_SCREEN::InitAnime() UINTN i; for (i = 0; i < Anime->Frames; i++) { - // DBG("Try to load file %s\n", FileName); + // DBG("Try to load file %ls\n", FileName); if (GlobalConfig.TypeSVG) { p = LoadSvgFrame(i); // DBG("frame %d loaded\n", i); @@ -1179,7 +1179,7 @@ VOID REFIT_MENU_SCREEN::InitAnime() } if (Film[0] != NULL) { Frames = i; - DBG(" found %d frames of the anime\n", i); + DBG(" found %llu frames of the anime\n", i); // Create background frame Film[i] = egCreateImage(Film[0]->Width, Film[0]->Height, FALSE); // Copy some settings from Anime into Screen @@ -1239,7 +1239,7 @@ BOOLEAN REFIT_MENU_SCREEN::GetAnime() return FALSE; } - DBG("Use anime=%s frames=%d\n", Anime->Path, Anime->Frames); + DBG("Use anime=%ls frames=%llu\n", Anime->Path, Anime->Frames); return TRUE; }