From: qwang12 Date: Thu, 28 Jun 2007 07:12:34 +0000 (+0000) Subject: Add in more library for ECP. X-Git-Tag: edk2-stable201903~23122 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=b38907a6d41515f48fe01a7c3d7c6b84b269926b Add in more library for ECP. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2833 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/Include/MemoryStatusCodeLib.h b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/Include/MemoryStatusCodeLib.h new file mode 100644 index 0000000000..b2ed83b1aa --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/Include/MemoryStatusCodeLib.h @@ -0,0 +1,60 @@ +/*++ + +Copyright (c) 2004 - 2005, 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: + + MemoryStatusCodeLib.h + +Abstract: + + Lib to provide memory status code reporting. + +--*/ + +#ifndef _PEI_MEMORY_STATUS_CODE_LIB_H_ +#define _PEI_MEMORY_STATUS_CODE_LIB_H_ + +// +// Statements that include other files +// +#include "Tiano.h" +#include "Pei.h" + +// +// Publicly exported data +// +extern BOOLEAN mRunningFromMemory; + +// +// Initialization function +// +VOID +MemoryInitializeStatusCode ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ) +; + +// +// Status code reporting function +// +EFI_STATUS +MemoryReportStatusCode ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +; + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/Include/SimpleCpuIoLib.h b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/Include/SimpleCpuIoLib.h new file mode 100644 index 0000000000..ca666def6a --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/Include/SimpleCpuIoLib.h @@ -0,0 +1,93 @@ +/*++ + +Copyright (c) 2004 - 2007, 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: + + SimpleCpuIoLib.h + +Abstract: + + Light weight monolithic Cpu Io Lib to support PEI Modules. + +--*/ + +#ifndef _PEI_SIMPLE_CPU_IO_LIB_H_ +#define _PEI_SIMPLE_CPU_IO_LIB_H_ + +// +// Base IO Class Functions +// +UINT8 +IoRead8 ( + IN UINT64 Address + ) +; + +UINT16 +IoRead16 ( + IN UINT64 Address + ) +; + +UINT32 +IoRead32 ( + IN UINT64 Address + ) +; + +VOID +IoWrite8 ( + IN UINT64 Address, + IN UINT8 Data + ) +; + +VOID +IoWrite16 ( + IN UINT64 Address, + IN UINT16 Data + ) +; + +VOID +IoWrite32 ( + IN UINT64 Address, + IN UINT32 Data + ) +; + +UINT32 +MemRead32 ( + IN UINT64 Address + ) +; + +UINT64 +MemRead64 ( + IN UINT64 Address + ) +; + +VOID +MemWrite32 ( + IN UINT64 Address, + IN UINT32 Data + ) +; + +VOID +MemWrite64 ( + IN UINT64 Address, + IN UINT64 Data + ) +; + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.c b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.c new file mode 100644 index 0000000000..be82428869 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.c @@ -0,0 +1,521 @@ +/*++ + +Copyright (c) 2004 - 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: + + MemoryStatusCode.c + +Abstract: + + Lib to provide memory journal status code reporting Routines. + +--*/ + +#include "MemoryStatusCode.h" +#include "PeiLib.h" +#include "MonoStatusCode.h" + +// +// Global variable. Not accessible while running from flash. +// After we relocate ourselves into memory, we update this +// and use it to determine if we are running from flash or memory. +// +BOOLEAN mRunningFromMemory = FALSE; + +// +// Global variable used to replace the PPI once we start running from memory. +// +PEI_STATUS_CODE_MEMORY_PPI mStatusCodeMemoryPpi = { 0, 0, 0, 0 }; + +// +// PPI descriptor for the MonoStatusCode PEIM, see MonoStatusCode.c +// +extern EFI_PEI_PPI_DESCRIPTOR mPpiListStatusCode; + +VOID +EFIAPI +MemoryInitializeStatusCode ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ) +/*++ + +Routine Description: + + Initialization routine. + Allocates heap space for storing Status Codes. + Installs a PPI to point to that heap space. + Installs a callback to switch to memory. + Installs a callback to + +Arguments: + + FfsHeader - FV this PEIM was loaded from. + PeiServices - General purpose services available to every PEIM. + +Returns: + + None + +--*/ +{ + EFI_STATUS Status; + MEMORY_STATUS_CODE_INSTANCE *PrivateData; + PEI_STATUS_CODE_MEMORY_PPI *StatusCodeMemoryPpi; + PEI_STATUS_CODE_PPI *ReportStatusCodePpi; + EFI_PHYSICAL_ADDRESS Buffer; + VOID *StartPointer; + UINTN Length; + UINTN LastEntry; + EFI_PEI_PPI_DESCRIPTOR *ReportStatusCodeDescriptor; + EFI_PEI_PPI_DESCRIPTOR *StatusCodeMemoryDescriptor; + + // + // Determine if we are being called after relocation into memory. + // + if (!mRunningFromMemory) { + // + // If we are not running from memory, we need to allocate some heap and + // install the PPI + // + // + // Allocate heap storage for the journal + // + Status = (*PeiServices)->AllocatePool ( + PeiServices, + PEI_STATUS_CODE_HEAP_LENGTH, + &StartPointer + ); + + // + // This is not a required feature to boot. + // + if (EFI_ERROR (Status)) { + return ; + } + // + // Allocate heap storage for private data + // The private data contains the FFS header for this PEIM, + // a PPI containing information about the status code journal, and + // a notification for the LoadFile service, to relocate the PEIM into + // memory. + // + Status = (*PeiServices)->AllocatePool ( + PeiServices, + sizeof (MEMORY_STATUS_CODE_INSTANCE), + &PrivateData + ); + + // + // This is not a required feature to boot. + // + if (EFI_ERROR (Status)) { + return ; + } + // + // Update the contents of the private data. + // + PrivateData->Signature = MEMORY_STATUS_CODE_SIGNATURE; + PrivateData->This = PrivateData; + PrivateData->FfsHeader = FfsHeader; + PrivateData->PpiDescriptor.Flags = (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST); + PrivateData->PpiDescriptor.Guid = &gPeiStatusCodeMemoryPpiGuid; + PrivateData->PpiDescriptor.Ppi = &PrivateData->StatusCodeMemoryPpi; + PrivateData->StatusCodeMemoryPpi.FirstEntry = 0; + PrivateData->StatusCodeMemoryPpi.LastEntry = 0; + PrivateData->StatusCodeMemoryPpi.Address = (EFI_PHYSICAL_ADDRESS) (UINTN) StartPointer; + PrivateData->StatusCodeMemoryPpi.Length = PEI_STATUS_CODE_HEAP_LENGTH; +#if (PI_SPECIFICATION_VERSION < 0x00010000) + PrivateData->NotifyDescriptor.Flags = + ( + EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | + EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST + ); + PrivateData->NotifyDescriptor.Guid = &gPeiFvFileLoaderPpiGuid; + PrivateData->NotifyDescriptor.Notify = LoadImageCallback; +#endif + // + // Publish the PPI + // + Status = (*PeiServices)->InstallPpi (PeiServices, &PrivateData->PpiDescriptor); + if (EFI_ERROR (Status)) { + return ; + } + // + // Post a callback to relocate to memory + // +#if (PI_SPECIFICATION_VERSION < 0x00010000) + Status = (**PeiServices).NotifyPpi (PeiServices, &PrivateData->NotifyDescriptor); + if (EFI_ERROR (Status)) { + return ; + } +#endif + } else { + // + // If we are running from memory, we need to copy from the heap to a RT + // memory buffer. + // + // + // Locate Journal + // + Status = (*PeiServices)->LocatePpi ( + PeiServices, + &gPeiStatusCodeMemoryPpiGuid, + 0, + &StatusCodeMemoryDescriptor, + &StatusCodeMemoryPpi + ); + if (EFI_ERROR (Status)) { + return ; + } + // + // Get private data + // + PrivateData = MEMORY_STATUS_CODE_FROM_DESCRIPTOR_THIS (StatusCodeMemoryDescriptor); + + // + // At this point, we need to fix up any addresses that we have as the heap + // has moved. + // + PrivateData->PpiDescriptor.Ppi = &PrivateData->StatusCodeMemoryPpi; + PrivateData->PpiDescriptor.Guid = &gPeiStatusCodeMemoryPpiGuid; + PrivateData->StatusCodeMemoryPpi.Address = PrivateData->StatusCodeMemoryPpi.Address + + (UINTN) PrivateData - (UINTN) PrivateData->This; + PrivateData->This = PrivateData; +#if (PI_SPECIFICATION_VERSION < 0x00010000) + PrivateData->NotifyDescriptor.Guid = &gPeiFvFileLoaderPpiGuid; + PrivateData->NotifyDescriptor.Notify = LoadImageCallback; +#endif + + // + // Allocate RT memory. + // + Status = (*PeiServices)->AllocatePages ( + PeiServices, + EfiRuntimeServicesData, + PEI_STATUS_CODE_RT_PAGES, + &Buffer + ); + if (EFI_ERROR (Status)) { + return ; + } + + DEBUG_CODE ( + EfiCommonLibZeroMem ((VOID *) (UINTN) Buffer, PEI_STATUS_CODE_RT_LENGTH); + ) + // + // Copy the heap to the allocated memory. + // Unwind the rolling queue to start at 0 in the new space. We need to do + // this because the new queue is much bigger than the heap allocation. + // + if (PEI_STATUS_CODE_RT_LENGTH <= PEI_STATUS_CODE_HEAP_LENGTH) { + return ; + } + + if (StatusCodeMemoryPpi->LastEntry >= StatusCodeMemoryPpi->FirstEntry) { + LastEntry = StatusCodeMemoryPpi->LastEntry - StatusCodeMemoryPpi->FirstEntry; + StartPointer = (VOID *) ((UINTN) StatusCodeMemoryPpi->Address + (StatusCodeMemoryPpi->FirstEntry * sizeof (EFI_STATUS_CODE_ENTRY))); + Length = (StatusCodeMemoryPpi->LastEntry - StatusCodeMemoryPpi->FirstEntry) * sizeof (EFI_STATUS_CODE_ENTRY); + (*PeiServices)->CopyMem ((VOID *) (UINTN) Buffer, StartPointer, Length); + } else { + // + // The last entry will be the new last entry after moving heap to buffer + // + LastEntry = (PEI_STATUS_CODE_MAX_HEAP_ENTRY - StatusCodeMemoryPpi->FirstEntry) + StatusCodeMemoryPpi->LastEntry; + // + // Copy from the first entry to the end of the heap + // + StartPointer = (VOID *) ((UINTN) StatusCodeMemoryPpi->Address + (StatusCodeMemoryPpi->FirstEntry * sizeof (EFI_STATUS_CODE_ENTRY))); + Length = PEI_STATUS_CODE_HEAP_LENGTH - (StatusCodeMemoryPpi->FirstEntry * sizeof (EFI_STATUS_CODE_ENTRY)); + (*PeiServices)->CopyMem ((VOID *) (UINTN) Buffer, StartPointer, Length); + // + // Copy from the start to the heap to the last entry + // + StartPointer = (VOID *) (UINTN) StatusCodeMemoryPpi->Address; + (*PeiServices)->CopyMem ( + (VOID *) (UINTN) (Buffer + Length), + StartPointer, + (StatusCodeMemoryPpi->LastEntry * sizeof (EFI_STATUS_CODE_ENTRY)) + ); + }; + + // + // Update the PPI to NULL, so it will not be used. + // + StatusCodeMemoryPpi->FirstEntry = 0; + StatusCodeMemoryPpi->LastEntry = 0; + StatusCodeMemoryPpi->Address = 0; + StatusCodeMemoryPpi->Length = 0; + + // + // Update in memory version of PPI that will be used. + // + mStatusCodeMemoryPpi.FirstEntry = 0; + mStatusCodeMemoryPpi.LastEntry = LastEntry; + mStatusCodeMemoryPpi.Address = (EFI_PHYSICAL_ADDRESS) (UINTN) Buffer; + mStatusCodeMemoryPpi.Length = PEI_STATUS_CODE_RT_LENGTH; + + // + // Reinstall the report status code function + // + // + // Locate status code PPI + // + Status = (*PeiServices)->LocatePpi ( + PeiServices, + &gPeiStatusCodePpiGuid, + 0, + &ReportStatusCodeDescriptor, + &ReportStatusCodePpi + ); + if (EFI_ERROR (Status)) { + return ; + } + // + // Reinstall the ReportStatusCode interface using the memory-based + // descriptor + // + Status = (*PeiServices)->ReInstallPpi ( + PeiServices, + ReportStatusCodeDescriptor, + &mPpiListStatusCode + ); + if (EFI_ERROR (Status)) { + EFI_BREAKPOINT (); + return ; + } + // + // Publish a GUIDed HOB that contains a pointer to the status code PPI + // structure. This is a bit of a short cut as I just used the PPI GUID to + // identify the HOB. This HOB is caught by the DXE status code memory + // listener and used to find the journal. + // + StatusCodeMemoryPpi = &mStatusCodeMemoryPpi; + Status = PeiBuildHobGuidData ( + PeiServices, + &gPeiStatusCodeMemoryPpiGuid, + &StatusCodeMemoryPpi, + sizeof (VOID *) + ); + if (EFI_ERROR (Status)) { + EFI_BREAKPOINT (); + return ; + } + } +} + +EFI_STATUS +EFIAPI +MemoryReportStatusCode ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId , + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +/*++ + +Routine Description: + + Provide a memory status code + +Arguments: + + Same as ReportStatusCode PPI + +Returns: + + EFI_SUCCESS This function always returns success + +--*/ +{ + EFI_STATUS Status; + PEI_STATUS_CODE_MEMORY_PPI *StatusCodeMemoryPpi; + EFI_STATUS_CODE_ENTRY *CurrentEntry; + UINTN LastEntry; + MEMORY_STATUS_CODE_INSTANCE *PrivateData; + EFI_PEI_PPI_DESCRIPTOR *StatusCodeMemoryDescriptor; + + // + // We don't care to log debug codes. + // + if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) { + return EFI_SUCCESS; + } + + if (!mRunningFromMemory) { + // + // If we are called from DXE and have not been reinstalled into memory, we + // can no longer locate the journal, so we can no longer log status codes. + // + if (!PeiServices) { + return EFI_SUCCESS; + } + // + // Locate Journal + // + Status = (*PeiServices)->LocatePpi ( + PeiServices, + &gPeiStatusCodeMemoryPpiGuid, + 0, + &StatusCodeMemoryDescriptor, + &StatusCodeMemoryPpi + ); + if (EFI_ERROR (Status)) { + return EFI_SUCCESS; + } + // + // Determine the last entry in the journal. + // This is needed to properly implement the rolling queue. + // + LastEntry = PEI_STATUS_CODE_MAX_HEAP_ENTRY; + + // + // Get private data + // + PrivateData = MEMORY_STATUS_CODE_FROM_DESCRIPTOR_THIS (StatusCodeMemoryDescriptor); + + // + // Once memory gets installed, heap gets moved to real memory. + // We need to fix up the pointers to match the move. + // + PrivateData->PpiDescriptor.Ppi = &PrivateData->StatusCodeMemoryPpi; + PrivateData->PpiDescriptor.Guid = &gPeiStatusCodeMemoryPpiGuid; + PrivateData->StatusCodeMemoryPpi.Address = PrivateData->StatusCodeMemoryPpi.Address + + (UINTN) PrivateData - (UINTN) PrivateData->This; + PrivateData->This = PrivateData; +#if (PI_SPECIFICATION_VERSION < 0x00010000) + PrivateData->NotifyDescriptor.Guid = &gPeiFvFileLoaderPpiGuid; + PrivateData->NotifyDescriptor.Notify = LoadImageCallback; +#endif + StatusCodeMemoryPpi = PrivateData->PpiDescriptor.Ppi; + } else { + // + // Use global/memory copy of the PPI + // + StatusCodeMemoryPpi = &mStatusCodeMemoryPpi; + + // + // Determine the last entry in the journal. + // This is needed to properly implement the rolling queue. + // + LastEntry = PEI_STATUS_CODE_MAX_RT_ENTRY; + } + // + // Return if we are using a cleared PPI somehow + // + if (!StatusCodeMemoryPpi->Address || !StatusCodeMemoryPpi->Length) { + return EFI_SUCCESS; + } + // + // Update the latest entry in the journal (may actually be first due to rolling + // queue). + // + CurrentEntry = (EFI_STATUS_CODE_ENTRY *) (UINTN) (StatusCodeMemoryPpi->Address + (StatusCodeMemoryPpi->LastEntry * sizeof (EFI_STATUS_CODE_ENTRY))); + + StatusCodeMemoryPpi->LastEntry = (StatusCodeMemoryPpi->LastEntry + 1) % LastEntry; + if (StatusCodeMemoryPpi->LastEntry == StatusCodeMemoryPpi->FirstEntry) { + StatusCodeMemoryPpi->FirstEntry = (StatusCodeMemoryPpi->FirstEntry + 1) % LastEntry; + } + + CurrentEntry->Type = CodeType; + CurrentEntry->Value = Value; + CurrentEntry->Instance = Instance; + + return EFI_SUCCESS; +} + + +#if (PI_SPECIFICATION_VERSION < 0x00010000) + +EFI_STATUS +EFIAPI +LoadImageCallback ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, + IN VOID *Ppi + ) +/*++ + +Routine Description: + + Relocate the PEIM into memory. + + Once load protocol becomes available, relocate our PEIM into memory. + The primary benefit is to eliminate the blackout window that we would have in + the memory log between the end of PEI and the status code DXE driver taking + control. If we don't do this, we cannot determine where our memory journal + is located and cannot function. + + A second benefit is speed optimization throughout DXE. + +Arguments: + + PeiServices - General purpose services available to every PEIM. + NotifyDescriptor - Information about the notify event. + Ppi - Context + +Returns: + + EFI_SUCCESS This function always returns success. + +--*/ +{ + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS ImageAddress; + EFI_PHYSICAL_ADDRESS EntryPoint; + UINT64 ImageSize; + MEMORY_STATUS_CODE_INSTANCE *PrivateData; + + // + // Relocate to memory + // + if (!mRunningFromMemory) { + // + // Use the callback descriptor to get the FfsHeader + // + PrivateData = MEMORY_STATUS_CODE_FROM_NOTIFY_THIS (NotifyDescriptor); + + Status = ((EFI_PEI_FV_FILE_LOADER_PPI *) Ppi)->FvLoadFile ( + Ppi, + PrivateData->FfsHeader, + &ImageAddress, + &ImageSize, + &EntryPoint + ); + if (EFI_ERROR (Status)) { + return EFI_SUCCESS; + } + // + // Set the flag in the loaded image that indicates the PEIM is executing + // from memory. + // +#ifdef EFI_NT_EMULATOR + // + // For NT32, we should also relocate image here, because if the DLL + // is already load, we will NOT load it twice. This feature is added to + // prevent loading driver twice in DXE phase cause system crash. + // + * (BOOLEAN *) ((UINTN) &mRunningFromMemory + (UINTN) EntryPoint - (UINTN) InstallMonoStatusCode) = TRUE; +#else + * (BOOLEAN *) ((UINTN) &mRunningFromMemory + (UINTN) EntryPoint - (UINTN) InstallMonoStatusCode) = TRUE; +#endif + Status = ((EFI_PEIM_ENTRY_POINT )(UINTN) EntryPoint) (PrivateData->FfsHeader, PeiServices); + if (EFI_ERROR (Status)) { + return EFI_SUCCESS; + } + } + + return EFI_SUCCESS; +} +#endif + diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h new file mode 100644 index 0000000000..b6660b0452 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.h @@ -0,0 +1,103 @@ +/*++ + +Copyright (c) 2004, 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: + + MemoryStatusCode.h + +Abstract: + + Lib to provide status code reporting via memory. + +--*/ + +#ifndef _PEI_MEMORY_STATUS_CODE_H_ +#define _PEI_MEMORY_STATUS_CODE_H_ + +// +// Statements that include other files +// +#include "Tiano.h" +#include "Pei.h" +#include "SimpleCpuIoLib.h" +#include "EfiCommonLib.h" + +// +// Produced PPI +// +#include EFI_PPI_PRODUCER (StatusCodeMemory) +#include EFI_PPI_PRODUCER (StatusCode) + +// +// Ppi Consumed For Notification +// +#include EFI_PPI_CONSUMER (MemoryDiscovered) +#if (PI_SPECIFICATION_VERSION < 0x00010000) +#include EFI_PPI_CONSUMER (LoadFile) +#endif +// +// Private data +// +// +// Define the amount of heap to use before memory is allocated +// +#define PEI_STATUS_CODE_HEAP_LENGTH 512 +#define PEI_STATUS_CODE_MAX_HEAP_ENTRY (PEI_STATUS_CODE_HEAP_LENGTH / sizeof (EFI_STATUS_CODE_ENTRY)) + +// +// Define the number of 4K pages of BS memory to allocate (1MB) +// +#define PEI_STATUS_CODE_RT_PAGES (128) +#define PEI_STATUS_CODE_RT_LENGTH (PEI_STATUS_CODE_RT_PAGES * 1024 * 4) +#define PEI_STATUS_CODE_MAX_RT_ENTRY (PEI_STATUS_CODE_RT_LENGTH / sizeof (EFI_STATUS_CODE_ENTRY)) + +// +// Define a private data structure +// +#define MEMORY_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('M', 'S', 'C', 'S') + +typedef struct _MEMORY_STATUS_CODE_INSTANCE { + UINT32 Signature; + struct _MEMORY_STATUS_CODE_INSTANCE *This; + EFI_FFS_FILE_HEADER *FfsHeader; + EFI_PEI_PPI_DESCRIPTOR PpiDescriptor; + PEI_STATUS_CODE_MEMORY_PPI StatusCodeMemoryPpi; +#if (PI_SPECIFICATION_VERSION < 0x00010000) + EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor; +#endif +} MEMORY_STATUS_CODE_INSTANCE; + +#define MEMORY_STATUS_CODE_FROM_DESCRIPTOR_THIS(a) \ + PEI_CR (a, \ + MEMORY_STATUS_CODE_INSTANCE, \ + PpiDescriptor, \ + MEMORY_STATUS_CODE_SIGNATURE \ + ) +#define MEMORY_STATUS_CODE_FROM_NOTIFY_THIS(a) \ + PEI_CR (a, \ + MEMORY_STATUS_CODE_INSTANCE, \ + NotifyDescriptor, \ + MEMORY_STATUS_CODE_SIGNATURE \ + ) + +// +// Private function declarations +// +EFI_STATUS +EFIAPI +LoadImageCallback ( + IN EFI_PEI_SERVICES **PeiServices, + IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor, + IN VOID *Ppi + ) +; + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.inf b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.inf new file mode 100644 index 0000000000..2db56d6bf8 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/MonoStatusCode/Library/Pei/MemoryStatusCode/MemoryStatusCode.inf @@ -0,0 +1,50 @@ +#/*++ +# +# Copyright (c) 2004, 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: +# +# MemoryStatusCode.inf +# +# Abstract: +# +# Library producing a memory status code functionality. +# +#--*/ + +[defines] +BASE_NAME = MemoryStatusCodeLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + MemoryStatusCode.c + MemoryStatusCode.h + +[includes.common] + $(EDK_SOURCE)\Foundation + $(EDK_SOURCE)\Foundation\Framework + $(EDK_SOURCE)\Foundation\Efi + . + $(EDK_SOURCE)\Foundation\Include + $(EDK_SOURCE)\Foundation\Efi\Include + $(EDK_SOURCE)\Foundation\Framework\Include + $(EDK_SOURCE)\Foundation\Include\IndustryStandard + $(EDK_SOURCE)\Foundation\Core\Dxe + $(EDK_SOURCE)\Foundation\Library\Dxe\Include + $(EDK_SOURCE)\Foundation\Include\Pei + $(EDK_SOURCE)\Foundation\Library\Pei\Include + $(EDK_SOURCE)\Sample\Platform\Generic\MonoStatusCode\Pei + $(EDK_SOURCE)\Sample\Platform\Generic\MonoStatusCode\Library\Pei\Include + +[libraries.platform] + EdkPpiLib + EdkFrameworkPpiLib + +[nmake.common] diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsDataHubStatusCode/BsDataHubStatusCode.c b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsDataHubStatusCode/BsDataHubStatusCode.c new file mode 100644 index 0000000000..e950126c4f --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsDataHubStatusCode/BsDataHubStatusCode.c @@ -0,0 +1,491 @@ +/*++ + +Copyright (c) 2004 - 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: + + BsDataHubStatusCode.c + +Abstract: + + This implements a status code listener that logs status codes into the data + hub. This is only active during non-runtime DXE. + The status codes are recorded in a extensiable buffer, and a event is signalled + to log them to the data hub. The recorder is the producer of the status code in + buffer and the event notify function the consummer. + +--*/ + +#include "BsDataHubStatusCode.h" + +// +// Globals only work at BootService Time. NOT at Runtime! +// +static EFI_DATA_HUB_PROTOCOL *mDataHub; +static EFI_LIST_ENTRY *mRecordHead; +static EFI_LIST_ENTRY *mRecordTail; +static INTN mRecordNum = 0; +static EFI_EVENT mLogDataHubEvent; +static EFI_LOCK mStatusCodeReportLock = EFI_INITIALIZE_LOCK_VARIABLE(EFI_TPL_HIGH_LEVEL); +static BOOLEAN mEventHandlerActive = FALSE; + + +STATUS_CODE_RECORD_LIST * +AllocateRecordBuffer ( + VOID + ) +/*++ + +Routine Description: + + Allocate a new record list node and initialize it. + Inserting the node into the list isn't the task of this function. + +Arguments: + + None + +Returns: + + A pointer to the new allocated node or NULL if non available + +--*/ +{ + STATUS_CODE_RECORD_LIST *DataBuffer; + + DataBuffer = NULL; + + gBS->AllocatePool (EfiBootServicesData, sizeof (STATUS_CODE_RECORD_LIST), &DataBuffer); + if (DataBuffer == NULL) { + return NULL; + } + + EfiCommonLibZeroMem (DataBuffer, sizeof (STATUS_CODE_RECORD_LIST)); + DataBuffer->Signature = BS_DATA_HUB_STATUS_CODE_SIGNATURE; + + return DataBuffer; +} + +DATA_HUB_STATUS_CODE_DATA_RECORD * +AquireEmptyRecordBuffer ( + VOID + ) +/*++ + +Routine Description: + + Acquire an empty record buffer from the record list if there's free node, + or allocate one new node and insert it to the list if the list is full and + the function isn't run in EFI_TPL_HIGH_LEVEL. + +Arguments: + + None + +Returns: + + Pointer to new record buffer. NULL if none available. + +--*/ +{ + EFI_TPL OldTpl; + STATUS_CODE_RECORD_LIST *DataBuffer; + + DataBuffer = NULL; + + // + // This function must be reentrant because an event with higher priority may interrupt it + // and also report status code. + // + EfiAcquireLock (&mStatusCodeReportLock); + if (mRecordTail != mRecordHead->ForwardLink) { + if (mRecordNum != 0) { + mRecordHead = mRecordHead->ForwardLink; + } + DataBuffer = CR (mRecordHead, STATUS_CODE_RECORD_LIST, Link, BS_DATA_HUB_STATUS_CODE_SIGNATURE); + mRecordNum++; + EfiReleaseLock (&mStatusCodeReportLock); + + // + // Initalize the record buffer is the responsibility of the producer, + // because the consummer is in a lock so must keep it short. + // + EfiCommonLibZeroMem (&DataBuffer->RecordBuffer[0], BYTES_PER_BUFFER); + } else if (mRecordNum < MAX_RECORD_NUM) { + // + // The condition of "mRecordNum < MAX_RECORD_NUM" is not promised, + // because mRecodeNum may be increased out of this lock. + // + EfiReleaseLock (&mStatusCodeReportLock); + + // + // Can't allocate additional buffer in EFI_TPL_HIGH_LEVEL. + // Reporting too many status code in EFI_TPL_HIGH_LEVEL may cause status code lost. + // + OldTpl = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL); + if (OldTpl == EFI_TPL_HIGH_LEVEL) { + return NULL; + } + gBS->RestoreTPL (OldTpl); + DataBuffer = AllocateRecordBuffer (); + if (DataBuffer == NULL) { + return NULL; + } + EfiAcquireLock (&mStatusCodeReportLock); + InsertHeadList (mRecordHead, &DataBuffer->Link); + mRecordHead = mRecordHead->ForwardLink; + mRecordNum++; + EfiReleaseLock (&mStatusCodeReportLock); + } else { + EfiReleaseLock (&mStatusCodeReportLock); + return NULL; + } + + return (DATA_HUB_STATUS_CODE_DATA_RECORD *) DataBuffer->RecordBuffer; +} + +EFI_STATUS +ReleaseRecordBuffer ( + IN STATUS_CODE_RECORD_LIST *RecordBuffer + ) +/*++ + +Routine Description: + + Release a buffer in the list, remove some nodes to keep the list inital length. + +Arguments: + + RecordBuffer - Buffer to release + +Returns: + + EFI_SUCCESS - If DataRecord is valid + EFI_UNSUPPORTED - The record list has empty + +--*/ +{ + ASSERT (RecordBuffer != NULL); + + // + // The consummer needn't to be reentrient and the producer won't do any meaningful thing + // when consummer is logging records. + // + if (mRecordNum <= 0) { + return EFI_UNSUPPORTED; + } else if (mRecordNum > INITIAL_RECORD_NUM) { + mRecordTail = mRecordTail->ForwardLink; + RemoveEntryList (&RecordBuffer->Link); + mRecordNum--; + gBS->FreePool (RecordBuffer); + } else { + if (mRecordNum != 1) { + mRecordTail = mRecordTail->ForwardLink; + } + mRecordNum--; + } + + return EFI_SUCCESS; +} + +EFI_BOOTSERVICE +EFI_STATUS +EFIAPI +BsDataHubReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +/*++ + +Routine Description: + + Boot service report status code listener. This function logs the status code + into the data hub. + +Arguments: + + Same as gRT->ReportStatusCode (See Tiano Runtime Specification) + +Returns: + + None + +--*/ +{ + DATA_HUB_STATUS_CODE_DATA_RECORD *DataHub; + UINT32 ErrorLevel; + VA_LIST Marker; + CHAR8 *Format; + UINTN Index; + CHAR16 FormatBuffer[BYTES_PER_RECORD]; + + DataHub = NULL; + + if (EfiAtRuntime ()) { + // + // For now all we do is post code at runtime + // + return EFI_SUCCESS; + } + // + // If we had an error while in our event handler, then do nothing so + // that we don't get in an endless loop. + // + if (mEventHandlerActive) { + return EFI_SUCCESS; + } + + DataHub = (DATA_HUB_STATUS_CODE_DATA_RECORD *) AquireEmptyRecordBuffer (); + if (DataHub == NULL) { + // + // There are no empty record buffer in private buffers + // + return EFI_OUT_OF_RESOURCES; + } + // + // Construct Data Hub Extended Data + // + DataHub->CodeType = CodeType; + DataHub->Value = Value; + DataHub->Instance = Instance; + + if (CallerId != NULL) { + EfiCopyMem (&DataHub->CallerId, CallerId, sizeof (EFI_GUID)); + } else { + EfiZeroMem (&DataHub->CallerId, sizeof (EFI_GUID)); + } + + if (Data == NULL) { + EfiZeroMem (&DataHub->Data, sizeof (EFI_STATUS_CODE_DATA)); + } else { + // + // Copy generic Header + // + EfiCopyMem (&DataHub->Data, Data, sizeof (EFI_STATUS_CODE_DATA)); + + if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) { + // + // Convert Ascii Format string to Unicode. + // + for (Index = 0; Format[Index] != '\0' && Index < (BYTES_PER_RECORD - 1); Index += 1) { + FormatBuffer[Index] = (CHAR16) Format[Index]; + } + + FormatBuffer[Index] = L'\0'; + + // + // Put processed string into the buffer + // + Index = VSPrint ( + (UINT16 *) (DataHub + 1), + BYTES_PER_RECORD - (sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD)), + FormatBuffer, + Marker + ); + + // + // DATA_HUB_STATUS_CODE_DATA_RECORD followed by VSPrint String Buffer + // + DataHub->Data.Size = (UINT16) (Index * sizeof (CHAR16)); + + } else { + // + // Default behavior is to copy optional data + // + if (Data->Size > (BYTES_PER_RECORD - sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD))) { + DataHub->Data.Size = (UINT16) (BYTES_PER_RECORD - sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD)); + } + + EfiCopyMem (DataHub + 1, Data + 1, DataHub->Data.Size); + } + } + + gBS->SignalEvent (mLogDataHubEvent); + + return EFI_SUCCESS; +} + +VOID +EFIAPI +LogDataHubEventHandler ( + IN EFI_EVENT Event, + IN VOID *Context + ) +/*++ + +Routine Description: + + The Event handler which will be notified to log data in Data Hub. + +Arguments: + + Event - Instance of the EFI_EVENT to signal whenever data is + available to be logged in the system. + Context - Context of the event. + +Returns: + + None. + +--*/ +{ + EFI_STATUS Status; + DATA_HUB_STATUS_CODE_DATA_RECORD *DataRecord; + UINTN Size; + UINT64 DataRecordClass; + EFI_LIST_ENTRY *Link; + STATUS_CODE_RECORD_LIST *BufferEntry; + + // + // Set our global flag so we don't recurse if we get an error here. + // + mEventHandlerActive = TRUE; + + // + // Log DataRecord in Data Hub. + // If there are multiple DataRecords, Log all of them. + // + Link = mRecordTail; + + while (mRecordNum != 0) { + BufferEntry = CR (Link, STATUS_CODE_RECORD_LIST, Link, BS_DATA_HUB_STATUS_CODE_SIGNATURE); + DataRecord = (DATA_HUB_STATUS_CODE_DATA_RECORD *) (BufferEntry->RecordBuffer); + Link = Link->ForwardLink; + + // + // Add in the size of the header we added. + // + Size = sizeof (DATA_HUB_STATUS_CODE_DATA_RECORD) + DataRecord->Data.Size; + + if ((DataRecord->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) { + DataRecordClass = EFI_DATA_RECORD_CLASS_PROGRESS_CODE; + } else if ((DataRecord->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) { + DataRecordClass = EFI_DATA_RECORD_CLASS_ERROR; + } else if ((DataRecord->CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) { + DataRecordClass = EFI_DATA_RECORD_CLASS_DEBUG; + } else { + // + // Should never get here. + // + DataRecordClass = EFI_DATA_RECORD_CLASS_DEBUG | + EFI_DATA_RECORD_CLASS_ERROR | + EFI_DATA_RECORD_CLASS_DATA | + EFI_DATA_RECORD_CLASS_PROGRESS_CODE; + } + + if (((DataRecord->Instance & EFI_D_ERROR) != 0) && + (((DataRecord->Instance & EFI_D_POOL) != 0) || ((DataRecord->Instance & EFI_D_PAGE) != 0)) + ) { + // + // If memory error, do not call LogData (). + // + ErrorPrint (L"ERROR", "Memory Error\n"); + Status = EFI_OUT_OF_RESOURCES; + } else { + // + // We don't log EFI_D_POOL and EFI_D_PAGE debug info to datahub + // to avoid recursive logging due to the memory allocation in datahub + // + if (DataRecordClass != EFI_DATA_RECORD_CLASS_DEBUG || + ((DataRecord->Instance & EFI_D_POOL) == 0 && (DataRecord->Instance & EFI_D_PAGE) == 0)) { + // + // Log DataRecord in Data Hub + // + Status = mDataHub->LogData ( + mDataHub, + &gEfiStatusCodeGuid, + &gEfiStatusCodeRuntimeProtocolGuid, + DataRecordClass, + DataRecord, + (UINT32) Size + ); + } + } + + ReleaseRecordBuffer (BufferEntry); + } + + mEventHandlerActive = FALSE; + + return ; +} + +EFI_BOOTSERVICE +EFI_STATUS +BsDataHubInitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Install a data hub listener. + +Arguments: + + (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT) + +Returns: + + EFI_SUCCESS - Logging Hub protocol installed + Other - No protocol installed, unload driver. + +--*/ +{ + EFI_STATUS Status; + STATUS_CODE_RECORD_LIST *DataBuffer; + UINTN Index1; + + DataBuffer = NULL; + + Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, &mDataHub); + // + // Should never fail due to dependency grammer + // + ASSERT_EFI_ERROR (Status); + + // + // Initialize a record list with length not greater than INITIAL_RECORD_NUM. + // If no buffer can be allocated, return EFI_OUT_OF_RESOURCES. + // + DataBuffer = AllocateRecordBuffer (); + if (DataBuffer == NULL) { + return EFI_OUT_OF_RESOURCES; + } + mRecordHead = &DataBuffer->Link; + mRecordTail = mRecordHead; + InitializeListHead (mRecordHead); + + for (Index1 = 1; Index1 < INITIAL_RECORD_NUM; Index1++) { + DataBuffer = AllocateRecordBuffer (); + if (DataBuffer == NULL) { + break; + } + InsertHeadList (mRecordHead, &DataBuffer->Link); + } + + + // + // Create a Notify Event to log data in Data Hub + // + Status = gBS->CreateEvent ( + EFI_EVENT_NOTIFY_SIGNAL, + EFI_TPL_CALLBACK, + LogDataHubEventHandler, + NULL, + &mLogDataHubEvent + ); + + return EFI_SUCCESS; +} diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsDataHubStatusCode/BsDataHubStatusCode.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsDataHubStatusCode/BsDataHubStatusCode.h new file mode 100644 index 0000000000..7f5d026859 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsDataHubStatusCode/BsDataHubStatusCode.h @@ -0,0 +1,156 @@ +/*++ + +Copyright (c) 2004 - 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: + + BsDataHubStatusCode.h + +Abstract: + + Header for the status code data hub logging component + +--*/ + +#ifndef _EFI_BS_DATA_HUB_STATUS_CODE_H_ +#define _EFI_BS_DATA_HUB_STATUS_CODE_H_ + + +// Statements that include other files. +// +#include "Tiano.h" +#include "EfiCommonLib.h" +#include "EfiRuntimeLib.h" +#include "EfiPrintLib.h" +#include "EfiStatusCode.h" + +// +// Dependent protocols +// +#include EFI_PROTOCOL_DEPENDENCY (DataHub) + +// +// Consumed protocols +// +#include EFI_ARCH_PROTOCOL_CONSUMER (StatusCode) + +// +// GUID definitions +// +#include EFI_GUID_DEFINITION (StatusCode) +#include EFI_GUID_DEFINITION (StatusCodeCallerId) +#include EFI_GUID_DEFINITION (StatusCodeDataTypeId) + +// +// Private data declarations +// +#define MAX_RECORD_NUM 1000 +#define INITIAL_RECORD_NUM 20 +#define BYTES_PER_RECORD EFI_STATUS_CODE_DATA_MAX_SIZE +#define BYTES_PER_BUFFER (BYTES_PER_RECORD * sizeof (UINT8)) + +#define BS_DATA_HUB_STATUS_CODE_SIGNATURE EFI_SIGNATURE_32 ('B', 'D', 'H', 'S') + +typedef struct { + UINTN Signature; + EFI_LIST_ENTRY Link; + UINT8 RecordBuffer[BYTES_PER_RECORD]; +} STATUS_CODE_RECORD_LIST; + +// +// Function prototypes +// +STATUS_CODE_RECORD_LIST * +AllocateRecordBuffer ( + VOID + ); +/*++ + +Routine Description: + + Allocate a new record list node and initialize it. + Inserting the node into the list isn't the task of this function. + +Arguments: + + None + +Returns: + + A pointer to the new allocated node or NULL if non available + +--*/ + +DATA_HUB_STATUS_CODE_DATA_RECORD * +AquireEmptyRecordBuffer ( + VOID + ); +/*++ + +Routine Description: + + Acquire an empty record buffer from the record list if there's free node, + or allocate one new node and insert it to the list if the list is full and + the function isn't run in EFI_TPL_HIGH_LEVEL. + +Arguments: + + None + +Returns: + + Pointer to new record buffer. NULL if none available. + +--*/ + +EFI_STATUS +ReleaseRecordBuffer ( + IN STATUS_CODE_RECORD_LIST *RecordBuffer + ); +/*++ + +Routine Description: + + Release a buffer in the list, remove some nodes to keep the list inital length. +Arguments: + + RecordBuffer - Buffer to release + +Returns: + + EFI_SUCCESS - If DataRecord is valid + EFI_UNSUPPORTED - The record list has empty + +--*/ + +void +EFIAPI +LogDataHubEventHandler ( + IN EFI_EVENT Event, + IN VOID *Context + ); +/*++ + +Routine Description: + + The Event handler which will be notified to log data in Data Hub. + +Arguments: + + Event - Instance of the EFI_EVENT to signal whenever data is + available to be logged in the system. + Context - Context of the event. + +Returns: + + None. + +--*/ +#endif \ No newline at end of file diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsDataHubStatusCode/BsDataHubStatusCode.inf b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsDataHubStatusCode/BsDataHubStatusCode.inf new file mode 100644 index 0000000000..b5a1ba9bea --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsDataHubStatusCode/BsDataHubStatusCode.inf @@ -0,0 +1,45 @@ +#/*++ +# +# Copyright (c) 2004, 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: +# +# BsDataHubStatusCode.inf +# +# Abstract: +# +# Library producing a data hub logger for status code functionality. +# +#--*/ + +[defines] +BASE_NAME = BsDataHubStatusCodeLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + BsDataHubStatusCode.c + BsDataHubStatusCode.h + +[includes.common] + $(EDK_SOURCE)\Foundation + $(EDK_SOURCE)\Foundation\Framework + $(EDK_SOURCE)\Foundation\Efi + . + $(EDK_SOURCE)\Foundation\Include + $(EDK_SOURCE)\Foundation\Efi\Include + $(EDK_SOURCE)\Foundation\Framework\Include + $(EDK_SOURCE)\Foundation\Include\IndustryStandard + $(EDK_SOURCE)\Foundation\Core\Dxe + $(EDK_SOURCE)\Foundation\Library\Dxe\Include + +[libraries.common] + PrintLib + +[nmake.common] diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsSerialStatusCode/BsSerialStatusCode.c b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsSerialStatusCode/BsSerialStatusCode.c new file mode 100644 index 0000000000..483064d737 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsSerialStatusCode/BsSerialStatusCode.c @@ -0,0 +1,2374 @@ +/*++ + +Copyright (c) 2004 - 2005, 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: + + BsSerialStatusCode.c + +Abstract: + + Lib to provide Serial I/O status code reporting Routines. + +--*/ + +#include "BsSerialStatusCode.h" + +// +// All of the lookup tables are only needed in debug. +// +#ifdef EFI_DEBUG + +typedef struct { + UINT32 Value; + CHAR8 *Token; +} STATUS_CODE_LOOKUP_TABLE; + +STATUS_CODE_LOOKUP_TABLE mSeverityToken[] = { + { + EFI_ERROR_MINOR, + "ERROR_MINOR" + }, + { + EFI_ERROR_MAJOR, + "ERROR_MAJOR" + }, + { + EFI_ERROR_UNRECOVERED, + "ERROR_UNRECOVERED" + }, + { + EFI_ERROR_UNCONTAINED, + "ERROR_UNCONTAINED" + }, + { + 0xFFFFFFFF, + "ERROR_UNRECOGNIZED" + } +}; +STATUS_CODE_LOOKUP_TABLE mClassSubClassToken[] = { + { + EFI_COMPUTING_UNIT_UNSPECIFIED, + "COMPUTING_UNIT_UNSPECIFIED" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR, + "COMPUTING_UNIT_HOST_PROCESSOR" + }, + { + EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR, + "COMPUTING_UNIT_FIRMWARE_PROCESSOR" + }, + { + EFI_COMPUTING_UNIT_IO_PROCESSOR, + "COMPUTING_UNIT_IO_PROCESSOR" + }, + { + EFI_COMPUTING_UNIT_CACHE, + "COMPUTING_UNIT_CACHE" + }, + { + EFI_COMPUTING_UNIT_MEMORY, + "COMPUTING_UNIT_MEMORY" + }, + { + EFI_COMPUTING_UNIT_CHIPSET, + "COMPUTING_UNIT_CHIPSET" + }, + { + EFI_PERIPHERAL_UNSPECIFIED, + "PERIPHERAL_UNSPECIFIED" + }, + { + EFI_PERIPHERAL_KEYBOARD, + "PERIPHERAL_KEYBOARD" + }, + { + EFI_PERIPHERAL_MOUSE, + "PERIPHERAL_MOUSE" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE, + "PERIPHERAL_LOCAL_CONSOLE" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE, + "PERIPHERAL_REMOTE_CONSOLE" + }, + { + EFI_PERIPHERAL_SERIAL_PORT, + "PERIPHERAL_SERIAL_PORT" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT, + "PERIPHERAL_PARALLEL_PORT" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA, + "PERIPHERAL_FIXED_MEDIA" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA, + "PERIPHERAL_REMOVABLE_MEDIA" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT, + "PERIPHERAL_AUDIO_INPUT" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT, + "PERIPHERAL_AUDIO_OUTPUT" + }, + { + EFI_PERIPHERAL_LCD_DEVICE, + "PERIPHERAL_LCD_DEVICE" + }, + { + EFI_IO_BUS_UNSPECIFIED, + "IO_BUS_UNSPECIFIED" + }, + { + EFI_IO_BUS_PCI, + "IO_BUS_PCI" + }, + { + EFI_IO_BUS_USB, + "IO_BUS_USB" + }, + { + EFI_IO_BUS_IBA, + "IO_BUS_IBA" + }, + { + EFI_IO_BUS_AGP, + "IO_BUS_AGP" + }, + { + EFI_IO_BUS_PC_CARD, + "IO_BUS_PC_CARD" + }, + { + EFI_IO_BUS_LPC, + "IO_BUS_LPC" + }, + { + EFI_IO_BUS_SCSI, + "IO_BUS_SCSI" + }, + { + EFI_IO_BUS_ATA_ATAPI, + "IO_BUS_ATA_ATAPI" + }, + { + EFI_IO_BUS_FC, + "IO_BUS_FC" + }, + { + EFI_IO_BUS_IP_NETWORK, + "IO_BUS_IP_NETWORK" + }, + { + EFI_IO_BUS_SMBUS, + "IO_BUS_SMBUS" + }, + { + EFI_IO_BUS_I2C, + "IO_BUS_I2C" + }, + { + EFI_SOFTWARE_UNSPECIFIED, + "SOFTWARE_UNSPECIFIED" + }, + { + EFI_SOFTWARE_SEC, + "SOFTWARE_EFI_SEC" + }, + { + EFI_SOFTWARE_PEI_CORE, + "SOFTWARE_EFI_PEI_CORE" + }, + { + EFI_SOFTWARE_PEI_MODULE, + "SOFTWARE_EFI_PEI_MODULE" + }, + { + EFI_SOFTWARE_DXE_CORE, + "SOFTWARE_EFI_DXE_CORE" + }, + { + EFI_SOFTWARE_EFI_BOOT_SERVICE, + "SOFTWARE_EFI_BOOT_SERVICE" + }, + { + EFI_SOFTWARE_EFI_RUNTIME_SERVICE, + "SOFTWARE_EFI_RUNTIME_SERVICE" + }, + { + EFI_SOFTWARE_DXE_BS_DRIVER, + "SOFTWARE_DXE_BS_DRIVER" + }, + { + EFI_SOFTWARE_DXE_RT_DRIVER, + "SOFTWARE_DXE_RT_DRIVER" + }, + { + EFI_SOFTWARE_SMM_DRIVER, + "SOFTWARE_SMM_DRIVER" + }, + { + EFI_SOFTWARE_RT, + "SOFTWARE_RT" + }, + { + EFI_SOFTWARE_AL, + "SOFTWARE_AL" + }, + { + EFI_SOFTWARE_EFI_APPLICATION, + "SOFTWARE_EFI_APPLICATION" + }, + { + EFI_SOFTWARE_EFI_OS_LOADER, + "SOFTWARE_EFI_OS_LOADER" + }, + { + 0xFFFFFFFF, + "ERROR_UNRECOGNIZED" + } +}; + +STATUS_CODE_LOOKUP_TABLE mOperationToken[] = { + { + EFI_COMPUTING_UNIT_UNSPECIFIED | EFI_CU_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_COMPUTING_UNIT_UNSPECIFIED | EFI_CU_EC_DISABLED, + "DISABLED" + }, + { + EFI_COMPUTING_UNIT_UNSPECIFIED | EFI_CU_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_COMPUTING_UNIT_UNSPECIFIED | EFI_CU_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_COMPUTING_UNIT_UNSPECIFIED | EFI_CU_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_EC_DISABLED, + "DISABLED" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_INVALID_TYPE, + "INVALID_TYPE" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_INVALID_SPEED, + "INVALID_SPEED" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_MISMATCH, + "MISMATCH" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_TIMER_EXPIRED, + "TIMER_EXPIRED" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_SELF_TEST, + "SELF_TEST" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_INTERNAL, + "INTERNAL" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_THERMAL, + "THERMAL" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_LOW_VOLTAGE, + "LOW_VOLTAGE" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_HIGH_VOLTAGE, + "HIGH_VOLTAGE" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_CACHE, + "CACHE" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_MICROCODE_UPDATE, + "MICROCODE_UPDATE" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_NO_MICROCODE_UPDATE, + "NO_MICROCODE_UPDATE" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_CORRECTABLE, + "1XECC" + }, + { + EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_UNCORRECTABLE, + "2XECC" + }, + { + EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | EFI_CU_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | EFI_CU_EC_DISABLED, + "DISABLED" + }, + { + EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | EFI_CU_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | EFI_CU_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | EFI_CU_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_COMPUTING_UNIT_IO_PROCESSOR | EFI_CU_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_COMPUTING_UNIT_IO_PROCESSOR | EFI_CU_EC_DISABLED, + "DISABLED" + }, + { + EFI_COMPUTING_UNIT_IO_PROCESSOR | EFI_CU_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_COMPUTING_UNIT_IO_PROCESSOR | EFI_CU_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_COMPUTING_UNIT_IO_PROCESSOR | EFI_CU_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_COMPUTING_UNIT_CACHE | EFI_CU_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_COMPUTING_UNIT_CACHE | EFI_CU_EC_DISABLED, + "DISABLED" + }, + { + EFI_COMPUTING_UNIT_CACHE | EFI_CU_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_COMPUTING_UNIT_CACHE | EFI_CU_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_COMPUTING_UNIT_CACHE | EFI_CU_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_COMPUTING_UNIT_CACHE | EFI_CU_CACHE_EC_INVALID_TYPE, + "INVALID_TYPE" + }, + { + EFI_COMPUTING_UNIT_CACHE | EFI_CU_CACHE_EC_INVALID_SPEED, + "INVALID_SPEED" + }, + { + EFI_COMPUTING_UNIT_CACHE | EFI_CU_CACHE_EC_INVALID_SIZE, + "INVALID_SIZE" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_EC_DISABLED, + "DISABLED" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_INVALID_TYPE, + "INVALID_TYPE" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_INVALID_SPEED, + "INVALID_SPEED" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_CORRECTABLE, + "1XECC" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_UNCORRECTABLE, + "2XECC" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_SPD_FAIL, + "SPD_FAIL" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_INVALID_SIZE, + "INVALID_SIZE" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_MISMATCH, + "MISMATCH" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_S3_RESUME_FAIL, + "S3_RESUME_FAIL" + }, + { + EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_UPDATE_FAIL, + "UPDATE_FAIL" + }, + { + EFI_COMPUTING_UNIT_CHIPSET | EFI_CU_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_COMPUTING_UNIT_CHIPSET | EFI_CU_EC_DISABLED, + "DISABLED" + }, + { + EFI_COMPUTING_UNIT_CHIPSET | EFI_CU_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_COMPUTING_UNIT_CHIPSET | EFI_CU_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_COMPUTING_UNIT_CHIPSET | EFI_CU_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_UNSPECIFIED | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_UNSPECIFIED | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_UNSPECIFIED | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_UNSPECIFIED | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_UNSPECIFIED | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_UNSPECIFIED | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_UNSPECIFIED | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_UNSPECIFIED | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_UNSPECIFIED | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_UNSPECIFIED | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_EC_LOCKED, + "LOCKED" + }, + { + EFI_PERIPHERAL_KEYBOARD | EFI_P_KEYBOARD_EC_STUCK_KEY, + "STUCK_KEY" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_MOUSE | EFI_P_MOUSE_EC_LOCKED, + "LOCKED" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_REMOTE_CONSOLE | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_SERIAL_PORT | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_SERIAL_PORT | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_SERIAL_PORT | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_SERIAL_PORT | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_SERIAL_PORT | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_SERIAL_PORT | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_SERIAL_PORT | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_SERIAL_PORT | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_SERIAL_PORT | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_SERIAL_PORT | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_PARALLEL_PORT | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_FIXED_MEDIA | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_REMOVABLE_MEDIA | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_AUDIO_INPUT | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_AUDIO_OUTPUT | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_PERIPHERAL_LCD_DEVICE | EFI_P_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_PERIPHERAL_LCD_DEVICE | EFI_P_EC_DISABLED, + "DISABLED" + }, + { + EFI_PERIPHERAL_LCD_DEVICE | EFI_P_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_PERIPHERAL_LCD_DEVICE | EFI_P_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_PERIPHERAL_LCD_DEVICE | EFI_P_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_PERIPHERAL_LCD_DEVICE | EFI_P_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_PERIPHERAL_LCD_DEVICE | EFI_P_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_PERIPHERAL_LCD_DEVICE | EFI_P_EC_INPUT_ERROR, + "INPUT_ERROR" + }, + { + EFI_PERIPHERAL_LCD_DEVICE | EFI_P_EC_OUTPUT_ERROR, + "OUTPUT_ERROR" + }, + { + EFI_PERIPHERAL_LCD_DEVICE | EFI_P_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_UNSPECIFIED | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_UNSPECIFIED | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_UNSPECIFIED | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_UNSPECIFIED | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_UNSPECIFIED | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_UNSPECIFIED | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_UNSPECIFIED | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_UNSPECIFIED | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_UNSPECIFIED | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_UNSPECIFIED | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_PCI_EC_PERR, + "PERR" + }, + { + EFI_IO_BUS_PCI | EFI_IOB_PCI_EC_SERR, + "SERR" + }, + { + EFI_IO_BUS_USB | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_USB | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_USB | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_USB | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_USB | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_USB | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_USB | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_USB | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_USB | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_USB | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_IBA | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_IBA | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_IBA | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_IBA | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_IBA | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_IBA | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_IBA | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_IBA | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_IBA | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_IBA | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_AGP | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_AGP | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_AGP | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_AGP | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_AGP | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_AGP | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_AGP | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_AGP | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_AGP | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_AGP | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_PC_CARD | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_PC_CARD | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_PC_CARD | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_PC_CARD | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_PC_CARD | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_PC_CARD | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_PC_CARD | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_PC_CARD | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_PC_CARD | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_PC_CARD | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_LPC | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_LPC | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_LPC | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_LPC | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_LPC | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_LPC | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_LPC | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_LPC | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_LPC | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_LPC | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_SCSI | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_SCSI | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_SCSI | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_SCSI | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_SCSI | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_SCSI | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_SCSI | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_SCSI | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_SCSI | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_SCSI | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_ATA_ATAPI | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_FC | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_FC | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_FC | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_FC | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_FC | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_FC | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_FC | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_FC | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_FC | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_FC | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_IP_NETWORK | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_IP_NETWORK | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_IP_NETWORK | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_IP_NETWORK | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_IP_NETWORK | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_IP_NETWORK | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_IP_NETWORK | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_IP_NETWORK | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_IP_NETWORK | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_IP_NETWORK | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_SMBUS | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_SMBUS | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_SMBUS | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_SMBUS | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_SMBUS | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_SMBUS | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_SMBUS | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_SMBUS | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_SMBUS | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_SMBUS | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_IO_BUS_I2C | EFI_IOB_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_IO_BUS_I2C | EFI_IOB_EC_DISABLED, + "DISABLED" + }, + { + EFI_IO_BUS_I2C | EFI_IOB_EC_NOT_SUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_IO_BUS_I2C | EFI_IOB_EC_NOT_DETECTED, + "NOT_DETECTED" + }, + { + EFI_IO_BUS_I2C | EFI_IOB_EC_NOT_CONFIGURED, + "NOT_CONFIGURED" + }, + { + EFI_IO_BUS_I2C | EFI_IOB_EC_INTERFACE_ERROR, + "INTERFACE_ERROR" + }, + { + EFI_IO_BUS_I2C | EFI_IOB_EC_CONTROLLER_ERROR, + "CONTROLLER_ERROR" + }, + { + EFI_IO_BUS_I2C | EFI_IOB_EC_READ_ERROR, + "READ_ERROR" + }, + { + EFI_IO_BUS_I2C | EFI_IOB_EC_WRITE_ERROR, + "WRITE_ERROR" + }, + { + EFI_IO_BUS_I2C | EFI_IOB_EC_RESOURCE_CONFLICT, + "RESOURCE_CONFLICT" + }, + { + EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_UNSPECIFIED | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_SEC | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_SEC | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_SEC | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_SEC | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_SEC | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_SEC | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_SEC | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_SEC | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_SEC | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_PEI_CORE | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_PEI_CORE | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_PEI_CORE | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_PEI_CORE | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_PEI_CORE | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_PEI_CORE | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_PEI_CORE | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_PEI_CORE | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_PEI_CORE | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_PEI_MODULE | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_DXE_CORE | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_DXE_CORE | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_DXE_CORE | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_DXE_CORE | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_DXE_CORE | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_DXE_CORE | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_DXE_CORE | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_DXE_CORE | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_DXE_CORE | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_EFI_RUNTIME_SERVICE | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_DXE_BS_DRIVER | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_DXE_RT_DRIVER | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_SMM_DRIVER | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_RT | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_RT | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_RT | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_RT | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_RT | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_RT | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_RT | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_RT | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_RT | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_AL | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_AL | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_AL | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_AL | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_AL | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_AL | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_AL | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_AL | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_AL | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_EFI_APPLICATION | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_EFI_APPLICATION | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_EFI_APPLICATION | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_EFI_APPLICATION | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_EFI_APPLICATION | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_EFI_APPLICATION | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_EFI_APPLICATION | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_EFI_APPLICATION | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_EFI_APPLICATION | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + EFI_SOFTWARE_EFI_OS_LOADER | EFI_SW_EC_NON_SPECIFIC, + "NON_SPECIFIC" + }, + { + EFI_SOFTWARE_EFI_OS_LOADER | EFI_SW_EC_LOAD_ERROR, + "LOAD_ERROR" + }, + { + EFI_SOFTWARE_EFI_OS_LOADER | EFI_SW_EC_INVALID_PARAMETER, + "INVALID_PARAMETER" + }, + { + EFI_SOFTWARE_EFI_OS_LOADER | EFI_SW_EC_UNSUPPORTED, + "NOT_SUPPORTED" + }, + { + EFI_SOFTWARE_EFI_OS_LOADER | EFI_SW_EC_INVALID_BUFFER, + "INVALID_BUFFER" + }, + { + EFI_SOFTWARE_EFI_OS_LOADER | EFI_SW_EC_OUT_OF_RESOURCES, + "OUT_OF_RESOURCES" + }, + { + EFI_SOFTWARE_EFI_OS_LOADER | EFI_SW_EC_ABORTED, + "ABORTED" + }, + { + EFI_SOFTWARE_EFI_OS_LOADER | EFI_SW_EC_ILLEGAL_SOFTWARE_STATE, + "ILLEGAL_SOFTWARE_STATE" + }, + { + EFI_SOFTWARE_EFI_OS_LOADER | EFI_SW_EC_ILLEGAL_HARDWARE_STATE, + "ILLEGAL_HARDWARE_STATE" + }, + { + 0xFFFFFFFF, + "ERROR_UNRECOGNIZED" + } +}; + +#endif +// +// Private function declarations +// +// +// Match is only needed for debug. +// +#ifdef EFI_DEBUG + +EFI_STATUS +EFIAPI +MatchString ( + IN STATUS_CODE_LOOKUP_TABLE *Table, + IN UINT32 Value, + OUT CHAR8 **Token + ); +#endif +// +// Function implemenations +// +// +// Match is only needed for debug. +// +#ifdef EFI_DEBUG + +EFI_STATUS +EFIAPI +MatchString ( + IN STATUS_CODE_LOOKUP_TABLE *Table, + IN UINT32 Value, + OUT CHAR8 **Token + ) +/*++ + +Routine Description: + + Search the input table for a matching value and return the token associated + with that value. Well formed tables will have the last value == 0 and will + return a default token. + +Arguments: + + Table Pointer to first entry in an array of table entries. + Value Value to look up. + Token String to return. + +Returns: + + EFI_SUCCESS The function always returns success. + +--*/ +{ + UINTN Current; + + ASSERT (Table); + ASSERT (Token); + + Current = 0; + *Token = 0; + + while (!*Token) { + // + // Found token if values match or current entry is the last entry. + // + if ((Table[Current].Value == (-1)) || (Table[Current].Value == Value)) { + *Token = Table[Current].Token; + } + + Current++; + } + + return EFI_SUCCESS; +} +#endif + +VOID +BsSerialInitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Initialize Serial Port + + The Baud Rate Divisor registers are programmed and the LCR + is used to configure the communications format. Hard coded + UART config comes from globals in DebugSerialPlatform lib. + +Arguments: + + Unused + +Returns: + + None + +--*/ +{ + UINTN Divisor; + UINT8 OutputData; + UINT8 Data; + + // + // Some init is done by the platform status code initialization. + // + // + // Map 5..8 to 0..3 + // + Data = (UINT8) (gData - (UINT8) 5); + + // + // Calculate divisor for baud generator + // + Divisor = 115200 / gBps; + + // + // Set communications format + // + OutputData = (UINT8) ((DLAB << 7) | ((gBreakSet << 6) | ((gParity << 3) | ((gStop << 2) | Data)))); + IoWrite8 (gComBase + LCR_OFFSET, OutputData); + + // + // Configure baud rate + // + IoWrite8 (gComBase + BAUD_HIGH_OFFSET, (UINT8) (Divisor >> 8)); + IoWrite8 (gComBase + BAUD_LOW_OFFSET, (UINT8) (Divisor & 0xff)); + + // + // Switch back to bank 0 + // + OutputData = (UINT8) ((~DLAB << 7) | ((gBreakSet << 6) | ((gParity << 3) | ((gStop << 2) | Data)))); + IoWrite8 (gComBase + LCR_OFFSET, OutputData); +} + +VOID +DebugSerialWrite ( + IN UINT8 Character + ) +/*++ + +Routine Description: + + DebugSerialWrite - Outputs a character to the Serial port + + Repeatedly polls the TXRDY bit of the Line Status Register + until the Transmitter Holding Register is empty. The character + is then written to the Serial port. + +Arguments: + + Character - Character to write + +Returns: + + None + +--*/ +{ + UINT8 Data; + + // + // Wait for the serail port to be ready. + // + do { + Data = IoRead8 (gComBase + LSR_OFFSET); + } while ((Data & LSR_TXRDY) == 0); + + IoWrite8 (gComBase, Character); +} + +VOID +DebugSerialPrint ( + IN UINT8 *OutputString + ) +/*++ + +Routine Description: + + Prints a string to the Serial port + +Arguments: + + OutputString - Ascii string to print to serial port. + +Returns: + + None + +--*/ +{ + EFI_STATUS Status; + + Status = EFI_SUCCESS; + + for (; *OutputString != 0; OutputString++) { + DebugSerialWrite (*OutputString); + } +} + +EFI_STATUS +EFIAPI +BsSerialReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +/*++ + +Routine Description: + + Provide a serial port print + +Arguments: + + +Returns: + + Status - EFI_SUCCESS if the interface could be successfully + installed + +--*/ +{ + CHAR8 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE * 3]; + UINT32 LineNumber; + CHAR8 *Filename; + CHAR8 *Description; + CHAR8 *Format; + VA_LIST Marker; + UINT32 ErrorLevel; + UINTN CharCount; + + Buffer[0] = '\0'; + + if (ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, &Filename, &Description, &LineNumber)) { + // + // Processes ASSERT () + // + ASPrint ( + Buffer, + EFI_STATUS_CODE_DATA_MAX_SIZE, + "\nDXE_ASSERT!: %a (%d): %a\n", + Filename, + LineNumber, + Description + ); + + } else if (ReportStatusCodeExtractDebugInfo (Data, &ErrorLevel, &Marker, &Format)) { + // + // Process DEBUG () macro to Serial + // + AvSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, Format, Marker); + + } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) { + // + // Process Errors + // + CharCount = ASPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, "ERROR: C%x:V%x I%x", CodeType, Value, Instance); + // + // Make sure we don't try to print values that weren't intended to be printed, especially NULL GUID pointers. + // + if (CallerId) { + CharCount += ASPrint ( + &Buffer[CharCount - 1], + (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)), + " %g", + CallerId + ); + } + + if (Data) { + CharCount += ASPrint ( + &Buffer[CharCount - 1], + (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)), + " %x", + Data + ); + } + + CharCount += ASPrint ( + &Buffer[CharCount - 1], + (EFI_STATUS_CODE_DATA_MAX_SIZE - (sizeof (Buffer[0]) * CharCount)), + "\n" + ); + + } + + if (Buffer[0] != '\0') { + // + // Callout to platform Lib function to do print. + // + DebugSerialPrint (Buffer); + } + // + // Debug code to display human readable code information. + // +#ifdef EFI_DEBUG + { + CHAR8 *SeverityToken; + CHAR8 *SubClassToken; + CHAR8 *OperationToken; + + if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) { + // + // Get the severity token + // + MatchString ( + mSeverityToken, + (CodeType & EFI_STATUS_CODE_SEVERITY_MASK), + &SeverityToken + ); + + // + // Get the Class/SubClass token + // + MatchString ( + mClassSubClassToken, + (Value & (EFI_STATUS_CODE_CLASS_MASK | EFI_STATUS_CODE_SUBCLASS_MASK)), + &SubClassToken + ); + + // + // Get the operation token + // + MatchString ( + mOperationToken, + (Value & (EFI_STATUS_CODE_CLASS_MASK | EFI_STATUS_CODE_SUBCLASS_MASK | EFI_STATUS_CODE_OPERATION_MASK)), + &OperationToken + ); + + // + // Concatenate the instance + // + ASPrint ( + Buffer, + EFI_STATUS_CODE_DATA_MAX_SIZE, + "%a:%a:%a:%d\n", + SeverityToken, + SubClassToken, + OperationToken, + Instance + ); + + DebugSerialPrint (Buffer); + } + } +#endif + + return EFI_SUCCESS; +} diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsSerialStatusCode/BsSerialStatusCode.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsSerialStatusCode/BsSerialStatusCode.h new file mode 100644 index 0000000000..63165471b1 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsSerialStatusCode/BsSerialStatusCode.h @@ -0,0 +1,90 @@ +/*++ + +Copyright (c) 2004, 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: + + BsSerialStatusCode.h + +Abstract: + + Lib to provide Serial I/O status code routines. This uses the PEI library + print functions. + +--*/ + +#ifndef _EFI_BS_SERIAL_STATUS_CODE_H_ +#define _EFI_BS_SERIAL_STATUS_CODE_H_ + +// +// Statements that include other files +// +#include "Tiano.h" +#include "Pei.h" +#include "PeiLib.h" +#include "EfiRuntimeLib.h" +#include "BsSerialStatusCodeLib.h" + +// +// GUID consumed +// +#include EFI_GUID_DEFINITION (StatusCodeDataTypeId) + +// +// --------------------------------------------- +// UART Register Offsets +// --------------------------------------------- +// +#define BAUD_LOW_OFFSET 0x00 +#define BAUD_HIGH_OFFSET 0x01 +#define IER_OFFSET 0x01 +#define LCR_SHADOW_OFFSET 0x01 +#define FCR_SHADOW_OFFSET 0x02 +#define IR_CONTROL_OFFSET 0x02 +#define FCR_OFFSET 0x02 +#define EIR_OFFSET 0x02 +#define BSR_OFFSET 0x03 +#define LCR_OFFSET 0x03 +#define MCR_OFFSET 0x04 +#define LSR_OFFSET 0x05 +#define MSR_OFFSET 0x06 + +// +// --------------------------------------------- +// UART Register Bit Defines +// --------------------------------------------- +// +#define LSR_TXRDY 0x20 +#define LSR_RXDA 0x01 +#define DLAB 0x01 + +// +// Globals for Serial Port settings +// +extern UINT16 gComBase; +extern UINTN gBps; +extern UINT8 gData; +extern UINT8 gStop; +extern UINT8 gParity; +extern UINT8 gBreakSet; + +VOID +DebugSerialPrint ( + IN UINT8 *OutputString + ) +; + +VOID +DebugSerialWrite ( + IN UINT8 Character + ) +; + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsSerialStatusCode/BsSerialStatusCode.inf b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsSerialStatusCode/BsSerialStatusCode.inf new file mode 100644 index 0000000000..0407fb032d --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/BsSerialStatusCode/BsSerialStatusCode.inf @@ -0,0 +1,47 @@ +#/*++ +# +# Copyright (c) 2004, 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: +# +# BsSerialStatusCode.inf +# +# Abstract: +# +# Library producing a serial port status code functionality. +# +#--*/ + +[defines] +BASE_NAME = BsSerialStatusCodeLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + BsSerialStatusCode.c + BsSerialStatusCode.h + +[includes.common] + $(EDK_SOURCE)\Foundation\Framework + $(EDK_SOURCE)\Foundation + $(EDK_SOURCE)\Foundation\Efi + . + ..\Include + $(EDK_SOURCE)\Foundation\Include + $(EDK_SOURCE)\Foundation\Efi\Include + $(EDK_SOURCE)\Foundation\Framework\Include + $(EDK_SOURCE)\Foundation\Include\IndustryStandard + $(EDK_SOURCE)\Foundation\Core\Dxe + $(EDK_SOURCE)\Foundation\Library\Dxe\Include + $(EDK_SOURCE)\Foundation\Include\Pei + $(EDK_SOURCE)\Foundation\Library\Pei\Include + +[libraries.platform] + +[nmake.common] diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/BsDataHubStatusCodeLib.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/BsDataHubStatusCodeLib.h new file mode 100644 index 0000000000..6d6dfcd16b --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/BsDataHubStatusCodeLib.h @@ -0,0 +1,53 @@ +/*++ + +Copyright (c) 2004 - 2005, 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: + + BsDataHubStatusCodeLib.h + +Abstract: + + Lib to provide data hub status code reporting. + +--*/ + +#ifndef _EFI_BS_DATA_HUB_STATUS_CODE_LIB_H_ +#define _EFI_BS_DATA_HUB_STATUS_CODE_LIB_H_ + +// +// Statements that include other files +// +#include "Tiano.h" + +// +// Initialization function +// +VOID +BsDataHubInitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + +// +// Status code reporting function +// +EFI_STATUS +BsDataHubReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +; + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/BsSerialStatusCodeLib.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/BsSerialStatusCodeLib.h new file mode 100644 index 0000000000..e0403cb8ea --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/BsSerialStatusCodeLib.h @@ -0,0 +1,53 @@ +/*++ + +Copyright (c) 2004 - 2005, 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: + + BsSerialStatusCodeLib.h + +Abstract: + + Lib to provide Serial I/O status code reporting. + +--*/ + +#ifndef _EFI_BS_SERIAL_STATUS_CODE_LIB_H_ +#define _EFI_BS_SERIAL_STATUS_CODE_LIB_H_ + +// +// Statements that include other files +// +#include "Tiano.h" + +// +// Initialization function +// +VOID +BsSerialInitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + +// +// Status code reporting function +// +EFI_STATUS +BsSerialReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +; + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtLedStatusCodeLib.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtLedStatusCodeLib.h new file mode 100644 index 0000000000..378d5dce8c --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtLedStatusCodeLib.h @@ -0,0 +1,49 @@ +/*++ + +Copyright (c) 2004 - 2005, 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: + + RtLedStatusCodeLib.h + +Abstract: + + Lib to provide status code reporting via LED. + +--*/ + +#ifndef _RT_LED_STATUS_CODE_H_ +#define _RT_LED_STATUS_CODE_H_ + +#include "Tiano.h" + +// +// Initialization function +// +VOID +RtLedInitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + +// +// Status code reporting function +// +EFI_STATUS +RtLedReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +; +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtMemoryStatusCodeLib.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtMemoryStatusCodeLib.h new file mode 100644 index 0000000000..3dadc1d2e4 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtMemoryStatusCodeLib.h @@ -0,0 +1,72 @@ +/*++ + +Copyright (c) 2004 - 2005, 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: + + RtMemoryStatusCodeLib.h + +Abstract: + + Lib to provide memory status code reporting. + +--*/ + +#ifndef _EFI_RT_MEMORY_STATUS_CODE_LIB_H_ +#define _EFI_RT_MEMORY_STATUS_CODE_LIB_H_ + +// +// Statements that include other files +// +#include "Tiano.h" + +// +// Initialization function +// +VOID +RtMemoryInitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + +// +// Status code reporting function +// +EFI_STATUS +RtMemoryReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +; + +// +// Playback all prior status codes to a listener +// +typedef +EFI_STATUS +(*PLATFORM_REPORT_STATUS_CODE) ( + 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 + ); + +VOID +PlaybackStatusCodes ( + IN PLATFORM_REPORT_STATUS_CODE ReportStatusCode + ) +; + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtPlatformStatusCodeLib.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtPlatformStatusCodeLib.h new file mode 100644 index 0000000000..6979aa1a1b --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtPlatformStatusCodeLib.h @@ -0,0 +1,54 @@ +/*++ + +Copyright (c) 2004 - 2005, 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: + + RtPlatformStatusCodeLib.h + +Abstract: + + Lib to provide platform implementations necessary for the Monolithic status + code to work. + +--*/ + +#ifndef _EFI_PLATFORM_STATUS_CODE_LIB_H_ +#define _EFI_PLATFORM_STATUS_CODE_LIB_H_ + +// +// Statements that include other files +// +#include "Tiano.h" + +// +// Initialization function +// +VOID +RtPlatformInitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + +// +// Status code reporting function +// +EFI_STATUS +RtPlatformReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +; + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtPort80StatusCodeLib.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtPort80StatusCodeLib.h new file mode 100644 index 0000000000..9c57ffb886 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/Include/RtPort80StatusCodeLib.h @@ -0,0 +1,43 @@ +/*++ + +Copyright (c) 2004 - 2005, 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: + + RtPort80StatusCodeLib.h + +Abstract: + + Lib to provide status code reporting via port 80. + +--*/ + +#ifndef _EFI_PORT_80_STATUS_CODE_H_ +#define _EFI_PORT_80_STATUS_CODE_H_ + +// +// Statements that include other files +// +#include "Tiano.h" + +// +// Status code reporting function +// +EFI_STATUS +RtPort80ReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +; + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtLedStatusCode/RtLedStatusCode.c b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtLedStatusCode/RtLedStatusCode.c new file mode 100644 index 0000000000..a92e2817e1 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtLedStatusCode/RtLedStatusCode.c @@ -0,0 +1,366 @@ +/*++ + +Copyright (c) 2004 - 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: + + RtLedStatusCode.c + +Abstract: + + Lib to provide LED status code reporting Routines. + + In general you should use PPI's, but some times a monolithic driver + is better. The best justification for monolithic code is debug. + +--*/ + +#include "RtLedStatusCode.h" + +// +// Prepare the data to initialize LPC chipset for Server Io Configuration +// This is hardcoded init value and would vary from platform to platform. +// +static SIO_INIT_DATA mSioInitData[] = { + // + // Program magic values in ServerI/O configuration registers + // + { + REG_SERVERIO_CNF1, + 0x19 + }, + { + REG_SERVERIO_CNF2, + 0x22 + }, + { + REG_SERVERIO_CNF3, + 0x76 + }, + { + REG_SERVERIO_CNF4, + 0x26 + }, + // + // Force the parallel port to be disabled, override reg 30 setting + // + { + REG_SERVERIO_CNF6, + 0x02 + }, + // + // Select GPIO device and setup GPIO base address + // + { + REG_LOGICAL_DEVICE, + SIO_GPIO + }, + { + ACTIVATE, + LOGICAL_DEVICE_OFF + }, + { + BASE_ADDRESS_HIGH, + SIO_GPIO_HIGH + }, + { + BASE_ADDRESS_LOW, + SIO_GPIO_LOW + }, + { + ACTIVATE, + LOGICAL_DEVICE_ON + }, + // + // Select DLED STB, post code LED, ZZ_POST_CLK_LED_L + // + { + GPIO_GPSEL, + 0x43 + }, + // + // Push pull output enable + // + { + GPIO_GPCFG1, + PUSH_PULL | OUTPUT_BUFFER_EN + }, + // + // Disable Event IRQ routing + // + { + GPIO_GPEVR, + GPIO_EVENT_OFF + }, + // + // Select DLED STB, ZZ_POST_DATA_LED_L + // + { + GPIO_GPSEL, + 0x54 + }, + // + // Push pull output enable + // + { + GPIO_GPCFG1, + PUSH_PULL | OUTPUT_BUFFER_EN + }, + // + // Disable Event IRQ routing + // + { + GPIO_GPEVR, + GPIO_EVENT_OFF + }, + // + // Select Select ACPI_MODE_IND_L + // + { + GPIO_GPSEL, + 0x63 + }, + // + // Push pull output enable + // + { + GPIO_GPCFG1, + PUSH_PULL | OUTPUT_BUFFER_EN + }, + + { + 0xff, + 0xff + } +}; + +VOID +RtLedInitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Initialization routine. Initializes LPC47817 to configure GPIO for LED + +Arguments: + + None + +Returns: + + None + +--*/ +{ + UINT8 OutputData; + UINT16 ConfigPort; + UINT16 DataPort; + UINT32 Index; + + // + // hard code for sio init + // + ConfigPort = CONFIG_PORT0; + DataPort = DATA_PORT0; + + // + // Initialize Sio from table to enable SererIoCfg and GPIO + // + Index = 0; + while ((mSioInitData[Index]).RegAddress != 0xff) { + OutputData = (UINT8) mSioInitData[Index].RegAddress; + + IoWrite8 (ConfigPort, OutputData); + + OutputData = (UINT8) mSioInitData[Index].RegValue; + IoWrite8 (DataPort, OutputData); + + Index++; + } + + return ; +} + +BOOLEAN +CodeTypeToProgressCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + OUT UINT8 *PostCode + ) +{ + // + // Convert Value to an 8 bit post code + // + if (((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE)) { + *PostCode = (UINT8) (((Value & EFI_STATUS_CODE_CLASS_MASK) >> 24) << 5); + *PostCode |= (UINT8) (((Value & EFI_STATUS_CODE_SUBCLASS_MASK) >> 16) & 0x1f); + return TRUE; + } + + return FALSE; +} + +VOID +SendDataToPort ( + IN UINT8 Data, + IN UINT16 DataOffset + ) +/*++ + +Routine Description: + + Writes the data to control LED output at desired port + +Arguments: + + Data - Data in bit0 is the relevant data + DataOffset - Port address to access GPIO54 + +Returns: + + None + +--*/ +{ + UINT8 PinData; + + // + // Read current Pin State of GPIO54 + // + PinData = IoRead8 (DataOffset); + + // + // Set GPIO54 pin to zero + // + PinData &= 0xEF; + + if (Data & 0x01) { + // + // Set GPIO54 pin to 1 if data is 1 + // otherwise it will be set to 0 + // + PinData |= LED_MASK_BIT; + } + + IoWrite8 (DataOffset, PinData); +} + +VOID +StrobeData ( + IN UINT16 StrobeOffset + ) +/*++ + +Routine Description: + + Controls the strobe to move the value from LSB to MSB in steps. + +Arguments: + + StrobeOffset - Port address to access GPIO43. This pin controls the shifting + of bit value from LSB to MSB + +Returns: + + None + +--*/ +{ + UINT8 StrobeData; + + StrobeData = IoRead8 (StrobeOffset); + + // + // Make bit 3 of data to be zero + // + StrobeData &= 0xF7; + + IoWrite8 (StrobeOffset, StrobeData); + + // + // Make bit 3 as 1 to perform the strobe to shift the data in 74HCT164 + // + StrobeData |= STROBE_MASK_BIT; + + IoWrite8 (StrobeOffset, StrobeData); +} + +VOID +SendDataToLed ( + UINT8 Data + ) +{ + UINT16 GpioBase; + UINT16 DataOffset; + UINT16 StrobeOffset; + UINTN Index; + UINTN DataBitPosition; + UINT8 TempData; + + GpioBase = GPIO_BASE (SIO_GPIO_HIGH, SIO_GPIO_LOW); + + DataOffset = (UINT16) (GpioBase + LED_DATA_OFFSET); + + StrobeOffset = (UINT16) (GpioBase + LED_STROBE_OFFSET); + + DataBitPosition = 7; + + Data = (UINT8) (~Data); + + TempData = Data; + + for (Index = 0; Index < 8; Index++) { + SendDataToPort ((UINT8) (TempData >> DataBitPosition), DataOffset); + StrobeData (StrobeOffset); + DataBitPosition--; + } + // + // To fix 5 Volt leakage problem + // + SendDataToPort (0, DataOffset); + +} + +EFI_STATUS +RtLedReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +/*++ + +Routine Description: + + Provide a LED status code + +Arguments: + + Same as ReportStatusCode PPI + +Returns: + + Status - EFI_SUCCESS if the interface could be successfully + installed + +--*/ +{ + UINT8 ProgressCode; + + if (CodeTypeToProgressCode (CodeType, Value, &ProgressCode)) { + SendDataToLed (ProgressCode); + } + + return EFI_SUCCESS; +} diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtLedStatusCode/RtLedStatusCode.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtLedStatusCode/RtLedStatusCode.h new file mode 100644 index 0000000000..e21169c454 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtLedStatusCode/RtLedStatusCode.h @@ -0,0 +1,89 @@ +/*++ + +Copyright (c) 2004, 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: + + RtLedStatusCode.h + +Abstract: + + Lib to provide status code reporting via LED. + +--*/ + +#ifndef _EFI_LED_STATUS_CODE_H_ +#define _EFI_LED_STATUS_CODE_H_ + +// +// Statements that include other files +// +#include "Tiano.h" +#include "EfiCommonLib.h" +#include "EfiRuntimeLib.h" +#include "EfiStatusCode.h" + +// +// SIOINIT data +// +typedef struct { + UINT8 RegAddress; + UINT8 RegValue; +} SIO_INIT_DATA; + +#define LED_DATA_OFFSET 0x0E +#define LED_STROBE_OFFSET 0x0A + +#define LED_MASK_BIT 0x10 +#define STROBE_MASK_BIT 0x08 + +#define GPIO_BASE(a, b) (UINT16) ((a << 8) | (b)) + +#define SIO_GPIO_HIGH 0x08 +#define SIO_GPIO_LOW 0x00 + +#define CONFIG_PORT0 0x2E +#define DATA_PORT0 0x2F + +// +// logical device in NSPC87417 +// +#define SIO_GPIO 0x7 + +// +// Global register in NSPC87417 +// +#define REG_LOGICAL_DEVICE 0x07 + +#define REG_SERVERIO_CNF1 0x21 +#define REG_SERVERIO_CNF2 0x22 +#define REG_SERVERIO_CNF3 0x23 +#define REG_SERVERIO_CNF4 0x24 +#define REG_SERVERIO_CNF6 0x26 + +#define ACTIVATE 0x30 +#define LOGICAL_DEVICE_ON 0x01 +#define LOGICAL_DEVICE_OFF 0x00 +#define BASE_ADDRESS_HIGH 0x60 +#define BASE_ADDRESS_LOW 0x61 + +// +// Register for GPIO +// +#define GPIO_GPSEL 0xF0 + +#define GPIO_GPCFG1 0xF1 +#define PUSH_PULL 0x02 +#define OUTPUT_BUFFER_EN 0x01 + +#define GPIO_GPEVR 0xF2 +#define GPIO_EVENT_OFF 0x00 + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtLedStatusCode/RtLedStatusCode.inf b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtLedStatusCode/RtLedStatusCode.inf new file mode 100644 index 0000000000..8a2c6f5245 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtLedStatusCode/RtLedStatusCode.inf @@ -0,0 +1,44 @@ +#/*++ +# +# Copyright (c) 2004, 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: +# +# RtLedStatusCode.inf +# +# Abstract: +# +# Library producing a LED status code functionality. +# +#--*/ + +[defines] +BASE_NAME = RtLedStatusCodeLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + RtLedStatusCode.c + RtLedStatusCode.h + +[includes.common] + $(EDK_SOURCE)\Foundation + $(EDK_SOURCE)\Foundation\Framework + $(EDK_SOURCE)\Foundation\Efi + . + $(EDK_SOURCE)\Foundation\Include + $(EDK_SOURCE)\Foundation\Efi\Include + $(EDK_SOURCE)\Foundation\Framework\Include + $(EDK_SOURCE)\Foundation\Include\IndustryStandard + $(EDK_SOURCE)\Foundation\Core\Dxe + $(EDK_SOURCE)\Foundation\Library\Dxe\Include + +[libraries.platform] + +[nmake.common] diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtMemoryStatusCode/RtMemoryStatusCode.c b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtMemoryStatusCode/RtMemoryStatusCode.c new file mode 100644 index 0000000000..28b5af51b9 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtMemoryStatusCode/RtMemoryStatusCode.c @@ -0,0 +1,203 @@ +/*++ + +Copyright (c) 2004 - 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: + + RtMemoryStatusCode.c + +Abstract: + + EFI lib to provide memory journal status code reporting routines. + +--*/ + +#include "RtMemoryStatusCode.h" + +// +// Global variables +// +PEI_STATUS_CODE_MEMORY_PPI mStatusCodeMemoryPpi = { 0, 0, 0, 0 }; + +// +// Function implementations +// +EFI_STATUS +EFIAPI +RtMemoryReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +/*++ + +Routine Description: + + Log a status code to a memory journal. If no memory journal exists, + we will just return. + +Arguments: + + Same as ReportStatusCode AP + +Returns: + + EFI_SUCCESS This function always returns success + +--*/ +{ + EFI_STATUS_CODE_ENTRY *CurrentEntry; + UINTN MaxEntry; + + // + // We don't care to log debug codes. + // + if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_DEBUG_CODE) { + return EFI_SUCCESS; + } + // + // Update the latest entry in the journal. + // + MaxEntry = mStatusCodeMemoryPpi.Length / sizeof (EFI_STATUS_CODE_ENTRY); + if (!MaxEntry) { + // + // If we don't have any entries, then we can return. + // This effectively means that no memory buffer was passed forward from PEI. + // + return EFI_SUCCESS; + } + + CurrentEntry = (EFI_STATUS_CODE_ENTRY *) (UINTN) (mStatusCodeMemoryPpi.Address + (mStatusCodeMemoryPpi.LastEntry * sizeof (EFI_STATUS_CODE_ENTRY))); + + mStatusCodeMemoryPpi.LastEntry = (mStatusCodeMemoryPpi.LastEntry + 1) % MaxEntry; + if (mStatusCodeMemoryPpi.LastEntry == mStatusCodeMemoryPpi.FirstEntry) { + mStatusCodeMemoryPpi.FirstEntry = (mStatusCodeMemoryPpi.FirstEntry + 1) % MaxEntry; + } + + CurrentEntry->Type = CodeType; + CurrentEntry->Value = Value; + CurrentEntry->Instance = Instance; + + return EFI_SUCCESS; +} + +VOID +EFIAPI +RtMemoryInitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Initialization routine. + Allocates heap space for storing Status Codes. + Installs a PPI to point to that heap space. + Installs a callback to switch to memory. + Installs a callback to + +Arguments: + + (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT) + +Returns: + + None + +--*/ +{ + EFI_STATUS Status; + VOID *HobList; + PEI_STATUS_CODE_MEMORY_PPI **StatusCodeMemoryPpi; + + // + // Locate the HOB that contains the PPI structure for the memory journal + // We don't check for more than one. + // + EfiLibGetSystemConfigurationTable ( + &gEfiHobListGuid, + &HobList + ); + Status = GetNextGuidHob ( + &HobList, + &gPeiStatusCodeMemoryPpiGuid, + (VOID **) &StatusCodeMemoryPpi, + NULL + ); + if (EFI_ERROR (Status)) { + return ; + } + // + // Copy data to our structure since the HOB will go away at runtime + // + // BUGBUG: Virtualize for RT + // + mStatusCodeMemoryPpi.FirstEntry = (*StatusCodeMemoryPpi)->FirstEntry; + mStatusCodeMemoryPpi.LastEntry = (*StatusCodeMemoryPpi)->LastEntry; + mStatusCodeMemoryPpi.Address = (*StatusCodeMemoryPpi)->Address; + mStatusCodeMemoryPpi.Length = (*StatusCodeMemoryPpi)->Length; +} + +VOID +EFIAPI +PlaybackStatusCodes ( + IN EFI_REPORT_STATUS_CODE ReportStatusCode + ) +/*++ + +Routine Description: + + Call the input ReportStatusCode function with every status code recorded in + the journal. + +Arguments: + + ReportStatusCode ReportStatusCode function to call. + +Returns: + + None + +--*/ +{ + UINTN MaxEntry; + EFI_STATUS_CODE_ENTRY *CurrentEntry; + UINTN Counter; + + if (ReportStatusCode == RtMemoryReportStatusCode) { + return ; + } + // + // Playback prior status codes to current listeners + // + MaxEntry = mStatusCodeMemoryPpi.Length / sizeof (EFI_STATUS_CODE_ENTRY); + for (Counter = mStatusCodeMemoryPpi.FirstEntry; Counter != mStatusCodeMemoryPpi.LastEntry; Counter++) { + // + // Check if we have to roll back to beginning of queue buffer + // + if (Counter == MaxEntry) { + Counter = 0; + } + // + // Play current entry + // + CurrentEntry = (EFI_STATUS_CODE_ENTRY *) (UINTN) (mStatusCodeMemoryPpi.Address + (Counter * sizeof (EFI_STATUS_CODE_ENTRY))); + ReportStatusCode ( + CurrentEntry->Type, + CurrentEntry->Value, + CurrentEntry->Instance, + NULL, + NULL + ); + } +} diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtMemoryStatusCode/RtMemoryStatusCode.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtMemoryStatusCode/RtMemoryStatusCode.h new file mode 100644 index 0000000000..15db58cf16 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtMemoryStatusCode/RtMemoryStatusCode.h @@ -0,0 +1,45 @@ +/*++ + +Copyright (c) 2004, 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: + + RtMemoryStatusCode.h + +Abstract: + + EFI library to provide status code reporting via a memory journal. + +--*/ + +#ifndef _EFI_RT_MEMORY_STATUS_CODE_H_ +#define _EFI_RT_MEMORY_STATUS_CODE_H_ + +// +// Statements that include other files +// +#include "Tiano.h" +#include "Pei.h" +#include "TianoCommon.h" +#include "EfiRuntimeLib.h" +#include "EfiHobLib.h" +#include "RtPlatformStatusCodeLib.h" + +// +// Consumed protocols +// +#include EFI_PPI_CONSUMER (StatusCodeMemory) + +// +// Consumed GUID +// +#include EFI_GUID_DEFINITION (Hob) + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtMemoryStatusCode/RtMemoryStatusCode.inf b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtMemoryStatusCode/RtMemoryStatusCode.inf new file mode 100644 index 0000000000..a5c28462d3 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtMemoryStatusCode/RtMemoryStatusCode.inf @@ -0,0 +1,49 @@ +#/*++ +# +# Copyright (c) 2004, 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: +# +# RtMemoryStatusCode.inf +# +# Abstract: +# +# Library producing a memory status code functionality. +# +#--*/ + +[defines] +BASE_NAME = RtMemoryStatusCodeLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + RtMemoryStatusCode.c + RtMemoryStatusCode.h + +[includes.common] + $(EDK_SOURCE)\Foundation + $(EDK_SOURCE)\Foundation\Framework + $(EDK_SOURCE)\Foundation\Efi + . + ..\Include + $(EDK_SOURCE)\Foundation\Include + $(EDK_SOURCE)\Foundation\Efi\Include + $(EDK_SOURCE)\Foundation\Framework\Include + $(EDK_SOURCE)\Foundation\Include\IndustryStandard + $(EDK_SOURCE)\Foundation\Core\Dxe + $(EDK_SOURCE)\Foundation\Library\Dxe\Include + $(EDK_SOURCE)\Foundation\Include\Pei + $(EDK_SOURCE)\Foundation\Library\Pei\Include + + +[libraries.platform] + EdkPpiLib + +[nmake.common] diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPlatformStatusCode/Nt32/RtPlatformStatusCode.c b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPlatformStatusCode/Nt32/RtPlatformStatusCode.c new file mode 100644 index 0000000000..46aedadab6 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPlatformStatusCode/Nt32/RtPlatformStatusCode.c @@ -0,0 +1,144 @@ +/*++ + +Copyright (c) 2004 - 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: + + RtPlatformStatusCode.c + +Abstract: + + Contains NT32 specific implementations required to use status codes. + +--*/ + +// +// Statements that include other files. +// +#include "Tiano.h" +#include "EfiCommonLib.h" +#include "EfiRuntimeLib.h" +#include "EfiStatusCode.h" +#include "EfiHobLib.h" +#include "RtMemoryStatusCodeLib.h" +#include "BsDataHubStatusCodeLib.h" + +// +// Consumed protocols +// +#include EFI_ARCH_PROTOCOL_CONSUMER (StatusCode) + +// +// GUID definitions +// +#include EFI_GUID_DEFINITION (Hob) + +// +// Globals only work at BootService Time. NOT at Runtime! +// +EFI_REPORT_STATUS_CODE mPeiReportStatusCode; + +// +// Function implementations +// +EFI_STATUS +EFIAPI +RtPlatformReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +/*++ + +Routine Description: + + Call all status code listeners in the MonoStatusCode. + +Arguments: + + Same as ReportStatusCode service + +Returns: + + EFI_SUCCESS Always returns success. + +--*/ +{ + RtMemoryReportStatusCode (CodeType, Value, Instance, CallerId, Data); + if (EfiAtRuntime ()) { + // + // For now all we do is post code at runtime + // + return EFI_SUCCESS; + } + + BsDataHubReportStatusCode (CodeType, Value, Instance, CallerId, Data); + + // + // Call back into PEI to get status codes. This is because SecMain contains + // status code that reports to Win32. + // + if (mPeiReportStatusCode != NULL) { + return mPeiReportStatusCode (CodeType, Value, Instance, CallerId, Data); + } + + return EFI_SUCCESS; +} + +VOID +EFIAPI +RtPlatformInitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Initialize the status code listeners. + +Arguments: + + (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT) + +Returns: + + None + +--*/ +{ + EFI_STATUS Status; + VOID *HobList; + VOID *Pointer; + + RtMemoryInitializeStatusCode (ImageHandle, SystemTable); + BsDataHubInitializeStatusCode (ImageHandle, SystemTable); + + // + // Play any prior status codes to the data hub. + // + PlaybackStatusCodes (BsDataHubReportStatusCode); + + // + // If PEI has a ReportStatusCode callback find it and use it before StdErr + // is connected. + // + mPeiReportStatusCode = NULL; + + Status = EfiLibGetSystemConfigurationTable (&gEfiHobListGuid, &HobList); + if (!EFI_ERROR (Status)) { + Status = GetNextGuidHob (&HobList, &gEfiStatusCodeRuntimeProtocolGuid, &Pointer, NULL); + if (!EFI_ERROR (Status)) { + mPeiReportStatusCode = (EFI_REPORT_STATUS_CODE) (*(UINTN *) Pointer); + } + } +} diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPlatformStatusCode/Nt32/RtPlatformStatusCode.inf b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPlatformStatusCode/Nt32/RtPlatformStatusCode.inf new file mode 100644 index 0000000000..a76c09c5ca --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPlatformStatusCode/Nt32/RtPlatformStatusCode.inf @@ -0,0 +1,47 @@ +#/*++ +# +# Copyright (c) 2004, 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: +# +# RtPlatformStatusCode.inf +# +# Abstract: +# +# Library selecting the listeners for the platform +# +#--*/ + +[defines] +BASE_NAME = RtPlatformStatusCodeLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + RtPlatformStatusCode.c + +[includes.common] + $(EDK_SOURCE)\Foundation\Framework + $(EDK_SOURCE)\Foundation + $(EDK_SOURCE)\Foundation\Efi + . + ..\..\Include + $(EDK_SOURCE)\Foundation\Include + $(EDK_SOURCE)\Foundation\Efi\Include + $(EDK_SOURCE)\Foundation\Framework\Include + $(EDK_SOURCE)\Foundation\Include\IndustryStandard + $(EDK_SOURCE)\Foundation\Core\Dxe + $(EDK_SOURCE)\Foundation\Library\Dxe\Include + +[libraries.common] + HobLib + RtMemoryStatusCodeLib + BsDataHubStatusCodeLib + +[nmake.common] diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPort80StatusCode/RtPort80StatusCode.c b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPort80StatusCode/RtPort80StatusCode.c new file mode 100644 index 0000000000..24f3aa4297 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPort80StatusCode/RtPort80StatusCode.c @@ -0,0 +1,63 @@ +/*++ + +Copyright (c) 2004 - 2007, 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: + + RtPort80StatusCode.c + +Abstract: + + Lib to provide port 80 status code reporting Routines. This routine + does not use PPI's but is monolithic. + + In general you should use PPI's, but some times a monolithic driver + is better. The best justification for monolithic code is debug. + +--*/ + +#include "RtPort80StatusCode.h" + +EFI_STATUS +EFIAPI +RtPort80ReportStatusCode ( + IN EFI_STATUS_CODE_TYPE CodeType, + IN EFI_STATUS_CODE_VALUE Value, + IN UINT32 Instance, + IN EFI_GUID * CallerId, + IN EFI_STATUS_CODE_DATA * Data OPTIONAL + ) +/*++ + +Routine Description: + + Provide a port 80 status code + +Arguments: + + Same as ReportStatusCode PPI + +Returns: + + EFI_SUCCESS Always returns success. + +--*/ +{ + UINT8 Port80Code; + + // + // Progress or error code, Output Port 80h card + // + if (CodeTypeToPostCode (CodeType, Value, &Port80Code)) { + IoWrite8 (0x80, Port80Code); + } + + return EFI_SUCCESS; +} diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPort80StatusCode/RtPort80StatusCode.h b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPort80StatusCode/RtPort80StatusCode.h new file mode 100644 index 0000000000..c9bcf21514 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPort80StatusCode/RtPort80StatusCode.h @@ -0,0 +1,33 @@ +/*++ + +Copyright (c) 2004, 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: + + RtPort80StatusCode.h + +Abstract: + + Lib to provide status code reporting via port 80. + +--*/ + +#ifndef _EFI_PORT_80_STATUS_CODE_H_ +#define _EFI_PORT_80_STATUS_CODE_H_ + +// +// Statements that include other files +// +#include "Tiano.h" +#include "EfiCommonLib.h" +#include "EfiRuntimeLib.h" +#include "EfiStatusCode.h" + +#endif diff --git a/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPort80StatusCode/RtPort80StatusCode.inf b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPort80StatusCode/RtPort80StatusCode.inf new file mode 100644 index 0000000000..b572c20b64 --- /dev/null +++ b/EdkCompatibilityPkg/Sample/Platform/Generic/RuntimeDxe/StatusCode/Lib/RtPort80StatusCode/RtPort80StatusCode.inf @@ -0,0 +1,44 @@ +#/*++ +# +# Copyright (c) 2004, 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: +# +# RtPort80StatusCode.inf +# +# Abstract: +# +# Library producing a port 80 status code functionality. +# +#--*/ + +[defines] +BASE_NAME = RtPort80StatusCodeLib +COMPONENT_TYPE = LIBRARY + +[sources.common] + RtPort80StatusCode.c + RtPort80StatusCode.h + +[includes.common] + $(EDK_SOURCE)\Foundation + $(EDK_SOURCE)\Foundation\Framework + $(EDK_SOURCE)\Foundation\Efi + . + $(EDK_SOURCE)\Foundation\Include + $(EDK_SOURCE)\Foundation\Efi\Include + $(EDK_SOURCE)\Foundation\Framework\Include + $(EDK_SOURCE)\Foundation\Include\IndustryStandard + $(EDK_SOURCE)\Foundation\Core\Dxe + $(EDK_SOURCE)\Foundation\Library\Dxe\Include + +[libraries.platform] + +[nmake.common]