]> git.proxmox.com Git - mirror_edk2.git/commit - OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
OvmfPkg/PciHotPlugInitDxe: generalize RESOURCE_PADDING composition
authorLaszlo Ersek <lersek@redhat.com>
Thu, 21 Sep 2017 12:33:56 +0000 (14:33 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Tue, 3 Oct 2017 14:07:35 +0000 (16:07 +0200)
commita980324709b195dfe3f83741a7319cc9dc7a2efd
treeaa99a0606a829abb174268e4d8b8a46900130f31
parentc18ac9fbcc71dd75f1f8cb84b6c929536c1ef580
OvmfPkg/PciHotPlugInitDxe: generalize RESOURCE_PADDING composition

PciHotPlugInitDxe has a static variable called "mPadding" (of type
RESOURCE_PADDING), which describes two constant resource reservations:

- MmioPadding: 2MB of non-prefetchable (hence 32-bit) MMIO space,

- IoPadding: 512B of IO space.

In the GetResourcePadding() member function of
EFI_PCI_HOT_PLUG_INIT_PROTOCOL, the driver outputs a dynamically allocated
verbatim copy of "mPadding", for PciBusDxe to consume in its
ApplyResourcePadding() function.

In a later patch, we're going to compose the set of resource reservations
dynamically, based on QEMU hints. Generalize the RESOURCE_PADDING
structure so that we may generate (or not generate) each resource type
individually:

- Replace the named "MmioPadding" and "IoPadding" fields in
  RESOURCE_PADDING with an array of descriptors,

- remove "mPadding",

- in GetResourcePadding(), request the same (default) reservations as
  before, as if we attempted and failed to fetch the QEMU hints.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c
OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf