From 738ec5655985bd75d2eb15cc161a77b46f4abeac Mon Sep 17 00:00:00 2001 From: vanjeff Date: Fri, 22 Jun 2007 07:42:13 +0000 Subject: Import DxeCoreHobLib, DxeHobLib, PeimEntryPoint and PeiServicesLib. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2714 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/PeimEntryPoint/CommonHeader.h | 32 ++++++++++ MdePkg/Library/PeimEntryPoint/PeimEntryPoint.c | 73 +++++++++++++++++++++ MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf | 80 ++++++++++++++++++++++++ MdePkg/Library/PeimEntryPoint/PeimEntryPoint.msa | 42 +++++++++++++ 4 files changed, 227 insertions(+) create mode 100644 MdePkg/Library/PeimEntryPoint/CommonHeader.h create mode 100644 MdePkg/Library/PeimEntryPoint/PeimEntryPoint.c create mode 100644 MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf create mode 100644 MdePkg/Library/PeimEntryPoint/PeimEntryPoint.msa (limited to 'MdePkg/Library/PeimEntryPoint') diff --git a/MdePkg/Library/PeimEntryPoint/CommonHeader.h b/MdePkg/Library/PeimEntryPoint/CommonHeader.h new file mode 100644 index 0000000000..64d6b7a77a --- /dev/null +++ b/MdePkg/Library/PeimEntryPoint/CommonHeader.h @@ -0,0 +1,32 @@ +/**@file + Common header file shared by all source files. + + This file includes package header files, library classes and protocol, PPI & GUID definitions. + + Copyright (c) 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 +// +// +// The Library classes this module consumes +// +#include +#include + +#endif diff --git a/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.c b/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.c new file mode 100644 index 0000000000..f80d4c2c88 --- /dev/null +++ b/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.c @@ -0,0 +1,73 @@ + +/** @file + Entry point to a PEIM. + +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. + +**/ + +// +// Include common header file for this module. +// +#include "CommonHeader.h" + +/** + Image entry point of Peim. + + @param FfsHeader Pointer to FFS header the loaded driver. + @param PeiServices Pointer to the PEI services. + + @return Status returned by entry points of Peims. + +**/ +EFI_STATUS +EFIAPI +_ModuleEntryPoint ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ) +{ + if (_gPeimRevision != 0) { + // + // Make sure that the PEI spec revision of the platform is >= PEI spec revision of the driver + // + ASSERT ((*PeiServices)->Hdr.Revision >= _gPeimRevision); + } + + // + // Call constructor for all libraries + // + ProcessLibraryConstructorList (FfsHeader, PeiServices); + + // + // Call the driver entry point + // + return ProcessModuleEntryPointList (FfsHeader, PeiServices); +} + + +/** + Wrapper of Peim image entry point. + + @param FfsHeader Pointer to FFS header the loaded driver. + @param PeiServices Pointer to the PEI services. + + @return Status returned by entry points of Peims. + +**/ +EFI_STATUS +EFIAPI +EfiMain ( + IN EFI_FFS_FILE_HEADER *FfsHeader, + IN EFI_PEI_SERVICES **PeiServices + ) +{ + return _ModuleEntryPoint (FfsHeader, PeiServices); +} diff --git a/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf b/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf new file mode 100644 index 0000000000..cefd6e4e88 --- /dev/null +++ b/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf @@ -0,0 +1,80 @@ +#/** @file +# Entry point of PEIM +# +# Contain entry point to PEIM Module Type, construct all dependent libararies +# Copyright (c) 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 = PeimEntryPoint + FILE_GUID = fa177ff7-1fc7-458d-a358-d9d62ae61cec + MODULE_TYPE = PEIM + VERSION_STRING = 1.0 + LIBRARY_CLASS = PeimEntryPoint|PEIM + EDK_RELEASE_VERSION = 0x00020000 + EFI_SPECIFICATION_VERSION = 0x00020000 + + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 IPF EBC +# + +################################################################################ +# +# Sources Section - list of files that are required for the build to succeed. +# +################################################################################ + +[Sources.common] + PeimEntryPoint.c + CommonHeader.h + + +################################################################################ +# +# 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 + + +################################################################################ +# +# Library Class Section - list of Library Classes that are required for +# this module. +# +################################################################################ + +[LibraryClasses] + DebugLib + diff --git a/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.msa b/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.msa new file mode 100644 index 0000000000..d03d350671 --- /dev/null +++ b/MdePkg/Library/PeimEntryPoint/PeimEntryPoint.msa @@ -0,0 +1,42 @@ + + + + PeimEntryPoint + PEIM + fa177ff7-1fc7-458d-a358-d9d62ae61cec + 1.0 + Entry point of PEIM + Contain entry point to PEIM Module Type, construct all dependent libararies + 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. + FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052 + + + IA32 X64 IPF EBC + false + PeimEntryPoint + + + + PeimEntryPoint + + + DebugLib + + + + PeimEntryPoint.c + + + + + + EFI_SPECIFICATION_VERSION 0x00020000 + EDK_RELEASE_VERSION 0x00020000 + + \ No newline at end of file -- cgit v1.2.3