TianoCore EDK2 master
Loading...
Searching...
No Matches
ExtraRootBusMap.h File Reference

Go to the source code of this file.

Typedefs

typedef struct EXTRA_ROOT_BUS_MAP_STRUCT EXTRA_ROOT_BUS_MAP
 

Functions

EFI_STATUS CreateExtraRootBusMap (OUT EXTRA_ROOT_BUS_MAP **ExtraRootBusMap)
 
VOID DestroyExtraRootBusMap (IN EXTRA_ROOT_BUS_MAP *ExtraRootBusMap)
 
EFI_STATUS MapRootBusPosToBusNr (IN CONST EXTRA_ROOT_BUS_MAP *ExtraRootBusMap, IN UINT64 RootBusPos, OUT UINT32 *RootBusNr)
 

Detailed Description

Map positions of extra PCI root buses to bus numbers.

Copyright (C) 2015, Red Hat, Inc.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file ExtraRootBusMap.h.

Typedef Documentation

◆ EXTRA_ROOT_BUS_MAP

Incomplete ("opaque") data type implementing the map.

Definition at line 15 of file ExtraRootBusMap.h.

Function Documentation

◆ CreateExtraRootBusMap()

EFI_STATUS CreateExtraRootBusMap ( OUT EXTRA_ROOT_BUS_MAP **  ExtraRootBusMap)

Create a structure that maps the relative positions of PCI root buses to bus numbers.

In the "bootorder" fw_cfg file, QEMU refers to extra PCI root buses by their positions, in relative root bus number order, not by their actual PCI bus numbers. The ACPI HID device path nodes however that are associated with PciRootBridgeIo protocol instances in the system have their UID fields set to the bus numbers. Create a map that gives, for each extra PCI root bus's position (ie. "serial number") its actual PCI bus number.

Parameters
[out]ExtraRootBusMapThe data structure implementing the map.
Return values
EFI_SUCCESSExtraRootBusMap has been populated.
EFI_OUT_OF_RESOURCESMemory allocation failed.
EFI_ALREADY_STARTEDA duplicate root bus number has been found in the system. (This should never happen.)
Returns
Error codes returned by gBS->LocateHandleBuffer() and gBS->HandleProtocol().

Definition at line 128 of file ExtraRootBusMap.c.

◆ DestroyExtraRootBusMap()

VOID DestroyExtraRootBusMap ( IN EXTRA_ROOT_BUS_MAP ExtraRootBusMap)

Release a map created with CreateExtraRootBusMap().

Parameters
[in]ExtraRootBusMapThe map to release.

Definition at line 278 of file ExtraRootBusMap.c.

◆ MapRootBusPosToBusNr()

EFI_STATUS MapRootBusPosToBusNr ( IN CONST EXTRA_ROOT_BUS_MAP ExtraRootBusMap,
IN UINT64  RootBusPos,
OUT UINT32 *  RootBusNr 
)

Map the position (serial number) of an extra PCI root bus to its bus number.

Parameters
[in]ExtraRootBusMapThe map created with CreateExtraRootBusMap();
[in]RootBusPosThe extra PCI root bus position to map.
[out]RootBusNrThe bus number belonging to the extra PCI root bus identified by RootBusPos.
Return values
EFI_INVALID_PARAMETERRootBusPos is zero. The zero position identifies the main root bus, whose bus number is always zero, and is therefore never maintained in ExtraRootBusMap.
EFI_NOT_FOUNDRootBusPos is not found in ExtraRootBusMap.
EFI_SUCCESSMapping successful.

Definition at line 309 of file ExtraRootBusMap.c.