crosvm/arch
Daniel Verkamp 9846f3f040 devices: refactor IRQ assignment API
Split the IRQ allocation into two PciDevice functions:
1. Ask the device if it has a preferred IRQ (used for PCI passthrough
   with VFIO where we want the IRQ and pin assignment to match the
   host).
2. Inform the device which IRQ it has been assigned (and providing the
   interrupt event object).

This moves the decision of which pin to use into the generate_pci_root
function in arch, which means we will know the pin before assigning an
IRQ. This will be used to ensure that pin <-> IRQ number assignments are
consistent within each device in a following change.

While the API is changing, also take the opportunity to clone the IRQ
event on the caller side so that each individual device does not need to
do it.

BUG=b:3834424
TEST=Boot x86_64 Linux in crosvm

Change-Id: Ia61c108143a5bc1862e0f345c912bc0724209a72
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3840306
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Noah Gold <nkgold@google.com>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
2022-08-20 00:51:16 +00:00
..
src devices: refactor IRQ assignment API 2022-08-20 00:51:16 +00:00
Cargo.toml arch: split platform lib code into sys mod. 2022-07-14 00:08:33 +00:00