2009-07-17 11:10:31 +02:00
|
|
|
/** @file
|
|
|
|
|
2010-05-18 07:04:32 +02:00
|
|
|
Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>
|
|
|
|
This program and the accompanying materials
|
2009-07-17 11:10:31 +02:00
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
Module Name:
|
|
|
|
|
|
|
|
EfiUtilityMsgs.h
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
|
|
Defines and prototypes for common EFI utility error and debug messages.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _EFI_UTILITY_MSGS_H_
|
|
|
|
#define _EFI_UTILITY_MSGS_H_
|
|
|
|
|
|
|
|
#include <Common/UefiBaseTypes.h>
|
|
|
|
|
|
|
|
//
|
|
|
|
// Log message print Level
|
|
|
|
//
|
|
|
|
#define VERBOSE_LOG_LEVEL 15
|
|
|
|
#define WARNING_LOG_LEVEL 15
|
|
|
|
#define INFO_LOG_LEVEL 20
|
|
|
|
#define KEY_LOG_LEVEL 40
|
|
|
|
#define ERROR_LOG_LEVLE 50
|
|
|
|
|
|
|
|
//
|
|
|
|
// Status codes returned by EFI utility programs and functions
|
|
|
|
//
|
|
|
|
#define STATUS_SUCCESS 0
|
|
|
|
#define STATUS_WARNING 1
|
|
|
|
#define STATUS_ERROR 2
|
|
|
|
#define VOID void
|
|
|
|
|
|
|
|
typedef int STATUS;
|
|
|
|
|
|
|
|
#define MAX_LINE_LEN 0x200
|
|
|
|
#define MAXIMUM_INPUT_FILE_NUM 10
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
//
|
|
|
|
// When we call Error() or Warning(), the module keeps track of the worst
|
|
|
|
// case reported. GetUtilityStatus() will get the worst-case results, which
|
|
|
|
// can be used as the return value from the app.
|
|
|
|
//
|
|
|
|
STATUS
|
|
|
|
GetUtilityStatus (
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// If someone prints an error message and didn't specify a source file name,
|
|
|
|
// then we print the utility name instead. However they must tell us the
|
|
|
|
// utility name early on via this function.
|
|
|
|
//
|
|
|
|
VOID
|
|
|
|
SetUtilityName (
|
|
|
|
CHAR8 *ProgramName
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
2010-03-01 00:39:39 +01:00
|
|
|
VOID
|
|
|
|
PrintMessage (
|
|
|
|
CHAR8 *Type,
|
|
|
|
CHAR8 *FileName,
|
|
|
|
UINT32 LineNumber,
|
|
|
|
UINT32 MessageCode,
|
|
|
|
CHAR8 *Text,
|
|
|
|
CHAR8 *MsgFmt,
|
|
|
|
va_list List
|
|
|
|
);
|
|
|
|
|
2009-07-17 11:10:31 +02:00
|
|
|
VOID
|
|
|
|
Error (
|
|
|
|
CHAR8 *FileName,
|
|
|
|
UINT32 LineNumber,
|
|
|
|
UINT32 ErrorCode,
|
|
|
|
CHAR8 *OffendingText,
|
|
|
|
CHAR8 *MsgFmt,
|
|
|
|
...
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
|
|
|
VOID
|
|
|
|
Warning (
|
|
|
|
CHAR8 *FileName,
|
|
|
|
UINT32 LineNumber,
|
|
|
|
UINT32 WarningCode,
|
|
|
|
CHAR8 *OffendingText,
|
|
|
|
CHAR8 *MsgFmt,
|
|
|
|
...
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
|
|
|
VOID
|
|
|
|
DebugMsg (
|
|
|
|
CHAR8 *FileName,
|
|
|
|
UINT32 LineNumber,
|
2009-09-11 05:14:43 +02:00
|
|
|
UINT64 MsgLevel,
|
2009-07-17 11:10:31 +02:00
|
|
|
CHAR8 *OffendingText,
|
|
|
|
CHAR8 *MsgFmt,
|
|
|
|
...
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
|
|
|
VOID
|
|
|
|
VerboseMsg (
|
|
|
|
CHAR8 *MsgFmt,
|
|
|
|
...
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
NormalMsg (
|
|
|
|
CHAR8 *MsgFmt,
|
|
|
|
...
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
KeyMsg (
|
|
|
|
CHAR8 *MsgFmt,
|
|
|
|
...
|
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
SetPrintLevel (
|
2009-09-11 05:14:43 +02:00
|
|
|
UINT64 LogLevel
|
2009-07-17 11:10:31 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
VOID
|
|
|
|
ParserSetPosition (
|
|
|
|
CHAR8 *SourceFileName,
|
|
|
|
UINT32 LineNum
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
|
|
|
VOID
|
|
|
|
ParserError (
|
|
|
|
UINT32 ErrorCode,
|
|
|
|
CHAR8 *OffendingText,
|
|
|
|
CHAR8 *MsgFmt,
|
|
|
|
...
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
|
|
|
VOID
|
|
|
|
ParserWarning (
|
|
|
|
UINT32 ErrorCode,
|
|
|
|
CHAR8 *OffendingText,
|
|
|
|
CHAR8 *MsgFmt,
|
|
|
|
...
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
|
|
|
VOID
|
|
|
|
SetPrintLimits (
|
|
|
|
UINT32 NumErrors,
|
|
|
|
UINT32 NumWarnings,
|
|
|
|
UINT32 NumWarningsPlusErrors
|
|
|
|
)
|
|
|
|
;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // #ifndef _EFI_UTILITY_MSGS_H_
|