xref: /aosp_15_r20/external/crosvm/src/sys.rs (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
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 
5 cfg_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     } else {
16         compile_error!("Unsupported platform");
17     }
18 }
19 
20 pub(crate) use platform::main::cleanup;
21 pub(crate) use platform::main::error_to_exit_code;
22 pub(crate) use platform::main::get_library_watcher;
23 pub(crate) use platform::main::init_log;
24 pub(crate) use platform::main::run_command;
25 #[cfg(feature = "sandbox")]
26 pub(crate) use platform::main::sandbox_lower_token;
27 pub(crate) use platform::main::start_device;
28 #[cfg(not(feature = "crash-report"))]
29 pub(crate) use platform::set_panic_hook;
30