mirror of https://github.com/acidanthera/audk.git
Code scrub for the following drivers and librarys.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7172 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
303ee61d53
commit
109e9a6156
|
@ -1,7 +1,8 @@
|
||||||
/** @file
|
/** @file
|
||||||
This simple application just print a "UEFI Hello World!" to the UEFI Console.
|
This sample application bases on HelloWorld PCD setting
|
||||||
|
to print "UEFI Hello World!" to the UEFI Console.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -20,8 +21,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The user Entry Point for Application. The user code starts with this function
|
The user Entry Point for Application. The user code starts with this function
|
||||||
as the real entry point for the image goes into a library that calls this
|
as the real entry point for the application.
|
||||||
function.
|
|
||||||
|
|
||||||
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
@param[in] ImageHandle The firmware allocated handle for the EFI image.
|
||||||
@param[in] SystemTable A pointer to the EFI System Table.
|
@param[in] SystemTable A pointer to the EFI System Table.
|
||||||
|
@ -46,6 +46,9 @@ UefiMain (
|
||||||
//
|
//
|
||||||
if (FeaturePcdGet (PcdHelloWorldPrintEnable)) {
|
if (FeaturePcdGet (PcdHelloWorldPrintEnable)) {
|
||||||
for (Index = 0; Index < PcdGet32 (PcdHelloWorldPrintTimes); Index ++) {
|
for (Index = 0; Index < PcdGet32 (PcdHelloWorldPrintTimes); Index ++) {
|
||||||
|
//
|
||||||
|
// Use UefiLib Print API to print string to UEFI console
|
||||||
|
//
|
||||||
Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString));
|
Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#/** @file
|
#/** @file
|
||||||
# Sample UEFI Application Reference Module
|
# Sample UEFI Application Reference EDKII Module
|
||||||
#
|
#
|
||||||
# This is a shell application that will display Hello World.
|
# This is a shell application that will display Hello World.
|
||||||
|
# It uses EDKII PCD feature to show PCD usage and configuration.
|
||||||
|
#
|
||||||
# Copyright (c) 2008, Intel Corporation.
|
# Copyright (c) 2008, Intel Corporation.
|
||||||
#
|
#
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
|
@ -20,7 +22,6 @@
|
||||||
FILE_GUID = 6987936E-ED34-44db-AE97-1FA5E4ED2116
|
FILE_GUID = 6987936E-ED34-44db-AE97-1FA5E4ED2116
|
||||||
MODULE_TYPE = UEFI_APPLICATION
|
MODULE_TYPE = UEFI_APPLICATION
|
||||||
VERSION_STRING = 1.0
|
VERSION_STRING = 1.0
|
||||||
|
|
||||||
ENTRY_POINT = UefiMain
|
ENTRY_POINT = UefiMain
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
This file defines capsule update guid, capsule variable name and
|
This file defines capsule vendor guid, capsule variable name
|
||||||
capsule guid hob data structure, which are required by capsule update feature.
|
and capsule guid hob data structure.
|
||||||
|
They are used by EDKII implementation of capsule update across a system reset.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
|
@ -18,9 +19,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#define __EFI_CAPSULE_VENDOR_GUID_H__
|
#define __EFI_CAPSULE_VENDOR_GUID_H__
|
||||||
|
|
||||||
///
|
///
|
||||||
/// This guid is used as a variable GUID (depending on implementation)
|
/// This guid is used as a variable GUID for the capsule variable
|
||||||
/// for the capsule variable if the capsule pointer is passes through reset
|
/// if the capsule pointer is passed through reset via a variable.
|
||||||
/// via a variable.
|
///
|
||||||
|
/// This guid is also used as a hob GUID for the capsule data
|
||||||
|
/// when the capsule pointer is passed from PEI phase to DXE phase.
|
||||||
///
|
///
|
||||||
#define EFI_CAPSULE_VENDOR_GUID \
|
#define EFI_CAPSULE_VENDOR_GUID \
|
||||||
{ 0x711C703F, 0xC285, 0x4B10, { 0xA3, 0xB0, 0x36, 0xEC, 0xBD, 0x3C, 0x8B, 0xE2 } }
|
{ 0x711C703F, 0xC285, 0x4B10, { 0xA3, 0xB0, 0x36, 0xEC, 0xBD, 0x3C, 0x8B, 0xE2 } }
|
||||||
|
@ -30,14 +33,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
///
|
///
|
||||||
#define EFI_CAPSULE_VARIABLE_NAME L"CapsuleUpdateData"
|
#define EFI_CAPSULE_VARIABLE_NAME L"CapsuleUpdateData"
|
||||||
|
|
||||||
extern EFI_GUID gEfiCapsuleVendorGuid;
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Data structure of capsule guid hob entry
|
/// Data structure of capsule guid hob entry
|
||||||
///
|
///
|
||||||
typedef struct {
|
typedef struct {
|
||||||
EFI_PHYSICAL_ADDRESS BaseAddress; /// Capsule data start address
|
EFI_PHYSICAL_ADDRESS BaseAddress; ///> Capsule data start address
|
||||||
UINT32 Length; /// Length of capsule data.
|
UINT32 Length; ///> Length of capsule data.
|
||||||
} CAPSULE_HOB_INFO;
|
} CAPSULE_HOB_INFO;
|
||||||
|
|
||||||
|
extern EFI_GUID gEfiCapsuleVendorGuid;
|
||||||
|
|
||||||
#endif // #ifndef _EFI_CAPSULE_VENDOR_GUID_H_
|
#endif // #ifndef _EFI_CAPSULE_VENDOR_GUID_H_
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Capsule Library. This library class defines a set of interfaces on
|
This library class defines a set of interfaces on how to process capusle image update.
|
||||||
how to process capusle image update.
|
|
||||||
|
|
||||||
Copyright (c) 2007, Intel Corporation
|
Copyright (c) 2007 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -18,7 +17,8 @@
|
||||||
#define __CAPSULE_LIB_H__
|
#define __CAPSULE_LIB_H__
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Those capsules supported by the firmwares.
|
The firmware checks whether the capsule image is supported
|
||||||
|
by the CapsuleGuid in CapsuleHeader or other specific information in capsule image.
|
||||||
|
|
||||||
@param CapsuleHeader Point to the UEFI capsule image to be checked.
|
@param CapsuleHeader Point to the UEFI capsule image to be checked.
|
||||||
|
|
||||||
|
@ -32,7 +32,8 @@ SupportCapsuleImage (
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The firmware implements to process the capsule image.
|
The firmware specific implementation processes the capsule image
|
||||||
|
if it recognized the format of this capsule image.
|
||||||
|
|
||||||
@param CapsuleHeader Point to the UEFI capsule image to be processed.
|
@param CapsuleHeader Point to the UEFI capsule image to be processed.
|
||||||
|
|
||||||
|
@ -46,5 +47,3 @@ ProcessCapsuleImage (
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/** @file
|
/** @file
|
||||||
Recovery Library. This library class defines a set of methods related recovery mode.
|
Recovery library class defines a set of methods related recovery boot mode.
|
||||||
|
|
||||||
Copyright (c) 2005 - 2008, Intel Corporation. <BR>
|
Copyright (c) 2005 - 2008, Intel Corporation. <BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
|
@ -16,7 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#define __RECOVERY_LIB_H__
|
#define __RECOVERY_LIB_H__
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Calling this function causes the system do recovery.
|
Calling this function causes the system do recovery boot path.
|
||||||
|
|
||||||
@retval EFI_SUCESS Sucess to do recovery.
|
@retval EFI_SUCESS Sucess to do recovery.
|
||||||
@retval Others Fail to do recovery.
|
@retval Others Fail to do recovery.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/** @file
|
/** @file
|
||||||
S3 Library. This library class defines a set of methods related do S3 mode.
|
S3 library class defines a set of methods related do S3 boot mode.
|
||||||
|
|
||||||
Copyright (c) 2005 - 2008, Intel Corporation. <BR>
|
Copyright (c) 2005 - 2008, Intel Corporation. <BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/** @file
|
/** @file
|
||||||
Null Dxe Capsule Library instance.
|
Null Dxe Capsule Library instance does nothing and returns unsupport status.
|
||||||
|
|
||||||
Copyright (c) 2007 - 2008 Intel Corporation
|
Copyright (c) 2007 - 2008 Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
|
@ -15,7 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#include <Library/CapsuleLib.h>
|
#include <Library/CapsuleLib.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Check those capsules are supported by the firmwares.
|
The firmware checks whether the capsule image is supported
|
||||||
|
by the CapsuleGuid in CapsuleHeader or other specific information in capsule image.
|
||||||
|
|
||||||
@param CapsuleHeader Point to the UEFI capsule image to be checked.
|
@param CapsuleHeader Point to the UEFI capsule image to be checked.
|
||||||
|
|
||||||
|
@ -31,7 +32,8 @@ SupportCapsuleImage (
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The firmware implements to process the capsule image.
|
The firmware specific implementation processes the capsule image
|
||||||
|
if it recognized the format of this capsule image.
|
||||||
|
|
||||||
@param CapsuleHeader Point to the UEFI capsule image to be processed.
|
@param CapsuleHeader Point to the UEFI capsule image to be processed.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#/** @file
|
#/** @file
|
||||||
# Capsule library NULL instance for DXE_DRIVER, DXE_RUNTIME_DRIVER
|
# NULL Dxe Capsule library instance.
|
||||||
|
# It can make core modules pass package level build.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2008, Intel Corporation.
|
# Copyright (c) 2006 - 2008, Intel Corporation.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
/** @file
|
/** @file
|
||||||
|
|
||||||
Implements CRC32 guided section handler to parse CRC32 encapsulation section,
|
This library registers CRC32 guided section handler
|
||||||
extract data and authenticate 32 bit CRC value.
|
to parse CRC32 encapsulation section and extract raw data.
|
||||||
|
It uses UEFI boot service CalculateCrc32 to authenticate 32 bit CRC value.
|
||||||
|
|
||||||
Copyright (c) 2007 - 2008, Intel Corporation
|
Copyright (c) 2007 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
|
@ -24,15 +25,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
#define EFI_SECITON_SIZE_MASK 0x00ffffff
|
#define EFI_SECITON_SIZE_MASK 0x00ffffff
|
||||||
|
|
||||||
|
///
|
||||||
|
/// CRC32 Guided Section header
|
||||||
|
///
|
||||||
typedef struct {
|
typedef struct {
|
||||||
EFI_GUID_DEFINED_SECTION GuidedSectionHeader;
|
EFI_GUID_DEFINED_SECTION GuidedSectionHeader; ///< EFI guided section header
|
||||||
UINT32 CRC32Checksum;
|
UINT32 CRC32Checksum; ///< 32bit CRC check sum
|
||||||
} CRC32_SECTION_HEADER;
|
} CRC32_SECTION_HEADER;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
The implementation of Crc32 guided section GetInfo() to get
|
GetInfo gets raw data size and attribute of the input guided section.
|
||||||
size and attribute of the guided section.
|
It first checks whether the input guid section is supported.
|
||||||
|
If not, EFI_INVALID_PARAMETER will return.
|
||||||
|
|
||||||
@param InputSection Buffer containing the input GUIDed section to be processed.
|
@param InputSection Buffer containing the input GUIDed section to be processed.
|
||||||
@param OutputBufferSize The size of OutputBuffer.
|
@param OutputBufferSize The size of OutputBuffer.
|
||||||
|
@ -74,10 +79,13 @@ Crc32GuidedSectionGetInfo (
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
The implementation of Crc32 Guided section extraction to get the section data.
|
Extraction handler tries to extract raw data from the input guided section.
|
||||||
|
It also does authentication check for 32bit CRC value in the input guided section.
|
||||||
|
It first checks whether the input guid section is supported.
|
||||||
|
If not, EFI_INVALID_PARAMETER will return.
|
||||||
|
|
||||||
@param InputSection Buffer containing the input GUIDed section to be processed.
|
@param InputSection Buffer containing the input GUIDed section to be processed.
|
||||||
@param OutputBuffer to contain the output data, which is allocated by the caller.
|
@param OutputBuffer Buffer to contain the output raw data allocated by the caller.
|
||||||
@param ScratchBuffer A pointer to a caller-allocated buffer for function internal use.
|
@param ScratchBuffer A pointer to a caller-allocated buffer for function internal use.
|
||||||
@param AuthenticationStatus A pointer to a caller-allocated UINT32 that indicates the
|
@param AuthenticationStatus A pointer to a caller-allocated UINT32 that indicates the
|
||||||
authentication status of the output buffer.
|
authentication status of the output buffer.
|
||||||
|
@ -161,13 +169,13 @@ Crc32GuidedSectionHandler (
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Register Crc32 section handler.
|
Register the handler to extract CRC32 guided section.
|
||||||
|
|
||||||
@param ImageHandle ImageHandle of the loaded driver.
|
@param ImageHandle ImageHandle of the loaded driver.
|
||||||
@param SystemTable Pointer to the EFI System Table.
|
@param SystemTable Pointer to the EFI System Table.
|
||||||
|
|
||||||
@retval RETURN_SUCCESS Register successfully.
|
@retval EFI_SUCCESS Register successfully.
|
||||||
@retval RETURN_OUT_OF_RESOURCES No enough memory to register this handler.
|
@retval EFI_OUT_OF_RESOURCES No enough memory to register this handler.
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
#/** @file
|
#/** @file
|
||||||
# Crc32SectionExtract library instance registers Crc32 handler into ExtractGuidedSectionLib.
|
# This library doesn't produce any library class. In its constructor function,
|
||||||
|
# it uses ExtractGuidedSectionLib service to registers CRC32 guided section handler
|
||||||
|
# that parses CRC32 encapsulation section and extracts raw data.
|
||||||
|
# It uses UEFI boot service CalculateCrc32 to authenticate 32 bit CRC value.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2008, Intel Corporation
|
# Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
#
|
#
|
||||||
|
@ -10,7 +13,6 @@
|
||||||
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#
|
#
|
||||||
#
|
|
||||||
#**/
|
#**/
|
||||||
|
|
||||||
[Defines]
|
[Defines]
|
||||||
|
@ -43,6 +45,6 @@
|
||||||
BaseMemoryLib
|
BaseMemoryLib
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiCrc32GuidedSectionExtractionProtocolGuid
|
gEfiCrc32GuidedSectionExtractionProtocolGuid # ALWAYS CONSUMED used as Guid, not protocol service
|
||||||
gEfiSecurityPolicyProtocolGuid
|
gEfiSecurityPolicyProtocolGuid # ALWAYS CONSUMED
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
/** @file
|
/** @file
|
||||||
Null Recovery Library instance.
|
Null Recovery Library instance does nothing and returns unsupport status.
|
||||||
This library class defines a set of methods related do recovery.
|
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
|
@ -13,9 +12,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#include <PiPei.h>
|
#include <PiPei.h>
|
||||||
|
#include <Library/RecoveryLib.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Calling this function causes the system do recovery.
|
Calling this function causes the system do recovery boot path.
|
||||||
|
|
||||||
@retval EFI_UNSUPPORTED Recovery is not supported.
|
@retval EFI_UNSUPPORTED Recovery is not supported.
|
||||||
**/
|
**/
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#/** @file
|
#/** @file
|
||||||
#
|
#
|
||||||
# Null Recovery library instance for PEIM module
|
# Null Recovery library instance for PEIM module
|
||||||
|
# It can make core modules pass package level build.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/** @file
|
/** @file
|
||||||
S3 Library. This library class defines a set of methods related do S3 mode
|
Null S3 Library instance does nothing and returns unsupport status.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
|
@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#include <PiPei.h>
|
#include <PiPei.h>
|
||||||
|
#include <Library/S3Lib.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This function is responsible for calling the S3 resume vector in the ACPI Tables.
|
This function is responsible for calling the S3 resume vector in the ACPI Tables.
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#/** @file
|
#/** @file
|
||||||
#
|
#
|
||||||
# A NULL instance of S3 Library for PEIM
|
# Null S3 library instance for PEIM module
|
||||||
|
# It can make core modules pass package level build.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2008, Intel Corporation.
|
# Copyright (c) 2006 - 2008, Intel Corporation.
|
||||||
#
|
#
|
||||||
|
@ -29,13 +30,9 @@
|
||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)
|
# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)
|
||||||
#
|
#
|
||||||
|
|
||||||
[Sources.common]
|
[Sources]
|
||||||
PeiS3LibNull.c
|
PeiS3LibNull.c
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
MdeModulePkg/MdeModulePkg.dec
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
|
|
||||||
[LibraryClasses]
|
|
||||||
BaseLib
|
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@
|
||||||
|
|
||||||
[PcdsFeatureFlag.common]
|
[PcdsFeatureFlag.common]
|
||||||
## Indicate whether platform can support update capsule across a system reset
|
## Indicate whether platform can support update capsule across a system reset
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleRest|FALSE|BOOLEAN|0x0001001d
|
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset|FALSE|BOOLEAN|0x0001001d
|
||||||
|
|
||||||
## This feature flag can be used to enable or disable the Pcd PEIM database
|
## This feature flag can be used to enable or disable the Pcd PEIM database
|
||||||
# traverse capability. Disable it can reduce the size of final image generated.
|
# traverse capability. Disable it can reduce the size of final image generated.
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#/** @file
|
#/** @file
|
||||||
#
|
#
|
||||||
# CapsuleRuntime module provides capsule runtime services
|
# Capsule Runtime Drivers produces two UEFI capsule runtime services.
|
||||||
|
# (UpdateCapsule, QueryCapsuleCapabilities)
|
||||||
|
# It installs the Capsule Architectural Protocol (EDKII definition) to signify
|
||||||
|
# the capsule runtime services are ready.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
# Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
|
@ -28,7 +31,6 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
[Sources.common]
|
[Sources.common]
|
||||||
CapsuleService.h
|
|
||||||
CapsuleService.c
|
CapsuleService.c
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
|
@ -39,22 +41,23 @@
|
||||||
UefiBootServicesTableLib
|
UefiBootServicesTableLib
|
||||||
PcdLib
|
PcdLib
|
||||||
DebugLib
|
DebugLib
|
||||||
UefiRuntimeLib
|
UefiRuntimeServicesTableLib
|
||||||
UefiDriverEntryPoint
|
UefiDriverEntryPoint
|
||||||
CapsuleLib
|
CapsuleLib
|
||||||
|
UefiRuntimeLib
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gEfiCapsuleVendorGuid # SOMETIMES_CONSUMED
|
gEfiCapsuleVendorGuid # Produce variable L"CapsuleUpdateData" for capsule updated data
|
||||||
|
|
||||||
[Protocols]
|
[Protocols]
|
||||||
gEfiCapsuleArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
gEfiCapsuleArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||||
|
|
||||||
[FeaturePcd.common]
|
[FeaturePcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleRest
|
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset
|
||||||
|
|
||||||
[FixedPcd.common]
|
[FixedPcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule
|
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule
|
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule
|
||||||
|
|
||||||
[Depex]
|
[Depex]
|
||||||
gEfiVariableWriteArchProtocolGuid
|
gEfiVariableWriteArchProtocolGuid # Depends on variable write functionality to produce capsule data variable
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
/** @file
|
/** @file
|
||||||
Capsule Runtime Drivers produces two UEFI capsule runtime services.
|
Capsule Runtime Drivers produces two UEFI capsule runtime services.
|
||||||
(UpdateCapsule, QueryCapsuleCapabilities)
|
(UpdateCapsule, QueryCapsuleCapabilities)
|
||||||
|
It installs the Capsule Architectural Protocol (EDKII definition) to signify
|
||||||
|
the capsule runtime services are ready.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
|
@ -13,7 +15,18 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "CapsuleService.h"
|
#include <Uefi.h>
|
||||||
|
|
||||||
|
#include <Protocol/Capsule.h>
|
||||||
|
#include <Guid/CapsuleVendor.h>
|
||||||
|
|
||||||
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
|
#include <Library/CapsuleLib.h>
|
||||||
|
#include <Library/UefiDriverEntryPoint.h>
|
||||||
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
|
#include <Library/UefiRuntimeServicesTableLib.h>
|
||||||
|
#include <Library/UefiRuntimeLib.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
|
Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
|
||||||
|
@ -90,7 +103,7 @@ UpdateCapsule (
|
||||||
//
|
//
|
||||||
// Check if the platform supports update capsule across a system reset
|
// Check if the platform supports update capsule across a system reset
|
||||||
//
|
//
|
||||||
if (!FeaturePcdGet(PcdSupportUpdateCapsuleRest)) {
|
if (!FeaturePcdGet(PcdSupportUpdateCapsuleReset)) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -105,7 +118,7 @@ UpdateCapsule (
|
||||||
// system reset. Set its value into NV storage to let pre-boot driver to pick it up
|
// system reset. Set its value into NV storage to let pre-boot driver to pick it up
|
||||||
// after coming through a system reset.
|
// after coming through a system reset.
|
||||||
//
|
//
|
||||||
Status = EfiSetVariable (
|
Status = gRT->SetVariable (
|
||||||
EFI_CAPSULE_VARIABLE_NAME,
|
EFI_CAPSULE_VARIABLE_NAME,
|
||||||
&gEfiCapsuleVendorGuid,
|
&gEfiCapsuleVendorGuid,
|
||||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||||
|
@ -219,7 +232,7 @@ QueryCapsuleCapabilities (
|
||||||
//
|
//
|
||||||
//Check if the platform supports update capsule across a system reset
|
//Check if the platform supports update capsule across a system reset
|
||||||
//
|
//
|
||||||
if (!FeaturePcdGet(PcdSupportUpdateCapsuleRest)) {
|
if (!FeaturePcdGet(PcdSupportUpdateCapsuleReset)) {
|
||||||
return EFI_UNSUPPORTED;
|
return EFI_UNSUPPORTED;
|
||||||
}
|
}
|
||||||
*ResetType = EfiResetWarm;
|
*ResetType = EfiResetWarm;
|
||||||
|
@ -237,7 +250,7 @@ QueryCapsuleCapabilities (
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
This code is to install UEFI capsule runtime service.
|
This code installs UEFI capsule runtime service.
|
||||||
|
|
||||||
@param ImageHandle The firmware allocated handle for the EFI image.
|
@param ImageHandle The firmware allocated handle for the EFI image.
|
||||||
@param SystemTable A pointer to the EFI System Table.
|
@param SystemTable A pointer to the EFI System Table.
|
||||||
|
@ -258,8 +271,8 @@ CapsuleServiceInitialize (
|
||||||
//
|
//
|
||||||
// Install capsule runtime services into UEFI runtime service tables.
|
// Install capsule runtime services into UEFI runtime service tables.
|
||||||
//
|
//
|
||||||
SystemTable->RuntimeServices->UpdateCapsule = UpdateCapsule;
|
gRT->UpdateCapsule = UpdateCapsule;
|
||||||
SystemTable->RuntimeServices->QueryCapsuleCapabilities = QueryCapsuleCapabilities;
|
gRT->QueryCapsuleCapabilities = QueryCapsuleCapabilities;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Install the Capsule Architectural Protocol on a new handle
|
// Install the Capsule Architectural Protocol on a new handle
|
||||||
|
|
|
@ -1,92 +0,0 @@
|
||||||
/** @file
|
|
||||||
Include the required header files for Capsule Runtime Service drivers.
|
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation. <BR>
|
|
||||||
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 _CAPSULE_RUNTIME_H_
|
|
||||||
#define _CAPSULE_RUNTIME_H_
|
|
||||||
|
|
||||||
|
|
||||||
#include <Uefi.h>
|
|
||||||
|
|
||||||
#include <Protocol/Capsule.h>
|
|
||||||
#include <Guid/CapsuleVendor.h>
|
|
||||||
|
|
||||||
#include <Library/UefiDriverEntryPoint.h>
|
|
||||||
#include <Library/UefiRuntimeLib.h>
|
|
||||||
#include <Library/DebugLib.h>
|
|
||||||
#include <Library/PcdLib.h>
|
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
|
||||||
#include <Library/CapsuleLib.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
Passes capsules to the firmware with both virtual and physical mapping. Depending on the intended
|
|
||||||
consumption, the firmware may process the capsule immediately. If the payload should persist
|
|
||||||
across a system reset, the reset value returned from EFI_QueryCapsuleCapabilities must
|
|
||||||
be passed into ResetSystem() and will cause the capsule to be processed by the firmware as
|
|
||||||
part of the reset process.
|
|
||||||
|
|
||||||
@param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
|
|
||||||
being passed into update capsule.
|
|
||||||
@param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in
|
|
||||||
CaspuleHeaderArray.
|
|
||||||
@param ScatterGatherList Physical pointer to a set of
|
|
||||||
EFI_CAPSULE_BLOCK_DESCRIPTOR that describes the
|
|
||||||
location in physical memory of a set of capsules.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS Valid capsule was passed. If
|
|
||||||
CAPSULE_FLAGS_PERSIT_ACROSS_RESET is not set, the
|
|
||||||
capsule has been successfully processed by the firmware.
|
|
||||||
@retval EFI_DEVICE_ERROR The capsule update was started, but failed due to a device error.
|
|
||||||
@retval EFI_INVALID_PARAMETER CapsuleCount is Zero, or CapsuleImage is not valid.
|
|
||||||
For across reset capsule image, ScatterGatherList is NULL.
|
|
||||||
@retval EFI_UNSUPPORTED CapsuleImage is not recognized by the firmware.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
UpdateCapsule(
|
|
||||||
IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,
|
|
||||||
IN UINTN CapsuleCount,
|
|
||||||
IN EFI_PHYSICAL_ADDRESS ScatterGatherList OPTIONAL
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Returns if the capsule can be supported via UpdateCapsule().
|
|
||||||
|
|
||||||
@param CapsuleHeaderArray Virtual pointer to an array of virtual pointers to the capsules
|
|
||||||
being passed into update capsule.
|
|
||||||
@param CapsuleCount Number of pointers to EFI_CAPSULE_HEADER in
|
|
||||||
CaspuleHeaderArray.
|
|
||||||
@param MaxiumCapsuleSize On output the maximum size that UpdateCapsule() can
|
|
||||||
support as an argument to UpdateCapsule() via
|
|
||||||
CapsuleHeaderArray and ScatterGatherList.
|
|
||||||
@param ResetType Returns the type of reset required for the capsule update.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS Valid answer returned.
|
|
||||||
@retval EFI_UNSUPPORTED The capsule image is not supported on this platform, and
|
|
||||||
MaximumCapsuleSize and ResetType are undefined.
|
|
||||||
@retval EFI_INVALID_PARAMETER MaximumCapsuleSize is NULL, or ResetTyep is NULL,
|
|
||||||
Or CapsuleCount is Zero, or CapsuleImage is not valid.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
QueryCapsuleCapabilities(
|
|
||||||
IN EFI_CAPSULE_HEADER **CapsuleHeaderArray,
|
|
||||||
IN UINTN CapsuleCount,
|
|
||||||
OUT UINT64 *MaxiumCapsuleSize,
|
|
||||||
OUT EFI_RESET_TYPE *ResetType
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#/** @file
|
#/** @file
|
||||||
# Single Segment Pci Configuration PPI
|
# This driver installs Single Segment Pci Configuration 2 PPI
|
||||||
|
# to provide read, write and modify access to Pci configuration space in PEI phase.
|
||||||
|
# To follow PI specification, these services also support access to the unaligned Pci address.
|
||||||
#
|
#
|
||||||
# This file declares PciCfg PPI used to access PCI configuration space in PEI
|
# Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
# Copyright (c) 2006 - 2007, Intel Corporation
|
|
||||||
#
|
#
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -21,6 +22,7 @@
|
||||||
MODULE_TYPE = PEIM
|
MODULE_TYPE = PEIM
|
||||||
VERSION_STRING = 1.0
|
VERSION_STRING = 1.0
|
||||||
ENTRY_POINT = PeimInitializePciCfg
|
ENTRY_POINT = PeimInitializePciCfg
|
||||||
|
PI_SPECIFICATION_VERSION = 0x00010000
|
||||||
|
|
||||||
#
|
#
|
||||||
# The following information is for reference only and not required by the build tools.
|
# The following information is for reference only and not required by the build tools.
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
/** @file
|
/** @file
|
||||||
Installs Single Segment Pci Configuration PPI.
|
This driver installs Single Segment Pci Configuration 2 PPI
|
||||||
|
to provide read, write and modify access to Pci configuration space in PEI phase.
|
||||||
|
To follow PI specification, these services also support access to the unaligned Pci address.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2007, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
are licensed and made available under the terms and conditions of the BSD License
|
||||||
which accompanies this distribution. The full text of the license may be found at
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -13,164 +15,19 @@
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include <PiPei.h>
|
#include <PiPei.h>
|
||||||
|
|
||||||
#include <Ppi/PciCfg2.h>
|
#include <Ppi/PciCfg2.h>
|
||||||
|
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/PciLib.h>
|
#include <Library/PciLib.h>
|
||||||
#include <Library/PeimEntryPoint.h>
|
#include <Library/PeimEntryPoint.h>
|
||||||
|
|
||||||
#include <IndustryStandard/Pci.h>
|
#include <IndustryStandard/Pci.h>
|
||||||
|
|
||||||
/**
|
|
||||||
Reads from a given location in the PCI configuration space.
|
|
||||||
|
|
||||||
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
|
|
||||||
|
|
||||||
@param This Pointer to local data for the interface.
|
|
||||||
|
|
||||||
@param Width The width of the access. Enumerated in bytes.
|
|
||||||
See EFI_PEI_PCI_CFG_PPI_WIDTH above.
|
|
||||||
|
|
||||||
@param Address The physical address of the access. The format of
|
|
||||||
the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
|
|
||||||
|
|
||||||
@param Buffer A pointer to the buffer of data..
|
|
||||||
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The function completed successfully.
|
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR There was a problem with the transaction.
|
|
||||||
|
|
||||||
@retval EFI_DEVICE_NOT_READY The device is not capable of supporting the operation at this
|
|
||||||
time.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
PciCfg2Read (
|
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
|
||||||
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
|
||||||
IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
|
|
||||||
IN UINT64 Address,
|
|
||||||
IN OUT VOID *Buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Write to a given location in the PCI configuration space.
|
|
||||||
|
|
||||||
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
|
|
||||||
|
|
||||||
@param This Pointer to local data for the interface.
|
|
||||||
|
|
||||||
@param Width The width of the access. Enumerated in bytes.
|
|
||||||
See EFI_PEI_PCI_CFG_PPI_WIDTH above.
|
|
||||||
|
|
||||||
@param Address The physical address of the access. The format of
|
|
||||||
the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
|
|
||||||
|
|
||||||
@param Buffer A pointer to the buffer of data..
|
|
||||||
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The function completed successfully.
|
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR There was a problem with the transaction.
|
|
||||||
|
|
||||||
@retval EFI_DEVICE_NOT_READY The device is not capable of supporting the operation at this
|
|
||||||
time.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
PciCfg2Write (
|
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
|
||||||
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
|
||||||
IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
|
|
||||||
IN UINT64 Address,
|
|
||||||
IN OUT VOID *Buffer
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
PCI read-modify-write operation.
|
|
||||||
|
|
||||||
@param PeiServices An indirect pointer to the PEI Services Table
|
|
||||||
published by the PEI Foundation.
|
|
||||||
|
|
||||||
@param This Pointer to local data for the interface.
|
|
||||||
|
|
||||||
@param Width The width of the access. Enumerated in bytes. Type
|
|
||||||
EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
|
|
||||||
|
|
||||||
@param Address The physical address of the access.
|
|
||||||
|
|
||||||
@param SetBits Points to value to bitwise-OR with the read configuration value.
|
|
||||||
|
|
||||||
The size of the value is determined by Width.
|
|
||||||
|
|
||||||
@param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
|
|
||||||
The size of the value is determined by Width.
|
|
||||||
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The function completed successfully.
|
|
||||||
|
|
||||||
@retval EFI_DEVICE_ERROR There was a problem with the transaction.
|
|
||||||
|
|
||||||
@retval EFI_DEVICE_NOT_READY The device is not capable of supporting
|
|
||||||
the operation at this time.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
PciCfg2Modify (
|
|
||||||
IN CONST EFI_PEI_SERVICES **PeiServices,
|
|
||||||
IN CONST EFI_PEI_PCI_CFG2_PPI *This,
|
|
||||||
IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
|
|
||||||
IN UINT64 Address,
|
|
||||||
IN VOID *SetBits,
|
|
||||||
IN VOID *ClearBits
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@par Ppi Description:
|
|
||||||
The EFI_PEI_PCI_CFG2_PPI interfaces are used to abstract
|
|
||||||
accesses to PCI controllers behind a PCI root bridge
|
|
||||||
controller.
|
|
||||||
|
|
||||||
@param Read PCI read services. See the Read() function description.
|
|
||||||
|
|
||||||
@param Write PCI write services. See the Write() function description.
|
|
||||||
|
|
||||||
@param Modify PCI read-modify-write services. See the Modify() function description.
|
|
||||||
|
|
||||||
@param Segment The PCI bus segment which the specified functions will access.
|
|
||||||
|
|
||||||
**/
|
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED
|
|
||||||
EFI_PEI_PCI_CFG2_PPI gPciCfg2Ppi = {
|
|
||||||
PciCfg2Read,
|
|
||||||
PciCfg2Write,
|
|
||||||
PciCfg2Modify
|
|
||||||
};
|
|
||||||
|
|
||||||
GLOBAL_REMOVE_IF_UNREFERENCED
|
|
||||||
EFI_PEI_PPI_DESCRIPTOR gPciCfg2PpiList = {
|
|
||||||
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
|
|
||||||
&gEfiPciCfg2PpiGuid,
|
|
||||||
&gPciCfg2Ppi
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.
|
Convert EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS to PCI_LIB_ADDRESS.
|
||||||
|
|
||||||
@param Address PCI address with
|
@param Address PCI address with EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.
|
||||||
EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.
|
|
||||||
|
|
||||||
@return The PCI address with PCI_LIB_ADDRESS format.
|
@return PCI address with PCI_LIB_ADDRESS format.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
UINTN
|
UINTN
|
||||||
|
@ -185,29 +42,19 @@ PciCfgAddressConvert (
|
||||||
return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->ExtendedRegister);
|
return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->ExtendedRegister);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Reads from a given location in the PCI configuration space.
|
Reads from a given location in the PCI configuration space.
|
||||||
|
|
||||||
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
|
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
|
||||||
|
|
||||||
@param This Pointer to local data for the interface.
|
@param This Pointer to local data for the interface.
|
||||||
|
|
||||||
@param Width The width of the access. Enumerated in bytes.
|
@param Width The width of the access. Enumerated in bytes.
|
||||||
See EFI_PEI_PCI_CFG_PPI_WIDTH above.
|
See EFI_PEI_PCI_CFG_PPI_WIDTH above.
|
||||||
|
|
||||||
@param Address The physical address of the access. The format of
|
@param Address The physical address of the access. The format of
|
||||||
the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
|
the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
|
||||||
|
@param Buffer A pointer to the buffer of data.
|
||||||
@param Buffer A pointer to the buffer of data..
|
|
||||||
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The function completed successfully.
|
@retval EFI_SUCCESS The function completed successfully.
|
||||||
|
@retval EFI_INVALID_PARAMETER The invalid access width.
|
||||||
@retval EFI_DEVICE_ERROR There was a problem with the transaction.
|
|
||||||
|
|
||||||
@retval EFI_DEVICE_NOT_READY The device is not capable of supporting the operation at this
|
|
||||||
time.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -271,24 +118,15 @@ PciCfg2Read (
|
||||||
Write to a given location in the PCI configuration space.
|
Write to a given location in the PCI configuration space.
|
||||||
|
|
||||||
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
|
@param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
|
||||||
|
|
||||||
@param This Pointer to local data for the interface.
|
@param This Pointer to local data for the interface.
|
||||||
|
|
||||||
@param Width The width of the access. Enumerated in bytes.
|
@param Width The width of the access. Enumerated in bytes.
|
||||||
See EFI_PEI_PCI_CFG_PPI_WIDTH above.
|
See EFI_PEI_PCI_CFG_PPI_WIDTH above.
|
||||||
|
|
||||||
@param Address The physical address of the access. The format of
|
@param Address The physical address of the access. The format of
|
||||||
the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
|
the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
|
||||||
|
@param Buffer A pointer to the buffer of data.
|
||||||
@param Buffer A pointer to the buffer of data..
|
|
||||||
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The function completed successfully.
|
@retval EFI_SUCCESS The function completed successfully.
|
||||||
|
@retval EFI_INVALID_PARAMETER The invalid access width.
|
||||||
@retval EFI_DEVICE_ERROR There was a problem with the transaction.
|
|
||||||
|
|
||||||
@retval EFI_DEVICE_NOT_READY The device is not capable of supporting the operation at this
|
|
||||||
time.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -350,32 +188,22 @@ PciCfg2Write (
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
PCI read-modify-write operation.
|
This function performs a read-modify-write operation on the contents from a given
|
||||||
|
location in the PCI configuration space.
|
||||||
|
|
||||||
@param PeiServices An indirect pointer to the PEI Services Table
|
@param PeiServices An indirect pointer to the PEI Services Table
|
||||||
published by the PEI Foundation.
|
published by the PEI Foundation.
|
||||||
|
|
||||||
@param This Pointer to local data for the interface.
|
@param This Pointer to local data for the interface.
|
||||||
|
|
||||||
@param Width The width of the access. Enumerated in bytes. Type
|
@param Width The width of the access. Enumerated in bytes. Type
|
||||||
EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
|
EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
|
||||||
|
|
||||||
@param Address The physical address of the access.
|
@param Address The physical address of the access.
|
||||||
|
|
||||||
@param SetBits Points to value to bitwise-OR with the read configuration value.
|
@param SetBits Points to value to bitwise-OR with the read configuration value.
|
||||||
|
|
||||||
The size of the value is determined by Width.
|
The size of the value is determined by Width.
|
||||||
|
|
||||||
@param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
|
@param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
|
||||||
The size of the value is determined by Width.
|
The size of the value is determined by Width.
|
||||||
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS The function completed successfully.
|
@retval EFI_SUCCESS The function completed successfully.
|
||||||
|
@retval EFI_INVALID_PARAMETER The invalid access width.
|
||||||
@retval EFI_DEVICE_ERROR There was a problem with the transaction.
|
|
||||||
|
|
||||||
@retval EFI_DEVICE_NOT_READY The device is not capable of supporting
|
|
||||||
the operation at this time.
|
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -445,9 +273,23 @@ PciCfg2Modify (
|
||||||
} else {
|
} else {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EFI_PEI_PCI_CFG2_PPI gPciCfg2Ppi = {
|
||||||
|
PciCfg2Read,
|
||||||
|
PciCfg2Write,
|
||||||
|
PciCfg2Modify,
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
EFI_PEI_PPI_DESCRIPTOR gPciCfg2PpiList = {
|
||||||
|
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
|
||||||
|
&gEfiPciCfg2PpiGuid,
|
||||||
|
&gPciCfg2Ppi
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Module's entry function.
|
Module's entry function.
|
||||||
This routine will install EFI_PEI_PCI_CFG2_PPI.
|
This routine will install EFI_PEI_PCI_CFG2_PPI.
|
||||||
|
@ -466,10 +308,10 @@ PeimInitializePciCfg (
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
|
||||||
ASSERT ((**PeiServices).Hdr.Revision >= PEI_SERVICES_REVISION);
|
ASSERT ((**PeiServices).Hdr.Revision >= PI_SPECIFICATION_VERSION);
|
||||||
|
|
||||||
(**(EFI_PEI_SERVICES **)PeiServices).PciCfg = &gPciCfg2Ppi;
|
(**(EFI_PEI_SERVICES **)PeiServices).PciCfg = &gPciCfg2Ppi;
|
||||||
Status = (**PeiServices).InstallPpi ((CONST EFI_PEI_SERVICES **)PeiServices, &gPciCfg2PpiList);
|
Status = (**PeiServices).InstallPpi (PeiServices, &gPciCfg2PpiList);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/** @file
|
/** @file
|
||||||
This driver implements one sample platform security service, which does
|
This driver implements a sample platform security service, which does
|
||||||
nothing and always return EFI_SUCCESS.
|
nothing and always return EFI_SUCCESS.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, Intel Corporation
|
Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
|
@ -14,21 +14,17 @@
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
|
||||||
#include "SecurityStub.h"
|
#include <Uefi.h>
|
||||||
|
#include <Protocol/Security.h>
|
||||||
|
#include <Library/DebugLib.h>
|
||||||
|
#include <Library/UefiBootServicesTableLib.h>
|
||||||
|
#include <Library/UefiDriverEntryPoint.h>
|
||||||
|
|
||||||
//
|
//
|
||||||
// Handle for the Security Architectural Protocol instance produced by this driver
|
// Handle for the Security Architectural Protocol instance produced by this driver
|
||||||
//
|
//
|
||||||
EFI_HANDLE mSecurityArchProtocolHandle = NULL;
|
EFI_HANDLE mSecurityArchProtocolHandle = NULL;
|
||||||
|
|
||||||
//
|
|
||||||
// Security Architectural Protocol instance produced by this driver
|
|
||||||
//
|
|
||||||
EFI_SECURITY_ARCH_PROTOCOL mSecurityStub = {
|
|
||||||
SecurityStubAuthenticateState
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific
|
The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific
|
||||||
policy from the DXE core response to an attempt to use a file that returns a
|
policy from the DXE core response to an attempt to use a file that returns a
|
||||||
|
@ -61,7 +57,7 @@ EFI_SECURITY_ARCH_PROTOCOL mSecurityStub = {
|
||||||
@param File This is a pointer to the device path of the file that is
|
@param File This is a pointer to the device path of the file that is
|
||||||
being dispatched. This will optionally be used for logging.
|
being dispatched. This will optionally be used for logging.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Do nothing and return.
|
@retval EFI_SUCCESS Do nothing and return success.
|
||||||
@retval EFI_INVALID_PARAMETER File is NULL.
|
@retval EFI_INVALID_PARAMETER File is NULL.
|
||||||
**/
|
**/
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
|
@ -79,13 +75,17 @@ SecurityStubAuthenticateState (
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Security Architectural Protocol instance produced by this driver
|
||||||
|
//
|
||||||
|
EFI_SECURITY_ARCH_PROTOCOL mSecurityStub = {
|
||||||
|
SecurityStubAuthenticateState
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The user Entry Point installs SAP. The user code starts with this function
|
Installs Security Architectural Protocol.
|
||||||
as the real entry point for the image goes into a library that calls this
|
|
||||||
function.
|
|
||||||
|
|
||||||
@param ImageHandle The firmware allocated handle for the EFI image.
|
@param ImageHandle The image handle of this driver.
|
||||||
@param SystemTable A pointer to the EFI System Table.
|
@param SystemTable A pointer to the EFI System Table.
|
||||||
|
|
||||||
@retval EFI_SUCCESS Install the sample Security Architectural Protocol successfully.
|
@retval EFI_SUCCESS Install the sample Security Architectural Protocol successfully.
|
||||||
|
|
|
@ -1,92 +0,0 @@
|
||||||
/** @file
|
|
||||||
Inlcude the required definitions for Security Architectural Protocol stub driver
|
|
||||||
|
|
||||||
Copyright (c) 2006 - 2008, 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 __SECURITY_STUB_ARCH_PROTOCOL_H__
|
|
||||||
#define __SECURITY_STUB_ARCH_PROTOCOL_H__
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Common header files for this module.
|
|
||||||
//
|
|
||||||
#include <Uefi.h>
|
|
||||||
#include <Protocol/Security.h>
|
|
||||||
#include <Library/DebugLib.h>
|
|
||||||
#include <Library/UefiBootServicesTableLib.h>
|
|
||||||
#include <Library/UefiDriverEntryPoint.h>
|
|
||||||
|
|
||||||
//
|
|
||||||
// Function prototypes
|
|
||||||
//
|
|
||||||
/**
|
|
||||||
The EFI_SECURITY_ARCH_PROTOCOL (SAP) is used to abstract platform-specific
|
|
||||||
policy from the DXE core response to an attempt to use a file that returns a
|
|
||||||
given status for the authentication check from the section extraction protocol.
|
|
||||||
|
|
||||||
The possible responses in a given SAP implementation may include locking
|
|
||||||
flash upon failure to authenticate, attestation logging for all signed drivers,
|
|
||||||
and other exception operations. The File parameter allows for possible logging
|
|
||||||
within the SAP of the driver.
|
|
||||||
|
|
||||||
If File is NULL, then EFI_INVALID_PARAMETER is returned.
|
|
||||||
|
|
||||||
If the file specified by File with an authentication status specified by
|
|
||||||
AuthenticationStatus is safe for the DXE Core to use, then EFI_SUCCESS is returned.
|
|
||||||
|
|
||||||
If the file specified by File with an authentication status specified by
|
|
||||||
AuthenticationStatus is not safe for the DXE Core to use under any circumstances,
|
|
||||||
then EFI_ACCESS_DENIED is returned.
|
|
||||||
|
|
||||||
If the file specified by File with an authentication status specified by
|
|
||||||
AuthenticationStatus is not safe for the DXE Core to use right now, but it
|
|
||||||
might be possible to use it at a future time, then EFI_SECURITY_VIOLATION is
|
|
||||||
returned.
|
|
||||||
|
|
||||||
@param This The EFI_SECURITY_ARCH_PROTOCOL instance.
|
|
||||||
@param AuthenticationStatus
|
|
||||||
This is the authentication type returned from the Section
|
|
||||||
Extraction protocol. See the Section Extraction Protocol
|
|
||||||
Specification for details on this type.
|
|
||||||
@param File This is a pointer to the device path of the file that is
|
|
||||||
being dispatched. This will optionally be used for logging.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS Do nothing and return.
|
|
||||||
@retval EFI_INVALID_PARAMETER File is NULL.
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
SecurityStubAuthenticateState (
|
|
||||||
IN CONST EFI_SECURITY_ARCH_PROTOCOL *This,
|
|
||||||
IN UINT32 AuthenticationStatus,
|
|
||||||
IN CONST EFI_DEVICE_PATH_PROTOCOL *File
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
The user Entry Point for DXE driver. The user code starts with this function
|
|
||||||
as the real entry point for the image goes into a library that calls this
|
|
||||||
function.
|
|
||||||
|
|
||||||
@param ImageHandle The firmware allocated handle for the EFI image.
|
|
||||||
@param SystemTable A pointer to the EFI System Table.
|
|
||||||
|
|
||||||
@retval EFI_SUCCESS Install the sample Security Architectural Protocol successfully.
|
|
||||||
|
|
||||||
**/
|
|
||||||
EFI_STATUS
|
|
||||||
EFIAPI
|
|
||||||
SecurityStubInitialize (
|
|
||||||
IN EFI_HANDLE ImageHandle,
|
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -1,5 +1,6 @@
|
||||||
#/** @file
|
#/** @file
|
||||||
# Sample SecurityStub module implements the dummy platform security service.
|
# Sample SecurityStub driver implements the dummy platform security service.
|
||||||
|
# It always return success without any authentication check.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2008, Intel Corporation
|
# Copyright (c) 2006 - 2008, Intel Corporation
|
||||||
# All rights reserved. This program and the accompanying materials
|
# All rights reserved. This program and the accompanying materials
|
||||||
|
@ -28,7 +29,6 @@
|
||||||
|
|
||||||
[Sources.common]
|
[Sources.common]
|
||||||
SecurityStub.c
|
SecurityStub.c
|
||||||
SecurityStub.h
|
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
|
Loading…
Reference in New Issue