crosvm/
sys.rs

1// Copyright 2022 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5cfg_if::cfg_if! {
6    if #[cfg(any(target_os = "android", target_os = "linux"))] {
7        pub(crate) mod linux;
8        use linux as platform;
9        pub(crate) use crate::crosvm::sys::linux::{run_config, ExitState};
10    } else if #[cfg(windows)] {
11        pub(crate) mod windows;
12        use windows as platform;
13        pub(crate) use windows::ExitState;
14        pub(crate) use windows::run_config;
15        #[cfg(feature = "sandbox")]
16        pub(crate) use windows::main::sandbox_lower_token;
17    } else {
18        compile_error!("Unsupported platform");
19    }
20}
21
22pub(crate) use platform::main::cleanup;
23pub(crate) use platform::main::error_to_exit_code;
24pub(crate) use platform::main::init_log;
25pub(crate) use platform::main::run_command;
26pub(crate) use platform::main::start_device;
27#[cfg(not(feature = "crash-report"))]
28pub(crate) use platform::set_panic_hook;