From 878ddf1fc3540a715f63594ed22b6929e881afb4 Mon Sep 17 00:00:00 2001 From: bbahnsen Date: Fri, 21 Apr 2006 22:54:32 +0000 Subject: Initial import. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Universal/StatusCode/RuntimeDxe/DebugAssert.c | 231 +++++++++++++++++++++ .../StatusCode/RuntimeDxe/Ia32/Ia32StatusCode.c | 75 +++++++ .../StatusCode/RuntimeDxe/Ia32/Ia32StatusCode.dxs | 26 +++ .../StatusCode/RuntimeDxe/Ipf/IpfStatusCode.c | 126 +++++++++++ .../StatusCode/RuntimeDxe/Ipf/IpfStatusCode.dxs | 27 +++ .../Universal/StatusCode/RuntimeDxe/StatusCode.c | 172 +++++++++++++++ .../Universal/StatusCode/RuntimeDxe/StatusCode.h | 64 ++++++ .../Universal/StatusCode/RuntimeDxe/StatusCode.mbd | 55 +++++ .../Universal/StatusCode/RuntimeDxe/StatusCode.msa | 77 +++++++ .../Universal/StatusCode/RuntimeDxe/build.xml | 47 +++++ .../StatusCode/RuntimeDxe/x64/x64StatusCode.c | 75 +++++++ .../StatusCode/RuntimeDxe/x64/x64StatusCode.dxs | 27 +++ 12 files changed, 1002 insertions(+) create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/DebugAssert.c create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ia32/Ia32StatusCode.c create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ia32/Ia32StatusCode.dxs create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ipf/IpfStatusCode.c create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ipf/IpfStatusCode.dxs create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.c create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.h create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.mbd create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.msa create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/build.xml create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/x64/x64StatusCode.c create mode 100644 EdkModulePkg/Universal/StatusCode/RuntimeDxe/x64/x64StatusCode.dxs (limited to 'EdkModulePkg/Universal/StatusCode') diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/DebugAssert.c b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/DebugAssert.c new file mode 100644 index 0000000..75f0ed1 --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/DebugAssert.c @@ -0,0 +1,231 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + DebugAssert.c + +Abstract: + + Produce EfiDebugAssertProtocol to enable EfiUtilityLib to function. + The EfiUtilityLib is used by the EFI shell! + +--*/ + +#include "StatusCode.h" + +EFI_STATUS +EFIAPI +StatusCodeDebugAssert ( + IN EFI_DEBUG_ASSERT_PROTOCOL *This, + IN CHAR8 *FileName, + IN INTN LineNumber, + IN CHAR8 *Description + ); + +EFI_STATUS +EFIAPI +StatusCodeDebugPrint ( + IN EFI_DEBUG_ASSERT_PROTOCOL *This, + IN UINTN ErrorLevel, + IN CHAR8 *Format, + IN VA_LIST Marker + ); + +EFI_STATUS +EFIAPI +StatusCodePostCode ( + IN EFI_DEBUG_ASSERT_PROTOCOL * This, + IN UINT16 PostCode, + IN CHAR8 *PostCodeString OPTIONAL + ); + +EFI_STATUS +EFIAPI +StatusCodeGetErrorLevel ( + IN EFI_DEBUG_ASSERT_PROTOCOL *This, + IN UINTN *ErrorLevel + ); + +EFI_STATUS +EFIAPI +StatusCodeSetErrorLevel ( + IN EFI_DEBUG_ASSERT_PROTOCOL *This, + IN UINTN ErrorLevel + ); + +// +// Protocol instance, there can be only one. +// +EFI_HANDLE mHandle = NULL; +EFI_DEBUG_ASSERT_PROTOCOL mDebugAssertProtocol = { + StatusCodeDebugAssert, + StatusCodeDebugPrint, + StatusCodePostCode, + StatusCodeGetErrorLevel, + StatusCodeSetErrorLevel +}; + +// +// Function implementations +// +EFI_STATUS +EFIAPI +StatusCodeDebugAssert ( + IN EFI_DEBUG_ASSERT_PROTOCOL *This, + IN CHAR8 *FileName, + IN INTN LineNumber, + IN CHAR8 *Description + ) +/*++ + +Routine Description: + + Worker function for ASSERT (). If Error Logging hub is loaded log ASSERT + information. If Error Logging hub is not loaded CpuBreakpoint (). + +Arguments: + + This - Protocol instance. + FileName - File name of failing routine. + LineNumber - Line number of failing ASSERT(). + Description - Description, usually the assertion, + +Returns: + + EFI_SUCCESS The function always completes successfully. + +--*/ +{ + DebugAssert (FileName, LineNumber, Description); + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +StatusCodeDebugPrint ( + IN EFI_DEBUG_ASSERT_PROTOCOL *This, + IN UINTN ErrorLevel, + IN CHAR8 *Format, + IN VA_LIST Marker + ) +/*++ + +Routine Description: + + Worker function for DEBUG (). If Error Logging hub is loaded log ASSERT + information. If Error Logging hub is not loaded do nothing. + +Arguments: + + This - Protocol Instance. + ErrorLevel - If error level is set do the debug print. + Format - String to use for the print, followed by Print arguments. + +Returns: + + EFI_SUCCESS The function always completes successfully. + +--*/ +{ + CHAR8 Buffer[EFI_STATUS_CODE_DATA_MAX_SIZE]; + + AsciiVSPrint (Buffer, EFI_STATUS_CODE_DATA_MAX_SIZE, Format, Marker); + DebugPrint (ErrorLevel, Buffer); + + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +StatusCodeGetErrorLevel ( + IN EFI_DEBUG_ASSERT_PROTOCOL *This, + IN UINTN *ErrorLevel + ) +{ + *ErrorLevel = PcdGet32(PcdDebugPrintErrorLevel); + return EFI_SUCCESS; +} + +EFI_STATUS +EFIAPI +StatusCodeSetErrorLevel ( + IN EFI_DEBUG_ASSERT_PROTOCOL *This, + IN UINTN ErrorLevel + ) +{ + return EFI_UNSUPPORTED; +} + +EFI_STATUS +EFIAPI +StatusCodePostCode ( + IN EFI_DEBUG_ASSERT_PROTOCOL * This, + IN UINT16 PostCode, + IN CHAR8 *PostCodeString OPTIONAL + ) +/*++ + +Routine Description: + + Write the code to IO ports 80 and 81. + +Arguments: + + This - Protocol Instance. + PostCode - Code to write + PostCodeString - String, currently ignored. + +Returns: + + EFI_SUCCESS The function always completes successfully. + +--*/ +{ + IoWrite8 (0x80, (UINT8) (PostCode & 0xff)); + IoWrite8 (0x81, (UINT8) (PostCode >> 8)); + + return EFI_SUCCESS; +} + +EFI_STATUS +InstallStatusCodeDebugAssert ( + VOID + ) +/*++ + +Routine Description: + + Install the status code debug assert protocol + +Arguments: + + None + +Returns: + + Results of call to InstallProtocolInterface. + +--*/ +{ + + DEBUG_CODE ( + gBS->InstallProtocolInterface ( + &mHandle, + &gEfiDebugAssertProtocolGuid, + EFI_NATIVE_INTERFACE, + &mDebugAssertProtocol + ); + ); + + return EFI_SUCCESS; +} diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ia32/Ia32StatusCode.c b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ia32/Ia32StatusCode.c new file mode 100644 index 0000000..d2e1009 --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ia32/Ia32StatusCode.c @@ -0,0 +1,75 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + Ia32StatusCode.c + +Abstract: + + Installs the ReportStatusCode runtime service. + +--*/ + +#include "StatusCode.h" + +// +// +// +EFI_HANDLE gStatusCodeHandle = NULL; + +const EFI_STATUS_CODE_PROTOCOL gStatusCodeInstance = { + StatusCodeReportStatusCode +}; + +// +// Define the driver entry point +// +EFI_STATUS +EFIAPI +InstallStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Install the ReportStatusCode runtime service. + +Arguments: + + ImageHandle Image handle of the loaded driver + SystemTable Pointer to the System Table + +Returns: + + EFI_SUCCESS The function always returns success. + +--*/ +{ + EFI_STATUS Status; + + // + // Initialize RT status code + // + InitializeStatusCode (ImageHandle, SystemTable); + + Status = gBS->InstallMultipleProtocolInterfaces ( + &gStatusCodeHandle, + &gEfiStatusCodeRuntimeProtocolGuid, + &gStatusCodeInstance, + NULL + ); + ASSERT_EFI_ERROR (Status); + + return Status; +} diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ia32/Ia32StatusCode.dxs b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ia32/Ia32StatusCode.dxs new file mode 100644 index 0000000..6371258 --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ia32/Ia32StatusCode.dxs @@ -0,0 +1,26 @@ +#/*++ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# Ia32StatusCode.dxs +# +# Abstract: +# +# Dependency expression source file. +# +#--*/ +#include +#include + +DEPENDENCY_START + EFI_DATA_HUB_PROTOCOL_GUID AND EFI_CPU_IO_PROTOCOL_GUID +DEPENDENCY_END diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ipf/IpfStatusCode.c b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ipf/IpfStatusCode.c new file mode 100644 index 0000000..62564c0 --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ipf/IpfStatusCode.c @@ -0,0 +1,126 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + IpfStatusCode.c + +Abstract: + + Contains the IPF installation function and an ESAL entry. + +--*/ + +#include "StatusCode.h" + +SAL_RETURN_REGS +ReportStatusCodeEsalServicesClassCommonEntry ( + IN UINT64 FunctionId, + IN UINT64 Arg2, + IN UINT64 Arg3, + IN UINT64 Arg4, + IN UINT64 Arg5, + IN UINT64 Arg6, + IN UINT64 Arg7, + IN UINT64 Arg8, + IN SAL_EXTENDED_SAL_PROC ExtendedSalProc, + IN BOOLEAN VirtualMode, + IN VOID *Global + ) +/*++ + +Routine Description: + + Main entry for Extended SAL ReportStatusCode Services + +Arguments: + + FunctionId Function Id which needed to be called + Arg2 Efi status code type + Arg3 Efi status code value + Arg4 Instance number + Arg5 Caller Id + Arg6 Efi status code data + Arg7 Not used + Arg8 Not used + ExtendedSalProc Esal Proc pointer + VirtualMode If this function is called in virtual mode + Global This module's global variable pointer + +Returns: + + SAL_RETURN_REGS + +--*/ +{ + SAL_RETURN_REGS ReturnVal; + + switch (FunctionId) { + + case ReportStatusCodeService: + ReturnVal.Status = StatusCodeReportStatusCode ( + (EFI_STATUS_CODE_TYPE) Arg2, + (EFI_STATUS_CODE_VALUE) Arg3, + (UINT32) Arg4, + (EFI_GUID *) Arg5, + (EFI_STATUS_CODE_DATA *) Arg6 + ); + break; + + default: + ReturnVal.Status = EFI_SAL_INVALID_ARGUMENT; + break; + } + + return ReturnVal; +} + +EFI_STATUS +EFIAPI +InstallStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Install the ReportStatusCode runtime service. + +Arguments: + + ImageHandle Image handle of the loaded driver + SystemTable Pointer to the System Table + +Returns: + + EFI_SUCCESS The function always returns success. + +--*/ +{ + // + // Initialize RT status code + // + InitializeStatusCode (ImageHandle, SystemTable); + + // + // Initialize ESAL capabilities + // + RegisterEsalClass ( + &gEfiExtendedSalStatusCodeServicesProtocolGuid, + NULL, + ReportStatusCodeEsalServicesClassCommonEntry, + StatusCode, + NULL + ); + + return EFI_SUCCESS; +} diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ipf/IpfStatusCode.dxs b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ipf/IpfStatusCode.dxs new file mode 100644 index 0000000..aaa3efe --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/Ipf/IpfStatusCode.dxs @@ -0,0 +1,27 @@ +#/*++ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# IpfStatusCode.dxs +# +# Abstract: +# +# Dependency expression source file. +# +#--*/ + +#include +#include + +DEPENDENCY_START + EFI_DATA_HUB_PROTOCOL_GUID AND EFI_EXTENDED_SAL_BASE_IO_SERVICES_PROTOCOL_GUID +DEPENDENCY_END diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.c b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.c new file mode 100644 index 0000000..13b6426 --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.c @@ -0,0 +1,172 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + StatusCode.c + +Abstract: + + Status Code Architectural Protocol implementation as defined in Tiano + Architecture Specification. + + This driver also depends on the DataHub, and will log all status code info + to the DataHub. Fatal Errors are Printed to Standard Error (StdErr) and not + logged to the data hub (If you crash what good is the data in the data hub). + + This driver has limited functionality at runtime and will not log to Data Hub + at runtime. + + Notes: + This driver assumes the following ReportStatusCode strategy: + PEI -> uses PeiReportStatusCode + DXE IPL -> uses PeiReportStatusCode + early DXE -> uses PeiReportStatusCode via HOB + DXE -> This driver + RT -> This driver + +--*/ + +#include "StatusCode.h" + +EFI_LOCK mStatusCodeLock; +BOOLEAN mStatusCodeFlag = FALSE; + +// +// Function implemenations +// + + +EFI_STATUS +EFIAPI +StatusCodeReportStatusCode ( + 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: + + Calls into the platform library which dispatches the platform specific + listeners. For NT environments we still call back into PEI because the + ReportStatusCode functionality requires Win32 services and is built into + the SecMain.exe utility. + +Arguments: + + (See Tiano Runtime Specification) + +Returns: + + None + +--*/ +{ + EFI_STATUS Status; + + // + // Acquire the lock required to update mStatusCodeFlag + // + Status = EfiAcquireLockOrFail (&mStatusCodeLock); + if (EFI_ERROR (Status)) { + // + // Check for reentrancy of the lock + // + return EFI_DEVICE_ERROR; + } + // + // Check to see if we are already in the middle of a ReportStatusCode() + // + if (mStatusCodeFlag) { + EfiReleaseLock (&mStatusCodeLock); + return EFI_DEVICE_ERROR; + } + // + // Set the flag to show we are in the middle of a ReportStatusCode() + // + mStatusCodeFlag = TRUE; + + // + // Release the lock for updating mStatusCodeFlag + // + EfiReleaseLock (&mStatusCodeLock); + + // + // Go do the work required to report a status code + // + RtPlatformReportStatusCode (CodeType, Value, Instance, CallerId, Data); + + // + // Acquire the lock required to update mStatusCodeFlag + // + Status = EfiAcquireLockOrFail (&mStatusCodeLock); + if (EFI_ERROR (Status)) { + // + // Check for reentrancy of the lock + // + return EFI_DEVICE_ERROR; + } + // + // Clear the flag to show we are no longer in the middle of a ReportStatusCode() + // + mStatusCodeFlag = FALSE; + + // + // Release the lock for updating mStatusCodeFlag + // + EfiReleaseLock (&mStatusCodeLock); + + return EFI_SUCCESS; +} +// +// Protocol instance, there can be only one. +// +EFI_STATUS +InitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Install Driver to produce Report Status Code Arch Protocol + +Arguments: + + (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT) + +Returns: + + EFI_SUCCESS - Logging Hub protocol installed + Other - No protocol installed, unload driver. + +--*/ +{ + + EfiInitializeLock (&mStatusCodeLock, EFI_TPL_HIGH_LEVEL); + + // + // Call the platform hook to initialize the different listeners. + // + RtPlatformStatusCodeInitialize (); + + // + // Register a protocol that EfiUtilityLib can use to implement DEBUG () and ASSERT () + // Macros. + // + InstallStatusCodeDebugAssert (); + + return EFI_SUCCESS; +} diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.h b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.h new file mode 100644 index 0000000..cb4a4d9 --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.h @@ -0,0 +1,64 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + StatusCode.h + +Abstract: + + EFI DXE/RT Status Code include file. + +--*/ + +#ifndef _EFI_RUNTIME_STATUS_CODE_H_ +#define _EFI_RUNTIME_STATUS_CODE_H_ + +// +// Function prototypes +// + +EFI_STATUS +EFIAPI +StatusCodeReportStatusCode ( + 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 + ) +; + +EFI_STATUS +InitializeStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + +EFI_STATUS +InstallStatusCodeDebugAssert ( + VOID + ) +; + +// +// Driver entry point +// +EFI_STATUS +EFIAPI +InstallStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +; + +#endif diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.mbd b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.mbd new file mode 100644 index 0000000..923914a --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.mbd @@ -0,0 +1,55 @@ + + + + + StatusCode + 9F455D3B-2B8A-4c06-960B-A71B9714B9CD + 0 + FIX ME! + 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. + + 2006-03-12 17:09 + 2006-03-19 15:19 + + + UefiBootServicesTableLib + BaseLib + EdkDxeRuntimeDriverLib + UefiDriverEntryPoint + UefiLib + BasePrintLib + BaseDebugLibReportStatusCode + EdkRtPlatformStatusCodeLib + DxeIoLibCpuIo + BaseMemoryLib + DxeReportStatusCodeLib + EdkRtMemoryStatusCodeLib + EdkBsDataHubStatusCodeLib + DxeHobLib + DxeMemoryAllocationLib + EdkMemoryStatusCodeLib + + + EdkDxeSalLib + + + + _ModuleEntryPoint + + diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.msa b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.msa new file mode 100644 index 0000000..b0d888b --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/StatusCode.msa @@ -0,0 +1,77 @@ + + + + + StatusCode + DXE_RUNTIME_DRIVER + RT_DRIVER + 9F455D3B-2B8A-4c06-960B-A71B9714B9CD + 0 + Component description file for DiskIo module. + FIX ME! + 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. + + 0 + 2006-03-12 17:09 + 2006-03-19 15:19 + + + BaseLib + DxeRuntimeDriverLib + UefiDriverEntryPoint + UefiLib + DebugLib + PrintLib + IoLib + EdkRtPlatformStatusCodeLib + EdkDxeSalLib + UefiBootServicesTableLib + PcdLib + + + DebugAssert.c + StatusCode.c + StatusCode.h + + Ia32\Ia32StatusCode.c + Ia32\Ia32StatusCode.dxs + + + x64\x64StatusCode.c + x64\x64StatusCode.dxs + + + Ipf\IpfStatusCode.c + Ipf\IpfStatusCode.dxs + + + + MdePkg + EdkModulePkg + + + DebugAssert + ExtendedSalStatusCodeServices + + + + InstallStatusCode + + + diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/build.xml b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/build.xml new file mode 100644 index 0000000..994d073 --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/build.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/x64/x64StatusCode.c b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/x64/x64StatusCode.c new file mode 100644 index 0000000..4c8ad0c --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/x64/x64StatusCode.c @@ -0,0 +1,75 @@ +/*++ + +Copyright (c) 2006, Intel Corporation +All rights reserved. This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +Module Name: + + x64StatusCode.c + +Abstract: + + Installs the ReportStatusCode runtime service. + +--*/ + +#include "StatusCode.h" + +// +// +// +EFI_HANDLE gStatusCodeHandle = NULL; + +const EFI_STATUS_CODE_PROTOCOL gStatusCodeInstance = { + StatusCodeReportStatusCode +}; + +// +// Define the driver entry point +// +EFI_STATUS +EFIAPI +InstallStatusCode ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Install the ReportStatusCode runtime service. + +Arguments: + + ImageHandle Image handle of the loaded driver + SystemTable Pointer to the System Table + +Returns: + + EFI_SUCCESS The function always returns success. + +--*/ +{ + EFI_STATUS Status; + + // + // Initialize RT status code + // + InitializeStatusCode (ImageHandle, SystemTable); + + Status = gBS->InstallMultipleProtocolInterfaces ( + &gStatusCodeHandle, + &gEfiStatusCodeRuntimeProtocolGuid, + &gStatusCodeInstance, + NULL + ); + ASSERT_EFI_ERROR (Status); + + return Status; +} diff --git a/EdkModulePkg/Universal/StatusCode/RuntimeDxe/x64/x64StatusCode.dxs b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/x64/x64StatusCode.dxs new file mode 100644 index 0000000..74cf23e --- /dev/null +++ b/EdkModulePkg/Universal/StatusCode/RuntimeDxe/x64/x64StatusCode.dxs @@ -0,0 +1,27 @@ +#/*++ +# +# Copyright (c) 2006, Intel Corporation +# All rights reserved. This program and the accompanying materials +# are licensed and made available under the terms and conditions of the BSD License +# which accompanies this distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +# +# Module Name: +# +# x64StatusCode.dxs +# +# Abstract: +# +# Dependency expression source file. +# +#--*/ + +#include +#include + +DEPENDENCY_START + EFI_DATA_HUB_PROTOCOL_GUID AND EFI_CPU_IO_PROTOCOL_GUID +DEPENDENCY_END -- cgit v1.1