From 94774441154ca4e11ab028490c66f1ef6105d267 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Thu, 28 Jun 2007 11:29:10 +0000 Subject: add English.inf, EdkFvbServiceLib.inf and Variable.inf git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2842 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/EdkFvbServiceLib/CommonHeader.h | 49 ++++++++ .../Library/EdkFvbServiceLib/EdkFvbServiceLib.inf | 123 +++++++++++++++++++++ .../Library/EdkFvbServiceLib/EdkFvbServiceLib.msa | 81 ++++++++++++++ MdeModulePkg/Library/EdkFvbServiceLib/EntryPoint.c | 54 +++++++++ MdeModulePkg/Library/EdkFvbServiceLib/Fvb.h | 44 ++++++++ 5 files changed, 351 insertions(+) create mode 100644 MdeModulePkg/Library/EdkFvbServiceLib/CommonHeader.h create mode 100644 MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf create mode 100644 MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.msa create mode 100644 MdeModulePkg/Library/EdkFvbServiceLib/EntryPoint.c create mode 100644 MdeModulePkg/Library/EdkFvbServiceLib/Fvb.h (limited to 'MdeModulePkg/Library') diff --git a/MdeModulePkg/Library/EdkFvbServiceLib/CommonHeader.h b/MdeModulePkg/Library/EdkFvbServiceLib/CommonHeader.h new file mode 100644 index 0000000..01f5eb9 --- /dev/null +++ b/MdeModulePkg/Library/EdkFvbServiceLib/CommonHeader.h @@ -0,0 +1,49 @@ +/**@file + Common header file shared by all source files. + + This file includes package header files, library classes and protocol, PPI & GUID definitions. + + Copyright (c) 2006 - 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. +**/ + +#ifndef __COMMON_HEADER_H_ +#define __COMMON_HEADER_H_ + + +// +// The package level header files this module uses +// +#include +// +// The protocols, PPI and GUID defintions for this module +// +#include +#include +// +// The Library classes this module consumes +// +#include +#include +#include +#include +#include +#include +#include + +// +// Declaration for callback Event. +// +VOID +EFIAPI +FvbVirtualAddressChangeNotifyEvent ( + IN EFI_EVENT Event, + IN VOID *Context + ); + +#endif diff --git a/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf b/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf new file mode 100644 index 0000000..9a89bfb --- /dev/null +++ b/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.inf @@ -0,0 +1,123 @@ +#/** @file +# FvbService Library for UEFI drivers +# +# This library instance provide sevice functions to access Firmware Volume Block protocol. +# Copyright (c) 2006 - 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. +# +# +#**/ + +################################################################################ +# +# Defines Section - statements that will be processed to create a Makefile. +# +################################################################################ +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = EdkFvbServiceLib + FILE_GUID = bd4d540e-04b0-4b10-8fd5-4a7bb533cf67 + MODULE_TYPE = DXE_DRIVER + VERSION_STRING = 1.0 + LIBRARY_CLASS = EdkFvbServiceLib|DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + + CONSTRUCTOR = FvbLibInitialize + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF +# +# VIRTUAL_ADDRESS_MAP_CALLBACK = FvbVirtualAddressChangeNotifyEvent +# + +################################################################################ +# +# Sources Section - list of files that are required for the build to succeed. +# +################################################################################ + +[Sources.common] + Fvb.h + +[Sources.Ia32] + Ia32/Fvb.c + +[Sources.X64] + x64/Fvb.c + +[Sources.IPF] + Ipf/Fvb.c + + +################################################################################ +# +# Includes Section - list of Include locations that are required for +# this module. +# +################################################################################ + +[Includes] + $(WORKSPACE)/MdePkg/Include/Library + +################################################################################ +# +# Package Dependency Section - list of Package files that are required for +# this module. +# +################################################################################ + +[Packages] + MdePkg/MdePkg.dec + IntelFrameworkPkg/IntelFrameworkPkg.dec + +################################################################################ +# +# Library Class Section - list of Library Classes that are required for +# this module. +# +################################################################################ + +[LibraryClasses.IA32] + UefiBootServicesTableLib + UefiRuntimeLib + BaseMemoryLib + DebugLib + BaseLib + UefiLib + +[LibraryClasses.X64] + UefiBootServicesTableLib + UefiRuntimeLib + BaseMemoryLib + DebugLib + BaseLib + UefiLib + + +################################################################################ +# +# Protocol C Name Section - list of Protocol and Protocol Notify C Names +# that this module uses or produces. +# +################################################################################ + +[Protocols] + gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL_NOTIFY SOMETIMES_CONSUMED + +[Protocols.IA32] + gEfiFvbExtensionProtocolGuid # PROTOCOL ALWAYS_CONSUMED + gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL ALWAYS_CONSUMED + +[Protocols.X64] + gEfiFvbExtensionProtocolGuid # PROTOCOL ALWAYS_CONSUMED + gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL ALWAYS_CONSUMED + diff --git a/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.msa b/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.msa new file mode 100644 index 0000000..2aa7abb --- /dev/null +++ b/MdeModulePkg/Library/EdkFvbServiceLib/EdkFvbServiceLib.msa @@ -0,0 +1,81 @@ + + + + EdkFvbServiceLib + DXE_DRIVER + bd4d540e-04b0-4b10-8fd5-4a7bb533cf67 + 1.0 + FvbService Library for UEFI drivers + This library instance provide sevice functions to access Firmware Volume Block protocol. + Copyright (c) 2006 - 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. + FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 + + + IA32 X64 IPF + false + EdkFvbServiceLib + + + + EdkFvbServiceLib + + + UefiLib + + + BaseLib + + + DebugLib + + + BaseMemoryLib + + + UefiRuntimeLib + + + UefiBootServicesTableLib + + + EdkDxeSalLib + + + + Fvb.h + Ia32/Fvb.c + x64/Fvb.c + Ipf/Fvb.c + + + + + + + + gEfiFirmwareVolumeBlockProtocolGuid + + + gEfiFvbExtensionProtocolGuid + + + gEfiFirmwareVolumeBlockProtocolGuid + + + + EFI_SPECIFICATION_VERSION 0x00020000 + EDK_RELEASE_VERSION 0x00020000 + + FvbLibInitialize + + + FvbVirtualAddressChangeNotifyEvent + + + \ No newline at end of file diff --git a/MdeModulePkg/Library/EdkFvbServiceLib/EntryPoint.c b/MdeModulePkg/Library/EdkFvbServiceLib/EntryPoint.c new file mode 100644 index 0000000..9cdf594 --- /dev/null +++ b/MdeModulePkg/Library/EdkFvbServiceLib/EntryPoint.c @@ -0,0 +1,54 @@ +/**@file + Entry Point Source file. + + This file contains the user entry point + + Copyright (c) 2006 - 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. +**/ + +// +// Include common header file for this module. +// +#include "CommonHeader.h" + +// +// Event for Exit Boot Services Callback +// +STATIC EFI_EVENT mExitBootServicesEvent = NULL; + +/** + The user Entry Point for module EdkFvbServiceLib. The user code starts with this function. + + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval other Some error occurs when executing this entry point. + +**/ +EFI_STATUS +EFIAPI +InitializeEdkFvbServiceLib( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + Status = gBS->CreateEvent ( + EVT_SIGNAL_EXIT_BOOT_SERVICES, + TPL_NOTIFY, + FvbVirtualAddressChangeNotifyEvent, + NULL, + &mExitBootServicesEvent + ); + ASSERT_EFI_ERROR (Status); + + return Status; +} diff --git a/MdeModulePkg/Library/EdkFvbServiceLib/Fvb.h b/MdeModulePkg/Library/EdkFvbServiceLib/Fvb.h new file mode 100644 index 0000000..0f17932 --- /dev/null +++ b/MdeModulePkg/Library/EdkFvbServiceLib/Fvb.h @@ -0,0 +1,44 @@ +/** + The internal header file for EdkFvbServiceLib. + +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 + +**/ + +#ifndef __FVB_H__ +#define __FVB_H__ + +// +// The package level header files this module uses +// +#include +// +// The protocols, PPI and GUID defintions for this module +// +#include +#include +// +// The Library classes this module consumes +// +#include +#include +#include +#include +#include +#include +#include + +#define MAX_FVB_COUNT 16 + +typedef struct { + EFI_HANDLE Handle; + EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *Fvb; + EFI_FVB_EXTENSION_PROTOCOL *FvbExtension; + BOOLEAN IsRuntimeAccess; +} FVB_ENTRY; + +#endif -- cgit v1.1