OpenCore
1.0.4
OpenCore Bootloader
|
#include <Uefi.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/OcDebugLogLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/OcMemoryLib.h>
#include <Library/OcMiscLib.h>
#include <Library/PciLib.h>
#include <IndustryStandard/AcpiAml.h>
#include <IndustryStandard/Acpi.h>
#include <Guid/Acpi.h>
#include <Library/OcAcpiLib.h>
Go to the source code of this file.
Macros | |
#define | PCI_VENDOR_NVIDIA 0x10DE |
Functions | |
STATIC EFI_ACPI_6_2_ROOT_SYSTEM_DESCRIPTION_POINTER * | AcpiFindLegacyRsdp (VOID) |
STATIC EFI_ACPI_6_2_ROOT_SYSTEM_DESCRIPTION_POINTER * | AcpiFindRsdp (VOID) |
STATIC UINT32 | AcpiReadSignature (IN CONST EFI_ACPI_COMMON_HEADER *Common) |
STATIC UINT64 | AcpiReadOemTableId (IN CONST EFI_ACPI_COMMON_HEADER *Common) |
STATIC BOOLEAN | AcpiReadName (IN CONST UINT8 *Data, OUT CHAR8 *Name, OUT UINT32 *NameOffset OPTIONAL) |
STATIC UINT32 | AcpiFindName (IN CONST UINT8 *Data, IN UINT32 Length, IN CONST CHAR8 *Name) |
STATIC VOID | AcpiRefreshTableChecksum (IN EFI_ACPI_DESCRIPTION_HEADER *Table) |
STATIC BOOLEAN | AcpiIsTableWritable (IN EFI_ACPI_COMMON_HEADER *Table) |
STATIC EFI_STATUS | AcpiAllocateCopyTable (IN EFI_ACPI_COMMON_HEADER *Table, IN UINT32 NewSize OPTIONAL, OUT EFI_ACPI_COMMON_HEADER **NewTable) |
STATIC EFI_STATUS | AcpiAllocateCopyFadt (IN OUT OC_ACPI_CONTEXT *Context, IN UINT32 NewSize) |
STATIC EFI_STATUS | AcpiAllocateCopyDsdt (IN OUT OC_ACPI_CONTEXT *Context, IN EFI_ACPI_DESCRIPTION_HEADER *NewDsdt OPTIONAL) |
STATIC EFI_STATUS | AcpiLoadTableRegions (IN OUT OC_ACPI_CONTEXT *Context, IN EFI_ACPI_COMMON_HEADER *Table) |
STATIC VOID | AcpiRelocateTableRegions (IN OUT OC_ACPI_CONTEXT *Context, IN EFI_ACPI_COMMON_HEADER *Table) |
STATIC BOOLEAN | AcpiNormalizeTableHeaders (IN EFI_ACPI_DESCRIPTION_HEADER *Table) |
STATIC BOOLEAN | AcpiNormalizeRsdp (IN EFI_ACPI_6_2_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp, IN BOOLEAN HasXsdt) |
EFI_STATUS | AcpiInitContext (IN OUT OC_ACPI_CONTEXT *Context) |
VOID | AcpiFreeContext (IN OUT OC_ACPI_CONTEXT *Context) |
EFI_STATUS | AcpiApplyContext (IN OUT OC_ACPI_CONTEXT *Context) |
EFI_STATUS | AcpiDeleteTable (IN OUT OC_ACPI_CONTEXT *Context, IN UINT32 Signature, IN UINT32 Length, IN UINT64 OemTableId, IN BOOLEAN All) |
EFI_STATUS | AcpiInsertTable (IN OUT OC_ACPI_CONTEXT *Context, IN CONST UINT8 *Data, IN UINT32 Length) |
VOID | AcpiNormalizeHeaders (IN OUT OC_ACPI_CONTEXT *Context) |
EFI_STATUS | AcpiApplyPatch (IN OUT OC_ACPI_CONTEXT *Context, IN OC_ACPI_PATCH *Patch) |
EFI_STATUS | AcpiLoadRegions (IN OUT OC_ACPI_CONTEXT *Context) |
VOID | AcpiRelocateRegions (IN OUT OC_ACPI_CONTEXT *Context) |
EFI_STATUS | AcpiFadtEnableReset (IN OUT OC_ACPI_CONTEXT *Context) |
VOID | AcpiResetLogoStatus (IN OUT OC_ACPI_CONTEXT *Context) |
VOID | AcpiSyncTableIds (IN OUT OC_ACPI_CONTEXT *Context) |
VOID | AcpiHandleHardwareSignature (IN OUT OC_ACPI_CONTEXT *Context, IN BOOLEAN Reset) |
Copyright (C) 2016, The HermitCrabs Lab. 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 OcAcpiLib.c.
#define PCI_VENDOR_NVIDIA 0x10DE |
Definition at line 33 of file OcAcpiLib.c.
STATIC EFI_STATUS AcpiAllocateCopyDsdt | ( | IN OUT OC_ACPI_CONTEXT * | Context, |
IN EFI_ACPI_DESCRIPTION_HEADER *NewDsdt | OPTIONAL ) |
Definition at line 396 of file OcAcpiLib.c.
STATIC EFI_STATUS AcpiAllocateCopyFadt | ( | IN OUT OC_ACPI_CONTEXT * | Context, |
IN UINT32 | NewSize ) |
Definition at line 362 of file OcAcpiLib.c.
STATIC EFI_STATUS AcpiAllocateCopyTable | ( | IN EFI_ACPI_COMMON_HEADER * | Table, |
IN UINT32 NewSize | OPTIONAL, | ||
OUT EFI_ACPI_COMMON_HEADER ** | NewTable ) |
Definition at line 311 of file OcAcpiLib.c.
EFI_STATUS AcpiApplyContext | ( | IN OUT OC_ACPI_CONTEXT * | Context | ) |
Apply ACPI context to this system.
[in,out] | Context | ACPI library context. |
Definition at line 900 of file OcAcpiLib.c.
EFI_STATUS AcpiApplyPatch | ( | IN OUT OC_ACPI_CONTEXT * | Context, |
IN OC_ACPI_PATCH * | Patch ) |
Patch ACPI tables.
[in,out] | Context | ACPI library context. |
[in] | Patch | ACPI patch. |
Definition at line 1247 of file OcAcpiLib.c.
EFI_STATUS AcpiDeleteTable | ( | IN OUT OC_ACPI_CONTEXT * | Context, |
IN UINT32 | Signature, | ||
IN UINT32 | Length, | ||
IN UINT64 | OemTableId, | ||
IN BOOLEAN | All ) |
Delete one ACPI table.
[in,out] | Context | ACPI library context. |
[in] | Signature | Table signature or 0. |
[in] | Length | Table length or 0. |
[in] | OemTableId | Table Id or 0. |
[in] | All | Delete all tables or first matched. |
Definition at line 1015 of file OcAcpiLib.c.
EFI_STATUS AcpiFadtEnableReset | ( | IN OUT OC_ACPI_CONTEXT * | Context | ) |
Upgrade FADT to support reset register needed on very old legacy hardware.
[in,out] | Context | ACPI library context. |
Definition at line 1510 of file OcAcpiLib.c.
STATIC EFI_ACPI_6_2_ROOT_SYSTEM_DESCRIPTION_POINTER * AcpiFindLegacyRsdp | ( | VOID | ) |
Find RSD_PTR Table In Legacy Area
EFI_ACPI_6_0_ROOT_SYSTEM_DESCRIPTION_POINTER |
Definition at line 42 of file OcAcpiLib.c.
STATIC UINT32 AcpiFindName | ( | IN CONST UINT8 * | Data, |
IN UINT32 | Length, | ||
IN CONST CHAR8 * | Name ) |
Find ACPI name declaration in data.
Data | ACPI table data. |
Length | ACPI table data length. |
Name | ACPI name of at least OC_ACPI_NAME_SIZE bytes. |
Definition at line 241 of file OcAcpiLib.c.
STATIC EFI_ACPI_6_2_ROOT_SYSTEM_DESCRIPTION_POINTER * AcpiFindRsdp | ( | VOID | ) |
Find RSD_PTR Table From System Configuration Tables
EFI_ACPI_6_0_ROOT_SYSTEM_DESCRIPTION_POINTER |
Definition at line 87 of file OcAcpiLib.c.
VOID AcpiFreeContext | ( | IN OUT OC_ACPI_CONTEXT * | Context | ) |
Free ACPI context dynamic resources.
[in,out] | Context | ACPI library context. |
Definition at line 884 of file OcAcpiLib.c.
VOID AcpiHandleHardwareSignature | ( | IN OUT OC_ACPI_CONTEXT * | Context, |
IN BOOLEAN | Reset ) |
Log and reset FACS hardware signature.
[in,out] | Context | ACPI library context. |
[in] | Reset | Perform reset. |
Definition at line 1700 of file OcAcpiLib.c.
EFI_STATUS AcpiInitContext | ( | IN OUT OC_ACPI_CONTEXT * | Context | ) |
Find ACPI System Tables for later table configuration.
[in,out] | Context | ACPI library context. |
Definition at line 738 of file OcAcpiLib.c.
EFI_STATUS AcpiInsertTable | ( | IN OUT OC_ACPI_CONTEXT * | Context, |
IN CONST UINT8 * | Data, | ||
IN UINT32 | Length ) |
Install one ACPI table. For DSDT this performs table replacement.
[in,out] | Context | ACPI library context. |
[in] | Data | Table data. |
[in] | Length | Table length. |
Definition at line 1082 of file OcAcpiLib.c.
STATIC BOOLEAN AcpiIsTableWritable | ( | IN EFI_ACPI_COMMON_HEADER * | Table | ) |
Definition at line 292 of file OcAcpiLib.c.
EFI_STATUS AcpiLoadRegions | ( | IN OUT OC_ACPI_CONTEXT * | Context | ) |
Try to load ACPI regions.
[in,out] | Context | ACPI library context. |
Definition at line 1421 of file OcAcpiLib.c.
STATIC EFI_STATUS AcpiLoadTableRegions | ( | IN OUT OC_ACPI_CONTEXT * | Context, |
IN EFI_ACPI_COMMON_HEADER * | Table ) |
Load ACPI table regions.
Context | ACPI library context. |
Table | ACPI table. |
Definition at line 446 of file OcAcpiLib.c.
VOID AcpiNormalizeHeaders | ( | IN OUT OC_ACPI_CONTEXT * | Context | ) |
Normalise ACPI headers to contain 7-bit ASCII.
[in,out] | Context | ACPI library context. |
Definition at line 1164 of file OcAcpiLib.c.
STATIC BOOLEAN AcpiNormalizeRsdp | ( | IN EFI_ACPI_6_2_ROOT_SYSTEM_DESCRIPTION_POINTER * | Rsdp, |
IN BOOLEAN | HasXsdt ) |
Cleanup RSDP table from unprintable symbols. Reference: https://alextjam.es/debugging-appleacpiplatform/.
Rsdp | RSDP table. |
HasXsdt | RSDP has XSDT and is extended. |
Definition at line 695 of file OcAcpiLib.c.
STATIC BOOLEAN AcpiNormalizeTableHeaders | ( | IN EFI_ACPI_DESCRIPTION_HEADER * | Table | ) |
Cleanup ACPI table from unprintable symbols. Reference: https://alextjam.es/debugging-appleacpiplatform/.
Table | ACPI table. |
Definition at line 629 of file OcAcpiLib.c.
STATIC BOOLEAN AcpiReadName | ( | IN CONST UINT8 * | Data, |
OUT CHAR8 * | Name, | ||
OUT UINT32 *NameOffset | OPTIONAL ) |
Extract and verify ACPI name from data.
Data | Data of at least OC_ACPI_NAME_SIZE+1 bytes to read name from. |
Name | Name buffer of at least OC_ACPI_NAME_SIZE+1 bytes. |
NameOffset | Name offset from original data (1 if '\' and 0 otherwise). |
Definition at line 196 of file OcAcpiLib.c.
STATIC UINT64 AcpiReadOemTableId | ( | IN CONST EFI_ACPI_COMMON_HEADER * | Common | ) |
Extract and verify ACPI OemTableId from common header.
Common | ACPI common header. |
Definition at line 174 of file OcAcpiLib.c.
STATIC UINT32 AcpiReadSignature | ( | IN CONST EFI_ACPI_COMMON_HEADER * | Common | ) |
Extract and verify ACPI signature from common header.
Common | ACPI common header. |
Definition at line 145 of file OcAcpiLib.c.
STATIC VOID AcpiRefreshTableChecksum | ( | IN EFI_ACPI_DESCRIPTION_HEADER * | Table | ) |
Definition at line 272 of file OcAcpiLib.c.
VOID AcpiRelocateRegions | ( | IN OUT OC_ACPI_CONTEXT * | Context | ) |
Attempt to relocate ACPI regions based on loaded ones.
[in,out] | Context | ACPI library context. |
Definition at line 1465 of file OcAcpiLib.c.
STATIC VOID AcpiRelocateTableRegions | ( | IN OUT OC_ACPI_CONTEXT * | Context, |
IN EFI_ACPI_COMMON_HEADER * | Table ) |
Relocate ACPI table regions.
Context | ACPI library context. |
Table | ACPI table. |
Definition at line 534 of file OcAcpiLib.c.
VOID AcpiResetLogoStatus | ( | IN OUT OC_ACPI_CONTEXT * | Context | ) |
Reset BGRT Displayed status.
[in,out] | Context | ACPI library context. |
Definition at line 1596 of file OcAcpiLib.c.
VOID AcpiSyncTableIds | ( | IN OUT OC_ACPI_CONTEXT * | Context | ) |
Sync ACPI table identifiers with SLIC.
[in,out] | Context | ACPI library context. |
Definition at line 1640 of file OcAcpiLib.c.