3 Copyright (c) 2006 - 2008 Intel Corporation. <BR>
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 PEIM to provide the Variable functionality
22 #include <Ppi/PciCfg.h>
23 #include <Ppi/PciCfg2.h>
24 #include <Library/DebugLib.h>
27 // Function Prototypes
32 IN EFI_PEI_SERVICES
**PeiServices
,
33 IN EFI_PEI_PCI_CFG_PPI
*This
,
34 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
42 IN EFI_PEI_SERVICES
**PeiServices
,
43 IN EFI_PEI_PCI_CFG_PPI
*This
,
44 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
52 IN EFI_PEI_SERVICES
**PeiServices
,
53 IN EFI_PEI_PCI_CFG_PPI
*This
,
54 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
63 EFI_PEI_PCI_CFG_PPI mPciCfgPpi
= {
69 EFI_PEI_PPI_DESCRIPTOR mPpiListPciCfg
= {
70 (EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
),
71 &gEfiPciCfgPpiInServiceTableGuid
,
77 PeimInitializePciCfg (
78 IN EFI_FFS_FILE_HEADER
*FfsHeader
,
79 IN CONST EFI_PEI_SERVICES
**PeiServices
85 Provide the functionality of the variable services.
89 FfsHeadher - The FFS file header
90 PeiServices - General purpose services available to every PEIM.
94 Status - EFI_SUCCESS if the interface could be successfully
100 // Publish the variable capability to other modules
102 return (*PeiServices
)->InstallPpi (PeiServices
, &mPpiListPciCfg
);
108 IN EFI_PEI_SERVICES
**PeiServices
,
109 IN EFI_PEI_PCI_CFG_PPI
*This
,
110 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
115 EFI_PEI_PCI_CFG2_PPI
*PciCfg2
;
117 PciCfg2
= (*PeiServices
)->PciCfg
;
119 return PciCfg2
->Read ((CONST EFI_PEI_SERVICES
**)PeiServices
, PciCfg2
, Width
, Address
, Buffer
);
125 IN EFI_PEI_SERVICES
**PeiServices
,
126 IN EFI_PEI_PCI_CFG_PPI
*This
,
127 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
132 EFI_PEI_PCI_CFG2_PPI
*PciCfg2
;
134 PciCfg2
= (*PeiServices
)->PciCfg
;
136 return PciCfg2
->Write ((CONST EFI_PEI_SERVICES
**)PeiServices
, PciCfg2
, Width
, Address
, Buffer
);
142 IN EFI_PEI_SERVICES
**PeiServices
,
143 IN EFI_PEI_PCI_CFG_PPI
*This
,
144 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
150 EFI_PEI_PCI_CFG2_PPI
*PciCfg2
;
152 PciCfg2
= (*PeiServices
)->PciCfg
;
154 return PciCfg2
->Modify ((CONST EFI_PEI_SERVICES
**)PeiServices
, PciCfg2
, Width
, Address
, &SetBits
, &ClearBits
);