Skip to content

Commit

Permalink
Merge branch 'release/202302' into repo-sync/mu_devops/default
Browse files Browse the repository at this point in the history
  • Loading branch information
kuqin12 authored Oct 11, 2023
2 parents 67f4d9d + 4c5d1d1 commit 5c9fb4f
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,5 @@ AdvancedLoggerHdwPortWrite (
IN UINTN NumberOfBytes
)
{
UINTN NumberReturned;

NumberReturned = NumberOfBytes;
if (DebugLevel & PcdGet32 (PcdAdvancedLoggerHdwPortDebugPrintErrorLevel)) {
NumberReturned = SerialPortWrite (Buffer, NumberOfBytes);
}

return NumberReturned;
return SerialPortWrite (Buffer, NumberOfBytes);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## @file
# Advanced Logger Access library.
# Advanced Logger Hardware Port Library.
#
# Copyright (c) Microsoft Corporation.
#
Expand Down Expand Up @@ -30,10 +30,5 @@
[LibraryClasses]
SerialPortLib

[Protocols]

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## CONSUMES

[Depex]
TRUE
17 changes: 14 additions & 3 deletions AdvLoggerPkg/Library/AdvancedLoggerLib/AdvancedLoggerCommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,24 @@ AdvancedLoggerWrite (
// If LoggerInfo == NULL, assume there is a HdwPort and it has not been disabled. This
// does occur in SEC
if ((LoggerInfo == NULL) || (!LoggerInfo->HdwPortDisabled)) {
if (DebugLevel & PcdGet32 (PcdAdvancedLoggerHdwPortDebugPrintErrorLevel)) {
AdvancedLoggerHdwPortWrite (DebugLevel, (UINT8 *)Buffer, NumberOfBytes);
}
}

#else
if ((LoggerInfo != NULL) && (!LoggerInfo->HdwPortDisabled)) {
// if we are at a high enough version to support HW_LVL logging, only call the HdwPortWrite if this DebugLevel
// is asked to be logged
// if we are at an older version, check the PCD to see if we should log this message
if (LoggerInfo->Version >= ADVANCED_LOGGER_HW_LVL_VER) {
DebugLevel = (DebugLevel & LoggerInfo->HwPrintLevel);
if (DebugLevel & LoggerInfo->HwPrintLevel) {
AdvancedLoggerHdwPortWrite (DebugLevel, (UINT8 *)Buffer, NumberOfBytes);
}
} else if (DebugLevel & PcdGet32 (PcdAdvancedLoggerHdwPortDebugPrintErrorLevel)) {
AdvancedLoggerHdwPortWrite (DebugLevel, (UINT8 *)Buffer, NumberOfBytes);
}
}

#endif
AdvancedLoggerHdwPortWrite (DebugLevel, (UINT8 *)Buffer, NumberOfBytes);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@
gEfiDebugPortProtocolGuid ## CONSUMES

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,8 @@
[Guids]
gAdvancedLoggerHobGuid

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES

[Depex]
TRUE
TRUE
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@
gAdvancedLoggerPpiGuid ## CONSUMES

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerBase ## CONSUMES
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
gAdvancedLoggerProtocolGuid ## CONSUMES

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerBase ## CONSUMES
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerPreMemPages ## CONSUMES
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerPages ## CONSUMES
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## CONSUMES

[BuildOptions]
*_*_*_CC_FLAGS = -D ADVANCED_LOGGER_SEC=1
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@
gAdvancedLoggerProtocolGuid ## CONSUMES

[Pcd]
gAdvLoggerPkgTokenSpaceGuid.PcdAdvancedLoggerHdwPortDebugPrintErrorLevel ## SOMETIMES_CONSUMES

0 comments on commit 5c9fb4f

Please sign in to comment.