OpenCore
1.0.4
OpenCore Bootloader
|
#include <Uefi.h>
#include <IndustryStandard/Pci.h>
#include <Protocol/PciIo.h>
#include <Protocol/PciRootBridgeIo.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/IoLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/OcDeviceMiscLib.h>
#include "PciExtInternal.h"
Go to the source code of this file.
Functions | |
STATIC EFI_STATUS | LocatePciCapabilityPciIo (IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT16 CapId, OUT UINT32 *Offset) |
STATIC UINT64 | PciAddrOffset (UINT64 PciAddress, INT32 Offset) |
STATIC EFI_STATUS | LocatePciCapabilityRbIo (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo, IN UINT64 PciAddress, IN UINT16 CapId, OUT UINT32 *Offset) |
STATIC EFI_STATUS | SetResizableBarOnDevicePciIo (IN EFI_PCI_IO_PROTOCOL *PciIo, IN PCI_BAR_SIZE Size, IN BOOLEAN Increase) |
STATIC EFI_STATUS | SetResizableBarOnDeviceRbIo (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo, IN UINT64 PciAddress, IN PCI_BAR_SIZE Size, IN BOOLEAN Increase) |
EFI_STATUS | ResizeGpuBarsPciIo (IN PCI_BAR_SIZE Size, IN BOOLEAN Increase) |
STATIC BOOLEAN | PciGetNextBusRange (IN OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors, OUT UINT16 *MinBus, OUT UINT16 *MaxBus) |
STATIC EFI_STATUS | ResizeGpuBarsRbIo (IN PCI_BAR_SIZE Size, IN BOOLEAN Increase) |
EFI_STATUS | ResizeGpuBars (IN PCI_BAR_SIZE Size, IN BOOLEAN Increase, IN BOOLEAN UseRbIo) |
Copyright (C) 2021, vit9696. All rights reserved.
All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file SetResizableBar.c.
STATIC EFI_STATUS LocatePciCapabilityPciIo | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN UINT16 | CapId, | ||
OUT UINT32 * | Offset ) |
Definition at line 34 of file SetResizableBar.c.
STATIC EFI_STATUS LocatePciCapabilityRbIo | ( | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * | PciRootBridgeIo, |
IN UINT64 | PciAddress, | ||
IN UINT16 | CapId, | ||
OUT UINT32 * | Offset ) |
Definition at line 103 of file SetResizableBar.c.
STATIC UINT64 PciAddrOffset | ( | UINT64 | PciAddress, |
INT32 | Offset ) |
Definition at line 88 of file SetResizableBar.c.
STATIC BOOLEAN PciGetNextBusRange | ( | IN OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR ** | Descriptors, |
OUT UINT16 * | MinBus, | ||
OUT UINT16 * | MaxBus ) |
Definition at line 694 of file SetResizableBar.c.
EFI_STATUS ResizeGpuBars | ( | IN PCI_BAR_SIZE | Size, |
IN BOOLEAN | Increase, | ||
IN BOOLEAN | UseRbIo ) |
Resize GPU PCIe BARs up to Size.
Note: this function can increase RBAR size but it currently does not check whether the resulting BAR will not overlap other device memory. Use with care.
[in] | Size | Maximum BAR size. |
[in] | Increase | Increase BAR size if possible. |
EFI_SUCCESS | if at least one BAR resized. |
Definition at line 854 of file SetResizableBar.c.
EFI_STATUS ResizeGpuBarsPciIo | ( | IN PCI_BAR_SIZE | Size, |
IN BOOLEAN | Increase ) |
Definition at line 611 of file SetResizableBar.c.
STATIC EFI_STATUS ResizeGpuBarsRbIo | ( | IN PCI_BAR_SIZE | Size, |
IN BOOLEAN | Increase ) |
Definition at line 733 of file SetResizableBar.c.
STATIC EFI_STATUS SetResizableBarOnDevicePciIo | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN PCI_BAR_SIZE | Size, | ||
IN BOOLEAN | Increase ) |
Definition at line 155 of file SetResizableBar.c.
STATIC EFI_STATUS SetResizableBarOnDeviceRbIo | ( | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * | PciRootBridgeIo, |
IN UINT64 | PciAddress, | ||
IN PCI_BAR_SIZE | Size, | ||
IN BOOLEAN | Increase ) |
Definition at line 386 of file SetResizableBar.c.