TianoCore EDK2 master
Loading...
Searching...
No Matches
PciResourceSupport.h
Go to the documentation of this file.
1
9#ifndef _EFI_PCI_RESOURCE_SUPPORT_H_
10#define _EFI_PCI_RESOURCE_SUPPORT_H_
11
12typedef enum {
13 PciResUsageTypical,
14 PciResUsagePadding
15} PCI_RESOURCE_USAGE;
16
17#define PCI_RESOURCE_SIGNATURE SIGNATURE_32 ('p', 'c', 'r', 'c')
18
19typedef struct {
20 UINT32 Signature;
21 LIST_ENTRY Link;
22 LIST_ENTRY ChildList;
23 PCI_IO_DEVICE *PciDev;
24 UINT64 Alignment;
25 UINT64 Offset;
26 UINT8 Bar;
27 PCI_BAR_TYPE ResType;
28 UINT64 Length;
29 BOOLEAN Reserved;
30 PCI_RESOURCE_USAGE ResourceUsage;
31 BOOLEAN Virtual;
33
34#define RESOURCE_NODE_FROM_LINK(a) \
35 CR (a, PCI_RESOURCE_NODE, Link, PCI_RESOURCE_SIGNATURE)
36
44VOID
46 OUT UINT64 *Start,
47 IN UINT64 Length
48 );
49
57VOID
59 OUT UINT64 *Start,
60 IN UINT64 Length
61 );
62
71VOID
73 IN OUT PCI_RESOURCE_NODE *Bridge,
74 IN PCI_RESOURCE_NODE *ResNode
75 );
76
95VOID
99 IN BOOLEAN TypeMerge
100 );
101
109VOID
111 IN PCI_RESOURCE_NODE *Bridge
112 );
113
121VOID
123 IN PCI_RESOURCE_NODE *Bridge
124 );
125
137VOID
139 IN PCI_IO_DEVICE *PciDev,
140 IN OUT PCI_RESOURCE_NODE *IoNode,
141 IN OUT PCI_RESOURCE_NODE *Mem32Node,
142 IN OUT PCI_RESOURCE_NODE *PMem32Node,
143 IN OUT PCI_RESOURCE_NODE *Mem64Node,
144 IN OUT PCI_RESOURCE_NODE *PMem64Node
145 );
146
163 IN PCI_IO_DEVICE *PciDev,
164 IN UINT64 Length,
165 IN UINT64 Alignment,
166 IN UINT8 Bar,
167 IN PCI_BAR_TYPE ResType,
168 IN PCI_RESOURCE_USAGE ResUsage
169 );
170
187 IN PCI_IO_DEVICE *PciDev,
188 IN UINT64 Length,
189 IN UINT64 Alignment,
190 IN UINT8 Bar,
191 IN PCI_BAR_TYPE ResType,
192 IN PCI_RESOURCE_USAGE ResUsage
193 );
194
207VOID
209 IN PCI_IO_DEVICE *Bridge,
210 IN OUT PCI_RESOURCE_NODE *IoNode,
211 IN OUT PCI_RESOURCE_NODE *Mem32Node,
212 IN OUT PCI_RESOURCE_NODE *PMem32Node,
213 IN OUT PCI_RESOURCE_NODE *Mem64Node,
214 IN OUT PCI_RESOURCE_NODE *PMem64Node
215 );
216
228VOID
230 IN PCI_IO_DEVICE *PciDev,
231 IN PCI_RESOURCE_NODE *IoNode,
232 IN PCI_RESOURCE_NODE *Mem32Node,
233 IN PCI_RESOURCE_NODE *PMem32Node,
234 IN PCI_RESOURCE_NODE *Mem64Node,
235 IN PCI_RESOURCE_NODE *PMem64Node
236 );
237
252VOID
254 IN PCI_IO_DEVICE *Bridge,
255 IN PCI_RESOURCE_NODE *Mem32Node,
256 IN PCI_RESOURCE_NODE *PMem32Node,
257 IN PCI_RESOURCE_NODE *Mem64Node,
258 IN PCI_RESOURCE_NODE *PMem64Node
259 );
260
271BOOLEAN
273 IN PCI_IO_DEVICE *Bridge,
274 IN UINT32 Decode
275 );
276
291 IN UINT64 Base,
292 IN PCI_RESOURCE_NODE *Bridge
293 );
294
302VOID
304 IN UINT64 Base,
306 );
307
317 IN UINT64 Base,
319 );
320
328VOID
330 IN UINT64 Base,
332 );
333
342VOID
344 IN PCI_IO_DEVICE *PciDevice,
345 IN UINT32 OptionRomBase,
346 IN BOOLEAN Enable
347 );
348
358BOOLEAN
360 IN PCI_RESOURCE_NODE *Bridge
361 );
362
371VOID
373 IN OUT PCI_RESOURCE_NODE *ResourcePool,
374 IN PCI_BAR_TYPE ResourceType
375 );
376
383VOID
385 IN PCI_RESOURCE_NODE *Bridge
386 );
387
399VOID
401 IN PCI_IO_DEVICE *PciDev,
402 IN PCI_RESOURCE_NODE *IoNode,
403 IN PCI_RESOURCE_NODE *Mem32Node,
404 IN PCI_RESOURCE_NODE *PMem32Node,
405 IN PCI_RESOURCE_NODE *Mem64Node,
406 IN PCI_RESOURCE_NODE *PMem64Node
407 );
408
416VOID
418 IN UINT64 Base,
420 );
421
433VOID
435 IN PCI_IO_DEVICE *PciDev,
436 IN PCI_RESOURCE_NODE *IoNode,
437 IN PCI_RESOURCE_NODE *Mem32Node,
438 IN PCI_RESOURCE_NODE *PMem32Node,
439 IN PCI_RESOURCE_NODE *Mem64Node,
440 IN PCI_RESOURCE_NODE *PMem64Node
441 );
442
451VOID
453 IN PCI_IO_DEVICE *PciIoDevice
454 );
455
456#endif
VOID Decode(SCRATCH_DATA *Sd)
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
BOOLEAN ResourceRequestExisted(IN PCI_RESOURCE_NODE *Bridge)
VOID GetResourcePaddingPpb(IN PCI_IO_DEVICE *PciIoDevice)
BOOLEAN BridgeSupportResourceDecode(IN PCI_IO_DEVICE *Bridge, IN UINT32 Decode)
VOID SkipIsaAliasAperture(OUT UINT64 *Start, IN UINT64 Length)
VOID CalculateApertureIo16(IN PCI_RESOURCE_NODE *Bridge)
PCI_RESOURCE_NODE * CreateVfResourceNode(IN PCI_IO_DEVICE *PciDev, IN UINT64 Length, IN UINT64 Alignment, IN UINT8 Bar, IN PCI_BAR_TYPE ResType, IN PCI_RESOURCE_USAGE ResUsage)
VOID SkipVGAAperture(OUT UINT64 *Start, IN UINT64 Length)
VOID ApplyResourcePadding(IN PCI_IO_DEVICE *PciDev, IN PCI_RESOURCE_NODE *IoNode, IN PCI_RESOURCE_NODE *Mem32Node, IN PCI_RESOURCE_NODE *PMem32Node, IN PCI_RESOURCE_NODE *Mem64Node, IN PCI_RESOURCE_NODE *PMem64Node)
VOID ResourcePaddingForCardBusBridge(IN PCI_IO_DEVICE *PciDev, IN PCI_RESOURCE_NODE *IoNode, IN PCI_RESOURCE_NODE *Mem32Node, IN PCI_RESOURCE_NODE *PMem32Node, IN PCI_RESOURCE_NODE *Mem64Node, IN PCI_RESOURCE_NODE *PMem64Node)
VOID GetResourceFromDevice(IN PCI_IO_DEVICE *PciDev, IN OUT PCI_RESOURCE_NODE *IoNode, IN OUT PCI_RESOURCE_NODE *Mem32Node, IN OUT PCI_RESOURCE_NODE *PMem32Node, IN OUT PCI_RESOURCE_NODE *Mem64Node, IN OUT PCI_RESOURCE_NODE *PMem64Node)
VOID ResourcePaddingPolicy(IN PCI_IO_DEVICE *PciDev, IN PCI_RESOURCE_NODE *IoNode, IN PCI_RESOURCE_NODE *Mem32Node, IN PCI_RESOURCE_NODE *PMem32Node, IN PCI_RESOURCE_NODE *Mem64Node, IN PCI_RESOURCE_NODE *PMem64Node)
EFI_STATUS ProgramVfBar(IN UINT64 Base, IN PCI_RESOURCE_NODE *Node)
VOID ProgramUpstreamBridgeForRom(IN PCI_IO_DEVICE *PciDevice, IN UINT32 OptionRomBase, IN BOOLEAN Enable)
EFI_STATUS ProgramResource(IN UINT64 Base, IN PCI_RESOURCE_NODE *Bridge)
VOID CreateResourceMap(IN PCI_IO_DEVICE *Bridge, IN OUT PCI_RESOURCE_NODE *IoNode, IN OUT PCI_RESOURCE_NODE *Mem32Node, IN OUT PCI_RESOURCE_NODE *PMem32Node, IN OUT PCI_RESOURCE_NODE *Mem64Node, IN OUT PCI_RESOURCE_NODE *PMem64Node)
VOID InitializeResourcePool(IN OUT PCI_RESOURCE_NODE *ResourcePool, IN PCI_BAR_TYPE ResourceType)
VOID ProgramBar(IN UINT64 Base, IN PCI_RESOURCE_NODE *Node)
VOID DegradeResource(IN PCI_IO_DEVICE *Bridge, IN PCI_RESOURCE_NODE *Mem32Node, IN PCI_RESOURCE_NODE *PMem32Node, IN PCI_RESOURCE_NODE *Mem64Node, IN PCI_RESOURCE_NODE *PMem64Node)
VOID InsertResourceNode(IN OUT PCI_RESOURCE_NODE *Bridge, IN PCI_RESOURCE_NODE *ResNode)
PCI_RESOURCE_NODE * CreateResourceNode(IN PCI_IO_DEVICE *PciDev, IN UINT64 Length, IN UINT64 Alignment, IN UINT8 Bar, IN PCI_BAR_TYPE ResType, IN PCI_RESOURCE_USAGE ResUsage)
VOID CalculateResourceAperture(IN PCI_RESOURCE_NODE *Bridge)
VOID MergeResourceTree(IN PCI_RESOURCE_NODE *Dst, IN PCI_RESOURCE_NODE *Res, IN BOOLEAN TypeMerge)
VOID DestroyResourceTree(IN PCI_RESOURCE_NODE *Bridge)
VOID ProgramPpbApperture(IN UINT64 Base, IN PCI_RESOURCE_NODE *Node)
VOID ProgramP2C(IN UINT64 Base, IN PCI_RESOURCE_NODE *Node)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29