]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Compatibility/PciCfgToPciCfg2Thunk/PciCfgToPciCfg2Thunk.c
Add doxygen style comments for section extraction module.
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / PciCfgToPciCfg2Thunk / PciCfgToPciCfg2Thunk.c
1 /*++
2
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
8
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.
11 Module Name:
12
13 Variable.c
14
15 Abstract:
16
17 PEIM to provide the Variable functionality
18
19 --*/
20
21 #include <PiPei.h>
22 #include <Ppi/PciCfg.h>
23 #include <Ppi/PciCfg2.h>
24 #include <Library/DebugLib.h>
25
26 //
27 // Function Prototypes
28 //
29 EFI_STATUS
30 EFIAPI
31 PciCfgRead (
32 IN EFI_PEI_SERVICES **PeiServices,
33 IN EFI_PEI_PCI_CFG_PPI *This,
34 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
35 IN UINT64 Address,
36 IN OUT VOID *Buffer
37 );
38
39 EFI_STATUS
40 EFIAPI
41 PciCfgWrite (
42 IN EFI_PEI_SERVICES **PeiServices,
43 IN EFI_PEI_PCI_CFG_PPI *This,
44 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
45 IN UINT64 Address,
46 IN OUT VOID *Buffer
47 );
48
49 EFI_STATUS
50 EFIAPI
51 PciCfgModify (
52 IN EFI_PEI_SERVICES **PeiServices,
53 IN EFI_PEI_PCI_CFG_PPI *This,
54 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
55 IN UINT64 Address,
56 IN UINTN SetBits,
57 IN UINTN ClearBits
58 );
59
60 //
61 // Module globals
62 //
63 EFI_PEI_PCI_CFG_PPI mPciCfgPpi = {
64 PciCfgRead,
65 PciCfgWrite,
66 PciCfgModify,
67 };
68
69 EFI_PEI_PPI_DESCRIPTOR mPpiListPciCfg = {
70 (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
71 &gEfiPciCfgPpiInServiceTableGuid,
72 &mPciCfgPpi
73 };
74
75 EFI_STATUS
76 EFIAPI
77 PeimInitializePciCfg (
78 IN EFI_FFS_FILE_HEADER *FfsHeader,
79 IN CONST EFI_PEI_SERVICES **PeiServices
80 )
81 /*++
82
83 Routine Description:
84
85 Provide the functionality of the variable services.
86
87 Arguments:
88
89 FfsHeadher - The FFS file header
90 PeiServices - General purpose services available to every PEIM.
91
92 Returns:
93
94 Status - EFI_SUCCESS if the interface could be successfully
95 installed
96
97 --*/
98 {
99 //
100 // Publish the variable capability to other modules
101 //
102 return (*PeiServices)->InstallPpi (PeiServices, &mPpiListPciCfg);
103 }
104
105 EFI_STATUS
106 EFIAPI
107 PciCfgRead (
108 IN EFI_PEI_SERVICES **PeiServices,
109 IN EFI_PEI_PCI_CFG_PPI *This,
110 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
111 IN UINT64 Address,
112 IN OUT VOID *Buffer
113 )
114 {
115 EFI_PEI_PCI_CFG2_PPI *PciCfg2;
116
117 PciCfg2 = (*PeiServices)->PciCfg;
118
119 return PciCfg2->Read ((CONST EFI_PEI_SERVICES **)PeiServices, PciCfg2, Width, Address, Buffer);
120 }
121
122 EFI_STATUS
123 EFIAPI
124 PciCfgWrite (
125 IN EFI_PEI_SERVICES **PeiServices,
126 IN EFI_PEI_PCI_CFG_PPI *This,
127 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
128 IN UINT64 Address,
129 IN OUT VOID *Buffer
130 )
131 {
132 EFI_PEI_PCI_CFG2_PPI *PciCfg2;
133
134 PciCfg2 = (*PeiServices)->PciCfg;
135
136 return PciCfg2->Write ((CONST EFI_PEI_SERVICES **)PeiServices, PciCfg2, Width, Address, Buffer);
137 }
138
139 EFI_STATUS
140 EFIAPI
141 PciCfgModify (
142 IN EFI_PEI_SERVICES **PeiServices,
143 IN EFI_PEI_PCI_CFG_PPI *This,
144 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
145 IN UINT64 Address,
146 IN UINTN SetBits,
147 IN UINTN ClearBits
148 )
149 {
150 EFI_PEI_PCI_CFG2_PPI *PciCfg2;
151
152 PciCfg2 = (*PeiServices)->PciCfg;
153
154 return PciCfg2->Modify ((CONST EFI_PEI_SERVICES **)PeiServices, PciCfg2, Width, Address, &SetBits, &ClearBits);
155 }