VirtualBox

Ignore:
Timestamp:
Sep 28, 2013 3:21:23 AM (11 years ago)
Author:
vboxsync
Message:

EFI: Logging.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/Firmware/VBoxPkg/Library/VBoxDebugLib/VBoxDebugLib.c

    r48727 r48748  
    6767    szBuf[cch] = '\0';
    6868
     69    /* Output the log string. */
    6970    SavedFlags = ASMIntDisableFlags();
    7071
     
    7677
    7778    ASMSetFlags(SavedFlags);
    78 
     79}
     80
     81/**
     82 * Our own log worker function, avoid the dbg/00000xxx prefix and makes it clear
     83 * which log statements we added..
     84 *
     85 * @param   pszFormat           Format string. EFI style!
     86 * @param   ...                 Argument referneced in the format string.
     87 */
     88VOID EFIAPI
     89VBoxLogWorker(const char *pszFormat, ...)
     90{
     91    CHAR8       szBuf[384];
     92    VA_LIST     va;
     93    UINTN       cch;
     94    RTCCUINTREG SavedFlags;
     95
     96    VA_START(va, pszFormat);
     97    cch = AsciiVSPrint(szBuf, sizeof(szBuf), pszFormat, va);
     98    VA_END(va);
     99
     100    /* make sure it's terminated and doesn't end with a newline */
     101    if (cch >= sizeof(szBuf))
     102        cch = sizeof(szBuf) - 1;
     103    while (cch > 0 && (szBuf[cch - 1] == '\n' || szBuf[cch - 1] == '\r'))
     104        cch--;
     105    szBuf[cch] = '\0';
     106
     107    /* Output the log string. */
     108    SavedFlags = ASMIntDisableFlags();
     109
     110    VBoxPrintString(szBuf);
     111    VBoxPrintChar('\n');
     112
     113    ASMSetFlags(SavedFlags);
    79114}
    80115
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette