VBoxDebugLib.c revision e99df4387f81aa7b9900504a6a6117e0d3226eb3
/* $Id$ */
/** @file
* VBoxDebugLib.c - Debug logging and assertions support routines using DevEFI.
*/
/*
* Copyright (C) 2009-2012 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* The contents of this file may alternatively be used under the terms
* of the Common Development and Distribution License Version 1.0
* (CDDL) only, as it comes in the "COPYING.CDDL" file of the
* VirtualBox OSE distribution, in which case the provisions of the
* CDDL are applicable instead of those of the GPL.
*
* You may elect to license modified versions of this file under the
* terms and conditions of either the GPL or the CDDL or both.
*/
/*******************************************************************************
* Header Files *
*******************************************************************************/
#include <Base.h>
#include <Library/PrintLib.h>
#include <Library/DebugLib.h>
#include "VBoxDebugLib.h"
#include <Protocol/DevicePath.h>
#include <Protocol/DevicePathToText.h>
#include <Uefi/UefiSpec.h>
#include <Library/UefiBootServicesTableLib.h>
#include "DevEFI.h"
#if 0
#endif
{
/* No pool noise, please. */
if (ErrorLevel == DEBUG_POOL)
return;
/* make sure it's terminated and doesn't end with a newline */
cch--;
/* Output the log string. */
VBoxPrintString("dbg/");
VBoxPrintChar(' ');
VBoxPrintChar('\n');
}
/**
* Our own log worker function, avoid the dbg/00000xxx prefix and makes it clear
* which log statements we added..
*
* @param pszFormat Format string. EFI style!
* @param ... Argument referneced in the format string.
*/
VBoxLogWorker(const char *pszFormat, ...)
{
/* make sure it's terminated and doesn't end with a newline */
cch--;
/* Output the log string. */
VBoxPrintChar('\n');
}
/**
* Adds a character to the panic message.
*
* @param ch The ASCII char to add.
*/
static void
VBoxPanicMsgChar(int ch)
{
}
/**
* Adds a string to the panic message.
*
* @param pszString The string to add.
*/
static void
VBoxPanicMsgString(const char *pszString)
{
char ch;
}
/**
* Adds a unsigned decimal number to the panic message.
*
* @param uValue The value.
*/
static void
{
char szTmp[32];
do
{
uValue /= 10;
}
{
VBoxPanicMsgString("EFI Assertion failed!"
"\nFile: ");
VBoxPanicMsgString("\nLine: ");
VBoxPanicMsgString("\nEDescription: ");
}
{
#if 0
if (!g_DevPath2Txt)
{
{
DEBUG((DEBUG_INFO, "gEfiDevicePathToTextProtocolGuid:%g isn't instantied\n", gEfiDevicePathToTextProtocolGuid));
return NULL;
}
}
#else
return NULL;
#endif
}
{
#if 0
(VOID **)pDevicePath,
NULL,
{
rc,
hHandle));
return NULL;
}
return psz16TxtDevicePath;
#else
return NULL;
#endif
}
{
#if 0
if (!g_DevPath2Txt)
{
{
DEBUG((DEBUG_INFO, "gEfiDevicePathToTextProtocolGuid:%g isn't instantied\n", gEfiDevicePathToTextProtocolGuid));
return NULL;
}
}
#else
return NULL;
#endif
}
{
return Buffer;
}
{
return TRUE;
}
{
/** @todo some PCD for this so we can disable it in release builds. */
return TRUE;
}
{
/** @todo ditto */
return TRUE;
}
{
return FALSE;
}