x86_64/devices: acpi: Add support for ACPI shutdown & reboot

Add an I/O port "device" to handle requests from the kernel to shutdown
or trigger a reboot, borrowing an I/O used for ACPI on the Q35 platform.
The details of this I/O port are included in the FADT
(SLEEP_STATUS_REG/SLEEP_CONTROL_REG/RESET_REG) with the details of the
value to write in the FADT for reset (RESET_VALUE) and in the DSDT for
shutdown (S5 -> 0x05)

Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
Rob Bradford
2019-08-29 14:58:25 +01:00
committed by Samuel Ortiz
parent ae66a44d26
commit 5a187ee2c2
4 changed files with 89 additions and 4 deletions

View File

@@ -19,10 +19,12 @@ extern crate vmm_sys_util;
use std::fs::File;
use std::{io, result};
mod acpi;
mod bus;
pub mod ioapic;
pub mod legacy;
pub use self::acpi::AcpiShutdownDevice;
pub use self::bus::{Bus, BusDevice, Error as BusError};
pub type DeviceEventT = u16;