//! # QEMU Crate //! //! Provide QEMU bindings /// # QEMU Exit Codes /// /// Provides QEMU exit codes #[derive(Debug, Clone, Copy, PartialEq, Eq)] #[repr(u32)] pub enum QemuExitCode { /// # Success /// /// Exit QEMU successfully Success = 0x10, /// # Failure /// /// Exit QEMU with error Failed = 0x11, } /// # Exit QEMU /// /// Exit QEMU with an exit code pub fn exit_qemu(exit_code: QemuExitCode) { use x86_64::instructions::port::Port; unsafe { let mut port = Port::new(0xf4); port.write(exit_code as u32); } }