devices: acpi: use slice instead of vectors to pass around direct GPEs

We make a copy of the data when creating instance of ACPIPMResource, so
let's use slice to pass the data around.

BUG=None
TEST=./tools/presubmit

Change-Id: Idf9627c4ef6aee86fa9de4d1c24ec45aa684432e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3537263
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Dmitry Torokhov <dtor@chromium.org>
This commit is contained in:
Dmitry Torokhov 2022-03-21 12:28:13 -07:00 committed by Commit Bot
parent baa34b5be5
commit bc09a2d8aa
2 changed files with 4 additions and 4 deletions

View file

@ -72,7 +72,7 @@ impl ACPIPMResource {
sci_evt: Event,
sci_evt_resample: Event,
#[cfg(feature = "direct")] sci_direct_evt: Option<(Event, Event)>,
#[cfg(feature = "direct")] direct_gpe: Vec<u32>,
#[cfg(feature = "direct")] direct_gpe: &[u32],
suspend_evt: Event,
exit_evt: Event,
) -> ACPIPMResource {

View file

@ -550,7 +550,7 @@ impl arch::LinuxArch for X8664arch {
exit_evt.try_clone().map_err(Error::CloneEvent)?,
components.acpi_sdts,
#[cfg(feature = "direct")]
components.direct_gpe,
&components.direct_gpe,
irq_chip.as_irq_chip_mut(),
sci_irq,
battery,
@ -1283,7 +1283,7 @@ impl X8664arch {
suspend_evt: Event,
exit_evt: Event,
sdts: Vec<SDT>,
#[cfg(feature = "direct")] direct_gpe: Vec<u32>,
#[cfg(feature = "direct")] direct_gpe: &[u32],
irq_chip: &mut dyn IrqChip,
sci_irq: u32,
battery: (&Option<BatteryType>, Option<Minijail>),
@ -1335,7 +1335,7 @@ impl X8664arch {
sci_devirq.sci_irq_prepare().map_err(Error::CreateGpe)?;
for gpe in &direct_gpe {
for gpe in direct_gpe {
sci_devirq
.gpe_enable_forwarding(*gpe)
.map_err(Error::CreateGpe)?;