Merge the PI enabling works from the branch
First round of PI enabling work: 1) PiPeiCis changes (CONST, EFI_PEI_FILE_HANDLE.. etc) 2) Make use of FirmwareVolume 2 protocol. 3) Verified for Nt32Pkg and real platform for S3. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3770 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
507b36ca9e
commit
22936e958f
|
@ -25,6 +25,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#include <Library/SmbusLib.h>
|
#include <Library/SmbusLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/PeiServicesTablePointerLib.h>
|
#include <Library/PeiServicesTablePointerLib.h>
|
||||||
|
#include <Library/PeiServicesLib.h>
|
||||||
#include <Library/BaseMemoryLib.h>
|
#include <Library/BaseMemoryLib.h>
|
||||||
|
|
||||||
#define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)
|
#define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress) (((SmBusAddress) >> 1) & 0x7f)
|
||||||
|
@ -42,14 +43,14 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
This internal function retrieves Smbus PPI from PPI database.
|
This internal function retrieves Smbus PPI from PPI database.
|
||||||
|
|
||||||
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES published by the PEI Foundation.
|
@param VOID
|
||||||
|
|
||||||
@return The pointer to Smbus PPI.
|
@return The pointer to Smbus PPI.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
EFI_PEI_SMBUS_PPI *
|
EFI_PEI_SMBUS_PPI *
|
||||||
InternalGetSmbusPpi (
|
InternalGetSmbusPpi (
|
||||||
EFI_PEI_SERVICES **PeiServices
|
VOID
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -29,13 +29,13 @@ Module Name: PeiSmbusLib.c
|
||||||
**/
|
**/
|
||||||
EFI_PEI_SMBUS_PPI *
|
EFI_PEI_SMBUS_PPI *
|
||||||
InternalGetSmbusPpi (
|
InternalGetSmbusPpi (
|
||||||
EFI_PEI_SERVICES **PeiServices
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
EFI_PEI_SMBUS_PPI *SmbusPpi;
|
EFI_PEI_SMBUS_PPI *SmbusPpi;
|
||||||
|
|
||||||
Status = (*PeiServices)->LocatePpi (PeiServices, &gEfiPeiSmbusPpiGuid, 0, NULL, (VOID **) &SmbusPpi);
|
Status = PeiServicesLocatePpi (&gEfiPeiSmbusPpiGuid, 0, NULL, (VOID **) &SmbusPpi);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
ASSERT (SmbusPpi != NULL);
|
ASSERT (SmbusPpi != NULL);
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ InternalSmBusExec (
|
||||||
EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;
|
EFI_SMBUS_DEVICE_ADDRESS SmbusDeviceAddress;
|
||||||
|
|
||||||
PeiServices = GetPeiServicesTablePointer ();
|
PeiServices = GetPeiServicesTablePointer ();
|
||||||
SmbusPpi = InternalGetSmbusPpi (PeiServices);
|
SmbusPpi = InternalGetSmbusPpi ();
|
||||||
SmbusDeviceAddress.SmbusDeviceAddress = SMBUS_LIB_SLAVE_ADDRESS (SmBusAddress);
|
SmbusDeviceAddress.SmbusDeviceAddress = SMBUS_LIB_SLAVE_ADDRESS (SmBusAddress);
|
||||||
|
|
||||||
ReturnStatus = SmbusPpi->Execute (
|
ReturnStatus = SmbusPpi->Execute (
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
BaseMemoryLib
|
BaseMemoryLib
|
||||||
PeiServicesTablePointerLib
|
PeiServicesTablePointerLib
|
||||||
|
PeiServicesLib
|
||||||
DebugLib
|
DebugLib
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue