mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 15:44:04 +02:00
Code Scrub for Status Code PEIM.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8186 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d357145fca
commit
d5aea10cc3
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Memory status code worker in PEI.
|
PEI memory status code worker.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2009, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -10,19 +10,17 @@
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name: MemoryStatusCodeWorker.c
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "PeiStatusCode.h"
|
#include "PeiStatusCode.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Create one memory status code GUID'ed HOB, use PacketIndex
|
Worker function to create one memory status code GUID'ed HOB,
|
||||||
to identify the packet.
|
using PacketIndex to identify the packet.
|
||||||
|
|
||||||
@param PacketIndex Index of records packet.
|
@param PacketIndex Index of records packet.
|
||||||
|
|
||||||
@return Always return pointer of memory status code packet.
|
@return Pointer to the memory status code packet.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
MEMORY_STATUSCODE_PACKET_HEADER *
|
MEMORY_STATUSCODE_PACKET_HEADER *
|
||||||
@ -35,30 +33,23 @@ CreateMemoryStatusCodePacket (
|
|||||||
//
|
//
|
||||||
// Build GUID'ed HOB with PCD defined size.
|
// Build GUID'ed HOB with PCD defined size.
|
||||||
//
|
//
|
||||||
PacketHeader =
|
PacketHeader = BuildGuidHob (
|
||||||
(MEMORY_STATUSCODE_PACKET_HEADER *) BuildGuidHob (
|
&gMemoryStatusCodeRecordGuid,
|
||||||
&gMemoryStatusCodeRecordGuid,
|
PcdGet16 (PcdStatusCodeMemorySize) * 1024 + sizeof (MEMORY_STATUSCODE_PACKET_HEADER)
|
||||||
PcdGet16 (PcdStatusCodeMemorySize) *
|
);
|
||||||
1024 +
|
|
||||||
sizeof (MEMORY_STATUSCODE_PACKET_HEADER)
|
|
||||||
);
|
|
||||||
ASSERT (PacketHeader != NULL);
|
ASSERT (PacketHeader != NULL);
|
||||||
|
|
||||||
PacketHeader->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024)/ sizeof (MEMORY_STATUSCODE_RECORD);
|
PacketHeader->MaxRecordsNumber = (PcdGet16 (PcdStatusCodeMemorySize) * 1024) / sizeof (MEMORY_STATUSCODE_RECORD);
|
||||||
PacketHeader->PacketIndex = PacketIndex;
|
PacketHeader->PacketIndex = PacketIndex;
|
||||||
PacketHeader->RecordIndex = 0;
|
PacketHeader->RecordIndex = 0;
|
||||||
|
|
||||||
return PacketHeader;
|
return PacketHeader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize memory status code.
|
Create the first memory status code GUID'ed HOB as initialization for memory status code worker.
|
||||||
Create one GUID'ed HOB with PCD defined size. If create required size
|
|
||||||
GUID'ed HOB failed, then ASSERT().
|
|
||||||
|
|
||||||
@return The function always return EFI_SUCCESS
|
@retval EFI_SUCCESS The GUID'ed HOB is created successfully.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -76,23 +67,24 @@ MemoryStatusCodeInitializeWorker (
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Report status code into GUID'ed HOB..
|
Report status code into GUID'ed HOB.
|
||||||
|
|
||||||
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
|
This function reports status code into GUID'ed HOB. If not all packets are full, then
|
||||||
|
write status code into available entry. Otherwise, create a new packet for it.
|
||||||
|
|
||||||
@param Value Describes the current status of a hardware or software entity.
|
@param CodeType Indicates the type of status code being reported.
|
||||||
This included information about the class and subclass that is used to classify the entity
|
@param Value Describes the current status of a hardware or
|
||||||
as well as an operation. For progress codes, the operation is the current activity.
|
software entity. This includes information about the class and
|
||||||
For error codes, it is the exception. For debug codes, it is not defined at this time.
|
subclass that is used to classify the entity as well as an operation.
|
||||||
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
|
For progress codes, the operation is the current activity.
|
||||||
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
|
For error codes, it is the exception.For debug codes,it is not defined at this time.
|
||||||
|
@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 Instance The enumeration of a hardware or software entity within the system.
|
@retval EFI_SUCCESS The function always return EFI_SUCCESS.
|
||||||
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.
|
|
||||||
|
|
||||||
@return The function always return EFI_SUCCESS.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -105,11 +97,14 @@ MemoryStatusCodeReportWorker (
|
|||||||
|
|
||||||
EFI_PEI_HOB_POINTERS Hob;
|
EFI_PEI_HOB_POINTERS Hob;
|
||||||
MEMORY_STATUSCODE_PACKET_HEADER *PacketHeader;
|
MEMORY_STATUSCODE_PACKET_HEADER *PacketHeader;
|
||||||
MEMORY_STATUSCODE_RECORD *Record = NULL;
|
MEMORY_STATUSCODE_RECORD *Record;
|
||||||
UINT16 PacketIndex = 0;;
|
UINT16 PacketIndex;
|
||||||
|
|
||||||
|
Record = NULL;
|
||||||
|
PacketIndex = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Journal GUID'ed HOBs to find empty record entry, if found, then save status code in it.
|
// Journal GUID'ed HOBs to find empty record entry. if found, then save status code in it.
|
||||||
// otherwise, create a new GUID'ed HOB.
|
// otherwise, create a new GUID'ed HOB.
|
||||||
//
|
//
|
||||||
Hob.Raw = GetFirstGuidHob (&gMemoryStatusCodeRecordGuid);
|
Hob.Raw = GetFirstGuidHob (&gMemoryStatusCodeRecordGuid);
|
||||||
@ -132,9 +127,9 @@ MemoryStatusCodeReportWorker (
|
|||||||
Hob.Raw = GetNextGuidHob (&gMemoryStatusCodeRecordGuid, Hob.Raw);
|
Hob.Raw = GetNextGuidHob (&gMemoryStatusCodeRecordGuid, Hob.Raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NULL == Record) {
|
if (Record == NULL) {
|
||||||
//
|
//
|
||||||
// In order to save status code , create new packet.
|
// No available entry found, so create new packet.
|
||||||
//
|
//
|
||||||
PacketHeader = CreateMemoryStatusCodePacket (PacketIndex);
|
PacketHeader = CreateMemoryStatusCodePacket (PacketIndex);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Generic PeiStatusCode Module.
|
Status code PEIM which produces Status Code PPI.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2009, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -10,13 +10,11 @@
|
|||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
Module Name: PeiStatusCode.c
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "PeiStatusCode.h"
|
#include "PeiStatusCode.h"
|
||||||
|
|
||||||
EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi = {
|
EFI_PEI_PROGRESS_CODE_PPI mStatusCodePpi = {
|
||||||
ReportDispatcher
|
ReportDispatcher
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -27,40 +25,38 @@ EFI_PEI_PPI_DESCRIPTOR mStatusCodePpiDescriptor = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Report status code to all supported device.
|
Publishes an interface that allows PEIMs to report status codes.
|
||||||
|
|
||||||
|
This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().
|
||||||
|
It publishes an interface that allows PEIMs to report status codes.
|
||||||
|
|
||||||
@param PeiServices
|
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
|
||||||
|
@param CodeType Indicates the type of status code being reported.
|
||||||
|
@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.
|
||||||
|
@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.
|
||||||
|
|
||||||
@param CodeType Indicates the type of status code being reported.
|
@retval EFI_SUCCESS The function completed successfully.
|
||||||
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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ReportDispatcher (
|
ReportDispatcher (
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||||
IN EFI_STATUS_CODE_TYPE CodeType,
|
IN EFI_STATUS_CODE_TYPE CodeType,
|
||||||
IN EFI_STATUS_CODE_VALUE Value,
|
IN EFI_STATUS_CODE_VALUE Value,
|
||||||
IN UINT32 Instance,
|
IN UINT32 Instance,
|
||||||
IN CONST EFI_GUID *CallerId OPTIONAL,
|
IN CONST EFI_GUID *CallerId OPTIONAL,
|
||||||
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
|
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
|
||||||
)
|
)
|
||||||
@ -82,6 +78,9 @@ ReportDispatcher (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (FeaturePcdGet (PcdStatusCodeUseOEM)) {
|
if (FeaturePcdGet (PcdStatusCodeUseOEM)) {
|
||||||
|
//
|
||||||
|
// Call OEM hook status code library API to report status code to OEM device
|
||||||
|
//
|
||||||
OemHookStatusCodeReport (
|
OemHookStatusCodeReport (
|
||||||
CodeType,
|
CodeType,
|
||||||
Value,
|
Value,
|
||||||
@ -95,13 +94,16 @@ ReportDispatcher (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize PEI status codes and publish the status code
|
Entry point of Status Code PEIM.
|
||||||
PPI.
|
|
||||||
|
This function is the entry point of this Status Code PEIM.
|
||||||
|
It initializes supported status code devices according to PCD settings,
|
||||||
|
and installs Status Code PPI.
|
||||||
|
|
||||||
@param FileHandle Handle of the file being invoked.
|
@param FileHandle Handle of the file being invoked.
|
||||||
@param PeiServices Describes the list of possible PEI Services.
|
@param PeiServices Describes the list of possible PEI Services.
|
||||||
|
|
||||||
@return The function always returns success.
|
@retval EFI_SUCESS The entry point of DXE IPL PEIM executes successfully.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -133,9 +135,9 @@ PeiStatusCodeDriverEntry (
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Install PeiStatusCodePpi.
|
// Install Status Code PPI.
|
||||||
// PeiServices use this Ppi to output status code.
|
// It serves the PEI Service ReportStatusCode.
|
||||||
// use library
|
//
|
||||||
Status = PeiServicesInstallPpi (&mStatusCodePpiDescriptor);
|
Status = PeiServicesInstallPpi (&mStatusCodePpiDescriptor);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Heade file of status code PEIM
|
Internal include file for Status Code PEIM.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2009, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -38,47 +38,39 @@
|
|||||||
/**
|
/**
|
||||||
Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
|
Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
|
||||||
|
|
||||||
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
|
@param CodeType Indicates the type of status code being reported.
|
||||||
|
@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.
|
||||||
|
@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.
|
||||||
|
|
||||||
@param Value Describes the current status of a hardware or software entity.
|
@retval EFI_SUCCESS Status code reported to serial I/O successfully.
|
||||||
This included 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.
|
|
||||||
Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.
|
|
||||||
|
|
||||||
|
|
||||||
@param Data This optional parameter may be used to pass additional data
|
|
||||||
|
|
||||||
@return The function always return EFI_SUCCESS.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
SerialStatusCodeReportWorker (
|
SerialStatusCodeReportWorker (
|
||||||
IN EFI_STATUS_CODE_TYPE CodeType,
|
IN EFI_STATUS_CODE_TYPE CodeType,
|
||||||
IN EFI_STATUS_CODE_VALUE Value,
|
IN EFI_STATUS_CODE_VALUE Value,
|
||||||
IN UINT32 Instance,
|
IN UINT32 Instance,
|
||||||
IN CONST EFI_GUID *CallerId,
|
IN CONST EFI_GUID *CallerId,
|
||||||
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
|
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize memory status code.
|
Create the first memory status code GUID'ed HOB as initialization for memory status code worker.
|
||||||
Create one GUID'ed HOB with PCD defined size. If create required size
|
|
||||||
GUID'ed HOB failed, then ASSERT().
|
|
||||||
|
|
||||||
@return The function always return EFI_SUCCESS
|
@retval EFI_SUCCESS The GUID'ed HOB is created successfully.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -89,21 +81,22 @@ MemoryStatusCodeInitializeWorker (
|
|||||||
/**
|
/**
|
||||||
Report status code into GUID'ed HOB.
|
Report status code into GUID'ed HOB.
|
||||||
|
|
||||||
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
|
This function reports status code into GUID'ed HOB. If not all packets are full, then
|
||||||
|
write status code into available entry. Otherwise, create a new packet for it.
|
||||||
|
|
||||||
@param Value Describes the current status of a hardware or software entity.
|
@param CodeType Indicates the type of status code being reported.
|
||||||
This included information about the class and subclass that is used to classify the entity
|
@param Value Describes the current status of a hardware or
|
||||||
as well as an operation. For progress codes, the operation is the current activity.
|
software entity. This includes information about the class and
|
||||||
For error codes, it is the exception. For debug codes, it is not defined at this time.
|
subclass that is used to classify the entity as well as an operation.
|
||||||
Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.
|
For progress codes, the operation is the current activity.
|
||||||
Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.
|
For error codes, it is the exception.For debug codes,it is not defined at this time.
|
||||||
|
@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 Instance The enumeration of a hardware or software entity within the system.
|
@retval EFI_SUCCESS The function always return EFI_SUCCESS.
|
||||||
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.
|
|
||||||
|
|
||||||
@return The function always return EFI_SUCCESS.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
@ -114,44 +107,42 @@ MemoryStatusCodeReportWorker (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Report status code to all supported device.
|
Publishes an interface that allows PEIMs to report status codes.
|
||||||
|
|
||||||
|
This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().
|
||||||
|
It publishes an interface that allows PEIMs to report status codes.
|
||||||
|
|
||||||
@param PeiServices
|
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
|
||||||
|
@param CodeType Indicates the type of status code being reported.
|
||||||
|
@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.
|
||||||
|
@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.
|
||||||
|
|
||||||
@param Type Indicates the type of status code being reported.
|
@retval EFI_SUCCESS The function completed successfully.
|
||||||
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
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
ReportDispatcher (
|
ReportDispatcher (
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
IN CONST EFI_PEI_SERVICES **PeiServices,
|
||||||
IN EFI_STATUS_CODE_TYPE Type,
|
IN EFI_STATUS_CODE_TYPE CodeType,
|
||||||
IN EFI_STATUS_CODE_VALUE Value,
|
IN EFI_STATUS_CODE_VALUE Value,
|
||||||
IN UINT32 Instance,
|
IN UINT32 Instance,
|
||||||
IN CONST EFI_GUID *CallerId OPTIONAL,
|
IN CONST EFI_GUID *CallerId OPTIONAL,
|
||||||
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
|
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif //__PEI_STATUS_CODE_H__
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#/** @file
|
#/** @file
|
||||||
# Generic Status code Pei driver
|
# Status code PEIM which produces Status Code PPI.
|
||||||
#
|
#
|
||||||
# Customized output devices based on feature flags.
|
|
||||||
# Copyright (c) 2006 - 2009, Intel Corporation.
|
# Copyright (c) 2006 - 2009, Intel Corporation.
|
||||||
#
|
#
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
@ -16,7 +15,7 @@
|
|||||||
|
|
||||||
[Defines]
|
[Defines]
|
||||||
INF_VERSION = 0x00010005
|
INF_VERSION = 0x00010005
|
||||||
BASE_NAME = PeiStatusCode
|
BASE_NAME = StatusCodePei
|
||||||
FILE_GUID = 1EC0F53A-FDE0-4576-8F25-7A1A410F58EB
|
FILE_GUID = 1EC0F53A-FDE0-4576-8F25-7A1A410F58EB
|
||||||
MODULE_TYPE = PEIM
|
MODULE_TYPE = PEIM
|
||||||
VERSION_STRING = 1.0
|
VERSION_STRING = 1.0
|
||||||
@ -38,7 +37,6 @@
|
|||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
MdeModulePkg/MdeModulePkg.dec
|
|
||||||
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
IntelFrameworkPkg/IntelFrameworkPkg.dec
|
||||||
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Serial I/O status code reporting worker.
|
Serial I/O status code reporting worker.
|
||||||
|
|
||||||
Copyright (c) 2006, Intel Corporation
|
Copyright (c) 2006 - 2009, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -16,36 +16,30 @@
|
|||||||
/**
|
/**
|
||||||
Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
|
Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
|
||||||
|
|
||||||
@param CodeType Indicates the type of status code being reported. Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.
|
@param CodeType Indicates the type of status code being reported.
|
||||||
|
@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.
|
||||||
|
@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.
|
||||||
|
|
||||||
@param Value Describes the current status of a hardware or software entity.
|
@retval EFI_SUCCESS Status code reported to serial I/O successfully.
|
||||||
This included 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.
|
|
||||||
Type EFI_GUID is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.
|
|
||||||
|
|
||||||
|
|
||||||
@param Data This optional parameter may be used to pass additional data
|
|
||||||
|
|
||||||
@return The function always return EFI_SUCCESS.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
SerialStatusCodeReportWorker (
|
SerialStatusCodeReportWorker (
|
||||||
IN EFI_STATUS_CODE_TYPE CodeType,
|
IN EFI_STATUS_CODE_TYPE CodeType,
|
||||||
IN EFI_STATUS_CODE_VALUE Value,
|
IN EFI_STATUS_CODE_VALUE Value,
|
||||||
IN UINT32 Instance,
|
IN UINT32 Instance,
|
||||||
IN CONST EFI_GUID *CallerId,
|
IN CONST EFI_GUID *CallerId,
|
||||||
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
|
IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
|
||||||
)
|
)
|
||||||
@ -98,10 +92,6 @@ SerialStatusCodeReportWorker (
|
|||||||
Instance
|
Instance
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
|
||||||
// Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers.
|
|
||||||
//
|
|
||||||
|
|
||||||
if (CallerId != NULL) {
|
if (CallerId != NULL) {
|
||||||
CharCount += AsciiSPrint (
|
CharCount += AsciiSPrint (
|
||||||
&Buffer[CharCount - 1],
|
&Buffer[CharCount - 1],
|
||||||
@ -126,6 +116,9 @@ SerialStatusCodeReportWorker (
|
|||||||
"\n\r"
|
"\n\r"
|
||||||
);
|
);
|
||||||
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
|
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
|
||||||
|
//
|
||||||
|
// Print PROGRESS information into output buffer.
|
||||||
|
//
|
||||||
CharCount = AsciiSPrint (
|
CharCount = AsciiSPrint (
|
||||||
Buffer,
|
Buffer,
|
||||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||||
@ -134,6 +127,9 @@ SerialStatusCodeReportWorker (
|
|||||||
Instance
|
Instance
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
//
|
||||||
|
// Code type is not defined.
|
||||||
|
//
|
||||||
CharCount = AsciiSPrint (
|
CharCount = AsciiSPrint (
|
||||||
Buffer,
|
Buffer,
|
||||||
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
EFI_STATUS_CODE_DATA_MAX_SIZE,
|
||||||
@ -145,7 +141,7 @@ SerialStatusCodeReportWorker (
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Callout to SerialPort Lib function to do print.
|
// Call SerialPort Lib function to do print.
|
||||||
//
|
//
|
||||||
SerialPortWrite ((UINT8 *) Buffer, CharCount);
|
SerialPortWrite ((UINT8 *) Buffer, CharCount);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user