mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-10-05 21:15:45 +00:00
devices: acpi: Add generic event controller
Rather than overloading the GED device with the detection of what the underlying event means move that to a new generic event controller. The advantage of this is that that the generic event controller can have a _CRS that covers the memory for the OperationRegion (the ged driver rejects _CRS entries that contain anything beyond the single interrupt) Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
b3bef3adda
commit
4465bbaf38
@ -105,18 +105,17 @@ impl BusDevice for AcpiGedDevice {
|
|||||||
impl Aml for AcpiGedDevice {
|
impl Aml for AcpiGedDevice {
|
||||||
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) {
|
fn append_aml_bytes(&self, bytes: &mut Vec<u8>) {
|
||||||
aml::Device::new(
|
aml::Device::new(
|
||||||
"_SB_.GED_".into(),
|
"_SB_.GEC_".into(),
|
||||||
vec![
|
vec![
|
||||||
&aml::Name::new("_HID".into(), &"ACPI0013"),
|
&aml::Name::new("_HID".into(), &aml::EisaName::new("PNP0A06")),
|
||||||
&aml::Name::new("_UID".into(), &aml::ZERO),
|
&aml::Name::new("_UID".into(), &"Generic Event Controller"),
|
||||||
&aml::Name::new(
|
&aml::Name::new(
|
||||||
"_CRS".into(),
|
"_CRS".into(),
|
||||||
&aml::ResourceTemplate::new(vec![&aml::Interrupt::new(
|
&aml::ResourceTemplate::new(vec![&aml::AddressSpace::new_memory(
|
||||||
|
aml::AddressSpaceCachable::NotCacheable,
|
||||||
true,
|
true,
|
||||||
true,
|
self.address.0 as u64,
|
||||||
false,
|
self.address.0 + GED_DEVICE_ACPI_SIZE as u64 - 1,
|
||||||
false,
|
|
||||||
self.ged_irq,
|
|
||||||
)]),
|
)]),
|
||||||
),
|
),
|
||||||
&aml::OpRegion::new(
|
&aml::OpRegion::new(
|
||||||
@ -132,8 +131,8 @@ impl Aml for AcpiGedDevice {
|
|||||||
vec![aml::FieldEntry::Named(*b"GDAT", 8)],
|
vec![aml::FieldEntry::Named(*b"GDAT", 8)],
|
||||||
),
|
),
|
||||||
&aml::Method::new(
|
&aml::Method::new(
|
||||||
"_EVT".into(),
|
"ESCN".into(),
|
||||||
1,
|
0,
|
||||||
true,
|
true,
|
||||||
vec![
|
vec![
|
||||||
&aml::Store::new(&aml::Local(0), &aml::Path::new("GDAT")),
|
&aml::Store::new(&aml::Local(0), &aml::Path::new("GDAT")),
|
||||||
@ -164,6 +163,30 @@ impl Aml for AcpiGedDevice {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
.append_aml_bytes(bytes);
|
||||||
|
aml::Device::new(
|
||||||
|
"_SB_.GED_".into(),
|
||||||
|
vec![
|
||||||
|
&aml::Name::new("_HID".into(), &"ACPI0013"),
|
||||||
|
&aml::Name::new("_UID".into(), &aml::ZERO),
|
||||||
|
&aml::Name::new(
|
||||||
|
"_CRS".into(),
|
||||||
|
&aml::ResourceTemplate::new(vec![&aml::Interrupt::new(
|
||||||
|
true,
|
||||||
|
true,
|
||||||
|
false,
|
||||||
|
false,
|
||||||
|
self.ged_irq,
|
||||||
|
)]),
|
||||||
|
),
|
||||||
|
&aml::Method::new(
|
||||||
|
"_EVT".into(),
|
||||||
|
1,
|
||||||
|
true,
|
||||||
|
vec![&aml::MethodCall::new("\\_SB_.GEC_.ESCN".into(), vec![])],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
.append_aml_bytes(bytes)
|
.append_aml_bytes(bytes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user