mirror of https://github.com/acidanthera/audk.git
Remove CommonHeader.h in StatusCodeDxe.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3230 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
6ef9509940
commit
6f2b45bb67
|
@ -13,6 +13,8 @@
|
||||||
Module Name: DataHubStatusCodeWorker.c
|
Module Name: DataHubStatusCodeWorker.c
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
#include <Common/StatusCode.h>
|
||||||
#include "DxeStatusCode.h"
|
#include "DxeStatusCode.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -41,7 +43,7 @@ EFI_DATA_HUB_PROTOCOL *mDataHubProtocol;
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
DATAHUB_STATUSCODE_RECORD *
|
DATA_HUB_STATUS_CODE_DATA_RECORD *
|
||||||
AcquireRecordBuffer (
|
AcquireRecordBuffer (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
|
@ -81,7 +83,7 @@ AcquireRecordBuffer (
|
||||||
|
|
||||||
gBS->RestoreTPL (CurrentTpl);
|
gBS->RestoreTPL (CurrentTpl);
|
||||||
|
|
||||||
return Record;
|
return (DATA_HUB_STATUS_CODE_DATA_RECORD *) (Record->Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,14 +96,15 @@ AcquireRecordBuffer (
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
DATAHUB_STATUSCODE_RECORD *
|
DATA_HUB_STATUS_CODE_DATA_RECORD *
|
||||||
RetrieveRecord (
|
RetrieveRecord (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DATAHUB_STATUSCODE_RECORD *Record = NULL;
|
DATA_HUB_STATUS_CODE_DATA_RECORD *RecordData = NULL;
|
||||||
LIST_ENTRY *Node;
|
DATAHUB_STATUSCODE_RECORD *Record;
|
||||||
EFI_TPL CurrentTpl;
|
LIST_ENTRY *Node;
|
||||||
|
EFI_TPL CurrentTpl;
|
||||||
|
|
||||||
CurrentTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
|
CurrentTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
|
||||||
|
|
||||||
|
@ -112,11 +115,12 @@ RetrieveRecord (
|
||||||
RemoveEntryList (&Record->Node);
|
RemoveEntryList (&Record->Node);
|
||||||
InsertTailList (&mRecordsBuffer, &Record->Node);
|
InsertTailList (&mRecordsBuffer, &Record->Node);
|
||||||
Record->Signature = 0;
|
Record->Signature = 0;
|
||||||
|
RecordData = (DATA_HUB_STATUS_CODE_DATA_RECORD *) Record->Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBS->RestoreTPL (CurrentTpl);
|
gBS->RestoreTPL (CurrentTpl);
|
||||||
|
|
||||||
return Record;
|
return RecordData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,11 +163,11 @@ DataHubStatusCodeReportWorker (
|
||||||
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DATAHUB_STATUSCODE_RECORD *Record;
|
DATA_HUB_STATUS_CODE_DATA_RECORD *Record;
|
||||||
UINT32 ErrorLevel;
|
UINT32 ErrorLevel;
|
||||||
VA_LIST Marker;
|
VA_LIST Marker;
|
||||||
CHAR8 *Format;
|
CHAR8 *Format;
|
||||||
UINTN CharCount;
|
UINTN CharCount;
|
||||||
|
|
||||||
//
|
//
|
||||||
// See whether in runtime phase or not.
|
// See whether in runtime phase or not.
|
||||||
|
@ -193,7 +197,7 @@ DataHubStatusCodeReportWorker (
|
||||||
if (Data != NULL) {
|
if (Data != NULL) {
|
||||||
if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {
|
if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {
|
||||||
CharCount = UnicodeVSPrintAsciiFormat (
|
CharCount = UnicodeVSPrintAsciiFormat (
|
||||||
(CHAR16 *) Record->ExtendData,
|
(CHAR16 *) (Record + 1),
|
||||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||||
Format,
|
Format,
|
||||||
Marker
|
Marker
|
||||||
|
@ -201,7 +205,7 @@ DataHubStatusCodeReportWorker (
|
||||||
//
|
//
|
||||||
// Change record data type from DebugType to String Type.
|
// Change record data type from DebugType to String Type.
|
||||||
//
|
//
|
||||||
CopyGuid (&Record->Data.Type, &gEfiStatusCodeDataTypeStringGuid);
|
CopyGuid (&Record->Data.Type, &gEfiStatusCodeDataTypeDebugGuid);
|
||||||
Record->Data.HeaderSize = Data->HeaderSize;
|
Record->Data.HeaderSize = Data->HeaderSize;
|
||||||
Record->Data.Size = (UINT16) ((CharCount + 1) * sizeof (CHAR16));
|
Record->Data.Size = (UINT16) ((CharCount + 1) * sizeof (CHAR16));
|
||||||
} else {
|
} else {
|
||||||
|
@ -213,7 +217,7 @@ DataHubStatusCodeReportWorker (
|
||||||
if (Data->Size > EFI_STATUS_CODE_DATA_MAX_SIZE) {
|
if (Data->Size > EFI_STATUS_CODE_DATA_MAX_SIZE) {
|
||||||
Record->Data.Size = EFI_STATUS_CODE_DATA_MAX_SIZE;
|
Record->Data.Size = EFI_STATUS_CODE_DATA_MAX_SIZE;
|
||||||
}
|
}
|
||||||
CopyMem (Record->ExtendData, Data + 1, Record->Data.Size);
|
CopyMem ((VOID *) (Record + 1), Data + 1, Record->Data.Size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,7 +243,7 @@ LogDataHubEventCallBack (
|
||||||
IN VOID *Context
|
IN VOID *Context
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DATAHUB_STATUSCODE_RECORD *Record;
|
DATA_HUB_STATUS_CODE_DATA_RECORD *Record;
|
||||||
UINT32 Size;
|
UINT32 Size;
|
||||||
UINT64 DataRecordClass;
|
UINT64 DataRecordClass;
|
||||||
|
|
||||||
|
@ -255,7 +259,7 @@ LogDataHubEventCallBack (
|
||||||
//
|
//
|
||||||
// Add in the size of the header we added.
|
// Add in the size of the header we added.
|
||||||
//
|
//
|
||||||
Size = sizeof (DATAHUB_STATUSCODE_RECORD) + (UINT32) Record->Data.Size;
|
Size = sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD) + (UINT32) Record->Data.Size;
|
||||||
|
|
||||||
if ((Record->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
|
if ((Record->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
|
||||||
DataRecordClass = EFI_DATA_RECORD_CLASS_PROGRESS_CODE;
|
DataRecordClass = EFI_DATA_RECORD_CLASS_PROGRESS_CODE;
|
||||||
|
|
|
@ -22,6 +22,8 @@ Abstract:
|
||||||
#ifndef __DXE_STATUS_CODE_H__
|
#ifndef __DXE_STATUS_CODE_H__
|
||||||
#define __DXE_STATUS_CODE_H__
|
#define __DXE_STATUS_CODE_H__
|
||||||
|
|
||||||
|
#include <Common/StatusCode.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// Data hub worker definition
|
// Data hub worker definition
|
||||||
//
|
//
|
||||||
|
@ -41,14 +43,10 @@ typedef enum {
|
||||||
} PROCESSOR_MODE;
|
} PROCESSOR_MODE;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINTN Signature;
|
UINTN Signature;
|
||||||
LIST_ENTRY Node;
|
LIST_ENTRY Node;
|
||||||
EFI_STATUS_CODE_TYPE CodeType;
|
|
||||||
EFI_STATUS_CODE_VALUE Value;
|
UINT8 Data[sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD) + EFI_STATUS_CODE_DATA_MAX_SIZE];
|
||||||
UINT32 Instance;
|
|
||||||
EFI_GUID CallerId;
|
|
||||||
EFI_STATUS_CODE_DATA Data;
|
|
||||||
UINT8 ExtendData[EFI_STATUS_CODE_DATA_MAX_SIZE];
|
|
||||||
} DATAHUB_STATUSCODE_RECORD;
|
} DATAHUB_STATUSCODE_RECORD;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@
|
||||||
<GuidCName>gMemoryStatusCodeRecordGuid</GuidCName>
|
<GuidCName>gMemoryStatusCodeRecordGuid</GuidCName>
|
||||||
</GuidCNames>
|
</GuidCNames>
|
||||||
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
||||||
<GuidCName>gEfiStatusCodeDataTypeStringGuid</GuidCName>
|
<GuidCName>gEfiStatusCodeDataTypeDebugGuid</GuidCName>
|
||||||
</GuidCNames>
|
</GuidCNames>
|
||||||
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
<GuidCNames Usage="SOMETIMES_CONSUMED">
|
||||||
<GuidCName>gEfiStatusCodeSpecificDataGuid</GuidCName>
|
<GuidCName>gEfiStatusCodeSpecificDataGuid</GuidCName>
|
||||||
|
|
|
@ -1,233 +0,0 @@
|
||||||
/** @file
|
|
||||||
Status code driver for IA32/X64/EBC architecture.
|
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
|
||||||
All rights reserved. This program and the accompanying materials
|
|
||||||
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: DxeStatusCodeCommon.c
|
|
||||||
|
|
||||||
**/
|
|
||||||
//
|
|
||||||
// Include common header file for this module.
|
|
||||||
//
|
|
||||||
#include "CommonHeader.h"
|
|
||||||
|
|
||||||
#include "DxeStatusCode.h"
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Report status code to all supported device.
|
|
||||||
Calls into the workers which dispatches the platform specific
|
|
||||||
listeners.
|
|
||||||
|
|
||||||
@param Type Indicates the type of status code being reported.
|
|
||||||
The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
|
|
||||||
@param Value Describes the current status of a hardware or software entity.
|
|
||||||
This includes information about the class and subclass that is used to classify the entity
|
|
||||||
as well as an operation. For progress codes, the operation is the current activity.
|
|
||||||
For error codes, it is the exception. For debug codes, it is not defined at this time.
|
|
||||||
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
|
|
||||||
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
|
|
||||||
@param Instance The enumeration of a hardware or software entity within the system.
|
|
||||||
A system may contain multiple entities that match a class/subclass pairing.
|
|
||||||
The instance differentiates between them. An instance of 0 indicates that instance
|
|
||||||
information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1.
|
|
||||||
@param CallerId This optional parameter may be used to identify the caller.
|
|
||||||
This parameter allows the status code driver to apply different rules to different callers.
|
|
||||||
@param Data This optional parameter may be used to pass additional data.
|
|
||||||
Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below.
|
|
||||||
The contents of this data type may have additional GUID-specific data. The standard GUIDs and
|
|
||||||
their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.
|
|
||||||
|
|
||||||
@return Always return EFI_SUCCESS.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
ReportDispatcher (
|
|
||||||
IN EFI_STATUS_CODE_TYPE Type,
|
|
||||||
IN EFI_STATUS_CODE_VALUE Value,
|
|
||||||
IN UINT32 Instance,
|
|
||||||
IN EFI_GUID *CallerId OPTIONAL,
|
|
||||||
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Declaration of status code protocol.
|
|
||||||
//
|
|
||||||
STATIC
|
|
||||||
EFI_STATUS_CODE_PROTOCOL mEfiStatusCodeProtocol = {
|
|
||||||
ReportDispatcher
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// Delaration of DXE status code controller
|
|
||||||
//
|
|
||||||
DXE_STATUS_CODE_CONTROLLER gDxeStatusCode = {
|
|
||||||
//
|
|
||||||
// Initialize nest status as non nested.
|
|
||||||
//
|
|
||||||
0,
|
|
||||||
{NULL, NULL}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
|
|
||||||
Install the ReportStatusCode runtime service.
|
|
||||||
|
|
||||||
@param ImageHandle Image handle of the loaded driver
|
|
||||||
@param SystemTable Pointer to the System Table
|
|
||||||
|
|
||||||
@return The function always returns success.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
DxeStatusCodeDriverEntry (
|
|
||||||
IN EFI_HANDLE ImageHandle,
|
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
|
||||||
)
|
|
||||||
{
|
|
||||||
EFI_HANDLE Handle = NULL;
|
|
||||||
EFI_STATUS Status;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Dispatch initialization request to supported devices
|
|
||||||
//
|
|
||||||
InitializationDispatcherWorker ();
|
|
||||||
|
|
||||||
//
|
|
||||||
// Install Status Code Architectural Protocol implementation as defined in Tiano
|
|
||||||
// Architecture Specification.
|
|
||||||
//
|
|
||||||
Status = gBS->InstallMultipleProtocolInterfaces (
|
|
||||||
&Handle,
|
|
||||||
&gEfiStatusCodeRuntimeProtocolGuid,
|
|
||||||
&mEfiStatusCodeProtocol,
|
|
||||||
NULL
|
|
||||||
);
|
|
||||||
ASSERT_EFI_ERROR (Status);
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Report status code to all supported device.
|
|
||||||
Calls into the workers which dispatches the platform specific
|
|
||||||
listeners.
|
|
||||||
|
|
||||||
@param CodeType Indicates the type of status code being reported.
|
|
||||||
The type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
|
|
||||||
@param Value Describes the current status of a hardware or software entity.
|
|
||||||
This includes information about the class and subclass that is used to classify the entity
|
|
||||||
as well as an operation. For progress codes, the operation is the current activity.
|
|
||||||
For error codes, it is the exception. For debug codes, it is not defined at this time.
|
|
||||||
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
|
|
||||||
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
|
|
||||||
@param Instance The enumeration of a hardware or software entity within the system.
|
|
||||||
A system may contain multiple entities that match a class/subclass pairing.
|
|
||||||
The instance differentiates between them. An instance of 0 indicates that instance
|
|
||||||
information is unavailable, not meaningful, or not relevant. Valid instance numbers start with 1.
|
|
||||||
@param CallerId This optional parameter may be used to identify the caller.
|
|
||||||
This parameter allows the status code driver to apply different rules to different callers.
|
|
||||||
@param Data This optional parameter may be used to pass additional data.
|
|
||||||
Type EFI_STATUS_CODE_DATA is defined in "Related Definitions" below.
|
|
||||||
The contents of this data type may have additional GUID-specific data. The standard GUIDs and
|
|
||||||
their associated data structures are defined in the Intel? Platform Innovation Framework for EFI Status Codes Specification.
|
|
||||||
|
|
||||||
@return Always return EFI_SUCCESS.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
ReportDispatcher (
|
|
||||||
IN EFI_STATUS_CODE_TYPE CodeType,
|
|
||||||
IN EFI_STATUS_CODE_VALUE Value,
|
|
||||||
IN UINT32 Instance,
|
|
||||||
IN EFI_GUID *CallerId OPTIONAL,
|
|
||||||
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Use atom operation to avoid the reentant of report.
|
|
||||||
// If current status is not zero, then the function is reentrancy.
|
|
||||||
//
|
|
||||||
if (1 == InterlockedCompareExchange32 (&gDxeStatusCode.StatusCodeNestStatus, 0, 1)) {
|
|
||||||
return EFI_DEVICE_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FeaturePcdGet (PcdStatusCodeUseEfiSerial) || FeaturePcdGet (PcdStatusCodeUseHardSerial)) {
|
|
||||||
SerialStatusCodeReportWorker (
|
|
||||||
CodeType,
|
|
||||||
Value,
|
|
||||||
Instance,
|
|
||||||
CallerId,
|
|
||||||
Data
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (FeaturePcdGet (PcdStatusCodeUseRuntimeMemory)) {
|
|
||||||
RtMemoryStatusCodeReportWorker (
|
|
||||||
gDxeStatusCode.RtMemoryStatusCodeTable[PHYSICAL_MODE],
|
|
||||||
CodeType,
|
|
||||||
Value,
|
|
||||||
Instance
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (FeaturePcdGet (PcdStatusCodeUseDataHub)) {
|
|
||||||
DataHubStatusCodeReportWorker (
|
|
||||||
CodeType,
|
|
||||||
Value,
|
|
||||||
Instance,
|
|
||||||
CallerId,
|
|
||||||
Data
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (FeaturePcdGet (PcdStatusCodeUseOEM)) {
|
|
||||||
OemHookStatusCodeReport (
|
|
||||||
CodeType,
|
|
||||||
Value,
|
|
||||||
Instance,
|
|
||||||
CallerId,
|
|
||||||
Data
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Restore the nest status of report
|
|
||||||
//
|
|
||||||
InterlockedCompareExchange32 (&gDxeStatusCode.StatusCodeNestStatus, 1, 0);
|
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Virtual address change notification call back. It converts global pointer
|
|
||||||
to virtual address.
|
|
||||||
|
|
||||||
@param Event Event whose notification function is being invoked.
|
|
||||||
@param Context Pointer to the notification function's context, which is
|
|
||||||
always zero in current implementation.
|
|
||||||
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
VirtualAddressChangeCallBack (
|
|
||||||
IN EFI_EVENT Event,
|
|
||||||
IN VOID *Context
|
|
||||||
)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// Convert memory status code table to virtual address;
|
|
||||||
//
|
|
||||||
EfiConvertPointer (
|
|
||||||
0,
|
|
||||||
(VOID **) &gDxeStatusCode.RtMemoryStatusCodeTable[PHYSICAL_MODE]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,70 +0,0 @@
|
||||||
/**@file
|
|
||||||
Common header file shared by all source files.
|
|
||||||
|
|
||||||
This file includes package header files, library classes and protocol, PPI & GUID definitions.
|
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation.
|
|
||||||
All rights reserved. This program and the accompanying materials
|
|
||||||
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.
|
|
||||||
**/
|
|
||||||
|
|
||||||
#ifndef __COMMON_HEADER_H_
|
|
||||||
#define __COMMON_HEADER_H_
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// The package level header files this module uses
|
|
||||||
//
|
|
||||||
#include <FrameworkDxe.h>
|
|
||||||
//
|
|
||||||
// The protocols, PPI and GUID defintions for this module
|
|
||||||
//
|
|
||||||
#include <Guid/StatusCode.h>
|
|
||||||
#include <Protocol/DataHub.h>
|
|
||||||
#include <Protocol/SerialIo.h>
|
|
||||||
#include <Guid/MemoryStatusCodeRecord.h>
|
|
||||||
#include <Protocol/StatusCode.h>
|
|
||||||
#include <Guid/StatusCodeDataTypeId.h>
|
|
||||||
//
|
|
||||||
// The Library classes this module consumes
|
|
||||||
//
|
|
||||||
#include <Library/BaseLib.h>
|
|
||||||
#include <Library/BaseMemoryLib.h>
|
|
||||||
#include <Library/DebugLib.h>
|
|
||||||
#include <Library/ReportStatusCodeLib.h>
|
|
||||||
#include <Library/PrintLib.h>
|
|
||||||
#include <Library/PcdLib.h>
|
|
||||||
#include <Library/HobLib.h>
|
|
||||||
#include <Library/UefiDriverEntryPoint.h>
|
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
|
||||||
#include <Library/UefiLib.h>
|
|
||||||
#include <Library/MemoryAllocationLib.h>
|
|
||||||
#include <Library/UefiRuntimeLib.h>
|
|
||||||
#include <Library/SerialPortLib.h>
|
|
||||||
#include <Library/OemHookStatusCodeLib.h>
|
|
||||||
|
|
||||||
//
|
|
||||||
// Declaration for callback Event.
|
|
||||||
//
|
|
||||||
VOID
|
|
||||||
EFIAPI
|
|
||||||
VirtualAddressChangeCallBack (
|
|
||||||
IN EFI_EVENT Event,
|
|
||||||
IN VOID *Context
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Declaration for original Entry Point.
|
|
||||||
//
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
DxeStatusCodeDriverEntry (
|
|
||||||
IN EFI_HANDLE ImageHandle,
|
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -13,10 +13,6 @@
|
||||||
Module Name: DataHubStatusCodeWorker.c
|
Module Name: DataHubStatusCodeWorker.c
|
||||||
|
|
||||||
**/
|
**/
|
||||||
//
|
|
||||||
// Include common header file for this module.
|
|
||||||
//
|
|
||||||
#include "CommonHeader.h"
|
|
||||||
|
|
||||||
#include "DxeStatusCode.h"
|
#include "DxeStatusCode.h"
|
||||||
|
|
||||||
|
@ -46,7 +42,7 @@ EFI_DATA_HUB_PROTOCOL *mDataHubProtocol;
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
DATAHUB_STATUSCODE_RECORD *
|
DATA_HUB_STATUS_CODE_DATA_RECORD *
|
||||||
AcquireRecordBuffer (
|
AcquireRecordBuffer (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
|
@ -86,7 +82,7 @@ AcquireRecordBuffer (
|
||||||
|
|
||||||
gBS->RestoreTPL (CurrentTpl);
|
gBS->RestoreTPL (CurrentTpl);
|
||||||
|
|
||||||
return Record;
|
return (DATA_HUB_STATUS_CODE_DATA_RECORD *) (Record->Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,14 +95,15 @@ AcquireRecordBuffer (
|
||||||
|
|
||||||
**/
|
**/
|
||||||
STATIC
|
STATIC
|
||||||
DATAHUB_STATUSCODE_RECORD *
|
DATA_HUB_STATUS_CODE_DATA_RECORD *
|
||||||
RetrieveRecord (
|
RetrieveRecord (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DATAHUB_STATUSCODE_RECORD *Record = NULL;
|
DATA_HUB_STATUS_CODE_DATA_RECORD *RecordData = NULL;
|
||||||
LIST_ENTRY *Node;
|
DATAHUB_STATUSCODE_RECORD *Record;
|
||||||
EFI_TPL CurrentTpl;
|
LIST_ENTRY *Node;
|
||||||
|
EFI_TPL CurrentTpl;
|
||||||
|
|
||||||
CurrentTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
|
CurrentTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
|
||||||
|
|
||||||
|
@ -117,11 +114,12 @@ RetrieveRecord (
|
||||||
RemoveEntryList (&Record->Node);
|
RemoveEntryList (&Record->Node);
|
||||||
InsertTailList (&mRecordsBuffer, &Record->Node);
|
InsertTailList (&mRecordsBuffer, &Record->Node);
|
||||||
Record->Signature = 0;
|
Record->Signature = 0;
|
||||||
|
RecordData = (DATA_HUB_STATUS_CODE_DATA_RECORD *) Record->Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
gBS->RestoreTPL (CurrentTpl);
|
gBS->RestoreTPL (CurrentTpl);
|
||||||
|
|
||||||
return Record;
|
return RecordData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -164,11 +162,11 @@ DataHubStatusCodeReportWorker (
|
||||||
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DATAHUB_STATUSCODE_RECORD *Record;
|
DATA_HUB_STATUS_CODE_DATA_RECORD *Record;
|
||||||
UINT32 ErrorLevel;
|
UINT32 ErrorLevel;
|
||||||
VA_LIST Marker;
|
VA_LIST Marker;
|
||||||
CHAR8 *Format;
|
CHAR8 *Format;
|
||||||
UINTN CharCount;
|
UINTN CharCount;
|
||||||
|
|
||||||
//
|
//
|
||||||
// See whether in runtime phase or not.
|
// See whether in runtime phase or not.
|
||||||
|
@ -184,6 +182,7 @@ DataHubStatusCodeReportWorker (
|
||||||
//
|
//
|
||||||
return EFI_OUT_OF_RESOURCES;
|
return EFI_OUT_OF_RESOURCES;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Construct Data Hub Extended Data
|
// Construct Data Hub Extended Data
|
||||||
//
|
//
|
||||||
|
@ -198,7 +197,7 @@ DataHubStatusCodeReportWorker (
|
||||||
if (Data != NULL) {
|
if (Data != NULL) {
|
||||||
if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {
|
if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) {
|
||||||
CharCount = UnicodeVSPrintAsciiFormat (
|
CharCount = UnicodeVSPrintAsciiFormat (
|
||||||
(CHAR16 *) Record->ExtendData,
|
(CHAR16 *) (Record + 1),
|
||||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||||
Format,
|
Format,
|
||||||
Marker
|
Marker
|
||||||
|
@ -206,7 +205,7 @@ DataHubStatusCodeReportWorker (
|
||||||
//
|
//
|
||||||
// Change record data type from DebugType to String Type.
|
// Change record data type from DebugType to String Type.
|
||||||
//
|
//
|
||||||
CopyGuid (&Record->Data.Type, &gEfiStatusCodeDataTypeStringGuid);
|
CopyGuid (&Record->Data.Type, &gEfiStatusCodeDataTypeDebugGuid);
|
||||||
Record->Data.HeaderSize = Data->HeaderSize;
|
Record->Data.HeaderSize = Data->HeaderSize;
|
||||||
Record->Data.Size = (UINT16) ((CharCount + 1) * sizeof (CHAR16));
|
Record->Data.Size = (UINT16) ((CharCount + 1) * sizeof (CHAR16));
|
||||||
} else {
|
} else {
|
||||||
|
@ -218,7 +217,7 @@ DataHubStatusCodeReportWorker (
|
||||||
if (Data->Size > EFI_STATUS_CODE_DATA_MAX_SIZE) {
|
if (Data->Size > EFI_STATUS_CODE_DATA_MAX_SIZE) {
|
||||||
Record->Data.Size = EFI_STATUS_CODE_DATA_MAX_SIZE;
|
Record->Data.Size = EFI_STATUS_CODE_DATA_MAX_SIZE;
|
||||||
}
|
}
|
||||||
CopyMem (Record->ExtendData, Data + 1, Record->Data.Size);
|
CopyMem ((VOID *) (Record + 1), Data + 1, Record->Data.Size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,7 +243,7 @@ LogDataHubEventCallBack (
|
||||||
IN VOID *Context
|
IN VOID *Context
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
DATAHUB_STATUSCODE_RECORD *Record;
|
DATA_HUB_STATUS_CODE_DATA_RECORD *Record;
|
||||||
UINT32 Size;
|
UINT32 Size;
|
||||||
UINT64 DataRecordClass;
|
UINT64 DataRecordClass;
|
||||||
|
|
||||||
|
@ -260,7 +259,7 @@ LogDataHubEventCallBack (
|
||||||
//
|
//
|
||||||
// Add in the size of the header we added.
|
// Add in the size of the header we added.
|
||||||
//
|
//
|
||||||
Size = sizeof (DATAHUB_STATUSCODE_RECORD) + (UINT32) Record->Data.Size;
|
Size = sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD) + (UINT32) Record->Data.Size;
|
||||||
|
|
||||||
if ((Record->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
|
if ((Record->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
|
||||||
DataRecordClass = EFI_DATA_RECORD_CLASS_PROGRESS_CODE;
|
DataRecordClass = EFI_DATA_RECORD_CLASS_PROGRESS_CODE;
|
||||||
|
|
|
@ -26,11 +26,6 @@
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
//
|
|
||||||
// Include common header file for this module.
|
|
||||||
//
|
|
||||||
#include "CommonHeader.h"
|
|
||||||
|
|
||||||
#include "DxeStatusCode.h"
|
#include "DxeStatusCode.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -23,9 +23,35 @@ Abstract:
|
||||||
#define __DXE_STATUS_CODE_H__
|
#define __DXE_STATUS_CODE_H__
|
||||||
|
|
||||||
//
|
//
|
||||||
// Include common header file for this module.
|
// The package level header files this module uses
|
||||||
//
|
//
|
||||||
#include "CommonHeader.h"
|
#include <FrameworkDxe.h>
|
||||||
|
//
|
||||||
|
// The protocols, PPI and GUID defintions for this module
|
||||||
|
//
|
||||||
|
#include <Guid/StatusCode.h>
|
||||||
|
#include <Protocol/DataHub.h>
|
||||||
|
#include <Protocol/SerialIo.h>
|
||||||
|
#include <Guid/MemoryStatusCodeRecord.h>
|
||||||
|
#include <Protocol/StatusCode.h>
|
||||||
|
#include <Guid/StatusCodeDataTypeId.h>
|
||||||
|
//
|
||||||
|
// The Library classes this module consumes
|
||||||
|
//
|
||||||
|
#include <Library/BaseLib.h>
|
||||||
|
#include <Library/BaseMemoryLib.h>
|
||||||
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Library/ReportStatusCodeLib.h>
|
||||||
|
#include <Library/PrintLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
|
#include <Library/HobLib.h>
|
||||||
|
#include <Library/UefiDriverEntryPoint.h>
|
||||||
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
|
#include <Library/UefiLib.h>
|
||||||
|
#include <Library/MemoryAllocationLib.h>
|
||||||
|
#include <Library/UefiRuntimeLib.h>
|
||||||
|
#include <Library/SerialPortLib.h>
|
||||||
|
#include <Library/OemHookStatusCodeLib.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// Data hub worker definition
|
// Data hub worker definition
|
||||||
|
@ -46,14 +72,10 @@ typedef enum {
|
||||||
} PROCESSOR_MODE;
|
} PROCESSOR_MODE;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
UINTN Signature;
|
UINTN Signature;
|
||||||
LIST_ENTRY Node;
|
LIST_ENTRY Node;
|
||||||
EFI_STATUS_CODE_TYPE CodeType;
|
|
||||||
EFI_STATUS_CODE_VALUE Value;
|
UINT8 Data[sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD) + EFI_STATUS_CODE_DATA_MAX_SIZE];
|
||||||
UINT32 Instance;
|
|
||||||
EFI_GUID CallerId;
|
|
||||||
EFI_STATUS_CODE_DATA Data;
|
|
||||||
UINT8 ExtendData[EFI_STATUS_CODE_DATA_MAX_SIZE];
|
|
||||||
} DATAHUB_STATUSCODE_RECORD;
|
} DATAHUB_STATUSCODE_RECORD;
|
||||||
|
|
||||||
|
|
||||||
|
@ -237,6 +259,27 @@ DataHubStatusCodeReportWorker (
|
||||||
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
IN EFI_STATUS_CODE_DATA *Data OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Declaration for callback Event.
|
||||||
|
//
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
VirtualAddressChangeCallBack (
|
||||||
|
IN EFI_EVENT Event,
|
||||||
|
IN VOID *Context
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Declaration for original Entry Point.
|
||||||
|
//
|
||||||
|
EFI_STATUS
|
||||||
|
EFIAPI
|
||||||
|
DxeStatusCodeDriverEntry (
|
||||||
|
IN EFI_HANDLE ImageHandle,
|
||||||
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
// declaration of DXE status code controller.
|
// declaration of DXE status code controller.
|
||||||
//
|
//
|
||||||
|
|
|
@ -52,20 +52,19 @@
|
||||||
DataHubStatusCodeWorker.c
|
DataHubStatusCodeWorker.c
|
||||||
DxeStatusCode.c
|
DxeStatusCode.c
|
||||||
DxeStatusCode.h
|
DxeStatusCode.h
|
||||||
CommonHeader.h
|
|
||||||
EntryPoint.c
|
EntryPoint.c
|
||||||
|
|
||||||
[Sources.Ia32]
|
[Sources.Ia32]
|
||||||
Common/StatusCode.dxs
|
StatusCode.dxs
|
||||||
Common/DxeStatusCodeCommon.c
|
DxeStatusCodeCommon.c
|
||||||
|
|
||||||
[Sources.X64]
|
[Sources.X64]
|
||||||
Common/StatusCode.dxs
|
StatusCode.dxs
|
||||||
Common/DxeStatusCodeCommon.c
|
DxeStatusCodeCommon.c
|
||||||
|
|
||||||
[Sources.EBC]
|
[Sources.EBC]
|
||||||
Common/StatusCode.dxs
|
StatusCode.dxs
|
||||||
Common/DxeStatusCodeCommon.c
|
DxeStatusCodeCommon.c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -114,8 +113,8 @@
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiStatusCodeGuid # SOMETIMES_CONSUMED
|
gEfiStatusCodeGuid # SOMETIMES_CONSUMED
|
||||||
gMemoryStatusCodeRecordGuid # SOMETIMES_CONSUMED
|
gMemoryStatusCodeRecordGuid # SOMETIMES_CONSUMED
|
||||||
gEfiStatusCodeDataTypeStringGuid # SOMETIMES_CONSUMED
|
|
||||||
gEfiStatusCodeSpecificDataGuid # SOMETIMES_CONSUMED
|
gEfiStatusCodeSpecificDataGuid # SOMETIMES_CONSUMED
|
||||||
|
gEfiStatusCodeDataTypeDebugGuid # PROTOCOL ALWAYS_CONSUMED
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
|
|
|
@ -12,10 +12,7 @@
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
**/
|
**/
|
||||||
|
|
||||||
//
|
#include "DxeStatusCode.h"
|
||||||
// Include common header file for this module.
|
|
||||||
//
|
|
||||||
#include "CommonHeader.h"
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Event for Exit Boot Services Callback
|
// Event for Exit Boot Services Callback
|
||||||
|
|
|
@ -14,11 +14,6 @@
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
//
|
|
||||||
// Include common header file for this module.
|
|
||||||
//
|
|
||||||
#include "CommonHeader.h"
|
|
||||||
|
|
||||||
#include "DxeStatusCode.h"
|
#include "DxeStatusCode.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -15,11 +15,6 @@
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
//
|
|
||||||
// Include common header file for this module.
|
|
||||||
//
|
|
||||||
#include "CommonHeader.h"
|
|
||||||
|
|
||||||
#include "DxeStatusCode.h"
|
#include "DxeStatusCode.h"
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
|
|
Loading…
Reference in New Issue