VirtualBox

Ignore:
Timestamp:
Jun 12, 2017 5:42:14 PM (8 years ago)
Author:
vboxsync
Message:

EFI/Firmware: fix compiler confusion caused by using ASMIntDisableFlags which resulted in truncated EFI debug output, plus some minor cleanup

File:
1 edited

Legend:

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

    r62500 r67350  
    2929*******************************************************************************/
    3030#include <Base.h>
     31#include <Library/BaseLib.h>
    3132#include <Library/PrintLib.h>
    3233#include <Library/DebugLib.h>
     
    3839#include <Library/UefiBootServicesTableLib.h>
    3940#include "DevEFI.h"
     41#include "iprt/asm.h"
    4042
    4143#if 0
     
    5052    VA_LIST     va;
    5153    UINTN       cch;
    52     RTCCUINTREG SavedFlags;
     54    BOOLEAN     InterruptState;
    5355
    5456    /* No pool noise, please. */
     
    6769    szBuf[cch] = '\0';
    6870
     71    InterruptState = SaveAndDisableInterrupts();
     72
    6973    /* Output the log string. */
    70     SavedFlags = ASMIntDisableFlags();
    71 
    7274    VBoxPrintString("dbg/");
    7375    VBoxPrintHex(ErrorLevel, sizeof(ErrorLevel));
     
    7678    VBoxPrintChar('\n');
    7779
    78     ASMSetFlags(SavedFlags);
     80    SetInterruptState(InterruptState);
    7981}
    8082
     
    9193    CHAR8       szBuf[384];
    9294    VA_LIST     va;
    93     RTCCUINTREG SavedFlags;
     95    BOOLEAN     InterruptState;
    9496
    9597    /* Format it. */
     
    99101    szBuf[sizeof(szBuf) - 1] = '\0';
    100102
     103    InterruptState = SaveAndDisableInterrupts();
     104
    101105    /* Output the log string. */
    102     SavedFlags = ASMIntDisableFlags();
    103 
    104106    VBoxPrintString(szBuf);
    105107    VBoxPrintChar('\n');
    106108
    107     ASMSetFlags(SavedFlags);
     109    SetInterruptState(InterruptState);
    108110}
    109111
     
    157159DebugAssert(IN CONST CHAR8 *FileName, IN UINTN LineNumber, IN CONST CHAR8 *Description)
    158160{
    159     RTCCUINTREG SavedFlags = ASMIntDisableFlags();
     161    BOOLEAN InterruptState = SaveAndDisableInterrupts();
    160162
    161163    ASMOutU8(EFI_PANIC_PORT, EFI_PANIC_CMD_START_MSG);
     
    169171    ASMOutU8(EFI_PANIC_PORT, EFI_PANIC_CMD_END_MSG);
    170172
    171     ASMSetFlags(SavedFlags);
     173    SetInterruptState(InterruptState);
    172174}
    173175
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