// VA_LIST can not initialize to NULL for all compiler, so we use this to\r
// indicate a null VA_LIST\r
//\r
-VA_LIST mVaListNull;\r
+VA_LIST mVaListNull;\r
\r
/**\r
Prints a debug message to the debug output device if the specified error level is enabled.\r
...\r
)\r
{\r
- VA_LIST Marker;\r
+ VA_LIST Marker;\r
\r
VA_START (Marker, Format);\r
DebugVPrint (ErrorLevel, Format, Marker);\r
**/\r
VOID\r
DebugPrintMarker (\r
- IN UINTN ErrorLevel,\r
- IN CONST CHAR8 *Format,\r
- IN VA_LIST VaListMarker,\r
- IN BASE_LIST BaseListMarker\r
+ IN UINTN ErrorLevel,\r
+ IN CONST CHAR8 *Format,\r
+ IN VA_LIST VaListMarker,\r
+ IN BASE_LIST BaseListMarker\r
)\r
{\r
UINT64 Buffer[(EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)) + 1];\r
// Copy the Format string into the record. It will be truncated if it's too long.\r
//\r
AsciiStrnCpyS (\r
- FormatString, sizeof(Buffer) - (4 + sizeof(EFI_DEBUG_INFO) + 12 * sizeof(UINT64)),\r
- Format, sizeof(Buffer) - (4 + sizeof(EFI_DEBUG_INFO) + 12 * sizeof(UINT64)) - 1\r
+ FormatString,\r
+ sizeof (Buffer) - (4 + sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64)),\r
+ Format,\r
+ sizeof (Buffer) - (4 + sizeof (EFI_DEBUG_INFO) + 12 * sizeof (UINT64)) - 1\r
);\r
\r
//\r
// Use the actual format string.\r
//\r
Format = FormatString;\r
- for (; *Format != '\0'; Format++) {\r
+ for ( ; *Format != '\0'; Format++) {\r
//\r
// Only format with prefix % is processed.\r
//\r
if (*Format != '%') {\r
continue;\r
}\r
+\r
Long = FALSE;\r
//\r
// Parse Flags and Width\r
//\r
for (Format++; TRUE; Format++) {\r
- if (*Format == '.' || *Format == '-' || *Format == '+' || *Format == ' ') {\r
+ if ((*Format == '.') || (*Format == '-') || (*Format == '+') || (*Format == ' ')) {\r
//\r
// These characters in format field are omitted.\r
//\r
continue;\r
}\r
- if (*Format >= '0' && *Format <= '9') {\r
+\r
+ if ((*Format >= '0') && (*Format <= '9')) {\r
//\r
// These characters in format field are omitted.\r
//\r
continue;\r
}\r
- if (*Format == 'L' || *Format == 'l') {\r
+\r
+ if ((*Format == 'L') || (*Format == 'l')) {\r
//\r
// 'L" or "l" in format field means the number being printed is a UINT64\r
//\r
Long = TRUE;\r
continue;\r
}\r
+\r
if (*Format == '*') {\r
//\r
// '*' in format field means the precision of the field is specified by\r
} else {\r
BASE_ARG (BaseListMarkerPointer, UINTN) = BASE_ARG (BaseListMarker, UINTN);\r
}\r
+\r
continue;\r
}\r
+\r
if (*Format == '\0') {\r
//\r
// Make no output if Format string terminates unexpectedly when\r
//\r
Format--;\r
}\r
+\r
//\r
// When valid argument type detected or format string terminates unexpectedly,\r
// the inner loop is done.\r
if ((*Format == 'p') && (sizeof (VOID *) > 4)) {\r
Long = TRUE;\r
}\r
- if (*Format == 'p' || *Format == 'X' || *Format == 'x' || *Format == 'd' || *Format == 'u') {\r
+\r
+ if ((*Format == 'p') || (*Format == 'X') || (*Format == 'x') || (*Format == 'd') || (*Format == 'u')) {\r
if (Long) {\r
if (BaseListMarker == NULL) {\r
BASE_ARG (BaseListMarkerPointer, INT64) = VA_ARG (VaListMarker, INT64);\r
BASE_ARG (BaseListMarkerPointer, int) = BASE_ARG (BaseListMarker, int);\r
}\r
}\r
- } else if (*Format == 's' || *Format == 'S' || *Format == 'a' || *Format == 'g' || *Format == 't') {\r
+ } else if ((*Format == 's') || (*Format == 'S') || (*Format == 'a') || (*Format == 'g') || (*Format == 't')) {\r
if (BaseListMarker == NULL) {\r
BASE_ARG (BaseListMarkerPointer, VOID *) = VA_ARG (VaListMarker, VOID *);\r
} else {\r
VOID\r
EFIAPI\r
DebugVPrint (\r
- IN UINTN ErrorLevel,\r
- IN CONST CHAR8 *Format,\r
- IN VA_LIST VaListMarker\r
+ IN UINTN ErrorLevel,\r
+ IN CONST CHAR8 *Format,\r
+ IN VA_LIST VaListMarker\r
)\r
{\r
DebugPrintMarker (ErrorLevel, Format, VaListMarker, NULL);\r
VOID\r
EFIAPI\r
DebugBPrint (\r
- IN UINTN ErrorLevel,\r
- IN CONST CHAR8 *Format,\r
- IN BASE_LIST BaseListMarker\r
+ IN UINTN ErrorLevel,\r
+ IN CONST CHAR8 *Format,\r
+ IN BASE_LIST BaseListMarker\r
)\r
{\r
DebugPrintMarker (ErrorLevel, Format, mVaListNull, BaseListMarker);\r
IN CONST CHAR8 *Description\r
)\r
{\r
- UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof(UINT64)];\r
+ UINT64 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE / sizeof (UINT64)];\r
EFI_DEBUG_ASSERT_DATA *AssertData;\r
UINTN HeaderSize;\r
UINTN TotalSize;\r
//\r
// Get string size\r
//\r
- HeaderSize = sizeof (EFI_DEBUG_ASSERT_DATA);\r
+ HeaderSize = sizeof (EFI_DEBUG_ASSERT_DATA);\r
//\r
// Compute string size of module name enclosed by []\r
//\r
- ModuleNameSize = 2 + AsciiStrSize (gEfiCallerBaseName);\r
- FileNameSize = AsciiStrSize (FileName);\r
- DescriptionSize = AsciiStrSize (Description);\r
+ ModuleNameSize = 2 + AsciiStrSize (gEfiCallerBaseName);\r
+ FileNameSize = AsciiStrSize (FileName);\r
+ DescriptionSize = AsciiStrSize (Description);\r
\r
//\r
// Make sure it will all fit in the passed in buffer.\r
}\r
}\r
}\r
+\r
//\r
// Fill in EFI_DEBUG_ASSERT_DATA\r
//\r
- AssertData = (EFI_DEBUG_ASSERT_DATA *)Buffer;\r
+ AssertData = (EFI_DEBUG_ASSERT_DATA *)Buffer;\r
AssertData->LineNumber = (UINT32)LineNumber;\r
- TotalSize = sizeof (EFI_DEBUG_ASSERT_DATA);\r
+ TotalSize = sizeof (EFI_DEBUG_ASSERT_DATA);\r
\r
Temp = (CHAR8 *)(AssertData + 1);\r
\r
// Copy Ascii [ModuleName].\r
//\r
if (ModuleNameSize != 0) {\r
- CopyMem(Temp, "[", 1);\r
- CopyMem(Temp + 1, gEfiCallerBaseName, ModuleNameSize - 3);\r
- CopyMem(Temp + ModuleNameSize - 2, "] ", 2);\r
+ CopyMem (Temp, "[", 1);\r
+ CopyMem (Temp + 1, gEfiCallerBaseName, ModuleNameSize - 3);\r
+ CopyMem (Temp + ModuleNameSize - 2, "] ", 2);\r
}\r
\r
//\r
// Copy Ascii FileName including NULL terminator.\r
//\r
- Temp = CopyMem (Temp + ModuleNameSize, FileName, FileNameSize);\r
+ Temp = CopyMem (Temp + ModuleNameSize, FileName, FileNameSize);\r
Temp[FileNameSize - 1] = 0;\r
- TotalSize += (ModuleNameSize + FileNameSize);\r
+ TotalSize += (ModuleNameSize + FileNameSize);\r
\r
//\r
// Copy Ascii Description include NULL terminator.\r
//\r
- Temp = CopyMem (Temp + FileNameSize, Description, DescriptionSize);\r
+ Temp = CopyMem (Temp + FileNameSize, Description, DescriptionSize);\r
Temp[DescriptionSize - 1] = 0;\r
- TotalSize += DescriptionSize;\r
+ TotalSize += DescriptionSize;\r
\r
REPORT_STATUS_CODE_EX (\r
(EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED),\r
}\r
}\r
\r
-\r
/**\r
Fills a target buffer with PcdDebugClearMemoryValue, and returns the target buffer.\r
\r
return SetMem (Buffer, Length, PcdGet8 (PcdDebugClearMemoryValue));\r
}\r
\r
-\r
/**\r
Returns TRUE if ASSERT() macros are enabled.\r
\r
VOID\r
)\r
{\r
- return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
+ return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0);\r
}\r
\r
-\r
/**\r
Returns TRUE if DEBUG() macros are enabled.\r
\r
VOID\r
)\r
{\r
- return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
+ return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0);\r
}\r
\r
-\r
/**\r
Returns TRUE if DEBUG_CODE() macros are enabled.\r
\r
VOID\r
)\r
{\r
- return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
+ return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0);\r
}\r
\r
-\r
/**\r
Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled.\r
\r
VOID\r
)\r
{\r
- return (BOOLEAN) ((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);\r
+ return (BOOLEAN)((PcdGet8 (PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0);\r
}\r
\r
/**\r
BOOLEAN\r
EFIAPI\r
DebugPrintLevelEnabled (\r
- IN CONST UINTN ErrorLevel\r
+ IN CONST UINTN ErrorLevel\r
)\r
{\r
- return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0);\r
+ return (BOOLEAN)((ErrorLevel & PcdGet32 (PcdFixedDebugPrintErrorLevel)) != 0);\r
}\r