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:
@@ -1,6 +1,9 @@
|
||||
#/** @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>
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
@@ -28,7 +31,6 @@
|
||||
#
|
||||
|
||||
[Sources.common]
|
||||
CapsuleService.h
|
||||
CapsuleService.c
|
||||
|
||||
[Packages]
|
||||
@@ -39,22 +41,23 @@
|
||||
UefiBootServicesTableLib
|
||||
PcdLib
|
||||
DebugLib
|
||||
UefiRuntimeLib
|
||||
UefiRuntimeServicesTableLib
|
||||
UefiDriverEntryPoint
|
||||
CapsuleLib
|
||||
UefiRuntimeLib
|
||||
|
||||
[Guids]
|
||||
gEfiCapsuleVendorGuid # SOMETIMES_CONSUMED
|
||||
gEfiCapsuleVendorGuid # Produce variable L"CapsuleUpdateData" for capsule updated data
|
||||
|
||||
[Protocols]
|
||||
gEfiCapsuleArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
|
||||
[FeaturePcd.common]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleRest
|
||||
[FeaturePcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdSupportUpdateCapsuleReset
|
||||
|
||||
[FixedPcd.common]
|
||||
[FixedPcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizeNonPopulateCapsule
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxSizePopulateCapsule
|
||||
|
||||
[Depex]
|
||||
gEfiVariableWriteArchProtocolGuid
|
||||
gEfiVariableWriteArchProtocolGuid # Depends on variable write functionality to produce capsule data variable
|
||||
|
@@ -1,6 +1,8 @@
|
||||
/** @file
|
||||
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>
|
||||
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
|
||||
@@ -90,7 +103,7 @@ UpdateCapsule (
|
||||
//
|
||||
// Check if the platform supports update capsule across a system reset
|
||||
//
|
||||
if (!FeaturePcdGet(PcdSupportUpdateCapsuleRest)) {
|
||||
if (!FeaturePcdGet(PcdSupportUpdateCapsuleReset)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
//
|
||||
@@ -105,13 +118,13 @@ UpdateCapsule (
|
||||
// system reset. Set its value into NV storage to let pre-boot driver to pick it up
|
||||
// after coming through a system reset.
|
||||
//
|
||||
Status = EfiSetVariable (
|
||||
EFI_CAPSULE_VARIABLE_NAME,
|
||||
&gEfiCapsuleVendorGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof (UINTN),
|
||||
(VOID *) &ScatterGatherList
|
||||
);
|
||||
Status = gRT->SetVariable (
|
||||
EFI_CAPSULE_VARIABLE_NAME,
|
||||
&gEfiCapsuleVendorGuid,
|
||||
EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
|
||||
sizeof (UINTN),
|
||||
(VOID *) &ScatterGatherList
|
||||
);
|
||||
if (Status != EFI_SUCCESS) {
|
||||
return Status;
|
||||
}
|
||||
@@ -219,7 +232,7 @@ QueryCapsuleCapabilities (
|
||||
//
|
||||
//Check if the platform supports update capsule across a system reset
|
||||
//
|
||||
if (!FeaturePcdGet(PcdSupportUpdateCapsuleRest)) {
|
||||
if (!FeaturePcdGet(PcdSupportUpdateCapsuleReset)) {
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
*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 SystemTable A pointer to the EFI System Table.
|
||||
@@ -258,8 +271,8 @@ CapsuleServiceInitialize (
|
||||
//
|
||||
// Install capsule runtime services into UEFI runtime service tables.
|
||||
//
|
||||
SystemTable->RuntimeServices->UpdateCapsule = UpdateCapsule;
|
||||
SystemTable->RuntimeServices->QueryCapsuleCapabilities = QueryCapsuleCapabilities;
|
||||
gRT->UpdateCapsule = UpdateCapsule;
|
||||
gRT->QueryCapsuleCapabilities = QueryCapsuleCapabilities;
|
||||
|
||||
//
|
||||
// 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
|
||||
# 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 - 2007, Intel Corporation
|
||||
# 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
|
||||
@@ -21,6 +22,7 @@
|
||||
MODULE_TYPE = PEIM
|
||||
VERSION_STRING = 1.0
|
||||
ENTRY_POINT = PeimInitializePciCfg
|
||||
PI_SPECIFICATION_VERSION = 0x00010000
|
||||
|
||||
#
|
||||
# The following information is for reference only and not required by the build tools.
|
||||
|
@@ -1,7 +1,9 @@
|
||||
/** @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
|
||||
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
|
||||
@@ -13,164 +15,19 @@
|
||||
**/
|
||||
|
||||
#include <PiPei.h>
|
||||
|
||||
#include <Ppi/PciCfg2.h>
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/PciLib.h>
|
||||
#include <Library/PeimEntryPoint.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.
|
||||
|
||||
@param Address PCI address with
|
||||
EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS format.
|
||||
@param Address PCI address with 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
|
||||
@@ -185,30 +42,20 @@ PciCfgAddressConvert (
|
||||
return PCI_LIB_ADDRESS (Address->Bus, Address->Device, Address->Function, Address->ExtendedRegister);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
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..
|
||||
|
||||
@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.
|
||||
|
||||
@retval EFI_INVALID_PARAMETER The invalid access width.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
EFIAPI
|
||||
@@ -271,24 +118,15 @@ PciCfg2Read (
|
||||
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..
|
||||
|
||||
@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.
|
||||
@retval EFI_INVALID_PARAMETER The invalid access width.
|
||||
|
||||
**/
|
||||
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
|
||||
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.
|
||||
@retval EFI_INVALID_PARAMETER The invalid access width.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -445,9 +273,23 @@ PciCfg2Modify (
|
||||
} else {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
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.
|
||||
This routine will install EFI_PEI_PCI_CFG2_PPI.
|
||||
@@ -466,10 +308,10 @@ PeimInitializePciCfg (
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
|
||||
ASSERT ((**PeiServices).Hdr.Revision >= PEI_SERVICES_REVISION);
|
||||
ASSERT ((**PeiServices).Hdr.Revision >= PI_SPECIFICATION_VERSION);
|
||||
|
||||
(**(EFI_PEI_SERVICES **)PeiServices).PciCfg = &gPciCfg2Ppi;
|
||||
Status = (**PeiServices).InstallPpi ((CONST EFI_PEI_SERVICES **)PeiServices, &gPciCfg2PpiList);
|
||||
Status = (**PeiServices).InstallPpi (PeiServices, &gPciCfg2PpiList);
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/** @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.
|
||||
|
||||
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
|
||||
//
|
||||
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
|
||||
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
|
||||
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.
|
||||
**/
|
||||
EFI_STATUS
|
||||
@@ -79,14 +75,18 @@ SecurityStubAuthenticateState (
|
||||
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
|
||||
as the real entry point for the image goes into a library that calls this
|
||||
function.
|
||||
Installs Security Architectural Protocol.
|
||||
|
||||
@param ImageHandle The firmware allocated handle for the EFI image.
|
||||
@param SystemTable A pointer to the EFI System Table.
|
||||
@param ImageHandle The image handle of this driver.
|
||||
@param SystemTable A pointer to the EFI System Table.
|
||||
|
||||
@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
|
||||
# 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
|
||||
# All rights reserved. This program and the accompanying materials
|
||||
@@ -28,7 +29,6 @@
|
||||
|
||||
[Sources.common]
|
||||
SecurityStub.c
|
||||
SecurityStub.h
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
@@ -42,4 +42,4 @@
|
||||
gEfiSecurityArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||
|
||||
[Depex]
|
||||
TRUE
|
||||
TRUE
|
||||
|
Reference in New Issue
Block a user