TianoCore EDK2 master
Loading...
Searching...
No Matches
PciDecoding.c File Reference

Go to the source code of this file.

Functions

VOID EnablePciDecoding (OUT ORIGINAL_ATTRIBUTES **OriginalAttributes, OUT UINTN *Count)
 
VOID RestorePciDecoding (IN ORIGINAL_ATTRIBUTES *OriginalAttributes, IN UINTN Count)
 

Detailed Description

Temporarily enable IO and MMIO decoding for all PCI devices while QEMU regenerates the ACPI tables.

Copyright (C) 2016, Red Hat, Inc.

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

Definition in file PciDecoding.c.

Function Documentation

◆ EnablePciDecoding()

VOID EnablePciDecoding ( OUT ORIGINAL_ATTRIBUTES **  OriginalAttributes,
OUT UINTN Count 
)

Collect all PciIo protocol instances in the system. Save their original attributes, and enable IO and MMIO decoding for each.

This is a best effort function; it doesn't return status codes. Its caller is supposed to proceed even if this function fails.

Parameters
[out]OriginalAttributesOn output, a dynamically allocated array of ORIGINAL_ATTRIBUTES elements. The array lists the PciIo protocol instances found in the system at the time of the call, plus the original PCI attributes for each.

Before returning, the function enables IO and MMIO decoding for each PciIo instance it finds.

On error, or when no such instances are found, OriginalAttributes is set to NULL.

Parameters
[out]CountOn output, the number of elements in OriginalAttributes. On error it is set to zero.

Definition at line 40 of file PciDecoding.c.

◆ RestorePciDecoding()

VOID RestorePciDecoding ( IN ORIGINAL_ATTRIBUTES OriginalAttributes,
IN UINTN  Count 
)

Restore the original PCI attributes saved with EnablePciDecoding().

Parameters
[in]OriginalAttributesThe array allocated and populated by EnablePciDecoding(). This parameter may be NULL. If OriginalAttributes is NULL, then the function is a no-op; otherwise the PciIo attributes will be restored, and the OriginalAttributes array will be freed.
[in]CountThe Count value stored by EnablePciDecoding(), the number of elements in OriginalAttributes. Count may be zero if and only if OriginalAttributes is NULL.

Definition at line 211 of file PciDecoding.c.