OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcDeviceMiscLib.h File Reference
#include <Uefi.h>
#include <Library/OcCpuLib.h>
#include <Library/OcFileLib.h>
#include <Library/OcStringLib.h>

Go to the source code of this file.

Data Structures

struct  PCI_CLASSCODE
 

Enumerations

enum  PCI_BAR_SIZE {
  PciBar1MB = 0 , PciBar2MB = 1 , PciBar4MB = 2 , PciBar8MB = 3 ,
  PciBar16MB = 4 , PciBar32MB = 5 , PciBar64MB = 6 , PciBar128MB = 7 ,
  PciBar256MB = 8 , PciBar512MB = 9 , PciBar1GB = 10 , PciBar2GB = 11 ,
  PciBar4GB = 12 , PciBar8GB = 13 , PciBar16GB = 14 , PciBar32GB = 15 ,
  PciBar64GB = 16 , PciBar128GB = 17 , PciBar256GB = 18 , PciBar512GB = 19 ,
  PciBarMacMax = PciBar1GB , PciBarTotal = PciBar512GB + 1
}
 

Functions

EFI_STATUS ReleaseUsbOwnership (VOID)
 
VOID ResetAudioTrafficClass (VOID)
 
VOID ActivateHpetSupport (VOID)
 
EFI_STATUS OcCpuInfoDump (IN OC_CPU_INFO *CpuInfo, IN EFI_FILE_PROTOCOL *Root)
 
EFI_STATUS OcPciInfoDump (IN EFI_FILE_PROTOCOL *Root)
 
EFI_STATUS OcForgeUefiSupport (IN BOOLEAN Forge, IN BOOLEAN Trash)
 
EFI_STATUS OcReloadOptionRoms (VOID)
 
EFI_STATUS ResizeGpuBars (IN PCI_BAR_SIZE Size, IN BOOLEAN Increase, IN BOOLEAN UseRbIo)
 

Detailed Description

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 OcDeviceMiscLib.h.

Enumeration Type Documentation

◆ PCI_BAR_SIZE

Valid PCI BAR sizes for PCI 2.0, modern PCI permit up to 8EB.

Enumerator
PciBar1MB 
PciBar2MB 
PciBar4MB 
PciBar8MB 
PciBar16MB 
PciBar32MB 
PciBar64MB 
PciBar128MB 
PciBar256MB 
PciBar512MB 
PciBar1GB 
PciBar2GB 
PciBar4GB 
PciBar8GB 
PciBar16GB 
PciBar32GB 
PciBar64GB 
PciBar128GB 
PciBar256GB 
PciBar512GB 
PciBarMacMax 
PciBarTotal 

Definition at line 102 of file OcDeviceMiscLib.h.

Function Documentation

◆ ActivateHpetSupport()

VOID ActivateHpetSupport ( VOID )

Force enables HPET timer.

Definition at line 30 of file ActivateHpetSupport.c.

◆ OcCpuInfoDump()

EFI_STATUS OcCpuInfoDump ( IN OC_CPU_INFO * CpuInfo,
IN EFI_FILE_PROTOCOL * Root )

Dump CPU info to the specified directory.

Parameters
[in]CpuInfoA pointer to the CPU info.
[in]RootDirectory to write CPU data.
Return values
EFI_SUCCESSon success.

Definition at line 23 of file CpuInfoDump.c.

◆ OcForgeUefiSupport()

EFI_STATUS OcForgeUefiSupport ( IN BOOLEAN Forge,
IN BOOLEAN Trash )

Upgrade UEFI version to 2.x.

Parameters
[in]ForgeIf TRUE forge, else just report status.
[in]TrashIf TRUE trash gBS->CreateEventEx directly, else reallocate gBS. Reallocate strategy will only affect current image and any images it loads. Trash strategy should affect all images.
Return values
EFI_SUCCESSon success.

Definition at line 81 of file ForgeUefi.c.

◆ OcPciInfoDump()

EFI_STATUS OcPciInfoDump ( IN EFI_FILE_PROTOCOL * Root)

Dump PCI info to the specified directory.

Parameters
[in]RootDirectory to write PCI info.
Return values
EFI_SUCCESSon success.

Definition at line 1434 of file PciInfoDump.c.

◆ OcReloadOptionRoms()

EFI_STATUS OcReloadOptionRoms ( VOID )

Reload Option ROMs.

Return values
EFI_SUCCESSon success.

Definition at line 203 of file ReloadOptionRoms.c.

◆ ReleaseUsbOwnership()

EFI_STATUS ReleaseUsbOwnership ( VOID )

Release UEFI ownership from USB controllers at booting.

Definition at line 534 of file ReleaseUsbOwnership.c.

◆ ResetAudioTrafficClass()

VOID ResetAudioTrafficClass ( VOID )

Reset HDA TCSEL to TC0 state.

Definition at line 30 of file ResetAudioTrafficClass.c.

◆ ResizeGpuBars()

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.

Parameters
[in]SizeMaximum BAR size.
[in]IncreaseIncrease BAR size if possible.
Return values
EFI_SUCCESSif at least one BAR resized.

Definition at line 854 of file SetResizableBar.c.