]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg: PciHostBridgeDxe: use private buffer in RootBridgeIoConfiguration()
authorLaszlo Ersek <lersek@redhat.com>
Tue, 14 Jul 2015 12:02:20 +0000 (12:02 +0000)
committerlersek <lersek@Edk2>
Tue, 14 Jul 2015 12:02:20 +0000 (12:02 +0000)
commit20f7840e3ff87e365d96fb7affe48f316ab8c225
tree1ffb25032d5bf3d618b3e8e0a640b48c8522c446
parent7ee9dc232114206bdfe9c9e5f4d8eb5ed1c917c9
OvmfPkg: PciHostBridgeDxe: use private buffer in RootBridgeIoConfiguration()

On output, the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.Configuration() function
produces a pointer to a buffer of ACPI 2.0 resource descriptors:

  Resources  A pointer to the ACPI 2.0 resource descriptors that describe
             the current configuration of this PCI root bridge. The
             storage for the ACPI 2.0 resource descriptors is allocated by
             this function. The caller must treat the return buffer as
             read-only data, and the buffer must not be freed by the
             caller.

PciHostBridgeDxe currently provides this buffer in a structure with static
storage duration. If multiple root bridges existed in parallel, the
pointers returned by their Configuration() methods would point to the same
static storage. A later Configuration() call would overwrite the storage
pointed out by an earlier Configuration() call (which was possibly made
for a different, but still alive, root bridge.)

Fix this problem by embedding the configuration buffer in
PCI_ROOT_BRIDGE_INSTANCE.

While we're at it, correct some typos (Desp -> Desc), spell out a missing
pack(1) pragma, and improve formatting.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Gabriel Somlo <somlo@cmu.edu>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17960 6f19259b-4bc3-4df7-8a09-765794883524
OvmfPkg/PciHostBridgeDxe/PciHostBridge.h
OvmfPkg/PciHostBridgeDxe/PciRootBridgeIo.c