Skip to content

Commit

Permalink
update based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorBeebe committed Feb 26, 2024
1 parent 90d3f69 commit 9ca9c6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions AdvLoggerPkg/Include/Guid/AdvancedLoggerPreDxeLogs.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#ifndef __ADVANCED_LOGGER_PRE_DXE_LOGS_H__
#define __ADVANCED_LOGGER_PRE_DXE_LOGS_H__
#ifndef ADVANCED_LOGGER_PRE_DXE_LOGS_H_
#define ADVANCED_LOGGER_PRE_DXE_LOGS_H_

#pragma pack(1)
// The region specified by this HOB entry should contain raw log output.
// The Advanced Logger library will serialize the contents of the buffer
// when adding it to the advanced logger output.
Expand All @@ -18,6 +19,7 @@ typedef struct _ADVANCED_LOGGER_PRE_DXE_LOGS_HOB {
UINT64 BaseAddress;
UINT64 LengthInBytes;
} ADVANCED_LOGGER_PRE_DXE_LOGS_HOB;
#pragma pack()

#define ADVANCED_LOGGER_PRE_DXE_LOGS_GUID \
{ \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ DxeCoreAdvancedLoggerLibConstructor (
{
ADVANCED_LOGGER_INFO *LoggerInfo;
EFI_STATUS Status;
ADVANCED_LOGGER_PRE_DXE_LOGS_HOB PreDxeLogs;
ADVANCED_LOGGER_PRE_DXE_LOGS_HOB *PreDxeLogs;
EFI_HOB_GUID_TYPE *PreDxeLogsHobEntry;

LoggerInfo = AdvancedLoggerGetLoggerInfo (); // Sets mLoggerInfo if Logger Information block found in HOB.
Expand Down Expand Up @@ -407,11 +407,11 @@ DxeCoreAdvancedLoggerLibConstructor (
PreDxeLogsHobEntry = GetFirstGuidHob (&gAdvancedLoggerPreDxeLogsGuid);

if (PreDxeLogsHobEntry != NULL) {
PreDxeLogs = *(ADVANCED_LOGGER_PRE_DXE_LOGS_HOB *)GET_GUID_HOB_DATA (PreDxeLogsHobEntry);
if (PreDxeLogs.Signature != ADVANCED_LOGGER_PRE_DXE_LOGS_SIGNATURE) {
ASSERT (PreDxeLogs.Signature == ADVANCED_LOGGER_PRE_DXE_LOGS_SIGNATURE);
PreDxeLogs = (ADVANCED_LOGGER_PRE_DXE_LOGS_HOB *)GET_GUID_HOB_DATA (PreDxeLogsHobEntry);
if (PreDxeLogs->Signature != ADVANCED_LOGGER_PRE_DXE_LOGS_SIGNATURE) {
ASSERT (PreDxeLogs->Signature == ADVANCED_LOGGER_PRE_DXE_LOGS_SIGNATURE);
} else {
AdvancedLoggerMemoryLoggerWrite (DEBUG_INFO, (CONST CHAR8 *)(UINTN)PreDxeLogs.BaseAddress, PreDxeLogs.LengthInBytes);
AdvancedLoggerMemoryLoggerWrite (DEBUG_INFO, (CONST CHAR8 *)(UINTN)PreDxeLogs->BaseAddress, PreDxeLogs->LengthInBytes);
}
}

Expand Down

0 comments on commit 9ca9c6a

Please sign in to comment.