提交 e6bec3ae 编写于 作者: V vit9696

Debug: Fix some log tags

上级 ef932e8a
...@@ -384,7 +384,7 @@ UefiMain ( ...@@ -384,7 +384,7 @@ UefiMain (
DEBUG (( DEBUG ((
DEBUG_WARN, DEBUG_WARN,
"GTT: Found %u handles with GOP protocol - %r\n", "GSTT: Found %u handles with GOP protocol - %r\n",
(UINT32) HandleCount, (UINT32) HandleCount,
Status Status
)); ));
...@@ -398,7 +398,7 @@ UefiMain ( ...@@ -398,7 +398,7 @@ UefiMain (
// //
Reports = AllocateZeroPool (EFI_PAGE_SIZE * HandleCount); Reports = AllocateZeroPool (EFI_PAGE_SIZE * HandleCount);
if (Reports == NULL) { if (Reports == NULL) {
DEBUG ((DEBUG_WARN, "GTT: Cannot allocate memory for GOP reports\n")); DEBUG ((DEBUG_WARN, "GSTT: Cannot allocate memory for GOP reports\n"));
FreePool (HandleBuffer); FreePool (HandleBuffer);
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
...@@ -441,7 +441,7 @@ UefiMain ( ...@@ -441,7 +441,7 @@ UefiMain (
FreePool (FinalReport); FreePool (FinalReport);
} else { } else {
DEBUG ((DEBUG_WARN, "GTT: Cannot allocate memory for final report\n")); DEBUG ((DEBUG_WARN, "GSTT: Cannot allocate memory for final report\n"));
} }
// //
......
...@@ -119,7 +119,7 @@ ReadProvisioningDataFile ( ...@@ -119,7 +119,7 @@ ReadProvisioningDataFile (
// Implement fallback for our firmwares. // Implement fallback for our firmwares.
// //
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCME: No %g in firmware, using default - %r\n", FvNameGuid, Status)); DEBUG ((DEBUG_INFO, "OCPAVP: No %g in firmware, using default - %r\n", FvNameGuid, Status));
if (CompareGuid (&gAppleEpidCertificateFileGuid, FvNameGuid)) { if (CompareGuid (&gAppleEpidCertificateFileGuid, FvNameGuid)) {
*Buffer = AllocateCopyPool (gDefaultAppleEpidCertificateSize, gDefaultAppleEpidCertificate); *Buffer = AllocateCopyPool (gDefaultAppleEpidCertificateSize, gDefaultAppleEpidCertificate);
...@@ -247,7 +247,7 @@ IsBuiltinGpuAvailable ( ...@@ -247,7 +247,7 @@ IsBuiltinGpuAvailable (
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OC: Failed to find PCI root protocol - %r\n", Status)); DEBUG ((DEBUG_INFO, "OCPAVP: Failed to find PCI root protocol - %r\n", Status));
return FALSE; return FALSE;
} }
...@@ -266,7 +266,7 @@ IsBuiltinGpuAvailable ( ...@@ -266,7 +266,7 @@ IsBuiltinGpuAvailable (
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OC: Failed to read from IGPU device - %r\n", Status)); DEBUG ((DEBUG_INFO, "OCPAVP: Failed to read from IGPU device - %r\n", Status));
return FALSE; return FALSE;
} }
...@@ -325,7 +325,7 @@ NeedsFpfProvisioning ( ...@@ -325,7 +325,7 @@ NeedsFpfProvisioning (
Hob = NULL; Hob = NULL;
#endif #endif
DEBUG ((DEBUG_INFO, "OC: HOB for FPF is %p\n", Hob)); DEBUG ((DEBUG_INFO, "OCPAVP: HOB for FPF is %p\n", Hob));
if (Hob == NULL || Hob->ShouldProvision) { if (Hob == NULL || Hob->ShouldProvision) {
DataSize = sizeof (Data); DataSize = sizeof (Data);
...@@ -604,11 +604,11 @@ OcPerformProvisioning ( ...@@ -604,11 +604,11 @@ OcPerformProvisioning (
DEBUG ((DEBUG_INFO, "OCPAVP: Done EPID provisioning - %r\n", Status)); DEBUG ((DEBUG_INFO, "OCPAVP: Done EPID provisioning - %r\n", Status));
#if 0 #if 0
DEBUG ((DEBUG_INFO, "OC: Starting FPF provisioning\n")); DEBUG ((DEBUG_INFO, "OCPAVP: Starting FPF provisioning\n"));
Status = OcPerformFpfProvisioning (); Status = OcPerformFpfProvisioning ();
DEBUG ((DEBUG_INFO, "OC: Done FPF provisioning - %r\n", Status)); DEBUG ((DEBUG_INFO, "OCPAVP: Done FPF provisioning - %r\n", Status));
#endif #endif
} }
......
...@@ -595,7 +595,7 @@ AppleMapPrepareKernelJump ( ...@@ -595,7 +595,7 @@ AppleMapPrepareKernelJump (
(VOID*) ImageAddress (VOID*) ImageAddress
); );
if (KernelEntryVaddr == 0) { if (KernelEntryVaddr == 0) {
RUNTIME_DEBUG ((DEBUG_ERROR, "Kernel entry point was not found!")); RUNTIME_DEBUG ((DEBUG_ERROR, "OCABC: Kernel entry point was not found!"));
return; return;
} }
......
...@@ -178,7 +178,7 @@ OcAppleChunklistVerifyData ( ...@@ -178,7 +178,7 @@ OcAppleChunklistVerifyData (
// //
// Calculate checksum of data and ensure they match. // Calculate checksum of data and ensure they match.
// //
DEBUG ((DEBUG_VERBOSE, "AppleChunklistVerifyData(): Validating chunk %lu of %lu\n", DEBUG ((DEBUG_VERBOSE, "OCCL: Validating chunk %lu of %lu\n",
(UINT64)Index + 1, (UINT64)Context->ChunkCount)); (UINT64)Index + 1, (UINT64)Context->ChunkCount));
Sha256 (ChunkHash, ChunkData, CurrentChunk->Length); Sha256 (ChunkHash, ChunkData, CurrentChunk->Length);
if (CompareMem (ChunkHash, CurrentChunk->Checksum, SHA256_DIGEST_SIZE) != 0) { if (CompareMem (ChunkHash, CurrentChunk->Checksum, SHA256_DIGEST_SIZE) != 0) {
......
...@@ -220,7 +220,7 @@ InternalConstructDmgDevicePath ( ...@@ -220,7 +220,7 @@ InternalConstructDmgDevicePath (
); );
UnicodeDevPath = ConvertDevicePathToText ((EFI_DEVICE_PATH_PROTOCOL *)DevPath, FALSE, FALSE); UnicodeDevPath = ConvertDevicePathToText ((EFI_DEVICE_PATH_PROTOCOL *)DevPath, FALSE, FALSE);
DEBUG ((DEBUG_INFO, "Built DMG DP: %s\n", UnicodeDevPath != NULL ? UnicodeDevPath : L"<NULL>")); DEBUG ((DEBUG_INFO, "OCDI: Built DMG DP: %s\n", UnicodeDevPath != NULL ? UnicodeDevPath : L"<NULL>"));
if (UnicodeDevPath != NULL) { if (UnicodeDevPath != NULL) {
FreePool (UnicodeDevPath); FreePool (UnicodeDevPath);
} }
......
...@@ -59,7 +59,7 @@ OcAppleDiskImageInitializeContext ( ...@@ -59,7 +59,7 @@ OcAppleDiskImageInitializeContext (
if (FileSize <= sizeof (Trailer)) { if (FileSize <= sizeof (Trailer)) {
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"OCBD: DMG file size error: %u/%u\n", "OCDI: DMG file size error: %u/%u\n",
FileSize, FileSize,
(UINT32) sizeof (Trailer) (UINT32) sizeof (Trailer)
)); ));
...@@ -79,7 +79,7 @@ OcAppleDiskImageInitializeContext ( ...@@ -79,7 +79,7 @@ OcAppleDiskImageInitializeContext (
if (!Result || (Trailer.Signature != SwappedSig)) { if (!Result || (Trailer.Signature != SwappedSig)) {
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"OCBD: DMG trailer error: %d - %Lx/%Lx - %X/%X\n", "OCDI: DMG trailer error: %d - %Lx/%Lx - %X/%X\n",
Result, Result,
(UINT64) TrailerOffset, (UINT64) TrailerOffset,
(UINT64) FileSize, (UINT64) FileSize,
...@@ -105,7 +105,7 @@ OcAppleDiskImageInitializeContext ( ...@@ -105,7 +105,7 @@ OcAppleDiskImageInitializeContext (
|| (SectorCount == 0)) { || (SectorCount == 0)) {
DEBUG (( DEBUG ((
DEBUG_INFO, DEBUG_INFO,
"OCBD: DMG context error: %u/%Lu/%Lu/%u/%u\n", "OCDI: DMG context error: %u/%Lu/%Lu/%u/%u\n",
HeaderSize, HeaderSize,
XmlLength, XmlLength,
SectorCount, SectorCount,
...@@ -115,7 +115,7 @@ OcAppleDiskImageInitializeContext ( ...@@ -115,7 +115,7 @@ OcAppleDiskImageInitializeContext (
} }
if ((SegmentCount != 0) && (SegmentCount != 1)) { if ((SegmentCount != 0) && (SegmentCount != 1)) {
DEBUG ((DEBUG_ERROR, "OCBD: Multiple segments are unsupported\n")); DEBUG ((DEBUG_ERROR, "OCDI: Multiple segments are unsupported\n"));
return FALSE; return FALSE;
} }
...@@ -125,7 +125,7 @@ OcAppleDiskImageInitializeContext ( ...@@ -125,7 +125,7 @@ OcAppleDiskImageInitializeContext (
&OffsetTop &OffsetTop
); );
if (Result || (OffsetTop > MAX_UINTN)) { if (Result || (OffsetTop > MAX_UINTN)) {
DEBUG ((DEBUG_INFO, "OCBD: DMG sector error: %Lu %Lu\n", SectorCount, OffsetTop)); DEBUG ((DEBUG_INFO, "OCDI: DMG sector error: %Lu %Lu\n", SectorCount, OffsetTop));
return FALSE; return FALSE;
} }
...@@ -135,7 +135,7 @@ OcAppleDiskImageInitializeContext ( ...@@ -135,7 +135,7 @@ OcAppleDiskImageInitializeContext (
&OffsetTop &OffsetTop
); );
if (Result || (OffsetTop > TrailerOffset)) { if (Result || (OffsetTop > TrailerOffset)) {
DEBUG ((DEBUG_INFO, "OCBD: DMG xml error: %Lu %Lu %Lu %Lu\n", XmlOffset, XmlLength, OffsetTop, TrailerOffset)); DEBUG ((DEBUG_INFO, "OCDI: DMG xml error: %Lu %Lu %Lu %Lu\n", XmlOffset, XmlLength, OffsetTop, TrailerOffset));
return FALSE; return FALSE;
} }
...@@ -145,13 +145,13 @@ OcAppleDiskImageInitializeContext ( ...@@ -145,13 +145,13 @@ OcAppleDiskImageInitializeContext (
&OffsetTop &OffsetTop
); );
if (Result || (OffsetTop > TrailerOffset)) { if (Result || (OffsetTop > TrailerOffset)) {
DEBUG ((DEBUG_INFO, "OCBD: DMG data error: %Lu %Lu %Lu %Lu\n", DataForkOffset, DataForkLength, OffsetTop, TrailerOffset)); DEBUG ((DEBUG_INFO, "OCDI: DMG data error: %Lu %Lu %Lu %Lu\n", DataForkOffset, DataForkLength, OffsetTop, TrailerOffset));
return FALSE; return FALSE;
} }
PlistData = AllocatePool ((UINT32)XmlLength); PlistData = AllocatePool ((UINT32)XmlLength);
if (PlistData == NULL) { if (PlistData == NULL) {
DEBUG ((DEBUG_INFO, "OCBD: DMG plist alloc error: %Lu\n", XmlLength)); DEBUG ((DEBUG_INFO, "OCDI: DMG plist alloc error: %Lu\n", XmlLength));
return FALSE; return FALSE;
} }
...@@ -162,7 +162,7 @@ OcAppleDiskImageInitializeContext ( ...@@ -162,7 +162,7 @@ OcAppleDiskImageInitializeContext (
PlistData PlistData
); );
if (!Result) { if (!Result) {
DEBUG ((DEBUG_INFO, "OCBD: DMG plist read error: %Lu %Lu\n", XmlOffset, XmlLength)); DEBUG ((DEBUG_INFO, "OCDI: DMG plist read error: %Lu %Lu\n", XmlOffset, XmlLength));
FreePool (PlistData); FreePool (PlistData);
return FALSE; return FALSE;
} }
...@@ -180,7 +180,7 @@ OcAppleDiskImageInitializeContext ( ...@@ -180,7 +180,7 @@ OcAppleDiskImageInitializeContext (
FreePool (PlistData); FreePool (PlistData);
if (!Result) { if (!Result) {
DEBUG ((DEBUG_INFO, "OCBD: DMG plist parse error: %Lu %Lu\n", XmlOffset, XmlLength)); DEBUG ((DEBUG_INFO, "OCDI: DMG plist parse error: %Lu %Lu\n", XmlOffset, XmlLength));
return FALSE; return FALSE;
} }
...@@ -209,19 +209,19 @@ OcAppleDiskImageInitializeFromFile ( ...@@ -209,19 +209,19 @@ OcAppleDiskImageInitializeFromFile (
Status = GetFileSize (File, &FileSize); Status = GetFileSize (File, &FileSize);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCBD: Failed to retrieve DMG file size\n")); DEBUG ((DEBUG_INFO, "OCDI: Failed to retrieve DMG file size\n"));
return FALSE; return FALSE;
} }
ExtentTable = OcAppleRamDiskAllocate (FileSize, EfiACPIMemoryNVS); ExtentTable = OcAppleRamDiskAllocate (FileSize, EfiACPIMemoryNVS);
if (ExtentTable == NULL) { if (ExtentTable == NULL) {
DEBUG ((DEBUG_INFO, "OCBD: Failed to allocate DMG data\n")); DEBUG ((DEBUG_INFO, "OCDI: Failed to allocate DMG data\n"));
return FALSE; return FALSE;
} }
Result = OcAppleRamDiskLoadFile (ExtentTable, File, FileSize); Result = OcAppleRamDiskLoadFile (ExtentTable, File, FileSize);
if (!Result) { if (!Result) {
DEBUG ((DEBUG_INFO, "OCBD: Failed to load DMG file\n")); DEBUG ((DEBUG_INFO, "OCDI: Failed to load DMG file\n"));
OcAppleRamDiskFree (ExtentTable); OcAppleRamDiskFree (ExtentTable);
return FALSE; return FALSE;
...@@ -229,7 +229,7 @@ OcAppleDiskImageInitializeFromFile ( ...@@ -229,7 +229,7 @@ OcAppleDiskImageInitializeFromFile (
Result = OcAppleDiskImageInitializeContext (Context, ExtentTable, FileSize); Result = OcAppleDiskImageInitializeContext (Context, ExtentTable, FileSize);
if (!Result) { if (!Result) {
DEBUG ((DEBUG_INFO, "OCBD: Failed to initialise DMG context\n")); DEBUG ((DEBUG_INFO, "OCDI: Failed to initialise DMG context\n"));
OcAppleRamDiskFree (ExtentTable); OcAppleRamDiskFree (ExtentTable);
return FALSE; return FALSE;
...@@ -406,7 +406,7 @@ OcAppleDiskImageRead ( ...@@ -406,7 +406,7 @@ OcAppleDiskImageRead (
{ {
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"Compression type %x unsupported\n", "OCDI: Compression type %x unsupported\n",
Chunk->Type Chunk->Type
)); ));
return FALSE; return FALSE;
......
...@@ -118,7 +118,7 @@ InternalSwapBlockData ( ...@@ -118,7 +118,7 @@ InternalSwapBlockData (
&BlockSectorTop &BlockSectorTop
); );
if (Result || BlockSectorTop > SectorCount) { if (Result || BlockSectorTop > SectorCount) {
DEBUG ((DEBUG_ERROR, "OCDMG: Block sectors exceed DMG sectors %lu %lu\n", BlockSectorTop, SectorCount)); DEBUG ((DEBUG_ERROR, "OCDI: Block sectors exceed DMG sectors %lu %lu\n", BlockSectorTop, SectorCount));
return FALSE; return FALSE;
} }
......
...@@ -69,7 +69,7 @@ GetImageDims ( ...@@ -69,7 +69,7 @@ GetImageDims (
Status = GetPngDims (ImageBuffer, ImageSize, ImageWidth, ImageHeight); Status = GetPngDims (ImageBuffer, ImageSize, ImageWidth, ImageHeight);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "Failed to obtain image dimensions for image\n")); DEBUG ((DEBUG_INFO, "OCIC: Failed to obtain image dimensions for image\n"));
} }
return Status; return Status;
......
...@@ -85,7 +85,7 @@ ParseFatArchitecture ( ...@@ -85,7 +85,7 @@ ParseFatArchitecture (
if (OcOverflowMulAddU32 (NumberOfFatArch, sizeof (MACH_FAT_ARCH), sizeof (MACH_FAT_HEADER), &TmpSize) if (OcOverflowMulAddU32 (NumberOfFatArch, sizeof (MACH_FAT_ARCH), sizeof (MACH_FAT_HEADER), &TmpSize)
|| TmpSize > KERNEL_HEADER_SIZE) { || TmpSize > KERNEL_HEADER_SIZE) {
DEBUG ((DEBUG_INFO, "Fat kernel invalid arch count %u\n", NumberOfFatArch)); DEBUG ((DEBUG_INFO, "OCAK: Fat kernel invalid arch count %u\n", NumberOfFatArch));
return 0; return 0;
} }
...@@ -106,12 +106,12 @@ ParseFatArchitecture ( ...@@ -106,12 +106,12 @@ ParseFatArchitecture (
} }
if (*Offset == 0) { if (*Offset == 0) {
DEBUG ((DEBUG_INFO, "Fat kernel has 0 offset\n")); DEBUG ((DEBUG_INFO, "OCAK: Fat kernel has 0 offset\n"));
return 0; return 0;
} }
if (OcOverflowAddU32 (*Offset, Size, &TmpSize)) { if (OcOverflowAddU32 (*Offset, Size, &TmpSize)) {
DEBUG ((DEBUG_INFO, "Fat kernel invalid size %u\n", Size)); DEBUG ((DEBUG_INFO, "OCAK: Fat kernel invalid size %u\n", Size));
return 0; return 0;
} }
...@@ -119,7 +119,7 @@ ParseFatArchitecture ( ...@@ -119,7 +119,7 @@ ParseFatArchitecture (
} }
} }
DEBUG ((DEBUG_INFO, "Fat kernel has no x86_64 arch\n")); DEBUG ((DEBUG_INFO, "OCAK: Fat kernel has no x86_64 arch\n"));
return 0; return 0;
} }
...@@ -155,25 +155,25 @@ ParseCompressedHeader ( ...@@ -155,25 +155,25 @@ ParseCompressedHeader (
|| CompressedSize == 0 || CompressedSize == 0
|| DecompressedSize > OC_COMPRESSION_MAX_LENGTH || DecompressedSize > OC_COMPRESSION_MAX_LENGTH
|| DecompressedSize < KERNEL_HEADER_SIZE) { || DecompressedSize < KERNEL_HEADER_SIZE) {
DEBUG ((DEBUG_INFO, "Comp kernel invalid comp %u or decomp %u at %08X\n", CompressedSize, DecompressedSize, Offset)); DEBUG ((DEBUG_INFO, "OCAK: Comp kernel invalid comp %u or decomp %u at %08X\n", CompressedSize, DecompressedSize, Offset));
return KernelSize; return KernelSize;
} }
Status = ReplaceBuffer (DecompressedSize, Buffer, AllocatedSize, ReservedSize); Status = ReplaceBuffer (DecompressedSize, Buffer, AllocatedSize, ReservedSize);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "Decomp kernel (%u bytes) cannot be allocated at %08X\n", DecompressedSize, Offset)); DEBUG ((DEBUG_INFO, "OCAK: Decomp kernel (%u bytes) cannot be allocated at %08X\n", DecompressedSize, Offset));
return KernelSize; return KernelSize;
} }
CompressedBuffer = AllocatePool (CompressedSize); CompressedBuffer = AllocatePool (CompressedSize);
if (CompressedBuffer == NULL) { if (CompressedBuffer == NULL) {
DEBUG ((DEBUG_INFO, "Comp kernel (%u bytes) cannot be allocated at %08X\n", CompressedSize, Offset)); DEBUG ((DEBUG_INFO, "OCAK: Comp kernel (%u bytes) cannot be allocated at %08X\n", CompressedSize, Offset));
return KernelSize; return KernelSize;
} }
Status = GetFileData (File, Offset + sizeof (MACH_COMP_HEADER), CompressedSize, CompressedBuffer); Status = GetFileData (File, Offset + sizeof (MACH_COMP_HEADER), CompressedSize, CompressedBuffer);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "Comp kernel (%u bytes) cannot be read at %08X\n", CompressedSize, Offset)); DEBUG ((DEBUG_INFO, "OCAK: Comp kernel (%u bytes) cannot be read at %08X\n", CompressedSize, Offset));
FreePool (CompressedBuffer); FreePool (CompressedBuffer);
return KernelSize; return KernelSize;
} }
...@@ -227,14 +227,14 @@ ReadAppleKernelImage ( ...@@ -227,14 +227,14 @@ ReadAppleKernelImage (
while (TRUE) { while (TRUE) {
if (!OC_TYPE_ALIGNED (UINT32 , *Buffer)) { if (!OC_TYPE_ALIGNED (UINT32 , *Buffer)) {
DEBUG ((DEBUG_INFO, "Misaligned kernel header %p at %08X\n", *Buffer, Offset)); DEBUG ((DEBUG_INFO, "OCAK: Misaligned kernel header %p at %08X\n", *Buffer, Offset));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
MagicPtr = (UINT32 *)* Buffer; MagicPtr = (UINT32 *)* Buffer;
switch (*MagicPtr) { switch (*MagicPtr) {
case MACH_HEADER_64_SIGNATURE: case MACH_HEADER_64_SIGNATURE:
DEBUG ((DEBUG_VERBOSE, "Found Mach-O compressed %d offset %u size %u\n", Compressed, Offset, *KernelSize)); DEBUG ((DEBUG_VERBOSE, "OCAK: Found Mach-O compressed %d offset %u size %u\n", Compressed, Offset, *KernelSize));
// //
// This is just a valid (formerly) compressed image. // This is just a valid (formerly) compressed image.
...@@ -253,22 +253,22 @@ ReadAppleKernelImage ( ...@@ -253,22 +253,22 @@ ReadAppleKernelImage (
// //
Status = GetFileSize (File, KernelSize); Status = GetFileSize (File, KernelSize);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "Kernel size cannot be determined - %r\n", Status)); DEBUG ((DEBUG_INFO, "OCAK: Kernel size cannot be determined - %r\n", Status));
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
DEBUG ((DEBUG_VERBOSE, "Determined kernel size is %u bytes\n", *KernelSize)); DEBUG ((DEBUG_VERBOSE, "OCAK: Determined kernel size is %u bytes\n", *KernelSize));
} }
Status = ReplaceBuffer (*KernelSize, Buffer, AllocatedSize, ReservedSize); Status = ReplaceBuffer (*KernelSize, Buffer, AllocatedSize, ReservedSize);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "Kernel (%u bytes) cannot be allocated at %08X\n", *KernelSize, Offset)); DEBUG ((DEBUG_INFO, "OCAK: Kernel (%u bytes) cannot be allocated at %08X\n", *KernelSize, Offset));
return Status; return Status;
} }
Status = GetFileData (File, Offset, *KernelSize, *Buffer); Status = GetFileData (File, Offset, *KernelSize, *Buffer);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "Kernel (%u bytes) cannot be read at %08X\n", *KernelSize, Offset)); DEBUG ((DEBUG_INFO, "OCAK: Kernel (%u bytes) cannot be read at %08X\n", *KernelSize, Offset));
} }
return Status; return Status;
...@@ -303,13 +303,13 @@ ReadAppleKernelImage ( ...@@ -303,13 +303,13 @@ ReadAppleKernelImage (
// //
*KernelSize = ParseCompressedHeader (File, Buffer, Offset, AllocatedSize, ReservedSize); *KernelSize = ParseCompressedHeader (File, Buffer, Offset, AllocatedSize, ReservedSize);
if (*KernelSize != 0) { if (*KernelSize != 0) {
DEBUG ((DEBUG_VERBOSE, "Compressed result has %08X magic\n", *(UINT32 *) Buffer)); DEBUG ((DEBUG_VERBOSE, "OCAK: Compressed result has %08X magic\n", *(UINT32 *) Buffer));
continue; continue;
} }
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
default: default:
DEBUG ((Offset > 0 ? DEBUG_INFO : DEBUG_VERBOSE, "Invalid kernel magic %08X at %08X\n", *MagicPtr, Offset)); DEBUG ((Offset > 0 ? DEBUG_INFO : DEBUG_VERBOSE, "OCAK: Invalid kernel magic %08X at %08X\n", *MagicPtr, Offset));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
} }
......
...@@ -930,7 +930,7 @@ InternalRelocateRelocationIntel64 ( ...@@ -930,7 +930,7 @@ InternalRelocateRelocationIntel64 (
} }
if (InvalidPcRel) { if (InvalidPcRel) {
DEBUG ((DEBUG_WARN, "Prelink: Relocation has invalid PC relative flag\n")); DEBUG ((DEBUG_WARN, "OCAK: Relocation has invalid PC relative flag\n"));
} }
ReturnValue = (MachoPreserveRelocationIntel64 (Type) ? 1 : 0); ReturnValue = (MachoPreserveRelocationIntel64 (Type) ? 1 : 0);
...@@ -1415,7 +1415,7 @@ InternalPrelinkKext64 ( ...@@ -1415,7 +1415,7 @@ InternalPrelinkKext64 (
NumUndefinedSymbols NumUndefinedSymbols
); );
if (!Result) { if (!Result) {
DEBUG ((DEBUG_INFO, "Symbol %s was unresolved for kext %a\n", DEBUG ((DEBUG_INFO, "OCAK: Symbol %s was unresolved for kext %a\n",
MachoGetSymbolName64 (MachoContext, Symbol), Kext->Identifier)); MachoGetSymbolName64 (MachoContext, Symbol), Kext->Identifier));
return EFI_LOAD_ERROR; return EFI_LOAD_ERROR;
} }
...@@ -1425,7 +1425,7 @@ InternalPrelinkKext64 ( ...@@ -1425,7 +1425,7 @@ InternalPrelinkKext64 (
// //
Result = InternalPatchByVtables64 (Context, Kext); Result = InternalPatchByVtables64 (Context, Kext);
if (!Result) { if (!Result) {
DEBUG ((DEBUG_INFO, "Vtable patching failed for kext %a\n", Kext->Identifier)); DEBUG ((DEBUG_INFO, "OCAK: Vtable patching failed for kext %a\n", Kext->Identifier));
return EFI_LOAD_ERROR; return EFI_LOAD_ERROR;
} }
// //
......
...@@ -537,7 +537,7 @@ PrelinkedInjectKext ( ...@@ -537,7 +537,7 @@ PrelinkedInjectKext (
if (Executable != NULL) { if (Executable != NULL) {
ASSERT (ExecutableSize > 0); ASSERT (ExecutableSize > 0);
if (!MachoInitializeContext (&ExecutableContext, (UINT8 *)Executable, ExecutableSize)) { if (!MachoInitializeContext (&ExecutableContext, (UINT8 *)Executable, ExecutableSize)) {
DEBUG ((DEBUG_INFO, "OCK: Injected kext %a/%a is not a supported executable\n", BundlePath, ExecutablePath)); DEBUG ((DEBUG_INFO, "OCAK: Injected kext %a/%a is not a supported executable\n", BundlePath, ExecutablePath));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
...@@ -607,7 +607,7 @@ PrelinkedInjectKext ( ...@@ -607,7 +607,7 @@ PrelinkedInjectKext (
} }
if (AsciiStrCmp (TmpKeyValue, INFO_BUNDLE_EXECUTABLE_KEY) == 0) { if (AsciiStrCmp (TmpKeyValue, INFO_BUNDLE_EXECUTABLE_KEY) == 0) {
DEBUG ((DEBUG_ERROR, "OCK: Plist-only kext has %a key\n", INFO_BUNDLE_EXECUTABLE_KEY)); DEBUG ((DEBUG_ERROR, "OCAK: Plist-only kext has %a key\n", INFO_BUNDLE_EXECUTABLE_KEY));
ASSERT (FALSE); ASSERT (FALSE);
CpuDeadLoop (); CpuDeadLoop ();
} }
......
...@@ -478,7 +478,7 @@ InternalInsertPrelinkedKextDependency ( ...@@ -478,7 +478,7 @@ InternalInsertPrelinkedKextDependency (
EFI_STATUS Status; EFI_STATUS Status;
if (DependencyIndex >= ARRAY_SIZE (Kext->Dependencies)) { if (DependencyIndex >= ARRAY_SIZE (Kext->Dependencies)) {
DEBUG ((DEBUG_INFO, "Kext %a has more than %u or more dependencies!", Kext->Identifier, DependencyIndex)); DEBUG ((DEBUG_INFO, "OCAK: Kext %a has more than %u or more dependencies!", Kext->Identifier, DependencyIndex));
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
...@@ -721,7 +721,7 @@ InternalScanPrelinkedKext ( ...@@ -721,7 +721,7 @@ InternalScanPrelinkedKext (
// //
DependencyKext = InternalCachedPrelinkedKext (Context, DependencyId); DependencyKext = InternalCachedPrelinkedKext (Context, DependencyId);
if (DependencyKext == NULL) { if (DependencyKext == NULL) {
DEBUG ((DEBUG_INFO, "Dependency %a was not found for kext %a\n", DependencyId, Kext->Identifier)); DEBUG ((DEBUG_INFO, "OCAK: Dependency %a was not found for kext %a\n", DependencyId, Kext->Identifier));
DependencyKext = InternalGetQuirkDependencyKext (DependencyId, Context); DependencyKext = InternalGetQuirkDependencyKext (DependencyId, Context);
if (DependencyKext == NULL) { if (DependencyKext == NULL) {
......
...@@ -354,7 +354,7 @@ InternalPatchVtableSymbol ( ...@@ -354,7 +354,7 @@ InternalPatchVtableSymbol (
// //
Name = ParentEntry->Name; Name = ParentEntry->Name;
if (!MachoSymbolNameIsPureVirtual (Name) && ((Symbol->Value & 1U) != 0)) { if (!MachoSymbolNameIsPureVirtual (Name) && ((Symbol->Value & 1U) != 0)) {
DEBUG ((DEBUG_WARN, "Prelink: Invalid VTable symbol\n")); DEBUG ((DEBUG_WARN, "OCAK: Prelink: Invalid VTable symbol\n"));
} }
return TRUE; return TRUE;
......
...@@ -281,7 +281,7 @@ OcKeyMapFlush ( ...@@ -281,7 +281,7 @@ OcKeyMapFlush (
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "OCAK: GetKeyStrokes failure - %r\n", Status)); DEBUG ((DEBUG_ERROR, "OCKM: GetKeyStrokes failure - %r\n", Status));
break; break;
} }
......
...@@ -129,7 +129,7 @@ InternalGetDiskImageBootFile ( ...@@ -129,7 +129,7 @@ InternalGetDiskImageBootFile (
if (ChunklistBuffer == NULL) { if (ChunklistBuffer == NULL) {
if ((Policy & OC_LOAD_REQUIRE_APPLE_SIGN) != 0) { if ((Policy & OC_LOAD_REQUIRE_APPLE_SIGN) != 0) {
DEBUG ((DEBUG_WARN, "Missing DMG signature, aborting\n")); DEBUG ((DEBUG_WARN, "OCB: Missing DMG signature, aborting\n"));
return NULL; return NULL;
} }
} else if ((Policy & (OC_LOAD_VERIFY_APPLE_SIGN | OC_LOAD_REQUIRE_TRUSTED_KEY)) != 0) { } else if ((Policy & (OC_LOAD_VERIFY_APPLE_SIGN | OC_LOAD_REQUIRE_TRUSTED_KEY)) != 0) {
...@@ -168,7 +168,7 @@ InternalGetDiskImageBootFile ( ...@@ -168,7 +168,7 @@ InternalGetDiskImageBootFile (
} }
if (!Result) { if (!Result) {
DEBUG ((DEBUG_WARN, "DMG is not trusted, aborting\n")); DEBUG ((DEBUG_WARN, "OCB: DMG is not trusted, aborting\n"));
return NULL; return NULL;
} }
} }
...@@ -178,7 +178,7 @@ InternalGetDiskImageBootFile ( ...@@ -178,7 +178,7 @@ InternalGetDiskImageBootFile (
&ChunklistContext &ChunklistContext
); );
if (!Result) { if (!Result) {
DEBUG ((DEBUG_WARN, "DMG has been altered\n")); DEBUG ((DEBUG_WARN, "OCB: DMG has been altered\n"));
// //
// FIXME: Warn user instead of aborting when OC_LOAD_REQUIRE_TRUSTED_KEY // FIXME: Warn user instead of aborting when OC_LOAD_REQUIRE_TRUSTED_KEY
// is not set. // is not set.
......
...@@ -171,7 +171,7 @@ AllocateNullTextOutSystemTable ( ...@@ -171,7 +171,7 @@ AllocateNullTextOutSystemTable (
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_WARN, "Failed to calculated new system table CRC32 with Status: %r\n", Status)); DEBUG ((DEBUG_WARN, "OCC: Failed to calculated new system table CRC32 with Status: %r\n", Status));
FreePool (NewSystemTable); FreePool (NewSystemTable);
return NULL; return NULL;
} }
......
...@@ -766,7 +766,7 @@ OcCpuScanProcessor ( ...@@ -766,7 +766,7 @@ OcCpuScanProcessor (
} else if (Cpu->Vendor[0] == CPUID_VENDOR_AMD) { } else if (Cpu->Vendor[0] == CPUID_VENDOR_AMD) {
ScanAmdProcessor (Cpu); ScanAmdProcessor (Cpu);
} else { } else {
DEBUG ((DEBUG_WARN, "Found unsupported CPU vendor: %0X", Cpu->Vendor[0])); DEBUG ((DEBUG_WARN, "OCCPU: Found unsupported CPU vendor: %0X", Cpu->Vendor[0]));
return; return;
} }
......
...@@ -114,7 +114,7 @@ DataHubSetAppleMiscUnicode ( ...@@ -114,7 +114,7 @@ DataHubSetAppleMiscUnicode (
if (Value != NULL) { if (Value != NULL) {
UnicodeValue = AsciiStrCopyToUnicode (Value, 0); UnicodeValue = AsciiStrCopyToUnicode (Value, 0);
if (UnicodeValue == NULL) { if (UnicodeValue == NULL) {
DEBUG ((DEBUG_WARN, "Data Hub failed to allocate %s\n", Key)); DEBUG ((DEBUG_WARN, "OCDH: Data Hub failed to allocate %s\n", Key));
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
......
...@@ -154,7 +154,7 @@ FindWritableFileSystem ( ...@@ -154,7 +154,7 @@ FindWritableFileSystem (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG (( DEBUG ((
DEBUG_VERBOSE, DEBUG_VERBOSE,
"FindWritableFileSystem: gBS->HandleProtocol[%u] returned %r\n", "OCFS: FindWritableFileSystem gBS->HandleProtocol[%u] returned %r\n",
(UINT32) Index, (UINT32) Index,
Status Status
)); ));
...@@ -165,7 +165,7 @@ FindWritableFileSystem ( ...@@ -165,7 +165,7 @@ FindWritableFileSystem (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG (( DEBUG ((
DEBUG_VERBOSE, DEBUG_VERBOSE,
"FindWritableFileSystem: SimpleFs->OpenVolume[%u] returned %r\n", "OCFS: FindWritableFileSystem SimpleFs->OpenVolume[%u] returned %r\n",
(UINT32) Index, (UINT32) Index,
Status Status
)); ));
...@@ -185,7 +185,7 @@ FindWritableFileSystem ( ...@@ -185,7 +185,7 @@ FindWritableFileSystem (
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG (( DEBUG ((
DEBUG_VERBOSE, DEBUG_VERBOSE,
"FindWritableFileSystem: Fs->Open[%u] returned %r\n", "OCFS: FindWritableFileSystem Fs->Open[%u] returned %r\n",
(UINT32) Index, (UINT32) Index,
Status Status
)); ));
...@@ -221,7 +221,7 @@ SetFileData ( ...@@ -221,7 +221,7 @@ SetFileData (
if (WritableFs == NULL) { if (WritableFs == NULL) {
Status = FindWritableFileSystem (&Fs); Status = FindWritableFileSystem (&Fs);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_VERBOSE, "WriteFileData: Can't find writable FS\n")); DEBUG ((DEBUG_VERBOSE, "OCFS: WriteFileData can't find writable FS\n"));
return Status; return Status;
} }
} else { } else {
...@@ -242,7 +242,7 @@ SetFileData ( ...@@ -242,7 +242,7 @@ SetFileData (
Fs->Close (File); Fs->Close (File);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_VERBOSE, "WriteFileData: File->Write returned %r\n", Status)); DEBUG ((DEBUG_VERBOSE, "OCFS: WriteFileData file->Write returned %r\n", Status));
} else if (WrittenSize != Size) { } else if (WrittenSize != Size) {
DEBUG (( DEBUG ((
DEBUG_VERBOSE, DEBUG_VERBOSE,
...@@ -254,7 +254,7 @@ SetFileData ( ...@@ -254,7 +254,7 @@ SetFileData (
Status = EFI_BAD_BUFFER_SIZE; Status = EFI_BAD_BUFFER_SIZE;
} }
} else { } else {
DEBUG ((DEBUG_VERBOSE, "WriteFileData: Fs->Open of %s returned %r\n", FileName, Status)); DEBUG ((DEBUG_VERBOSE, "OCFS: WriteFileData Fs->Open of %s returned %r\n", FileName, Status));
} }
if (WritableFs == NULL) { if (WritableFs == NULL) {
......
...@@ -79,7 +79,7 @@ GetVolumeLabel ( ...@@ -79,7 +79,7 @@ GetVolumeLabel (
// //
if (VolumeInfo->VolumeLabel[VolumeLabelSize / sizeof (CHAR16) - 1] != '\0' if (VolumeInfo->VolumeLabel[VolumeLabelSize / sizeof (CHAR16) - 1] != '\0'
|| VolumeLabelSize > OC_MAX_VOLUME_LABEL_SIZE * sizeof (CHAR16)) { || VolumeLabelSize > OC_MAX_VOLUME_LABEL_SIZE * sizeof (CHAR16)) {
DEBUG ((DEBUG_ERROR, "Found unterminated or too long volume label!")); DEBUG ((DEBUG_ERROR, "OCFS: Found unterminated or too long volume label!"));
FreePool (VolumeInfo); FreePool (VolumeInfo);
return AllocateCopyPool (sizeof (L"INVALID"), L"INVALID"); return AllocateCopyPool (sizeof (L"INVALID"), L"INVALID");
} else { } else {
......
...@@ -36,11 +36,11 @@ LocateFileSystem ( ...@@ -36,11 +36,11 @@ LocateFileSystem (
CHAR16 *UnicodeFilePath; CHAR16 *UnicodeFilePath;
DEBUG_CODE_BEGIN (); DEBUG_CODE_BEGIN ();
DEBUG ((DEBUG_INFO, "OCF: Trying to locate filesystem on %p %p\n", DeviceHandle, FilePath)); DEBUG ((DEBUG_INFO, "OCFS: Trying to locate filesystem on %p %p\n", DeviceHandle, FilePath));
if (FilePath != NULL) { if (FilePath != NULL) {
UnicodeFilePath = ConvertDevicePathToText (FilePath, FALSE, FALSE); UnicodeFilePath = ConvertDevicePathToText (FilePath, FALSE, FALSE);
if (UnicodeFilePath != NULL) { if (UnicodeFilePath != NULL) {
DEBUG ((DEBUG_INFO, "OCF: Filesystem DP is %s\n", UnicodeFilePath)); DEBUG ((DEBUG_INFO, "OCFS: Filesystem DP is %s\n", UnicodeFilePath));
FreePool (UnicodeFilePath); FreePool (UnicodeFilePath);
} }
} }
...@@ -51,7 +51,7 @@ LocateFileSystem ( ...@@ -51,7 +51,7 @@ LocateFileSystem (
// Locate DeviceHandle if we have none (idea by dmazar). // Locate DeviceHandle if we have none (idea by dmazar).
// //
if (FilePath == NULL) { if (FilePath == NULL) {
DEBUG ((DEBUG_WARN, "OCF: No device handle or path to proceed\n")); DEBUG ((DEBUG_WARN, "OCFS: No device handle or path to proceed\n"));
return NULL; return NULL;
} }
...@@ -62,7 +62,7 @@ LocateFileSystem ( ...@@ -62,7 +62,7 @@ LocateFileSystem (
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_WARN, "OCF: Failed to locate device handle over path - %r\n", Status)); DEBUG ((DEBUG_WARN, "OCFS: Failed to locate device handle over path - %r\n", Status));
return NULL; return NULL;
} }
} }
...@@ -74,7 +74,7 @@ LocateFileSystem ( ...@@ -74,7 +74,7 @@ LocateFileSystem (
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCF: No filesystem on device handle %p\n", DeviceHandle)); DEBUG ((DEBUG_INFO, "OCFS: No filesystem on device handle %p\n", DeviceHandle));
return NULL; return NULL;
} }
......
...@@ -464,7 +464,7 @@ FvNotificationEvent ( ...@@ -464,7 +464,7 @@ FvNotificationEvent (
(VOID **)&Private->FirmwareVolume2 (VOID **)&Private->FirmwareVolume2
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "HandleProtocol FirmwareVolume2 failure: %r", Status)); DEBUG ((DEBUG_INFO, "OCFV: HandleProtocol FirmwareVolume2 failure: %r", Status));
} }
// //
...@@ -483,7 +483,7 @@ FvNotificationEvent ( ...@@ -483,7 +483,7 @@ FvNotificationEvent (
NULL NULL
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "Install FirmwareVolume protocol failure: %r", Status)); DEBUG ((DEBUG_INFO, "OCFV: Install FirmwareVolume protocol failure: %r", Status));
} }
} }
} }
......
...@@ -1187,7 +1187,7 @@ InternalStripLoadCommands64 ( ...@@ -1187,7 +1187,7 @@ InternalStripLoadCommands64 (
// //
if ((LoadCommand->CommandType == MACH_LOAD_COMMAND_UNIX_THREAD) if ((LoadCommand->CommandType == MACH_LOAD_COMMAND_UNIX_THREAD)
|| (LoadCommand->CommandType == MACH_LOAD_COMMAND_MAIN)) { || (LoadCommand->CommandType == MACH_LOAD_COMMAND_MAIN)) {
DEBUG ((DEBUG_WARN, "UNIX Thread and Main LCs are unsupported\n")); DEBUG ((DEBUG_WARN, "OCMCO: UNIX Thread and Main LCs are unsupported\n"));
} }
SizeOfLeftCommands -= LoadCommand->CommandSize; SizeOfLeftCommands -= LoadCommand->CommandSize;
......
...@@ -50,7 +50,7 @@ GetPngDims ( ...@@ -50,7 +50,7 @@ GetPngDims (
lodepng_state_cleanup (&State); lodepng_state_cleanup (&State);
if (Error != 0) { if (Error != 0) {
DEBUG ((DEBUG_INFO, "OcPngLib: Error while getting image dimensions from PNG header\n")); DEBUG ((DEBUG_INFO, "OCPNG: Error while getting image dimensions from PNG header\n"));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
...@@ -91,7 +91,7 @@ DecodePng ( ...@@ -91,7 +91,7 @@ DecodePng (
Error = lodepng_decode ((unsigned char **) RawData, &W, &H, &State, Buffer, Size); Error = lodepng_decode ((unsigned char **) RawData, &W, &H, &State, Buffer, Size);
if (Error != 0) { if (Error != 0) {
DEBUG ((DEBUG_INFO, "OcPngLib: Error while decoding PNG image\n")); DEBUG ((DEBUG_INFO, "OCPNG: Error while decoding PNG image\n"));
lodepng_state_cleanup (&State); lodepng_state_cleanup (&State);
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
...@@ -131,7 +131,7 @@ EncodePng ( ...@@ -131,7 +131,7 @@ EncodePng (
Error = lodepng_encode32 ((unsigned char **) Buffer, BufferSize, RawData, Width, Height); Error = lodepng_encode32 ((unsigned char **) Buffer, BufferSize, RawData, Width, Height);
if (Error != 0) { if (Error != 0) {
DEBUG ((DEBUG_INFO, "OcPngLib: Error while encoding PNG image\n")); DEBUG ((DEBUG_INFO, "OCPNG: Error while encoding PNG image\n"));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
......
...@@ -295,7 +295,7 @@ OcAppleRtcRamInstallProtocol ( ...@@ -295,7 +295,7 @@ OcAppleRtcRamInstallProtocol (
UINTN Index; UINTN Index;
UINTN RtcBlacklistSize; UINTN RtcBlacklistSize;
DEBUG ((DEBUG_VERBOSE, "OcAppleRtcRamInstallProtocol\n")); DEBUG ((DEBUG_VERBOSE, "OCRTC: OcAppleRtcRamInstallProtocol\n"));
if (Reinstall) { if (Reinstall) {
Status = OcUninstallAllProtocolInstances (&gAppleRtcRamProtocolGuid); Status = OcUninstallAllProtocolInstances (&gAppleRtcRamProtocolGuid);
......
...@@ -111,7 +111,7 @@ SmbiosOverrideString ( ...@@ -111,7 +111,7 @@ SmbiosOverrideString (
// //
if (Length > SMBIOS_STRING_MAX_LENGTH) { if (Length > SMBIOS_STRING_MAX_LENGTH) {
Length = SMBIOS_STRING_MAX_LENGTH; Length = SMBIOS_STRING_MAX_LENGTH;
DEBUG ((DEBUG_INFO, "SMBIOS truncating '%a' to %u bytes\n", Override, Length)); DEBUG ((DEBUG_INFO, "OCMB: SMBIOS truncating '%a' to %u bytes\n", Override, Length));
} }
while (Length > 0 && Override[Length - 1] == ' ') { while (Length > 0 && Override[Length - 1] == ' ') {
...@@ -123,7 +123,7 @@ SmbiosOverrideString ( ...@@ -123,7 +123,7 @@ SmbiosOverrideString (
} }
if (EFI_ERROR (SmbiosExtendTable (Table, Length + 1))) { if (EFI_ERROR (SmbiosExtendTable (Table, Length + 1))) {
DEBUG ((DEBUG_WARN, "SMBIOS failed to write '%a' with %u byte extension\n", Override, Length + 1)); DEBUG ((DEBUG_WARN, "OCSMB: SMBIOS failed to write '%a' with %u byte extension\n", Override, Length + 1));
return 0; return 0;
} }
...@@ -328,7 +328,7 @@ SmbiosInitialiseStruct ( ...@@ -328,7 +328,7 @@ SmbiosInitialiseStruct (
Status = SmbiosExtendTable (Table, MinLength); Status = SmbiosExtendTable (Table, MinLength);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_WARN, "Failed to extend SMBIOS for table %u - %r", Type, Status)); DEBUG ((DEBUG_WARN, "OCSMB: Failed to extend SMBIOS for table %u - %r", Type, Status));
return Status; return Status;
} }
......
...@@ -131,12 +131,12 @@ OcStorageInitializeVault ( ...@@ -131,12 +131,12 @@ OcStorageInitializeVault (
) )
{ {
if (Signature != NULL && Vault == NULL) { if (Signature != NULL && Vault == NULL) {
DEBUG ((DEBUG_ERROR, "OCS: Missing vault with signature\n")); DEBUG ((DEBUG_ERROR, "OCST: Missing vault with signature\n"));
return EFI_SECURITY_VIOLATION; return EFI_SECURITY_VIOLATION;
} }
if (Vault == NULL) { if (Vault == NULL) {
DEBUG ((DEBUG_INFO, "OCS: Missing vault data, ignoring...\n")); DEBUG ((DEBUG_INFO, "OCST: Missing vault data, ignoring...\n"));
return EFI_SUCCESS; return EFI_SUCCESS;
} }
...@@ -144,7 +144,7 @@ OcStorageInitializeVault ( ...@@ -144,7 +144,7 @@ OcStorageInitializeVault (
ASSERT (StorageKey != NULL); ASSERT (StorageKey != NULL);
if (!RsaVerifySigDataFromKey (StorageKey, Signature, SignatureSize, Vault, VaultSize, OcSigHashTypeSha256)) { if (!RsaVerifySigDataFromKey (StorageKey, Signature, SignatureSize, Vault, VaultSize, OcSigHashTypeSha256)) {
DEBUG ((DEBUG_ERROR, "OCS: Invalid vault signature\n")); DEBUG ((DEBUG_ERROR, "OCST: Invalid vault signature\n"));
return EFI_SECURITY_VIOLATION; return EFI_SECURITY_VIOLATION;
} }
} }
...@@ -152,7 +152,7 @@ OcStorageInitializeVault ( ...@@ -152,7 +152,7 @@ OcStorageInitializeVault (
OC_STORAGE_VAULT_CONSTRUCT (&Context->Vault, sizeof (Context->Vault)); OC_STORAGE_VAULT_CONSTRUCT (&Context->Vault, sizeof (Context->Vault));
if (!ParseSerialized (&Context->Vault, &mVaultSchema, Vault, VaultSize)) { if (!ParseSerialized (&Context->Vault, &mVaultSchema, Vault, VaultSize)) {
OC_STORAGE_VAULT_DESTRUCT (&Context->Vault, sizeof (Context->Vault)); OC_STORAGE_VAULT_DESTRUCT (&Context->Vault, sizeof (Context->Vault));
DEBUG ((DEBUG_ERROR, "OCS: Invalid vault data\n")); DEBUG ((DEBUG_ERROR, "OCST: Invalid vault data\n"));
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
} }
...@@ -160,7 +160,7 @@ OcStorageInitializeVault ( ...@@ -160,7 +160,7 @@ OcStorageInitializeVault (
OC_STORAGE_VAULT_DESTRUCT (&Context->Vault, sizeof (Context->Vault)); OC_STORAGE_VAULT_DESTRUCT (&Context->Vault, sizeof (Context->Vault));
DEBUG (( DEBUG ((
DEBUG_ERROR, DEBUG_ERROR,
"OCS: Unsupported vault data verion %u vs %u\n", "OCST: Unsupported vault data verion %u vs %u\n",
Context->Vault.Version, Context->Vault.Version,
OC_STORAGE_VAULT_VERSION OC_STORAGE_VAULT_VERSION
)); ));
...@@ -232,7 +232,7 @@ OcStorageInitFromFs ( ...@@ -232,7 +232,7 @@ OcStorageInitFromFs (
Status = FileSystem->OpenVolume (FileSystem, &RootVolume); Status = FileSystem->OpenVolume (FileSystem, &RootVolume);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCS: FileSystem volume cannot be opened - %r\n", Status)); DEBUG ((DEBUG_INFO, "OCST: FileSystem volume cannot be opened - %r\n", Status));
return Status; return Status;
} }
...@@ -247,7 +247,7 @@ OcStorageInitFromFs ( ...@@ -247,7 +247,7 @@ OcStorageInitFromFs (
RootVolume->Close (RootVolume); RootVolume->Close (RootVolume);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCS: Directory %s cannot be opened - %r\n", Path, Status)); DEBUG ((DEBUG_INFO, "OCST: Directory %s cannot be opened - %r\n", Path, Status));
return Status; return Status;
} }
...@@ -279,7 +279,7 @@ OcStorageInitFromFs ( ...@@ -279,7 +279,7 @@ OcStorageInitFromFs (
Status = OcStorageInitializeVault (Context, Vault, DataSize, StorageKey, Signature, SignatureSize); Status = OcStorageInitializeVault (Context, Vault, DataSize, StorageKey, Signature, SignatureSize);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_INFO, "OCS: Vault init failure %p (%u) - %r\n", Vault, DataSize, Status)); DEBUG ((DEBUG_INFO, "OCST: Vault init failure %p (%u) - %r\n", Vault, DataSize, Status));
} }
gBS->InstallProtocolInterface ( gBS->InstallProtocolInterface (
...@@ -385,7 +385,7 @@ OcStorageReadFileUnicode ( ...@@ -385,7 +385,7 @@ OcStorageReadFileUnicode (
VaultDigest = OcStorageGetDigest (Context, FilePath); VaultDigest = OcStorageGetDigest (Context, FilePath);
if (Context->HasVault && VaultDigest == NULL) { if (Context->HasVault && VaultDigest == NULL) {
DEBUG ((DEBUG_ERROR, "OCS: Aborting %s file access not present in vault\n", FilePath)); DEBUG ((DEBUG_ERROR, "OCST: Aborting %s file access not present in vault\n", FilePath));
return NULL; return NULL;
} }
...@@ -430,7 +430,7 @@ OcStorageReadFileUnicode ( ...@@ -430,7 +430,7 @@ OcStorageReadFileUnicode (
if (VaultDigest != 0) { if (VaultDigest != 0) {
Sha256 (FileDigest, FileBuffer, Size); Sha256 (FileDigest, FileBuffer, Size);
if (CompareMem (FileDigest, VaultDigest, SHA256_DIGEST_SIZE) != 0) { if (CompareMem (FileDigest, VaultDigest, SHA256_DIGEST_SIZE) != 0) {
DEBUG ((DEBUG_ERROR, "OCS: Aborting corrupted %s file access\n", FilePath)); DEBUG ((DEBUG_ERROR, "OCST: Aborting corrupted %s file access\n", FilePath));
FreePool (FileBuffer); FreePool (FileBuffer);
return NULL; return NULL;
} }
......
...@@ -146,7 +146,7 @@ OcBlobAllocate ( ...@@ -146,7 +146,7 @@ OcBlobAllocate (
Blob = (PRIV_OC_BLOB *) Pointer; Blob = (PRIV_OC_BLOB *) Pointer;
DEBUG ((DEBUG_VERBOSE, "Allocating %u bytes in blob %p with size %u/%u curr %p\n", DEBUG ((DEBUG_VERBOSE, "OCTPL: Allocating %u bytes in blob %p with size %u/%u curr %p\n",
Size, Blob, Blob->Size, Blob->MaxSize, Blob->DynValue)); Size, Blob, Blob->Size, Blob->MaxSize, Blob->DynValue));
// //
...@@ -168,7 +168,7 @@ OcBlobAllocate ( ...@@ -168,7 +168,7 @@ OcBlobAllocate (
OcFreePointer (&Blob->DynValue, Blob->Size); OcFreePointer (&Blob->DynValue, Blob->Size);
DynValue = AllocatePool (Size); DynValue = AllocatePool (Size);
if (DynValue == NULL) { if (DynValue == NULL) {
DEBUG ((DEBUG_VERBOSE, "Failed to fit %u bytes in OC_BLOB\n", Size)); DEBUG ((DEBUG_VERBOSE, "OCTPL: Failed to fit %u bytes in OC_BLOB\n", Size));
return NULL; return NULL;
} }
// //
......
...@@ -382,9 +382,9 @@ XmlFreeRefs ( ...@@ -382,9 +382,9 @@ XmlFreeRefs (
// //
#ifdef XML_PARSER_VERBOSE #ifdef XML_PARSER_VERBOSE
#define XML_PARSER_INFO(Parser, Message) \ #define XML_PARSER_INFO(Parser, Message) \
DEBUG ((DEBUG_VERBOSE, "XML_PARSER_INFO %a\n", Message)); DEBUG ((DEBUG_VERBOSE, "OCXML: XML_PARSER_INFO %a\n", Message));
#define XML_PARSER_TAG(Parser, Tag) \ #define XML_PARSER_TAG(Parser, Tag) \
DEBUG ((DEBUG_VERBOSE, "XML_PARSER_TAG %a\n", Tag)); DEBUG ((DEBUG_VERBOSE, "OCXML: XML_PARSER_TAG %a\n", Tag));
#else #else
#define XML_PARSER_INFO(Parser, Message) do {} while (0) #define XML_PARSER_INFO(Parser, Message) do {} while (0)
#define XML_PARSER_TAG(Parser, Tag) do {} while (0) #define XML_PARSER_TAG(Parser, Tag) do {} while (0)
...@@ -422,11 +422,11 @@ XmlParserError ( ...@@ -422,11 +422,11 @@ XmlParserError (
} }
if (NO_CHARACTER != Offset) { if (NO_CHARACTER != Offset) {
DEBUG ((DEBUG_INFO, "XmlParserError at %u:%u (is %c): %a\n", DEBUG ((DEBUG_INFO, "OCXML: XmlParserError at %u:%u (is %c): %a\n",
Row + 1, Column, Parser->Buffer[Character], Message Row + 1, Column, Parser->Buffer[Character], Message
)); ));
} else { } else {
DEBUG ((DEBUG_INFO, "XmlParserError at %u:%u: %a\n", DEBUG ((DEBUG_INFO, "OCXML: XmlParserError at %u:%u: %a\n",
Row + 1, Column, Message Row + 1, Column, Message
)); ));
} }
...@@ -439,7 +439,7 @@ XmlParserError ( ...@@ -439,7 +439,7 @@ XmlParserError (
#define XML_PARSER_ERROR(Parser, Offset, Message) \ #define XML_PARSER_ERROR(Parser, Offset, Message) \
XmlParserError (Parser, Offset, Message) XmlParserError (Parser, Offset, Message)
#define XML_USAGE_ERROR(Message) \ #define XML_USAGE_ERROR(Message) \
DEBUG ((DEBUG_VERBOSE, "%a\n", Message)); DEBUG ((DEBUG_VERBOSE, "OCXML: %a\n", Message));
#else #else
#define XML_PARSER_ERROR(Parser, Offset, Message) do {} while (0) #define XML_PARSER_ERROR(Parser, Offset, Message) do {} while (0)
#define XML_USAGE_ERROR(X) do {} while (0) #define XML_USAGE_ERROR(X) do {} while (0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册