Changeset 48727 in vbox for trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/Library/VBoxDebugLib
- Timestamp:
- Sep 27, 2013 11:03:53 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.c
r48674 r48727 79 79 } 80 80 81 /** 82 * Adds a character to the panic message. 83 * 84 * @param ch The ASCII char to add. 85 */ 86 static void 87 VBoxPanicMsgChar(int ch) 88 { 89 ASMOutU16(EFI_PANIC_PORT, EFI_PANIC_CMD_MSG_FROM_CHAR(ch)); 90 } 91 92 /** 93 * Adds a string to the panic message. 94 * 95 * @param pszString The string to add. 96 */ 97 static void 98 VBoxPanicMsgString(const char *pszString) 99 { 100 char ch; 101 while ((ch = *pszString++) != '\0') 102 VBoxPanicMsgChar(ch); 103 } 104 105 /** 106 * Adds a unsigned decimal number to the panic message. 107 * 108 * @param uValue The value. 109 */ 110 static void 111 VBoxPanicMsgDecimalU32(uint32_t uValue) 112 { 113 char szTmp[32]; 114 unsigned off = sizeof(szTmp) - 1; 115 116 szTmp[off] = '\0'; 117 do 118 { 119 char chDigit = uValue % 10; 120 uValue /= 10; 121 szTmp[--off] = chDigit + '0'; 122 } while (uValue != 0 && off > 0); 123 124 VBoxPanicMsgString(&szTmp[off]); 125 } 81 126 82 127 VOID EFIAPI … … 85 130 RTCCUINTREG SavedFlags = ASMIntDisableFlags(); 86 131 87 VBoxPrintString("EFI Assertion failed! File="); 88 VBoxPrintString(FileName ? FileName : "<NULL>"); 89 VBoxPrintString(" line=0x"); 90 VBoxPrintHex(LineNumber, sizeof(LineNumber)); 91 VBoxPrintString("\nDescription: "); 92 VBoxPrintString(Description ? Description : "<NULL>"); 93 94 ASMOutU8(EFI_PANIC_PORT, 2); /** @todo fix this. */ 132 ASMOutU8(EFI_PANIC_PORT, EFI_PANIC_CMD_START_MSG); 133 VBoxPanicMsgString("EFI Assertion failed!" 134 "\nFile: "); 135 VBoxPanicMsgString(FileName ? FileName : "<NULL>"); 136 VBoxPanicMsgString("\nLine: "); 137 VBoxPanicMsgDecimalU32((uint32_t)LineNumber); 138 VBoxPanicMsgString("\nEDescription: "); 139 VBoxPanicMsgString(Description ? Description : "<NULL>"); 140 ASMOutU8(EFI_PANIC_PORT, EFI_PANIC_CMD_END_MSG); 95 141 96 142 ASMSetFlags(SavedFlags); 97 143 } 98 144 99 CHAR16 *VBoxDebugDevicePath2Str(IN EFI_DEVICE_PATH_PROTOCOL *pDevicePath)145 CHAR16 *VBoxDebugDevicePath2Str(IN EFI_DEVICE_PATH_PROTOCOL *pDevicePath) 100 146 { 101 147 #if 0 … … 116 162 } 117 163 118 CHAR16 *VBoxDebugHandleDevicePath2Str(IN EFI_HANDLE hHandle)164 CHAR16 *VBoxDebugHandleDevicePath2Str(IN EFI_HANDLE hHandle) 119 165 { 120 166 #if 0 … … 143 189 #endif 144 190 } 145 CHAR16 *VBoxDebugPrintDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *pDevicePath)191 CHAR16 *VBoxDebugPrintDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *pDevicePath) 146 192 { 147 193 #if 0
Note:
See TracChangeset
for help on using the changeset viewer.