TianoCore EDK2 master
Loading...
Searching...
No Matches
PciSegmentLib.c
Go to the documentation of this file.
1
9#include "PciSegmentLib.h"
10
11//
12// Global variable to record data of PCI Root Bridge I/O Protocol instances
13//
14PCI_ROOT_BRIDGE_DATA *mPciRootBridgeData = NULL;
15UINTN mNumberOfPciRootBridges = 0;
16
31EFIAPI
33 IN EFI_HANDLE ImageHandle,
34 IN EFI_SYSTEM_TABLE *SystemTable
35 )
36{
37 EFI_STATUS Status;
38 UINTN Index;
39 UINTN HandleCount;
40 EFI_HANDLE *HandleBuffer;
41 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
43
44 HandleCount = 0;
45 HandleBuffer = NULL;
46 PciRootBridgeIo = NULL;
47 Descriptors = NULL;
48
49 Status = gBS->LocateHandleBuffer (
51 &gEfiPciRootBridgeIoProtocolGuid,
52 NULL,
53 &HandleCount,
54 &HandleBuffer
55 );
56 ASSERT_EFI_ERROR (Status);
57
58 mNumberOfPciRootBridges = HandleCount;
59
60 mPciRootBridgeData = AllocatePool (HandleCount * sizeof (PCI_ROOT_BRIDGE_DATA));
61 ASSERT (mPciRootBridgeData != NULL);
62
63 //
64 // Traverse all PCI Root Bridge I/O Protocol instances, and record the protocol
65 // instances, together with their segment numbers and bus ranges.
66 //
67 for (Index = 0; Index < HandleCount; Index++) {
68 Status = gBS->HandleProtocol (
69 HandleBuffer[Index],
70 &gEfiPciRootBridgeIoProtocolGuid,
71 (VOID **)&PciRootBridgeIo
72 );
73 ASSERT_EFI_ERROR (Status);
74
75 mPciRootBridgeData[Index].PciRootBridgeIo = PciRootBridgeIo;
76 mPciRootBridgeData[Index].SegmentNumber = PciRootBridgeIo->SegmentNumber;
77
78 Status = PciRootBridgeIo->Configuration (PciRootBridgeIo, (VOID **)&Descriptors);
79 ASSERT_EFI_ERROR (Status);
80
81 while (Descriptors->Desc != ACPI_END_TAG_DESCRIPTOR) {
82 if (Descriptors->ResType == ACPI_ADDRESS_SPACE_TYPE_BUS) {
83 mPciRootBridgeData[Index].MinBusNumber = Descriptors->AddrRangeMin;
84 mPciRootBridgeData[Index].MaxBusNumber = Descriptors->AddrRangeMax;
85 break;
86 }
87
88 Descriptors++;
89 }
90
91 ASSERT (Descriptors->Desc != ACPI_END_TAG_DESCRIPTOR);
92 }
93
94 FreePool (HandleBuffer);
95
96 return EFI_SUCCESS;
97}
98
112EFIAPI
114 IN EFI_HANDLE ImageHandle,
115 IN EFI_SYSTEM_TABLE *SystemTable
116 )
117{
118 FreePool (mPciRootBridgeData);
119
120 return EFI_SUCCESS;
121}
122
137 IN UINT64 Address
138 )
139{
140 UINTN Index;
141 UINT64 SegmentNumber;
142 UINT64 BusNumber;
143
144 for (Index = 0; Index < mNumberOfPciRootBridges; Index++) {
145 //
146 // Matches segment number of address with the segment number of protocol instance.
147 //
148 SegmentNumber = BitFieldRead64 (Address, 32, 63);
149 if (SegmentNumber == mPciRootBridgeData[Index].SegmentNumber) {
150 //
151 // Matches the bus number of address with bus number range of protocol instance.
152 //
153 BusNumber = BitFieldRead64 (Address, 20, 27);
154 if ((BusNumber >= mPciRootBridgeData[Index].MinBusNumber) && (BusNumber <= mPciRootBridgeData[Index].MaxBusNumber)) {
155 return mPciRootBridgeData[Index].PciRootBridgeIo;
156 }
157 }
158 }
159
160 return NULL;
161}
162
177UINT32
179 IN UINT64 Address,
181 )
182{
183 UINT32 Data;
184 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
185
186 PciRootBridgeIo = PciSegmentLibSearchForRootBridge (Address);
187
188 if (PciRootBridgeIo == NULL) {
189 ASSERT (PciRootBridgeIo != NULL);
190 return 0;
191 }
192
193 PciRootBridgeIo->Pci.Read (
194 PciRootBridgeIo,
195 Width,
197 1,
198 &Data
199 );
200
201 return Data;
202}
203
220UINT32
222 IN UINT64 Address,
224 IN UINT32 Data
225 )
226{
227 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo;
228
229 PciRootBridgeIo = PciSegmentLibSearchForRootBridge (Address);
230
231 if (PciRootBridgeIo == NULL) {
232 ASSERT (PciRootBridgeIo != NULL);
233 return 0;
234 }
235
236 PciRootBridgeIo->Pci.Write (
237 PciRootBridgeIo,
238 Width,
240 1,
241 &Data
242 );
243
244 return Data;
245}
246
265RETURN_STATUS
266EFIAPI
268 IN UINTN Address
269 )
270{
272 return RETURN_UNSUPPORTED;
273}
274
288UINT8
289EFIAPI
291 IN UINT64 Address
292 )
293{
295
296 return (UINT8)DxePciSegmentLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint8);
297}
298
313UINT8
314EFIAPI
316 IN UINT64 Address,
317 IN UINT8 Value
318 )
319{
321
322 return (UINT8)DxePciSegmentLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint8, Value);
323}
324
342UINT8
343EFIAPI
345 IN UINT64 Address,
346 IN UINT8 OrData
347 )
348{
349 return PciSegmentWrite8 (Address, (UINT8)(PciSegmentRead8 (Address) | OrData));
350}
351
368UINT8
369EFIAPI
371 IN UINT64 Address,
372 IN UINT8 AndData
373 )
374{
375 return PciSegmentWrite8 (Address, (UINT8)(PciSegmentRead8 (Address) & AndData));
376}
377
398UINT8
399EFIAPI
401 IN UINT64 Address,
402 IN UINT8 AndData,
403 IN UINT8 OrData
404 )
405{
406 return PciSegmentWrite8 (Address, (UINT8)((PciSegmentRead8 (Address) & AndData) | OrData));
407}
408
430UINT8
431EFIAPI
433 IN UINT64 Address,
434 IN UINTN StartBit,
435 IN UINTN EndBit
436 )
437{
438 return BitFieldRead8 (PciSegmentRead8 (Address), StartBit, EndBit);
439}
440
465UINT8
466EFIAPI
468 IN UINT64 Address,
469 IN UINTN StartBit,
470 IN UINTN EndBit,
471 IN UINT8 Value
472 )
473{
474 return PciSegmentWrite8 (
475 Address,
476 BitFieldWrite8 (PciSegmentRead8 (Address), StartBit, EndBit, Value)
477 );
478}
479
507UINT8
508EFIAPI
510 IN UINT64 Address,
511 IN UINTN StartBit,
512 IN UINTN EndBit,
513 IN UINT8 OrData
514 )
515{
516 return PciSegmentWrite8 (
517 Address,
518 BitFieldOr8 (PciSegmentRead8 (Address), StartBit, EndBit, OrData)
519 );
520}
521
549UINT8
550EFIAPI
552 IN UINT64 Address,
553 IN UINTN StartBit,
554 IN UINTN EndBit,
555 IN UINT8 AndData
556 )
557{
558 return PciSegmentWrite8 (
559 Address,
560 BitFieldAnd8 (PciSegmentRead8 (Address), StartBit, EndBit, AndData)
561 );
562}
563
594UINT8
595EFIAPI
597 IN UINT64 Address,
598 IN UINTN StartBit,
599 IN UINTN EndBit,
600 IN UINT8 AndData,
601 IN UINT8 OrData
602 )
603{
604 return PciSegmentWrite8 (
605 Address,
606 BitFieldAndThenOr8 (PciSegmentRead8 (Address), StartBit, EndBit, AndData, OrData)
607 );
608}
609
624UINT16
625EFIAPI
627 IN UINT64 Address
628 )
629{
631
632 return (UINT16)DxePciSegmentLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint16);
633}
634
650UINT16
651EFIAPI
653 IN UINT64 Address,
654 IN UINT16 Value
655 )
656{
658
659 return (UINT16)DxePciSegmentLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint16, Value);
660}
661
682UINT16
683EFIAPI
685 IN UINT64 Address,
686 IN UINT16 OrData
687 )
688{
689 return PciSegmentWrite16 (Address, (UINT16)(PciSegmentRead16 (Address) | OrData));
690}
691
710UINT16
711EFIAPI
713 IN UINT64 Address,
714 IN UINT16 AndData
715 )
716{
717 return PciSegmentWrite16 (Address, (UINT16)(PciSegmentRead16 (Address) & AndData));
718}
719
741UINT16
742EFIAPI
744 IN UINT64 Address,
745 IN UINT16 AndData,
746 IN UINT16 OrData
747 )
748{
749 return PciSegmentWrite16 (Address, (UINT16)((PciSegmentRead16 (Address) & AndData) | OrData));
750}
751
774UINT16
775EFIAPI
777 IN UINT64 Address,
778 IN UINTN StartBit,
779 IN UINTN EndBit
780 )
781{
782 return BitFieldRead16 (PciSegmentRead16 (Address), StartBit, EndBit);
783}
784
810UINT16
811EFIAPI
813 IN UINT64 Address,
814 IN UINTN StartBit,
815 IN UINTN EndBit,
816 IN UINT16 Value
817 )
818{
819 return PciSegmentWrite16 (
820 Address,
821 BitFieldWrite16 (PciSegmentRead16 (Address), StartBit, EndBit, Value)
822 );
823}
824
853UINT16
854EFIAPI
856 IN UINT64 Address,
857 IN UINTN StartBit,
858 IN UINTN EndBit,
859 IN UINT16 OrData
860 )
861{
862 return PciSegmentWrite16 (
863 Address,
864 BitFieldOr16 (PciSegmentRead16 (Address), StartBit, EndBit, OrData)
865 );
866}
867
896UINT16
897EFIAPI
899 IN UINT64 Address,
900 IN UINTN StartBit,
901 IN UINTN EndBit,
902 IN UINT16 AndData
903 )
904{
905 return PciSegmentWrite16 (
906 Address,
907 BitFieldAnd16 (PciSegmentRead16 (Address), StartBit, EndBit, AndData)
908 );
909}
910
942UINT16
943EFIAPI
945 IN UINT64 Address,
946 IN UINTN StartBit,
947 IN UINTN EndBit,
948 IN UINT16 AndData,
949 IN UINT16 OrData
950 )
951{
952 return PciSegmentWrite16 (
953 Address,
954 BitFieldAndThenOr16 (PciSegmentRead16 (Address), StartBit, EndBit, AndData, OrData)
955 );
956}
957
972UINT32
973EFIAPI
975 IN UINT64 Address
976 )
977{
979
980 return DxePciSegmentLibPciRootBridgeIoReadWorker (Address, EfiPciWidthUint32);
981}
982
998UINT32
999EFIAPI
1001 IN UINT64 Address,
1002 IN UINT32 Value
1003 )
1004{
1006
1007 return DxePciSegmentLibPciRootBridgeIoWriteWorker (Address, EfiPciWidthUint32, Value);
1008}
1009
1028UINT32
1029EFIAPI
1031 IN UINT64 Address,
1032 IN UINT32 OrData
1033 )
1034{
1035 return PciSegmentWrite32 (Address, PciSegmentRead32 (Address) | OrData);
1036}
1037
1056UINT32
1057EFIAPI
1059 IN UINT64 Address,
1060 IN UINT32 AndData
1061 )
1062{
1063 return PciSegmentWrite32 (Address, PciSegmentRead32 (Address) & AndData);
1064}
1065
1087UINT32
1088EFIAPI
1090 IN UINT64 Address,
1091 IN UINT32 AndData,
1092 IN UINT32 OrData
1093 )
1094{
1095 return PciSegmentWrite32 (Address, (PciSegmentRead32 (Address) & AndData) | OrData);
1096}
1097
1120UINT32
1121EFIAPI
1123 IN UINT64 Address,
1124 IN UINTN StartBit,
1125 IN UINTN EndBit
1126 )
1127{
1128 return BitFieldRead32 (PciSegmentRead32 (Address), StartBit, EndBit);
1129}
1130
1156UINT32
1157EFIAPI
1159 IN UINT64 Address,
1160 IN UINTN StartBit,
1161 IN UINTN EndBit,
1162 IN UINT32 Value
1163 )
1164{
1165 return PciSegmentWrite32 (
1166 Address,
1167 BitFieldWrite32 (PciSegmentRead32 (Address), StartBit, EndBit, Value)
1168 );
1169}
1170
1198UINT32
1199EFIAPI
1201 IN UINT64 Address,
1202 IN UINTN StartBit,
1203 IN UINTN EndBit,
1204 IN UINT32 OrData
1205 )
1206{
1207 return PciSegmentWrite32 (
1208 Address,
1209 BitFieldOr32 (PciSegmentRead32 (Address), StartBit, EndBit, OrData)
1210 );
1211}
1212
1240UINT32
1241EFIAPI
1243 IN UINT64 Address,
1244 IN UINTN StartBit,
1245 IN UINTN EndBit,
1246 IN UINT32 AndData
1247 )
1248{
1249 return PciSegmentWrite32 (
1250 Address,
1251 BitFieldAnd32 (PciSegmentRead32 (Address), StartBit, EndBit, AndData)
1252 );
1253}
1254
1286UINT32
1287EFIAPI
1289 IN UINT64 Address,
1290 IN UINTN StartBit,
1291 IN UINTN EndBit,
1292 IN UINT32 AndData,
1293 IN UINT32 OrData
1294 )
1295{
1296 return PciSegmentWrite32 (
1297 Address,
1298 BitFieldAndThenOr32 (PciSegmentRead32 (Address), StartBit, EndBit, AndData, OrData)
1299 );
1300}
1301
1325UINTN
1326EFIAPI
1328 IN UINT64 StartAddress,
1329 IN UINTN Size,
1330 OUT VOID *Buffer
1331 )
1332{
1333 UINTN ReturnValue;
1334
1335 ASSERT_INVALID_PCI_SEGMENT_ADDRESS (StartAddress, 0);
1336 ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
1337
1338 if (Size == 0) {
1339 return Size;
1340 }
1341
1342 ASSERT (Buffer != NULL);
1343
1344 //
1345 // Save Size for return
1346 //
1347 ReturnValue = Size;
1348
1349 if ((StartAddress & BIT0) != 0) {
1350 //
1351 // Read a byte if StartAddress is byte aligned
1352 //
1353 *(volatile UINT8 *)Buffer = PciSegmentRead8 (StartAddress);
1354 StartAddress += sizeof (UINT8);
1355 Size -= sizeof (UINT8);
1356 Buffer = (UINT8 *)Buffer + 1;
1357 }
1358
1359 if ((Size >= sizeof (UINT16)) && ((StartAddress & BIT1) != 0)) {
1360 //
1361 // Read a word if StartAddress is word aligned
1362 //
1363 WriteUnaligned16 (Buffer, PciSegmentRead16 (StartAddress));
1364 StartAddress += sizeof (UINT16);
1365 Size -= sizeof (UINT16);
1366 Buffer = (UINT16 *)Buffer + 1;
1367 }
1368
1369 while (Size >= sizeof (UINT32)) {
1370 //
1371 // Read as many double words as possible
1372 //
1373 WriteUnaligned32 (Buffer, PciSegmentRead32 (StartAddress));
1374 StartAddress += sizeof (UINT32);
1375 Size -= sizeof (UINT32);
1376 Buffer = (UINT32 *)Buffer + 1;
1377 }
1378
1379 if (Size >= sizeof (UINT16)) {
1380 //
1381 // Read the last remaining word if exist
1382 //
1383 WriteUnaligned16 (Buffer, PciSegmentRead16 (StartAddress));
1384 StartAddress += sizeof (UINT16);
1385 Size -= sizeof (UINT16);
1386 Buffer = (UINT16 *)Buffer + 1;
1387 }
1388
1389 if (Size >= sizeof (UINT8)) {
1390 //
1391 // Read the last remaining byte if exist
1392 //
1393 *(volatile UINT8 *)Buffer = PciSegmentRead8 (StartAddress);
1394 }
1395
1396 return ReturnValue;
1397}
1398
1423UINTN
1424EFIAPI
1426 IN UINT64 StartAddress,
1427 IN UINTN Size,
1428 IN VOID *Buffer
1429 )
1430{
1431 UINTN ReturnValue;
1432
1433 ASSERT_INVALID_PCI_SEGMENT_ADDRESS (StartAddress, 0);
1434 ASSERT (((StartAddress & 0xFFF) + Size) <= 0x1000);
1435
1436 if (Size == 0) {
1437 return 0;
1438 }
1439
1440 ASSERT (Buffer != NULL);
1441
1442 //
1443 // Save Size for return
1444 //
1445 ReturnValue = Size;
1446
1447 if ((StartAddress & BIT0) != 0) {
1448 //
1449 // Write a byte if StartAddress is byte aligned
1450 //
1451 PciSegmentWrite8 (StartAddress, *(UINT8 *)Buffer);
1452 StartAddress += sizeof (UINT8);
1453 Size -= sizeof (UINT8);
1454 Buffer = (UINT8 *)Buffer + 1;
1455 }
1456
1457 if ((Size >= sizeof (UINT16)) && ((StartAddress & BIT1) != 0)) {
1458 //
1459 // Write a word if StartAddress is word aligned
1460 //
1461 PciSegmentWrite16 (StartAddress, ReadUnaligned16 (Buffer));
1462 StartAddress += sizeof (UINT16);
1463 Size -= sizeof (UINT16);
1464 Buffer = (UINT16 *)Buffer + 1;
1465 }
1466
1467 while (Size >= sizeof (UINT32)) {
1468 //
1469 // Write as many double words as possible
1470 //
1471 PciSegmentWrite32 (StartAddress, ReadUnaligned32 (Buffer));
1472 StartAddress += sizeof (UINT32);
1473 Size -= sizeof (UINT32);
1474 Buffer = (UINT32 *)Buffer + 1;
1475 }
1476
1477 if (Size >= sizeof (UINT16)) {
1478 //
1479 // Write the last remaining word if exist
1480 //
1481 PciSegmentWrite16 (StartAddress, ReadUnaligned16 (Buffer));
1482 StartAddress += sizeof (UINT16);
1483 Size -= sizeof (UINT16);
1484 Buffer = (UINT16 *)Buffer + 1;
1485 }
1486
1487 if (Size >= sizeof (UINT8)) {
1488 //
1489 // Write the last remaining byte if exist
1490 //
1491 PciSegmentWrite8 (StartAddress, *(UINT8 *)Buffer);
1492 }
1493
1494 return ReturnValue;
1495}
UINT64 UINTN
PACKED struct @89 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
UINT32 EFIAPI BitFieldAnd32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData)
Definition: BitField.c:639
UINT16 EFIAPI BitFieldAnd16(IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData)
Definition: BitField.c:447
UINT8 EFIAPI BitFieldAndThenOr8(IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData, IN UINT8 OrData)
Definition: BitField.c:296
UINT32 EFIAPI BitFieldAndThenOr32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData, IN UINT32 OrData)
Definition: BitField.c:680
UINT32 EFIAPI BitFieldWrite32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 Value)
Definition: BitField.c:563
UINT16 EFIAPI BitFieldAndThenOr16(IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData, IN UINT16 OrData)
Definition: BitField.c:488
UINT32 EFIAPI BitFieldOr32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
Definition: BitField.c:601
UINT16 EFIAPI ReadUnaligned16(IN CONST UINT16 *Buffer)
Definition: Unaligned.c:29
UINT8 EFIAPI BitFieldWrite8(IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 Value)
Definition: BitField.c:179
UINT8 EFIAPI BitFieldRead8(IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit)
Definition: BitField.c:143
UINT8 EFIAPI BitFieldAnd8(IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData)
Definition: BitField.c:255
UINT32 EFIAPI WriteUnaligned32(OUT UINT32 *Buffer, IN UINT32 Value)
Definition: Unaligned.c:177
UINT16 EFIAPI BitFieldWrite16(IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 Value)
Definition: BitField.c:371
UINT16 EFIAPI WriteUnaligned16(OUT UINT16 *Buffer, IN UINT16 Value)
Definition: Unaligned.c:61
UINT64 EFIAPI BitFieldRead64(IN UINT64 Operand, IN UINTN StartBit, IN UINTN EndBit)
Definition: BitField.c:719
UINT16 EFIAPI BitFieldOr16(IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 OrData)
Definition: BitField.c:409
UINT16 EFIAPI BitFieldRead16(IN UINT16 Operand, IN UINTN StartBit, IN UINTN EndBit)
Definition: BitField.c:335
UINT8 EFIAPI BitFieldOr8(IN UINT8 Operand, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 OrData)
Definition: BitField.c:217
UINT32 EFIAPI BitFieldRead32(IN UINT32 Operand, IN UINTN StartBit, IN UINTN EndBit)
Definition: BitField.c:527
UINT32 EFIAPI ReadUnaligned32(IN CONST UINT32 *Buffer)
Definition: Unaligned.c:145
UINT8 EFIAPI PciSegmentRead8(IN UINT64 Address)
Definition: PciSegmentLib.c:78
UINT32 EFIAPI PciSegmentAnd32(IN UINT64 Address, IN UINT32 AndData)
UINT16 EFIAPI PciSegmentWrite16(IN UINT64 Address, IN UINT16 Value)
UINT16 EFIAPI PciSegmentBitFieldAnd16(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData)
UINT32 EFIAPI PciSegmentWrite32(IN UINT64 Address, IN UINT32 Value)
UINT8 EFIAPI PciSegmentBitFieldOr8(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 OrData)
UINT16 EFIAPI PciSegmentBitFieldOr16(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 OrData)
UINTN EFIAPI PciSegmentReadBuffer(IN UINT64 StartAddress, IN UINTN Size, OUT VOID *Buffer)
UINT8 EFIAPI PciSegmentBitFieldAnd8(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData)
UINT16 EFIAPI PciSegmentAnd16(IN UINT64 Address, IN UINT16 AndData)
UINT16 EFIAPI PciSegmentRead16(IN UINT64 Address)
RETURN_STATUS EFIAPI PciSegmentRegisterForRuntimeAccess(IN UINTN Address)
Definition: PciSegmentLib.c:55
UINT32 EFIAPI PciSegmentBitFieldWrite32(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 Value)
UINT8 EFIAPI PciSegmentBitFieldWrite8(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 Value)
UINT16 EFIAPI PciSegmentOr16(IN UINT64 Address, IN UINT16 OrData)
UINT32 EFIAPI PciSegmentBitFieldAndThenOr32(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData, IN UINT32 OrData)
UINT8 EFIAPI PciSegmentBitFieldRead8(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit)
UINT8 EFIAPI PciSegmentOr8(IN UINT64 Address, IN UINT8 OrData)
UINT16 EFIAPI PciSegmentBitFieldAndThenOr16(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 AndData, IN UINT16 OrData)
UINT16 EFIAPI PciSegmentBitFieldRead16(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit)
UINT32 EFIAPI PciSegmentAndThenOr32(IN UINT64 Address, IN UINT32 AndData, IN UINT32 OrData)
UINT32 EFIAPI PciSegmentRead32(IN UINT64 Address)
UINT8 EFIAPI PciSegmentAnd8(IN UINT64 Address, IN UINT8 AndData)
UINT8 EFIAPI PciSegmentBitFieldAndThenOr8(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT8 AndData, IN UINT8 OrData)
UINT32 EFIAPI PciSegmentBitFieldOr32(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 OrData)
UINT16 EFIAPI PciSegmentAndThenOr16(IN UINT64 Address, IN UINT16 AndData, IN UINT16 OrData)
UINT32 EFIAPI PciSegmentBitFieldAnd32(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT32 AndData)
UINT8 EFIAPI PciSegmentAndThenOr8(IN UINT64 Address, IN UINT8 AndData, IN UINT8 OrData)
#define ASSERT_INVALID_PCI_SEGMENT_ADDRESS(A, M)
Definition: PciSegmentLib.c:25
UINT16 EFIAPI PciSegmentBitFieldWrite16(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit, IN UINT16 Value)
UINT8 EFIAPI PciSegmentWrite8(IN UINT64 Address, IN UINT8 Value)
UINT32 EFIAPI PciSegmentBitFieldRead32(IN UINT64 Address, IN UINTN StartBit, IN UINTN EndBit)
UINTN EFIAPI PciSegmentWriteBuffer(IN UINT64 StartAddress, IN UINTN Size, IN VOID *Buffer)
UINT32 EFIAPI PciSegmentOr32(IN UINT64 Address, IN UINT32 OrData)
VOID EFIAPI FreePool(IN VOID *Buffer)
#define NULL
Definition: Base.h:319
#define RETURN_UNSUPPORTED
Definition: Base.h:1081
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define PCI_TO_PCI_ROOT_BRIDGE_IO_ADDRESS(A)
Definition: PciLib.c:33
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_BOOT_SERVICES * gBS
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * PciSegmentLibSearchForRootBridge(IN UINT64 Address)
EFI_STATUS EFIAPI PciSegmentLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
Definition: PciSegmentLib.c:32
EFI_STATUS EFIAPI PciSegmentLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
UINT32 DxePciSegmentLibPciRootBridgeIoReadWorker(IN UINT64 Address, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width)
UINT32 DxePciSegmentLibPciRootBridgeIoWriteWorker(IN UINT64 Address, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT32 Data)
@ ByProtocol
Definition: UefiSpec.h:1518
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Write
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_IO_MEM Read