diff --git a/Cargo.toml b/Cargo.toml index 974cf1893a..2d768a5576 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,6 +55,7 @@ backtrace = { version = "0.3.74", default-features = false } # Used to get the s bindgen = "0.70.1" clap = "4.5.18" cc = "1.1.21" +cmake = "0.1.51" document-features = "0.2.10" hashbrown = { version = "0.14.5", default-features = false } # A faster hashmap, nostd compatible libc = "0.2.159" # For (*nix) libc @@ -87,6 +88,45 @@ which = "6.0.3" windows = "0.58.0" z3 = "0.12.1" + +[workspace.lints.rust] +# Forbid +unexpected_cfgs = "forbid" + +# Allow +incomplete_features = "allow" +ambiguous_glob_reexports = "allow" + + +[workspace.lints.clippy] +# Deny +all = { level = "deny", priority = -1 } +pedantic = { level = "deny", priority = -1 } +cargo_common_metadata = "deny" + +# Warn +cargo = { level = "warn", priority = -1 } +negative_feature_names = "warn" + +# Allow +unreadable_literal = "allow" +type_repetition_in_bounds = "allow" +missing_errors_doc = "allow" +cast_possible_truncation = "allow" +used_underscore_binding = "allow" +ptr_as_ptr = "allow" +missing_panics_doc = "allow" +module_name_repetitions = "allow" +unsafe_derive_deserialize = "allow" +similar_names = "allow" +too_many_lines = "allow" + + +[workspace.lints.rustdoc] +# Deny +broken_intra_doc_links = "deny" + + [profile.release] lto = true codegen-units = 1 diff --git a/fuzzers/binary_only/qemu_launcher/src/client.rs b/fuzzers/binary_only/qemu_launcher/src/client.rs index abe0488911..b41c5339bc 100644 --- a/fuzzers/binary_only/qemu_launcher/src/client.rs +++ b/fuzzers/binary_only/qemu_launcher/src/client.rs @@ -159,7 +159,7 @@ impl Client<'_> { instance_builder.build().run( tuple_list!( CmpLogModule::default(), - AsanGuestModule::default(qemu, asan_lib.take().unwrap()), + AsanGuestModule::default(qemu, &asan_lib.take().unwrap()), injection_module ), state, @@ -168,7 +168,7 @@ impl Client<'_> { instance_builder.build().run( tuple_list!( CmpLogModule::default(), - AsanGuestModule::default(qemu, asan_lib.take().unwrap()), + AsanGuestModule::default(qemu, &asan_lib.take().unwrap()), ), state, ) @@ -186,7 +186,7 @@ impl Client<'_> { ) } } else if is_asan_guest { - let modules = tuple_list!(AsanGuestModule::default(qemu, asan_lib.take().unwrap())); + let modules = tuple_list!(AsanGuestModule::default(qemu, &asan_lib.take().unwrap())); instance_builder.build().run(modules, state) } else if is_cmplog { if let Some(injection_module) = injection_module { diff --git a/fuzzers/binary_only/qemu_launcher/src/harness.rs b/fuzzers/binary_only/qemu_launcher/src/harness.rs index ac7fc58ac8..6376348d0c 100644 --- a/fuzzers/binary_only/qemu_launcher/src/harness.rs +++ b/fuzzers/binary_only/qemu_launcher/src/harness.rs @@ -98,7 +98,12 @@ impl Harness { } let len = len as GuestReg; - unsafe { self.qemu.write_mem(self.input_addr, buf) }; + self.qemu.write_mem(self.input_addr, buf).map_err(|e| { + Error::unknown(format!( + "Failed to write to memory@{:#x}: {e:?}", + self.input_addr + )) + })?; self.qemu .write_reg(Regs::Pc, self.pc) diff --git a/libafl/Cargo.toml b/libafl/Cargo.toml index eccc91fdda..f69ebb14e8 100644 --- a/libafl/Cargo.toml +++ b/libafl/Cargo.toml @@ -273,6 +273,9 @@ document-features = { workspace = true, optional = true } # Optional clap = { workspace = true, optional = true } +[lints] +workspace = true + [target.'cfg(unix)'.dependencies] libc = { workspace = true } # For (*nix) libc z3 = { workspace = true, optional = true } # for concolic mutation diff --git a/libafl/src/events/launcher.rs b/libafl/src/events/launcher.rs index 95f8abde1f..fcd75cafd2 100644 --- a/libafl/src/events/launcher.rs +++ b/libafl/src/events/launcher.rs @@ -338,7 +338,7 @@ where /// Launch the broker and the clients and fuzz #[cfg(all(feature = "std", any(windows, not(feature = "fork"))))] - #[allow(unused_mut, clippy::match_wild_err_arm)] + #[allow(unused_mut, clippy::match_wild_err_arm, clippy::too_many_lines)] pub fn launch_with_hooks(&mut self, hooks: EMH) -> Result<(), Error> where S: State + HasExecutions, diff --git a/libafl/src/executors/differential.rs b/libafl/src/executors/differential.rs index c7c53ec47e..75943798e6 100644 --- a/libafl/src/executors/differential.rs +++ b/libafl/src/executors/differential.rs @@ -212,8 +212,8 @@ where impl ProxyObserversTuple { fn set(&mut self, primary: &A, secondary: &B) { - self.primary = OwnedMutPtr::Ptr(ptr::from_ref(primary) as *mut A); - self.secondary = OwnedMutPtr::Ptr(ptr::from_ref(secondary) as *mut B); + self.primary = OwnedMutPtr::Ptr(ptr::from_ref(primary).cast_mut()); + self.secondary = OwnedMutPtr::Ptr(ptr::from_ref(secondary).cast_mut()); } } diff --git a/libafl/src/lib.rs b/libafl/src/lib.rs index a78c547c54..fc95a9f1d7 100644 --- a/libafl/src/lib.rs +++ b/libafl/src/lib.rs @@ -4,35 +4,11 @@ Welcome to `LibAFL` #![doc = include_str!("../README.md")] /*! */ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![forbid(unexpected_cfgs)] -#![allow(incomplete_features)] #![no_std] // For `type_eq` #![cfg_attr(nightly, feature(specialization))] // For `std::simd` #![cfg_attr(nightly, feature(portable_simd))] -#![warn(clippy::cargo)] -#![allow(ambiguous_glob_reexports)] -#![deny(clippy::cargo_common_metadata)] -#![deny(rustdoc::broken_intra_doc_links)] -#![deny(clippy::all)] -#![deny(clippy::pedantic)] -#![allow( - clippy::unreadable_literal, - clippy::type_repetition_in_bounds, - clippy::missing_errors_doc, - clippy::cast_possible_truncation, - clippy::used_underscore_binding, - clippy::ptr_as_ptr, - clippy::missing_panics_doc, - clippy::missing_docs_in_private_items, - clippy::module_name_repetitions, - clippy::ptr_cast_constness, - clippy::unsafe_derive_deserialize, - clippy::similar_names, - clippy::too_many_lines, - clippy::into_iter_without_iter, // broken -)] #![cfg_attr(not(test), warn( missing_debug_implementations, missing_docs, @@ -73,9 +49,6 @@ Welcome to `LibAFL` while_true ) )] -// Till they fix this buggy lint in clippy -#![allow(clippy::borrow_as_ptr)] -#![allow(clippy::borrow_deref_ref)] #[cfg(feature = "std")] #[macro_use] diff --git a/libafl/src/observers/value.rs b/libafl/src/observers/value.rs index eb4df41c08..47fcde05a2 100644 --- a/libafl/src/observers/value.rs +++ b/libafl/src/observers/value.rs @@ -23,6 +23,7 @@ use crate::{ /// The intent is that the value is something with interior mutability which the target could write to even though this /// observer has a reference to it. Use [`RefCellValueObserver`] if using a [`RefCell`] around the value. #[derive(Serialize, Deserialize, Debug)] +#[allow(clippy::unsafe_derive_deserialize)] pub struct ValueObserver<'a, T> { /// The name of this observer. name: Cow<'static, str>, @@ -82,6 +83,7 @@ impl ObserverWithHashField for ValueObserver<'_, T> { /// A simple observer with a single [`RefCell`]'d value. #[derive(Serialize, Deserialize, Debug)] +#[allow(clippy::unsafe_derive_deserialize)] pub struct RefCellValueObserver<'a, T> { /// The name of this observer. name: Cow<'static, str>, diff --git a/libafl_bolts/Cargo.toml b/libafl_bolts/Cargo.toml index b154ed1403..b10c0357c5 100644 --- a/libafl_bolts/Cargo.toml +++ b/libafl_bolts/Cargo.toml @@ -170,6 +170,9 @@ serial_test = { workspace = true, optional = true, default-features = false, fea # Document all features of this crate (for `cargo doc`) document-features = { workspace = true, optional = true } +[lints] +workspace = true + [target.'cfg(unix)'.dependencies] libc = { workspace = true } # For (*nix) libc uds = { version = "0.4.2", optional = true, default-features = false } diff --git a/libafl_bolts/src/lib.rs b/libafl_bolts/src/lib.rs index d7874a7c98..1dbae9131a 100644 --- a/libafl_bolts/src/lib.rs +++ b/libafl_bolts/src/lib.rs @@ -4,33 +4,11 @@ #![doc = include_str!("../README.md")] /*! */ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![forbid(unexpected_cfgs)] -#![allow(incomplete_features)] #![no_std] // For `type_eq` #![cfg_attr(nightly, feature(specialization))] // For `std::simd` #![cfg_attr(nightly, feature(portable_simd))] -#![warn(clippy::cargo)] -#![allow(ambiguous_glob_reexports)] -#![deny(clippy::cargo_common_metadata)] -#![deny(rustdoc::broken_intra_doc_links)] -#![deny(clippy::all)] -#![deny(clippy::pedantic)] -#![allow( - clippy::unreadable_literal, - clippy::type_repetition_in_bounds, - clippy::missing_errors_doc, - clippy::cast_possible_truncation, - clippy::used_underscore_binding, - clippy::ptr_as_ptr, - clippy::missing_panics_doc, - clippy::missing_docs_in_private_items, - clippy::module_name_repetitions, - clippy::ptr_cast_constness, - clippy::negative_feature_names, - clippy::too_many_lines -)] #![cfg_attr(not(test), warn( missing_debug_implementations, missing_docs, @@ -71,9 +49,6 @@ while_true ) )] -// Till they fix this buggy lint in clippy -#![allow(clippy::borrow_as_ptr)] -#![allow(clippy::borrow_deref_ref)] /// We need some sort of "[`String`]" for errors in `no_alloc`... /// We can only support `'static` without allocator, so let's do that. @@ -707,7 +682,7 @@ where type SliceRef = &'a [T]; fn as_slice(&'a self) -> Self::SliceRef { - &*self + self } } diff --git a/libafl_bolts/src/llmp.rs b/libafl_bolts/src/llmp.rs index d29763bdcd..59d322d02b 100644 --- a/libafl_bolts/src/llmp.rs +++ b/libafl_bolts/src/llmp.rs @@ -2654,6 +2654,7 @@ where /// It is supposed that the message is never unmapped. #[inline] #[allow(clippy::cast_ptr_alignment)] + #[allow(clippy::too_many_lines)] unsafe fn handle_new_msgs(&mut self, client_id: ClientId) -> Result { let mut new_messages = false; diff --git a/libafl_bolts/src/minibsod.rs b/libafl_bolts/src/minibsod.rs index 0b02710f81..dedd8c3ac3 100644 --- a/libafl_bolts/src/minibsod.rs +++ b/libafl_bolts/src/minibsod.rs @@ -1212,7 +1212,7 @@ mod tests { proc, cur, proc, - &mut out as *mut _, + std::ptr::addr_of_mut!(out), 0, true, DUPLICATE_SAME_ACCESS, @@ -1237,7 +1237,7 @@ mod tests { } else if cfg!(target_arch = "aarch64") { c.ctx.ContextFlags = CONTEXT_FULL_ARM64; } - unsafe { GetThreadContext(thread, &mut c.ctx as *mut _).unwrap() }; + unsafe { GetThreadContext(thread, std::ptr::addr_of_mut!(c.ctx)).unwrap() }; let mut writer = BufWriter::new(stdout()); dump_registers(&mut writer, &c.ctx).unwrap(); diff --git a/libafl_bolts/src/ownedref.rs b/libafl_bolts/src/ownedref.rs index 023e2b860c..4c0beb128d 100644 --- a/libafl_bolts/src/ownedref.rs +++ b/libafl_bolts/src/ownedref.rs @@ -513,7 +513,7 @@ impl<'a, T> From> for OwnedSlice<'a, T> { Self { inner: match mut_slice.inner { OwnedMutSliceInner::RefRaw(ptr, len, unsafe_marker) => { - OwnedSliceInner::RefRaw(ptr as _, len, unsafe_marker) + OwnedSliceInner::RefRaw(ptr.cast_const(), len, unsafe_marker) } OwnedMutSliceInner::Ref(r) => OwnedSliceInner::Ref(r as _), OwnedMutSliceInner::Owned(v) => OwnedSliceInner::Owned(v), diff --git a/libafl_bolts/src/shmem.rs b/libafl_bolts/src/shmem.rs index 152cba04e3..608e6de3c8 100644 --- a/libafl_bolts/src/shmem.rs +++ b/libafl_bolts/src/shmem.rs @@ -1421,7 +1421,7 @@ pub mod win32_shmem { let handle = OpenFileMappingA( FILE_MAP_ALL_ACCESS.0, BOOL(0), - PCSTR(map_str_bytes.as_ptr() as *mut _), + PCSTR(map_str_bytes.as_ptr().cast_mut()), )?; let map = diff --git a/libafl_bolts/src/subrange.rs b/libafl_bolts/src/subrange.rs index 742ed0e7a6..6b9ddf12b8 100644 --- a/libafl_bolts/src/subrange.rs +++ b/libafl_bolts/src/subrange.rs @@ -349,7 +349,7 @@ mod tests { let bytes_read = bytes_reader.next_sub_slice_truncated(8); let bytes_read_ref: &[u8] = &[]; - assert_eq!(&*bytes_read.as_slice(), bytes_read_ref); + assert_eq!(bytes_read.as_slice(), bytes_read_ref); } #[test] diff --git a/libafl_cc/Cargo.toml b/libafl_cc/Cargo.toml index 46c8b466b1..e2005f0d3c 100644 --- a/libafl_cc/Cargo.toml +++ b/libafl_cc/Cargo.toml @@ -55,3 +55,6 @@ serde = { workspace = true, default-features = false, features = [ "alloc", "derive", ] } # serialization lib + +[lints] +workspace = true diff --git a/libafl_cc/src/lib.rs b/libafl_cc/src/lib.rs index 6b2eacd929..8d71910c03 100644 --- a/libafl_cc/src/lib.rs +++ b/libafl_cc/src/lib.rs @@ -1,21 +1,5 @@ //! Compiler Wrapper from `LibAFL` -#![deny(rustdoc::broken_intra_doc_links)] -#![deny(clippy::all)] -#![deny(clippy::pedantic)] -#![forbid(unexpected_cfgs)] -#![allow( - clippy::unreadable_literal, - clippy::type_repetition_in_bounds, - clippy::missing_errors_doc, - clippy::cast_possible_truncation, - clippy::used_underscore_binding, - clippy::ptr_as_ptr, - clippy::missing_panics_doc, - clippy::missing_docs_in_private_items, - clippy::module_name_repetitions, - clippy::unreadable_literal -)] #![cfg_attr(not(test), warn( missing_debug_implementations, missing_docs, diff --git a/libafl_concolic/symcc_libafl/Cargo.toml b/libafl_concolic/symcc_libafl/Cargo.toml index 76d06a6cc0..8c1150be55 100644 --- a/libafl_concolic/symcc_libafl/Cargo.toml +++ b/libafl_concolic/symcc_libafl/Cargo.toml @@ -34,6 +34,9 @@ build = ["which", "cmake"] clone = ["which"] [dependencies] -which = { version = "6.0.3", optional = true } -cmake = { version = "0.1.51", optional = true } -log = "0.4.22" +which = { workspace = true, optional = true } +cmake = { workspace = true, optional = true } +log = { workspace = true } + +[lints] +workspace = true diff --git a/libafl_concolic/symcc_libafl/src/lib.rs b/libafl_concolic/symcc_libafl/src/lib.rs index dfe3df9569..a0f5507718 100644 --- a/libafl_concolic/symcc_libafl/src/lib.rs +++ b/libafl_concolic/symcc_libafl/src/lib.rs @@ -1,7 +1,5 @@ //! This is a 'meta-package' for libafl that exposes a consistent URL and commit hash for the //! [`SymCC` fork](https://github.com/AFLplusplus/symcc). -#![allow(clippy::module_name_repetitions)] -#![forbid(unexpected_cfgs)] /// The URL of the `LibAFL` `SymCC` fork. pub const SYMCC_REPO_URL: &str = "https://github.com/AFLplusplus/symcc.git"; @@ -65,6 +63,8 @@ pub use clone::clone_symcc; #[cfg(feature = "build")] mod build { + #![allow(clippy::module_name_repetitions)] + use std::path::{Path, PathBuf}; /// Builds `SymCC` at the given directory using [`cmake`](https://crates.io/crates/cmake). diff --git a/libafl_concolic/symcc_runtime/Cargo.toml b/libafl_concolic/symcc_runtime/Cargo.toml index eff1a2d1ea..5484ccf9e4 100644 --- a/libafl_concolic/symcc_runtime/Cargo.toml +++ b/libafl_concolic/symcc_runtime/Cargo.toml @@ -32,9 +32,6 @@ all-features = true no-cpp-runtime = [] [dependencies] -unchecked_unwrap = "4.0.0" -ctor = "0.2.8" -libc = "0.2.159" libafl = { path = "../../libafl", version = "0.13.2", default-features = false, features = [ "std", "serdeany_autoreg", @@ -44,9 +41,16 @@ libafl_bolts = { path = "../../libafl_bolts", version = "0.13.2", default-featur "serdeany_autoreg", ] } +unchecked_unwrap = "4.0.0" +ctor = "0.2.8" +libc = { workspace = true } + [build-dependencies] -cmake = "0.1.51" -bindgen = "0.70.1" -regex = "1.10.6" -which = "6.0.3" +cmake = { workspace = true } +bindgen = { workspace = true } +regex = { workspace = true } +which = { workspace = true } symcc_libafl = { path = "../symcc_libafl", version = "0.13.2" } + +[lints] +workspace = true diff --git a/libafl_concolic/symcc_runtime/src/lib.rs b/libafl_concolic/symcc_runtime/src/lib.rs index 9b5d534412..7caea28316 100644 --- a/libafl_concolic/symcc_runtime/src/lib.rs +++ b/libafl_concolic/symcc_runtime/src/lib.rs @@ -27,12 +27,6 @@ //! # SymCC and SymQEMU expect to runtime file to be called `libSymRuntime.so`. Setting the name to `SymRuntime` achieves this. //! name = "SymRuntime" //! ``` -#![allow( - clippy::module_name_repetitions, - clippy::missing_panics_doc, - clippy::pub_underscore_fields -)] -#![forbid(unexpected_cfgs)] pub mod filter; pub mod tracing; @@ -40,8 +34,9 @@ pub mod tracing; // The following exports are used by the `export_runtime` macro. They are therefore exported, but hidden from docs, as they are not supposed to be used directly by the user. #[doc(hidden)] #[cfg(target_os = "linux")] -#[allow(clippy::mixed_attributes_style)] pub mod cpp_runtime { + #![allow(clippy::mixed_attributes_style)] + #![allow(clippy::pub_underscore_fields)] #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] diff --git a/libafl_concolic/test/dump_constraints/Cargo.toml b/libafl_concolic/test/dump_constraints/Cargo.toml index 7f0a8ef5b2..adf42fda92 100644 --- a/libafl_concolic/test/dump_constraints/Cargo.toml +++ b/libafl_concolic/test/dump_constraints/Cargo.toml @@ -22,4 +22,7 @@ categories = [ [dependencies] libafl = { path = "../../../libafl" } libafl_bolts = { path = "../../../libafl_bolts" } -clap = { version = "4.5.18", features = ["derive"] } +clap = { workspace = true, features = ["derive"] } + +[lints] +workspace = true diff --git a/libafl_concolic/test/dump_constraints/src/main.rs b/libafl_concolic/test/dump_constraints/src/main.rs index 51b02ae988..34d12b6322 100644 --- a/libafl_concolic/test/dump_constraints/src/main.rs +++ b/libafl_concolic/test/dump_constraints/src/main.rs @@ -1,7 +1,6 @@ //! This is a straight-forward command line utility that can dump constraints written by a tracing runtime. //! It achieves this by running an instrumented target program with the necessary environment variables set. //! When the program has finished executing, it dumps the traced constraints to a file. -#![forbid(unexpected_cfgs)] use std::{ ffi::OsString, diff --git a/libafl_concolic/test/runtime_test/Cargo.toml b/libafl_concolic/test/runtime_test/Cargo.toml index c176a6c89e..1594f61e0c 100644 --- a/libafl_concolic/test/runtime_test/Cargo.toml +++ b/libafl_concolic/test/runtime_test/Cargo.toml @@ -8,7 +8,7 @@ documentation = "https://docs.rs/libafl" repository = "https://github.com/AFLplusplus/LibAFL/" readme = "../README.md" license = "MIT OR Apache-2.0" -keywords = ["fuzzing", "libafl", "symbolic", "symcc", "symqemu", "fuzzer"] +keywords = ["fuzzing", "libafl", "symbolic", "symcc", "symqemu"] categories = [ "development-tools::testing", "emulators", @@ -25,3 +25,6 @@ name = "SymRuntime" [dependencies] symcc_runtime = { path = "../../symcc_runtime" } + +[lints] +workspace = true diff --git a/libafl_derive/Cargo.toml b/libafl_derive/Cargo.toml index 15b962ec16..2cf8c5534a 100644 --- a/libafl_derive/Cargo.toml +++ b/libafl_derive/Cargo.toml @@ -24,3 +24,6 @@ proc-macro = true syn = { version = "2.0.77", features = ["full", "extra-traits"] } quote = "1.0.37" proc-macro2 = "1.0.86" + +[lints] +workspace = true diff --git a/libafl_derive/src/lib.rs b/libafl_derive/src/lib.rs index 40195d0ffa..7e06226b89 100644 --- a/libafl_derive/src/lib.rs +++ b/libafl_derive/src/lib.rs @@ -1,22 +1,6 @@ //! Derives for `LibAFL` #![no_std] -#![forbid(unexpected_cfgs)] -#![deny(rustdoc::broken_intra_doc_links)] -#![deny(clippy::all)] -#![deny(clippy::pedantic)] -#![allow( - clippy::unreadable_literal, - clippy::type_repetition_in_bounds, - clippy::missing_errors_doc, - clippy::cast_possible_truncation, - clippy::used_underscore_binding, - clippy::ptr_as_ptr, - clippy::missing_panics_doc, - clippy::missing_docs_in_private_items, - clippy::module_name_repetitions, - clippy::unreadable_literal -)] #![cfg_attr(not(test), warn( missing_debug_implementations, missing_docs, diff --git a/libafl_frida/Cargo.toml b/libafl_frida/Cargo.toml index c7eb83ac38..eab21ba289 100644 --- a/libafl_frida/Cargo.toml +++ b/libafl_frida/Cargo.toml @@ -46,13 +46,6 @@ auto-download = ["frida-gum-sys/auto-download", "frida-gum/auto-download"] [build-dependencies] cc = { workspace = true, features = ["parallel"] } -[target.'cfg(target_arch = "aarch64")'.dependencies] -yaxpeax-arm = "0.3.0" - -[target.'cfg(target_arch = "x86_64")'.dependencies] -yaxpeax-x86 = "2.0.0" -iced-x86 = { version = "1.21.0", features = ["code_asm"], optional = true } - [dependencies] libafl = { path = "../libafl", default-features = false, version = "0.13.2", features = [ "std", @@ -101,12 +94,6 @@ yaxpeax-arch = "0.3.2" document-features = { workspace = true, optional = true } # Document all features of this crate (for `cargo doc`) -[target.'cfg(windows)'.dependencies] -winsafe = { version = "0.0.22", features = ["kernel"] } - -[target.'cfg(target_vendor="apple")'.dependencies] -mach-sys = { version = "0.5.4" } - [dev-dependencies] serial_test = { workspace = true, default-features = false, features = [ "logging", @@ -115,3 +102,19 @@ clap = { workspace = true, features = ["derive"] } libloading = "0.8.5" mimalloc = { workspace = true, default-features = false } dlmalloc = { version = "0.2.6", features = ["global"] } + +[lints] +workspace = true + +[target.'cfg(target_arch = "aarch64")'.dependencies] +yaxpeax-arm = "0.3.0" + +[target.'cfg(target_arch = "x86_64")'.dependencies] +yaxpeax-x86 = "2.0.0" +iced-x86 = { version = "1.21.0", features = ["code_asm"], optional = true } + +[target.'cfg(windows)'.dependencies] +winsafe = { version = "0.0.22", features = ["kernel"] } + +[target.'cfg(target_vendor="apple")'.dependencies] +mach-sys = { version = "0.5.4" } diff --git a/libafl_frida/src/alloc.rs b/libafl_frida/src/alloc.rs index 271277b963..40a9021b64 100644 --- a/libafl_frida/src/alloc.rs +++ b/libafl_frida/src/alloc.rs @@ -512,7 +512,7 @@ impl Allocator { return true; } - if !self.is_managed(address as *mut c_void) { + if !self.is_managed(address.cast_mut()) { return true; } diff --git a/libafl_frida/src/asan/errors.rs b/libafl_frida/src/asan/errors.rs index 745830ca0f..4e7078054f 100644 --- a/libafl_frida/src/asan/errors.rs +++ b/libafl_frida/src/asan/errors.rs @@ -605,6 +605,7 @@ impl AsanErrorsObserver { /// /// # Safety /// The field should not be accessed multiple times at the same time (i.e., from different threads)! + #[must_use] pub fn from_static_asan_errors() -> Self { Self::Static } diff --git a/libafl_frida/src/helper.rs b/libafl_frida/src/helper.rs index 51450bb957..b0e1ea1f7f 100644 --- a/libafl_frida/src/helper.rs +++ b/libafl_frida/src/helper.rs @@ -147,6 +147,7 @@ pub struct FridaInstrumentationHelperBuilder { impl FridaInstrumentationHelperBuilder { /// Create a new [`FridaInstrumentationHelperBuilder`] + #[must_use] pub fn new() -> Self { Self::default() } @@ -409,6 +410,7 @@ impl FridaInstrumentationHelper<'_, ()> { /// /// See the documentation of [`FridaInstrumentationHelperBuilder`] /// for more details. + #[must_use] pub fn builder() -> FridaInstrumentationHelperBuilder { FridaInstrumentationHelperBuilder::default() } @@ -644,6 +646,7 @@ where } /// Returns ref to the Transformer + #[must_use] pub fn transformer(&self) -> &Transformer<'a> { &self.transformer } @@ -671,6 +674,7 @@ where } /// If stalker is enabled + #[must_use] pub fn stalker_enabled(&self) -> bool { self.stalker_enabled } @@ -684,6 +688,7 @@ where } /// Ranges + #[must_use] pub fn ranges(&self) -> Ref> { self.ranges.borrow() } diff --git a/libafl_frida/src/lib.rs b/libafl_frida/src/lib.rs index 74f757e5b3..92fe2b2a5a 100644 --- a/libafl_frida/src/lib.rs +++ b/libafl_frida/src/lib.rs @@ -7,25 +7,6 @@ Additional documentation is available in [the `LibAFL` book](https://aflplus.plu */ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![forbid(unexpected_cfgs)] -#![deny(rustdoc::broken_intra_doc_links)] -#![deny(clippy::all)] -#![deny(clippy::pedantic)] -#![allow( - clippy::unreadable_literal, - clippy::type_repetition_in_bounds, - clippy::missing_errors_doc, - clippy::cast_possible_truncation, - clippy::used_underscore_binding, - clippy::ptr_as_ptr, - clippy::missing_panics_doc, - clippy::missing_docs_in_private_items, - clippy::module_name_repetitions, - clippy::unreadable_literal, - clippy::ptr_cast_constness, - clippy::must_use_candidate, - clippy::too_many_arguments -)] #![cfg_attr(not(test), warn( missing_debug_implementations, missing_docs, diff --git a/libafl_frida/src/utils.rs b/libafl_frida/src/utils.rs index 81e536bb0e..364b32a527 100644 --- a/libafl_frida/src/utils.rs +++ b/libafl_frida/src/utils.rs @@ -162,6 +162,7 @@ const X86_64_REGS: [(RegSpec, X86Register); 34] = [ /// Get the value of a register given a context #[cfg(target_arch = "x86_64")] +#[must_use] pub fn get_register(context: &CpuContext, reg: X86Register) -> u64 { match reg { X86Register::Rax => context.rax(), @@ -224,8 +225,9 @@ pub(crate) fn frida_to_cs( } } -#[cfg(target_arch = "x86_64")] /// Get the `base`, `idx`, `scale`, `disp` for each operand +#[cfg(target_arch = "x86_64")] +#[must_use] pub fn operand_details(operand: &Operand) -> Option<(X86Register, X86Register, u8, i32)> { match operand { Operand::MemDeref { base } => { @@ -263,8 +265,9 @@ pub fn operand_details(operand: &Operand) -> Option<(X86Register, X86Register, u } } -#[cfg(target_arch = "x86_64")] /// Get the immediate value of the operand +#[cfg(target_arch = "x86_64")] +#[must_use] pub fn immediate_value(operand: &Operand) -> Option { match operand { Operand::ImmediateI8 { imm } => Some(i64::from(*imm)), @@ -290,8 +293,9 @@ pub enum AccessType { Write, } -#[cfg(target_arch = "x86_64")] /// Disassemble "count" number of instructions +#[cfg(target_arch = "x86_64")] +#[must_use] pub fn disas_count(decoder: &InstDecoder, data: &[u8], count: usize) -> Vec { let mut counter = count; let mut ret = vec![]; @@ -312,6 +316,7 @@ pub fn disas_count(decoder: &InstDecoder, data: &[u8], count: usize) -> Vec Vec { let mut ret = vec![]; diff --git a/libafl_libfuzzer/Cargo.toml b/libafl_libfuzzer/Cargo.toml index 29cb77b72a..a578036a1d 100644 --- a/libafl_libfuzzer/Cargo.toml +++ b/libafl_libfuzzer/Cargo.toml @@ -50,3 +50,6 @@ features = ["document-features"] all-features = true rustdoc-args = ["--cfg", "docsrs"] + +[lints] +workspace = true diff --git a/libafl_libfuzzer/src/lib.rs b/libafl_libfuzzer/src/lib.rs index 14b2ed7639..188d9be378 100644 --- a/libafl_libfuzzer/src/lib.rs +++ b/libafl_libfuzzer/src/lib.rs @@ -75,28 +75,6 @@ //! to the runtime (e.g., to prevent coverage being collected on the runtime). //! #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![forbid(unexpected_cfgs)] -#![warn(clippy::cargo)] -#![allow(ambiguous_glob_reexports)] -#![deny(clippy::cargo_common_metadata)] -#![deny(rustdoc::broken_intra_doc_links)] -#![deny(clippy::all)] -#![deny(clippy::pedantic)] -#![allow( - clippy::unreadable_literal, - clippy::type_repetition_in_bounds, - clippy::missing_errors_doc, - clippy::cast_possible_truncation, - clippy::used_underscore_binding, - clippy::ptr_as_ptr, - clippy::missing_panics_doc, - clippy::missing_docs_in_private_items, - clippy::module_name_repetitions, - clippy::ptr_cast_constness, - clippy::unsafe_derive_deserialize, - clippy::similar_names, - clippy::too_many_lines -)] #![cfg_attr(not(test), warn( missing_debug_implementations, missing_docs, @@ -137,9 +115,6 @@ while_true ) )] -// Till they fix this buggy lint in clippy -#![allow(clippy::borrow_as_ptr)] -#![allow(clippy::borrow_deref_ref)] use std::ffi::{c_char, c_int}; diff --git a/libafl_nyx/Cargo.toml b/libafl_nyx/Cargo.toml index bb6a6d7589..a81bbac088 100644 --- a/libafl_nyx/Cargo.toml +++ b/libafl_nyx/Cargo.toml @@ -38,3 +38,6 @@ libafl_targets = { path = "../libafl_targets", version = "0.13.2", features = [ nix = { workspace = true, default-features = true, features = ["fs"] } typed-builder = { workspace = true } + +[lints] +workspace = true diff --git a/libafl_nyx/src/lib.rs b/libafl_nyx/src/lib.rs index 33c3cdce38..a1e3ffb763 100644 --- a/libafl_nyx/src/lib.rs +++ b/libafl_nyx/src/lib.rs @@ -1,6 +1,3 @@ -#![allow(clippy::module_name_repetitions, clippy::missing_panics_doc)] -#![forbid(unexpected_cfgs)] - #[cfg(target_os = "linux")] pub mod executor; #[cfg(target_os = "linux")] diff --git a/libafl_qemu/Cargo.toml b/libafl_qemu/Cargo.toml index 61f5ba3b74..64dcb918c0 100644 --- a/libafl_qemu/Cargo.toml +++ b/libafl_qemu/Cargo.toml @@ -142,3 +142,6 @@ cc = { workspace = true } [lib] name = "libafl_qemu" crate-type = ["cdylib", "rlib"] + +[lints] +workspace = true diff --git a/libafl_qemu/libafl_qemu_build/Cargo.toml b/libafl_qemu/libafl_qemu_build/Cargo.toml index 2c842ba993..ed4771eafa 100644 --- a/libafl_qemu/libafl_qemu_build/Cargo.toml +++ b/libafl_qemu/libafl_qemu_build/Cargo.toml @@ -39,3 +39,6 @@ cc = { workspace = true } regex = { workspace = true } rustversion = { workspace = true } rustc_version = "0.4.1" + +[lints] +workspace = true diff --git a/libafl_qemu/libafl_qemu_build/src/lib.rs b/libafl_qemu/libafl_qemu_build/src/lib.rs index e09d8b35ad..403a209ac0 100644 --- a/libafl_qemu/libafl_qemu_build/src/lib.rs +++ b/libafl_qemu/libafl_qemu_build/src/lib.rs @@ -1,6 +1,3 @@ -#![forbid(unexpected_cfgs)] -#![allow(clippy::missing_panics_doc)] - // #[rustversion::nightly] // use std::io::{BufRead, BufReader}; use std::{ diff --git a/libafl_qemu/libafl_qemu_build/src/main.rs b/libafl_qemu/libafl_qemu_build/src/main.rs deleted file mode 100644 index f37cd52a25..0000000000 --- a/libafl_qemu/libafl_qemu_build/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![forbid(unexpected_cfgs)] - -use std::path::PathBuf; - -use libafl_qemu_build::build_with_bindings; - -// RUST_BACKTRACE=1 OUT_DIR=/tmp/foo/a/b/c cargo run -fn main() { - let bfile = PathBuf::from("generated_qemu_bindings.rs"); - build_with_bindings("arm", false, false, None, &bfile); -} diff --git a/libafl_qemu/libafl_qemu_sys/Cargo.toml b/libafl_qemu/libafl_qemu_sys/Cargo.toml index 1d84994b25..65937de027 100644 --- a/libafl_qemu/libafl_qemu_sys/Cargo.toml +++ b/libafl_qemu/libafl_qemu_sys/Cargo.toml @@ -65,3 +65,6 @@ pyo3 = { workspace = true, optional = true } libafl_qemu_build = { path = "../libafl_qemu_build", version = "0.13.2" } pyo3-build-config = { workspace = true, optional = true } rustversion = { workspace = true } + +[lints] +workspace = true diff --git a/libafl_qemu/libafl_qemu_sys/build_linux.rs b/libafl_qemu/libafl_qemu_sys/build_linux.rs index 5002b41c0b..3c15b238a9 100644 --- a/libafl_qemu/libafl_qemu_sys/build_linux.rs +++ b/libafl_qemu/libafl_qemu_sys/build_linux.rs @@ -65,6 +65,7 @@ pub fn build() { }) }; println!("cargo:rerun-if-env-changed=CPU_TARGET"); + println!("cargo:rerun-if-env-changed=LIBAFL_QEMU_GEN_STUBS"); println!("cargo:rustc-cfg=cpu_target=\"{cpu_target}\""); println!("cargo::rustc-check-cfg=cfg(cpu_target, values(\"x86_64\", \"arm\", \"aarch64\", \"i386\", \"mips\", \"ppc\", \"hexagon\"))"); @@ -78,7 +79,7 @@ pub fn build() { let src_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); let src_dir = PathBuf::from(src_dir); - let stub_bindings_file = src_dir.join("src/x86_64_stub_bindings.rs"); + let stub_bindings_file = src_dir.join("src/bindings/x86_64_stub_bindings.rs"); if env::var("DOCS_RS").is_ok() || cfg!(feature = "clippy") { // Only build when we're not generating docs and not in clippy diff --git a/libafl_qemu/libafl_qemu_sys/src/bindings/mod.rs b/libafl_qemu/libafl_qemu_sys/src/bindings/mod.rs new file mode 100644 index 0000000000..fb25d7b7ff --- /dev/null +++ b/libafl_qemu/libafl_qemu_sys/src/bindings/mod.rs @@ -0,0 +1,18 @@ +#![allow(non_upper_case_globals)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(unused_mut)] +#![allow(unused)] +#![allow(unused_variables)] +#![allow(clippy::all)] +#![allow(clippy::pedantic)] +#![allow(improper_ctypes)] + +#[cfg(all(not(feature = "clippy"), target_os = "linux"))] +#[rustfmt::skip] + include!(concat!(env!("OUT_DIR"), "/bindings.rs")); + +#[cfg(any(feature = "clippy", not(target_os = "linux")))] +mod x86_64_stub_bindings; +#[cfg(any(feature = "clippy", not(target_os = "linux")))] +pub use x86_64_stub_bindings::*; diff --git a/libafl_qemu/libafl_qemu_sys/src/bindings/x86_64_stub_bindings.rs b/libafl_qemu/libafl_qemu_sys/src/bindings/x86_64_stub_bindings.rs new file mode 100644 index 0000000000..e057a90ecf --- /dev/null +++ b/libafl_qemu/libafl_qemu_sys/src/bindings/x86_64_stub_bindings.rs @@ -0,0 +1,7004 @@ +/* 1.83.0-nightly */ +/* qemu git hash: d6637939526f453c69f4c6bfe4635feb5dc5c0be */ +/* automatically generated by rust-bindgen 0.70.1 */ + +#[repr(C)] +#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub struct __BindgenBitfieldUnit { + storage: Storage, +} +impl __BindgenBitfieldUnit { + #[inline] + pub const fn new(storage: Storage) -> Self { + Self { storage } + } +} +impl __BindgenBitfieldUnit +where + Storage: AsRef<[u8]> + AsMut<[u8]>, +{ + #[inline] + pub fn get_bit(&self, index: usize) -> bool { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = self.storage.as_ref()[byte_index]; + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + byte & mask == mask + } + #[inline] + pub fn set_bit(&mut self, index: usize, val: bool) { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = &mut self.storage.as_mut()[byte_index]; + let bit_index = if cfg!(target_endian = "big") { + 7 - (index % 8) + } else { + index % 8 + }; + let mask = 1 << bit_index; + if val { + *byte |= mask; + } else { + *byte &= !mask; + } + } + #[inline] + pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if self.get_bit(i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] + pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + self.set_bit(index + bit_offset, val_bit_is_set); + } + } +} +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); +impl __IncompleteArrayField { + #[inline] + pub const fn new() -> Self { + __IncompleteArrayField(::std::marker::PhantomData, []) + } + #[inline] + pub fn as_ptr(&self) -> *const T { + self as *const _ as *const T + } + #[inline] + pub fn as_mut_ptr(&mut self) -> *mut T { + self as *mut _ as *mut T + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::std::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::std::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +pub type __uint32_t = ::std::os::raw::c_uint; +pub type __uid_t = ::std::os::raw::c_uint; +pub type __off_t = ::std::os::raw::c_long; +pub type __off64_t = ::std::os::raw::c_long; +pub type __pid_t = ::std::os::raw::c_int; +pub type __clock_t = ::std::os::raw::c_long; +pub type off_t = __off64_t; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __sigset_t { + pub __val: [::std::os::raw::c_ulong; 16usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sigset_t"][::std::mem::size_of::<__sigset_t>() - 128usize]; + ["Alignment of __sigset_t"][::std::mem::align_of::<__sigset_t>() - 8usize]; + ["Offset of field: __sigset_t::__val"][::std::mem::offset_of!(__sigset_t, __val) - 0usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub union __atomic_wide_counter { + pub __value64: ::std::os::raw::c_ulonglong, + pub __value32: __atomic_wide_counter__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __atomic_wide_counter__bindgen_ty_1 { + pub __low: ::std::os::raw::c_uint, + pub __high: ::std::os::raw::c_uint, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __atomic_wide_counter__bindgen_ty_1"] + [::std::mem::size_of::<__atomic_wide_counter__bindgen_ty_1>() - 8usize]; + ["Alignment of __atomic_wide_counter__bindgen_ty_1"] + [::std::mem::align_of::<__atomic_wide_counter__bindgen_ty_1>() - 4usize]; + ["Offset of field: __atomic_wide_counter__bindgen_ty_1::__low"] + [::std::mem::offset_of!(__atomic_wide_counter__bindgen_ty_1, __low) - 0usize]; + ["Offset of field: __atomic_wide_counter__bindgen_ty_1::__high"] + [::std::mem::offset_of!(__atomic_wide_counter__bindgen_ty_1, __high) - 4usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __atomic_wide_counter"][::std::mem::size_of::<__atomic_wide_counter>() - 8usize]; + ["Alignment of __atomic_wide_counter"] + [::std::mem::align_of::<__atomic_wide_counter>() - 8usize]; + ["Offset of field: __atomic_wide_counter::__value64"] + [::std::mem::offset_of!(__atomic_wide_counter, __value64) - 0usize]; + ["Offset of field: __atomic_wide_counter::__value32"] + [::std::mem::offset_of!(__atomic_wide_counter, __value32) - 0usize]; +}; +impl Default for __atomic_wide_counter { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for __atomic_wide_counter { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "__atomic_wide_counter {{ union }}") + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_internal_list { + pub __prev: *mut __pthread_internal_list, + pub __next: *mut __pthread_internal_list, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __pthread_internal_list"][::std::mem::size_of::<__pthread_internal_list>() - 16usize]; + ["Alignment of __pthread_internal_list"] + [::std::mem::align_of::<__pthread_internal_list>() - 8usize]; + ["Offset of field: __pthread_internal_list::__prev"] + [::std::mem::offset_of!(__pthread_internal_list, __prev) - 0usize]; + ["Offset of field: __pthread_internal_list::__next"] + [::std::mem::offset_of!(__pthread_internal_list, __next) - 8usize]; +}; +impl Default for __pthread_internal_list { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type __pthread_list_t = __pthread_internal_list; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __pthread_mutex_s { + pub __lock: ::std::os::raw::c_int, + pub __count: ::std::os::raw::c_uint, + pub __owner: ::std::os::raw::c_int, + pub __nusers: ::std::os::raw::c_uint, + pub __kind: ::std::os::raw::c_int, + pub __spins: ::std::os::raw::c_short, + pub __elision: ::std::os::raw::c_short, + pub __list: __pthread_list_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __pthread_mutex_s"][::std::mem::size_of::<__pthread_mutex_s>() - 40usize]; + ["Alignment of __pthread_mutex_s"][::std::mem::align_of::<__pthread_mutex_s>() - 8usize]; + ["Offset of field: __pthread_mutex_s::__lock"] + [::std::mem::offset_of!(__pthread_mutex_s, __lock) - 0usize]; + ["Offset of field: __pthread_mutex_s::__count"] + [::std::mem::offset_of!(__pthread_mutex_s, __count) - 4usize]; + ["Offset of field: __pthread_mutex_s::__owner"] + [::std::mem::offset_of!(__pthread_mutex_s, __owner) - 8usize]; + ["Offset of field: __pthread_mutex_s::__nusers"] + [::std::mem::offset_of!(__pthread_mutex_s, __nusers) - 12usize]; + ["Offset of field: __pthread_mutex_s::__kind"] + [::std::mem::offset_of!(__pthread_mutex_s, __kind) - 16usize]; + ["Offset of field: __pthread_mutex_s::__spins"] + [::std::mem::offset_of!(__pthread_mutex_s, __spins) - 20usize]; + ["Offset of field: __pthread_mutex_s::__elision"] + [::std::mem::offset_of!(__pthread_mutex_s, __elision) - 22usize]; + ["Offset of field: __pthread_mutex_s::__list"] + [::std::mem::offset_of!(__pthread_mutex_s, __list) - 24usize]; +}; +impl Default for __pthread_mutex_s { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __pthread_cond_s { + pub __wseq: __atomic_wide_counter, + pub __g1_start: __atomic_wide_counter, + pub __g_refs: [::std::os::raw::c_uint; 2usize], + pub __g_size: [::std::os::raw::c_uint; 2usize], + pub __g1_orig_size: ::std::os::raw::c_uint, + pub __wrefs: ::std::os::raw::c_uint, + pub __g_signals: [::std::os::raw::c_uint; 2usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __pthread_cond_s"][::std::mem::size_of::<__pthread_cond_s>() - 48usize]; + ["Alignment of __pthread_cond_s"][::std::mem::align_of::<__pthread_cond_s>() - 8usize]; + ["Offset of field: __pthread_cond_s::__wseq"] + [::std::mem::offset_of!(__pthread_cond_s, __wseq) - 0usize]; + ["Offset of field: __pthread_cond_s::__g1_start"] + [::std::mem::offset_of!(__pthread_cond_s, __g1_start) - 8usize]; + ["Offset of field: __pthread_cond_s::__g_refs"] + [::std::mem::offset_of!(__pthread_cond_s, __g_refs) - 16usize]; + ["Offset of field: __pthread_cond_s::__g_size"] + [::std::mem::offset_of!(__pthread_cond_s, __g_size) - 24usize]; + ["Offset of field: __pthread_cond_s::__g1_orig_size"] + [::std::mem::offset_of!(__pthread_cond_s, __g1_orig_size) - 32usize]; + ["Offset of field: __pthread_cond_s::__wrefs"] + [::std::mem::offset_of!(__pthread_cond_s, __wrefs) - 36usize]; + ["Offset of field: __pthread_cond_s::__g_signals"] + [::std::mem::offset_of!(__pthread_cond_s, __g_signals) - 40usize]; +}; +impl Default for __pthread_cond_s { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for __pthread_cond_s { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "__pthread_cond_s {{ __wseq: {:?}, __g1_start: {:?}, __g_refs: {:?}, __g_size: {:?}, __g1_orig_size: {:?}, __wrefs: {:?}, __g_signals: {:?} }}" , self . __wseq , self . __g1_start , self . __g_refs , self . __g_size , self . __g1_orig_size , self . __wrefs , self . __g_signals) + } +} +pub type pthread_t = ::std::os::raw::c_ulong; +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_mutex_t { + pub __data: __pthread_mutex_s, + pub __size: [::std::os::raw::c_char; 40usize], + pub __align: ::std::os::raw::c_long, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pthread_mutex_t"][::std::mem::size_of::() - 40usize]; + ["Alignment of pthread_mutex_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: pthread_mutex_t::__data"] + [::std::mem::offset_of!(pthread_mutex_t, __data) - 0usize]; + ["Offset of field: pthread_mutex_t::__size"] + [::std::mem::offset_of!(pthread_mutex_t, __size) - 0usize]; + ["Offset of field: pthread_mutex_t::__align"] + [::std::mem::offset_of!(pthread_mutex_t, __align) - 0usize]; +}; +impl Default for pthread_mutex_t { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for pthread_mutex_t { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "pthread_mutex_t {{ union }}") + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union pthread_cond_t { + pub __data: __pthread_cond_s, + pub __size: [::std::os::raw::c_char; 48usize], + pub __align: ::std::os::raw::c_longlong, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of pthread_cond_t"][::std::mem::size_of::() - 48usize]; + ["Alignment of pthread_cond_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: pthread_cond_t::__data"] + [::std::mem::offset_of!(pthread_cond_t, __data) - 0usize]; + ["Offset of field: pthread_cond_t::__size"] + [::std::mem::offset_of!(pthread_cond_t, __size) - 0usize]; + ["Offset of field: pthread_cond_t::__align"] + [::std::mem::offset_of!(pthread_cond_t, __align) - 0usize]; +}; +impl Default for pthread_cond_t { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for pthread_cond_t { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "pthread_cond_t {{ union }}") + } +} +pub type FILE = _IO_FILE; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_marker { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_codecvt { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_wide_data { + _unused: [u8; 0], +} +pub type _IO_lock_t = ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _IO_FILE { + pub _flags: ::std::os::raw::c_int, + pub _IO_read_ptr: *mut ::std::os::raw::c_char, + pub _IO_read_end: *mut ::std::os::raw::c_char, + pub _IO_read_base: *mut ::std::os::raw::c_char, + pub _IO_write_base: *mut ::std::os::raw::c_char, + pub _IO_write_ptr: *mut ::std::os::raw::c_char, + pub _IO_write_end: *mut ::std::os::raw::c_char, + pub _IO_buf_base: *mut ::std::os::raw::c_char, + pub _IO_buf_end: *mut ::std::os::raw::c_char, + pub _IO_save_base: *mut ::std::os::raw::c_char, + pub _IO_backup_base: *mut ::std::os::raw::c_char, + pub _IO_save_end: *mut ::std::os::raw::c_char, + pub _markers: *mut _IO_marker, + pub _chain: *mut _IO_FILE, + pub _fileno: ::std::os::raw::c_int, + pub _flags2: ::std::os::raw::c_int, + pub _old_offset: __off_t, + pub _cur_column: ::std::os::raw::c_ushort, + pub _vtable_offset: ::std::os::raw::c_schar, + pub _shortbuf: [::std::os::raw::c_char; 1usize], + pub _lock: *mut _IO_lock_t, + pub _offset: __off64_t, + pub _codecvt: *mut _IO_codecvt, + pub _wide_data: *mut _IO_wide_data, + pub _freeres_list: *mut _IO_FILE, + pub _freeres_buf: *mut ::std::os::raw::c_void, + pub _prevchain: *mut *mut _IO_FILE, + pub _mode: ::std::os::raw::c_int, + pub _unused2: [::std::os::raw::c_char; 20usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _IO_FILE"][::std::mem::size_of::<_IO_FILE>() - 216usize]; + ["Alignment of _IO_FILE"][::std::mem::align_of::<_IO_FILE>() - 8usize]; + ["Offset of field: _IO_FILE::_flags"][::std::mem::offset_of!(_IO_FILE, _flags) - 0usize]; + ["Offset of field: _IO_FILE::_IO_read_ptr"] + [::std::mem::offset_of!(_IO_FILE, _IO_read_ptr) - 8usize]; + ["Offset of field: _IO_FILE::_IO_read_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_read_end) - 16usize]; + ["Offset of field: _IO_FILE::_IO_read_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_read_base) - 24usize]; + ["Offset of field: _IO_FILE::_IO_write_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_write_base) - 32usize]; + ["Offset of field: _IO_FILE::_IO_write_ptr"] + [::std::mem::offset_of!(_IO_FILE, _IO_write_ptr) - 40usize]; + ["Offset of field: _IO_FILE::_IO_write_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_write_end) - 48usize]; + ["Offset of field: _IO_FILE::_IO_buf_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_buf_base) - 56usize]; + ["Offset of field: _IO_FILE::_IO_buf_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_buf_end) - 64usize]; + ["Offset of field: _IO_FILE::_IO_save_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_save_base) - 72usize]; + ["Offset of field: _IO_FILE::_IO_backup_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_backup_base) - 80usize]; + ["Offset of field: _IO_FILE::_IO_save_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_save_end) - 88usize]; + ["Offset of field: _IO_FILE::_markers"][::std::mem::offset_of!(_IO_FILE, _markers) - 96usize]; + ["Offset of field: _IO_FILE::_chain"][::std::mem::offset_of!(_IO_FILE, _chain) - 104usize]; + ["Offset of field: _IO_FILE::_fileno"][::std::mem::offset_of!(_IO_FILE, _fileno) - 112usize]; + ["Offset of field: _IO_FILE::_flags2"][::std::mem::offset_of!(_IO_FILE, _flags2) - 116usize]; + ["Offset of field: _IO_FILE::_old_offset"] + [::std::mem::offset_of!(_IO_FILE, _old_offset) - 120usize]; + ["Offset of field: _IO_FILE::_cur_column"] + [::std::mem::offset_of!(_IO_FILE, _cur_column) - 128usize]; + ["Offset of field: _IO_FILE::_vtable_offset"] + [::std::mem::offset_of!(_IO_FILE, _vtable_offset) - 130usize]; + ["Offset of field: _IO_FILE::_shortbuf"] + [::std::mem::offset_of!(_IO_FILE, _shortbuf) - 131usize]; + ["Offset of field: _IO_FILE::_lock"][::std::mem::offset_of!(_IO_FILE, _lock) - 136usize]; + ["Offset of field: _IO_FILE::_offset"][::std::mem::offset_of!(_IO_FILE, _offset) - 144usize]; + ["Offset of field: _IO_FILE::_codecvt"][::std::mem::offset_of!(_IO_FILE, _codecvt) - 152usize]; + ["Offset of field: _IO_FILE::_wide_data"] + [::std::mem::offset_of!(_IO_FILE, _wide_data) - 160usize]; + ["Offset of field: _IO_FILE::_freeres_list"] + [::std::mem::offset_of!(_IO_FILE, _freeres_list) - 168usize]; + ["Offset of field: _IO_FILE::_freeres_buf"] + [::std::mem::offset_of!(_IO_FILE, _freeres_buf) - 176usize]; + ["Offset of field: _IO_FILE::_prevchain"] + [::std::mem::offset_of!(_IO_FILE, _prevchain) - 184usize]; + ["Offset of field: _IO_FILE::_mode"][::std::mem::offset_of!(_IO_FILE, _mode) - 192usize]; + ["Offset of field: _IO_FILE::_unused2"][::std::mem::offset_of!(_IO_FILE, _unused2) - 196usize]; +}; +impl Default for _IO_FILE { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type __jmp_buf = [::std::os::raw::c_long; 8usize]; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct __jmp_buf_tag { + pub __jmpbuf: __jmp_buf, + pub __mask_was_saved: ::std::os::raw::c_int, + pub __saved_mask: __sigset_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __jmp_buf_tag"][::std::mem::size_of::<__jmp_buf_tag>() - 200usize]; + ["Alignment of __jmp_buf_tag"][::std::mem::align_of::<__jmp_buf_tag>() - 8usize]; + ["Offset of field: __jmp_buf_tag::__jmpbuf"] + [::std::mem::offset_of!(__jmp_buf_tag, __jmpbuf) - 0usize]; + ["Offset of field: __jmp_buf_tag::__mask_was_saved"] + [::std::mem::offset_of!(__jmp_buf_tag, __mask_was_saved) - 64usize]; + ["Offset of field: __jmp_buf_tag::__saved_mask"] + [::std::mem::offset_of!(__jmp_buf_tag, __saved_mask) - 72usize]; +}; +pub type sigjmp_buf = [__jmp_buf_tag; 1usize]; +#[repr(C)] +#[derive(Copy, Clone)] +pub union sigval { + pub sival_int: ::std::os::raw::c_int, + pub sival_ptr: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigval"][::std::mem::size_of::() - 8usize]; + ["Alignment of sigval"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigval::sival_int"][::std::mem::offset_of!(sigval, sival_int) - 0usize]; + ["Offset of field: sigval::sival_ptr"][::std::mem::offset_of!(sigval, sival_ptr) - 0usize]; +}; +impl Default for sigval { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for sigval { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "sigval {{ union }}") + } +} +pub type __sigval_t = sigval; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct siginfo_t { + pub si_signo: ::std::os::raw::c_int, + pub si_errno: ::std::os::raw::c_int, + pub si_code: ::std::os::raw::c_int, + pub __pad0: ::std::os::raw::c_int, + pub _sifields: siginfo_t__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union siginfo_t__bindgen_ty_1 { + pub _pad: [::std::os::raw::c_int; 28usize], + pub _kill: siginfo_t__bindgen_ty_1__bindgen_ty_1, + pub _timer: siginfo_t__bindgen_ty_1__bindgen_ty_2, + pub _rt: siginfo_t__bindgen_ty_1__bindgen_ty_3, + pub _sigchld: siginfo_t__bindgen_ty_1__bindgen_ty_4, + pub _sigfault: siginfo_t__bindgen_ty_1__bindgen_ty_5, + pub _sigpoll: siginfo_t__bindgen_ty_1__bindgen_ty_6, + pub _sigsys: siginfo_t__bindgen_ty_1__bindgen_ty_7, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_1 { + pub si_pid: __pid_t, + pub si_uid: __uid_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1::si_pid"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_1, si_pid) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_1::si_uid"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_1, si_uid) - 4usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_2 { + pub si_tid: ::std::os::raw::c_int, + pub si_overrun: ::std::os::raw::c_int, + pub si_sigval: __sigval_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_2"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_2::si_tid"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_2, si_tid) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_2::si_overrun"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_2, si_overrun) - 4usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_2::si_sigval"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_2, si_sigval) - 8usize]; +}; +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for siginfo_t__bindgen_ty_1__bindgen_ty_2 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "siginfo_t__bindgen_ty_1__bindgen_ty_2 {{ si_tid: {:?}, si_overrun: {:?}, si_sigval: {:?} }}" , self . si_tid , self . si_overrun , self . si_sigval) + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_3 { + pub si_pid: __pid_t, + pub si_uid: __uid_t, + pub si_sigval: __sigval_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_3"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_3::si_pid"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_3, si_pid) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_3::si_uid"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_3, si_uid) - 4usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_3::si_sigval"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_3, si_sigval) - 8usize]; +}; +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_3 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for siginfo_t__bindgen_ty_1__bindgen_ty_3 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "siginfo_t__bindgen_ty_1__bindgen_ty_3 {{ si_pid: {:?}, si_uid: {:?}, si_sigval: {:?} }}" , self . si_pid , self . si_uid , self . si_sigval) + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_4 { + pub si_pid: __pid_t, + pub si_uid: __uid_t, + pub si_status: ::std::os::raw::c_int, + pub si_utime: __clock_t, + pub si_stime: __clock_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_4"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_4"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_4::si_pid"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_4, si_pid) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_4::si_uid"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_4, si_uid) - 4usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_4::si_status"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_4, si_status) - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_4::si_utime"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_4, si_utime) - 16usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_4::si_stime"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_4, si_stime) - 24usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_5 { + pub si_addr: *mut ::std::os::raw::c_void, + pub si_addr_lsb: ::std::os::raw::c_short, + pub _bounds: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 { + pub _addr_bnd: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, + pub _pkey: __uint32_t, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { + pub _lower: *mut ::std::os::raw::c_void, + pub _upper: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::( + ) - 16usize]; + ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::( + ) - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_lower"] [:: std :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 , _lower) - 0usize] ; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1::_upper"] [:: std :: mem :: offset_of ! (siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 , _upper) - 8usize] ; +}; +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1::_addr_bnd"][::std::mem::offset_of!( + siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1, + _addr_bnd + ) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1::_pkey"][::std::mem::offset_of!( + siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1, + _pkey + ) - 0usize]; +}; +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 {{ union }}" + ) + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_5"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_5"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_5::si_addr"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_5, si_addr) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_5::si_addr_lsb"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_5, si_addr_lsb) - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_5::_bounds"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_5, _bounds) - 16usize]; +}; +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for siginfo_t__bindgen_ty_1__bindgen_ty_5 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "siginfo_t__bindgen_ty_1__bindgen_ty_5 {{ si_addr: {:?}, si_addr_lsb: {:?}, _bounds: {:?} }}" , self . si_addr , self . si_addr_lsb , self . _bounds) + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_6 { + pub si_band: ::std::os::raw::c_long, + pub si_fd: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_6"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_6"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_6::si_band"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_6, si_band) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_6::si_fd"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_6, si_fd) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct siginfo_t__bindgen_ty_1__bindgen_ty_7 { + pub _call_addr: *mut ::std::os::raw::c_void, + pub _syscall: ::std::os::raw::c_int, + pub _arch: ::std::os::raw::c_uint, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t__bindgen_ty_1__bindgen_ty_7"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of siginfo_t__bindgen_ty_1__bindgen_ty_7"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_7::_call_addr"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_7, _call_addr) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_7::_syscall"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_7, _syscall) - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1__bindgen_ty_7::_arch"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1__bindgen_ty_7, _arch) - 12usize]; +}; +impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_7 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t__bindgen_ty_1"] + [::std::mem::size_of::() - 112usize]; + ["Alignment of siginfo_t__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo_t__bindgen_ty_1::_pad"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1, _pad) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1::_kill"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1, _kill) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1::_timer"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1, _timer) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1::_rt"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1, _rt) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1::_sigchld"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1, _sigchld) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1::_sigfault"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1, _sigfault) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1::_sigpoll"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1, _sigpoll) - 0usize]; + ["Offset of field: siginfo_t__bindgen_ty_1::_sigsys"] + [::std::mem::offset_of!(siginfo_t__bindgen_ty_1, _sigsys) - 0usize]; +}; +impl Default for siginfo_t__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for siginfo_t__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "siginfo_t__bindgen_ty_1 {{ union }}") + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of siginfo_t"][::std::mem::size_of::() - 128usize]; + ["Alignment of siginfo_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: siginfo_t::si_signo"][::std::mem::offset_of!(siginfo_t, si_signo) - 0usize]; + ["Offset of field: siginfo_t::si_errno"][::std::mem::offset_of!(siginfo_t, si_errno) - 4usize]; + ["Offset of field: siginfo_t::si_code"][::std::mem::offset_of!(siginfo_t, si_code) - 8usize]; + ["Offset of field: siginfo_t::__pad0"][::std::mem::offset_of!(siginfo_t, __pad0) - 12usize]; + ["Offset of field: siginfo_t::_sifields"] + [::std::mem::offset_of!(siginfo_t, _sifields) - 16usize]; +}; +impl Default for siginfo_t { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for siginfo_t { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "siginfo_t {{ si_signo: {:?}, si_errno: {:?}, si_code: {:?}, __pad0: {:?}, _sifields: {:?} }}" , self . si_signo , self . si_errno , self . si_code , self . __pad0 , self . _sifields) + } +} +pub type guint8 = ::std::os::raw::c_uchar; +pub type gchar = ::std::os::raw::c_char; +pub type guint = ::std::os::raw::c_uint; +pub type gpointer = *mut ::std::os::raw::c_void; +pub type GArray = _GArray; +pub type GByteArray = _GByteArray; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GArray { + pub data: *mut gchar, + pub len: guint, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _GArray"][::std::mem::size_of::<_GArray>() - 16usize]; + ["Alignment of _GArray"][::std::mem::align_of::<_GArray>() - 8usize]; + ["Offset of field: _GArray::data"][::std::mem::offset_of!(_GArray, data) - 0usize]; + ["Offset of field: _GArray::len"][::std::mem::offset_of!(_GArray, len) - 8usize]; +}; +impl Default for _GArray { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GByteArray { + pub data: *mut guint8, + pub len: guint, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _GByteArray"][::std::mem::size_of::<_GByteArray>() - 16usize]; + ["Alignment of _GByteArray"][::std::mem::align_of::<_GByteArray>() - 8usize]; + ["Offset of field: _GByteArray::data"][::std::mem::offset_of!(_GByteArray, data) - 0usize]; + ["Offset of field: _GByteArray::len"][::std::mem::offset_of!(_GByteArray, len) - 8usize]; +}; +impl Default for _GByteArray { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GHashTable { + _unused: [u8; 0], +} +pub type GHashTable = _GHashTable; +pub type GSList = _GSList; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _GSList { + pub data: gpointer, + pub next: *mut GSList, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _GSList"][::std::mem::size_of::<_GSList>() - 16usize]; + ["Alignment of _GSList"][::std::mem::align_of::<_GSList>() - 8usize]; + ["Offset of field: _GSList::data"][::std::mem::offset_of!(_GSList, data) - 0usize]; + ["Offset of field: _GSList::next"][::std::mem::offset_of!(_GSList, next) - 8usize]; +}; +impl Default for _GSList { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct AccelCPUState { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct AddressSpace { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Clock { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CPUAddressSpace { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CpuInfoFast { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CPUJumpCache { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Error { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct MemoryRegion { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QDict { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QObject { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct RAMBlock { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCGCPUOps { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Visitor { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct VMChangeStateEntry { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct VMStateDescription { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct IRQState { + _unused: [u8; 0], +} +pub type qemu_irq = *mut IRQState; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QEnumLookup { + pub array: *const *const ::std::os::raw::c_char, + pub special_features: *const ::std::os::raw::c_uchar, + pub size: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QEnumLookup"][::std::mem::size_of::() - 24usize]; + ["Alignment of QEnumLookup"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QEnumLookup::array"][::std::mem::offset_of!(QEnumLookup, array) - 0usize]; + ["Offset of field: QEnumLookup::special_features"] + [::std::mem::offset_of!(QEnumLookup, special_features) - 8usize]; + ["Offset of field: QEnumLookup::size"][::std::mem::offset_of!(QEnumLookup, size) - 16usize]; +}; +impl Default for QEnumLookup { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +extern "C" { + pub fn qemu_target_page_size() -> usize; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QemuMutex { + pub lock: pthread_mutex_t, + pub initialized: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QemuMutex"][::std::mem::size_of::() - 48usize]; + ["Alignment of QemuMutex"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QemuMutex::lock"][::std::mem::offset_of!(QemuMutex, lock) - 0usize]; + ["Offset of field: QemuMutex::initialized"] + [::std::mem::offset_of!(QemuMutex, initialized) - 40usize]; +}; +impl Default for QemuMutex { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for QemuMutex { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "QemuMutex {{ lock: {:?}, initialized: {:?} }}", + self.lock, self.initialized + ) + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct QemuCond { + pub cond: pthread_cond_t, + pub initialized: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QemuCond"][::std::mem::size_of::() - 56usize]; + ["Alignment of QemuCond"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QemuCond::cond"][::std::mem::offset_of!(QemuCond, cond) - 0usize]; + ["Offset of field: QemuCond::initialized"] + [::std::mem::offset_of!(QemuCond, initialized) - 48usize]; +}; +impl Default for QemuCond { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for QemuCond { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "QemuCond {{ cond: {:?}, initialized: {:?} }}", + self.cond, self.initialized + ) + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct QemuThread { + pub thread: pthread_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QemuThread"][::std::mem::size_of::() - 8usize]; + ["Alignment of QemuThread"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QemuThread::thread"][::std::mem::offset_of!(QemuThread, thread) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct QemuSpin { + pub value: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QemuSpin"][::std::mem::size_of::() - 4usize]; + ["Alignment of QemuSpin"][::std::mem::align_of::() - 4usize]; + ["Offset of field: QemuSpin::value"][::std::mem::offset_of!(QemuSpin, value) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct QemuLockCnt { + pub count: ::std::os::raw::c_uint, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QemuLockCnt"][::std::mem::size_of::() - 4usize]; + ["Alignment of QemuLockCnt"][::std::mem::align_of::() - 4usize]; + ["Offset of field: QemuLockCnt::count"][::std::mem::offset_of!(QemuLockCnt, count) - 0usize]; +}; +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Default, Copy, Clone)] +pub struct MemTxAttrs { + pub _bitfield_align_1: [u16; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MemTxAttrs"][::std::mem::size_of::() - 4usize]; + ["Alignment of MemTxAttrs"][::std::mem::align_of::() - 4usize]; +}; +impl MemTxAttrs { + #[inline] + pub fn unspecified(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } + } + #[inline] + pub fn set_unspecified(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 1u8, val as u64) + } + } + #[inline] + pub fn secure(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } + } + #[inline] + pub fn set_secure(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) + } + } + #[inline] + pub fn space(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 2u8) as u32) } + } + #[inline] + pub fn set_space(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 2u8, val as u64) + } + } + #[inline] + pub fn user(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } + } + #[inline] + pub fn set_user(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub fn memory(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } + } + #[inline] + pub fn set_memory(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub fn requester_id(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 16u8) as u32) } + } + #[inline] + pub fn set_requester_id(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 16u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + unspecified: ::std::os::raw::c_uint, + secure: ::std::os::raw::c_uint, + space: ::std::os::raw::c_uint, + user: ::std::os::raw::c_uint, + memory: ::std::os::raw::c_uint, + requester_id: ::std::os::raw::c_uint, + ) -> __BindgenBitfieldUnit<[u8; 3usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let unspecified: u32 = unsafe { ::std::mem::transmute(unspecified) }; + unspecified as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let secure: u32 = unsafe { ::std::mem::transmute(secure) }; + secure as u64 + }); + __bindgen_bitfield_unit.set(2usize, 2u8, { + let space: u32 = unsafe { ::std::mem::transmute(space) }; + space as u64 + }); + __bindgen_bitfield_unit.set(4usize, 1u8, { + let user: u32 = unsafe { ::std::mem::transmute(user) }; + user as u64 + }); + __bindgen_bitfield_unit.set(5usize, 1u8, { + let memory: u32 = unsafe { ::std::mem::transmute(memory) }; + memory as u64 + }); + __bindgen_bitfield_unit.set(6usize, 16u8, { + let requester_id: u32 = unsafe { ::std::mem::transmute(requester_id) }; + requester_id as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct QTailQLink { + pub tql_next: *mut ::std::os::raw::c_void, + pub tql_prev: *mut QTailQLink, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of QTailQLink"][::std::mem::size_of::() - 16usize]; + ["Alignment of QTailQLink"][::std::mem::align_of::() - 8usize]; + ["Offset of field: QTailQLink::tql_next"] + [::std::mem::offset_of!(QTailQLink, tql_next) - 0usize]; + ["Offset of field: QTailQLink::tql_prev"] + [::std::mem::offset_of!(QTailQLink, tql_prev) - 8usize]; +}; +impl Default for QTailQLink { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Notifier { + pub notify: ::std::option::Option< + unsafe extern "C" fn(notifier: *mut Notifier, data: *mut ::std::os::raw::c_void), + >, + pub node: Notifier__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Notifier__bindgen_ty_1 { + pub le_next: *mut Notifier, + pub le_prev: *mut *mut Notifier, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of Notifier__bindgen_ty_1"][::std::mem::size_of::() - 16usize]; + ["Alignment of Notifier__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: Notifier__bindgen_ty_1::le_next"] + [::std::mem::offset_of!(Notifier__bindgen_ty_1, le_next) - 0usize]; + ["Offset of field: Notifier__bindgen_ty_1::le_prev"] + [::std::mem::offset_of!(Notifier__bindgen_ty_1, le_prev) - 8usize]; +}; +impl Default for Notifier__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of Notifier"][::std::mem::size_of::() - 24usize]; + ["Alignment of Notifier"][::std::mem::align_of::() - 8usize]; + ["Offset of field: Notifier::notify"][::std::mem::offset_of!(Notifier, notify) - 0usize]; + ["Offset of field: Notifier::node"][::std::mem::offset_of!(Notifier, node) - 8usize]; +}; +impl Default for Notifier { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type RCUCBFunc = ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rcu_head { + pub next: *mut rcu_head, + pub func: RCUCBFunc, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of rcu_head"][::std::mem::size_of::() - 16usize]; + ["Alignment of rcu_head"][::std::mem::align_of::() - 8usize]; + ["Offset of field: rcu_head::next"][::std::mem::offset_of!(rcu_head, next) - 0usize]; + ["Offset of field: rcu_head::func"][::std::mem::offset_of!(rcu_head, func) - 8usize]; +}; +impl Default for rcu_head { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TypeImpl { + _unused: [u8; 0], +} +pub type Type = *mut TypeImpl; +#[doc = " typedef ObjectPropertyAccessor:\n @obj: the object that owns the property\n @v: the visitor that contains the property data\n @name: the name of the property\n @opaque: the object property opaque\n @errp: a pointer to an Error that is filled if getting/setting fails.\n\n Called when trying to get/set a property."] +pub type ObjectPropertyAccessor = ::std::option::Option< + unsafe extern "C" fn( + obj: *mut Object, + v: *mut Visitor, + name: *const ::std::os::raw::c_char, + opaque: *mut ::std::os::raw::c_void, + errp: *mut *mut Error, + ), +>; +#[doc = " typedef ObjectPropertyResolve:\n @obj: the object that owns the property\n @opaque: the opaque registered with the property\n @part: the name of the property\n\n Resolves the #Object corresponding to property @part.\n\n The returned object can also be used as a starting point\n to resolve a relative path starting with \"@part\".\n\n Returns: If @path is the path that led to @obj, the function\n returns the #Object corresponding to \"@path/@part\".\n If \"@path/@part\" is not a valid object path, it returns #NULL."] +pub type ObjectPropertyResolve = ::std::option::Option< + unsafe extern "C" fn( + obj: *mut Object, + opaque: *mut ::std::os::raw::c_void, + part: *const ::std::os::raw::c_char, + ) -> *mut Object, +>; +#[doc = " typedef ObjectPropertyRelease:\n @obj: the object that owns the property\n @name: the name of the property\n @opaque: the opaque registered with the property\n\n Called when a property is removed from a object."] +pub type ObjectPropertyRelease = ::std::option::Option< + unsafe extern "C" fn( + obj: *mut Object, + name: *const ::std::os::raw::c_char, + opaque: *mut ::std::os::raw::c_void, + ), +>; +#[doc = " typedef ObjectPropertyInit:\n @obj: the object that owns the property\n @prop: the property to set\n\n Called when a property is initialized."] +pub type ObjectPropertyInit = + ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ObjectProperty { + pub name: *mut ::std::os::raw::c_char, + pub type_: *mut ::std::os::raw::c_char, + pub description: *mut ::std::os::raw::c_char, + pub get: ObjectPropertyAccessor, + pub set: ObjectPropertyAccessor, + pub resolve: ObjectPropertyResolve, + pub release: ObjectPropertyRelease, + pub init: ObjectPropertyInit, + pub opaque: *mut ::std::os::raw::c_void, + pub defval: *mut QObject, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ObjectProperty"][::std::mem::size_of::() - 80usize]; + ["Alignment of ObjectProperty"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ObjectProperty::name"] + [::std::mem::offset_of!(ObjectProperty, name) - 0usize]; + ["Offset of field: ObjectProperty::type_"] + [::std::mem::offset_of!(ObjectProperty, type_) - 8usize]; + ["Offset of field: ObjectProperty::description"] + [::std::mem::offset_of!(ObjectProperty, description) - 16usize]; + ["Offset of field: ObjectProperty::get"][::std::mem::offset_of!(ObjectProperty, get) - 24usize]; + ["Offset of field: ObjectProperty::set"][::std::mem::offset_of!(ObjectProperty, set) - 32usize]; + ["Offset of field: ObjectProperty::resolve"] + [::std::mem::offset_of!(ObjectProperty, resolve) - 40usize]; + ["Offset of field: ObjectProperty::release"] + [::std::mem::offset_of!(ObjectProperty, release) - 48usize]; + ["Offset of field: ObjectProperty::init"] + [::std::mem::offset_of!(ObjectProperty, init) - 56usize]; + ["Offset of field: ObjectProperty::opaque"] + [::std::mem::offset_of!(ObjectProperty, opaque) - 64usize]; + ["Offset of field: ObjectProperty::defval"] + [::std::mem::offset_of!(ObjectProperty, defval) - 72usize]; +}; +impl Default for ObjectProperty { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[doc = " typedef ObjectUnparent:\n @obj: the object that is being removed from the composition tree\n\n Called when an object is being removed from the QOM composition tree.\n The function should remove any backlinks from children objects to @obj."] +pub type ObjectUnparent = ::std::option::Option; +#[doc = " typedef ObjectFree:\n @obj: the object being freed\n\n Called when an object's last reference is removed."] +pub type ObjectFree = ::std::option::Option; +#[doc = " struct ObjectClass:\n\n The base for all classes. The only thing that #ObjectClass contains is an\n integer type handle."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct ObjectClass { + pub type_: Type, + pub interfaces: *mut GSList, + pub object_cast_cache: [*const ::std::os::raw::c_char; 4usize], + pub class_cast_cache: [*const ::std::os::raw::c_char; 4usize], + pub unparent: ObjectUnparent, + pub properties: *mut GHashTable, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ObjectClass"][::std::mem::size_of::() - 96usize]; + ["Alignment of ObjectClass"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ObjectClass::type_"][::std::mem::offset_of!(ObjectClass, type_) - 0usize]; + ["Offset of field: ObjectClass::interfaces"] + [::std::mem::offset_of!(ObjectClass, interfaces) - 8usize]; + ["Offset of field: ObjectClass::object_cast_cache"] + [::std::mem::offset_of!(ObjectClass, object_cast_cache) - 16usize]; + ["Offset of field: ObjectClass::class_cast_cache"] + [::std::mem::offset_of!(ObjectClass, class_cast_cache) - 48usize]; + ["Offset of field: ObjectClass::unparent"] + [::std::mem::offset_of!(ObjectClass, unparent) - 80usize]; + ["Offset of field: ObjectClass::properties"] + [::std::mem::offset_of!(ObjectClass, properties) - 88usize]; +}; +impl Default for ObjectClass { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[doc = " struct Object:\n\n The base for all objects. The first member of this object is a pointer to\n a #ObjectClass. Since C guarantees that the first member of a structure\n always begins at byte 0 of that structure, as long as any sub-object places\n its parent as the first member, we can cast directly to a #Object.\n\n As a result, #Object contains a reference to the objects type as its\n first member. This allows identification of the real type of the object at\n run time."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct Object { + pub class: *mut ObjectClass, + pub free: ObjectFree, + pub properties: *mut GHashTable, + pub ref_: u32, + pub parent: *mut Object, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of Object"][::std::mem::size_of::() - 40usize]; + ["Alignment of Object"][::std::mem::align_of::() - 8usize]; + ["Offset of field: Object::class"][::std::mem::offset_of!(Object, class) - 0usize]; + ["Offset of field: Object::free"][::std::mem::offset_of!(Object, free) - 8usize]; + ["Offset of field: Object::properties"][::std::mem::offset_of!(Object, properties) - 16usize]; + ["Offset of field: Object::ref_"][::std::mem::offset_of!(Object, ref_) - 24usize]; + ["Offset of field: Object::parent"][::std::mem::offset_of!(Object, parent) - 32usize]; +}; +impl Default for Object { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct HotplugHandler { + _unused: [u8; 0], +} +#[doc = " ResettableState:\n Structure holding reset related state. The fields should not be accessed\n directly; the definition is here to allow further inclusion into other\n objects.\n\n @count: Number of reset level the object is into. It is incremented when\n the reset operation starts and decremented when it finishes.\n @hold_phase_pending: flag which indicates that we need to invoke the 'hold'\n phase handler for this object.\n @exit_phase_in_progress: true if we are currently in the exit phase"] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct ResettableState { + pub count: ::std::os::raw::c_uint, + pub hold_phase_pending: bool, + pub exit_phase_in_progress: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ResettableState"][::std::mem::size_of::() - 8usize]; + ["Alignment of ResettableState"][::std::mem::align_of::() - 4usize]; + ["Offset of field: ResettableState::count"] + [::std::mem::offset_of!(ResettableState, count) - 0usize]; + ["Offset of field: ResettableState::hold_phase_pending"] + [::std::mem::offset_of!(ResettableState, hold_phase_pending) - 4usize]; + ["Offset of field: ResettableState::exit_phase_in_progress"] + [::std::mem::offset_of!(ResettableState, exit_phase_in_progress) - 5usize]; +}; +pub type DeviceRealize = + ::std::option::Option; +pub type DeviceUnrealize = ::std::option::Option; +pub type DeviceReset = ::std::option::Option; +#[doc = " struct DeviceClass - The base class for all devices.\n @props: Properties accessing state fields.\n @realize: Callback function invoked when the #DeviceState:realized\n property is changed to %true.\n @unrealize: Callback function invoked when the #DeviceState:realized\n property is changed to %false.\n @hotpluggable: indicates if #DeviceClass is hotpluggable, available\n as readonly \"hotpluggable\" property of #DeviceState instance\n"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct DeviceClass { + pub parent_class: ObjectClass, + #[doc = " @categories: device categories device belongs to"] + pub categories: [::std::os::raw::c_ulong; 1usize], + #[doc = " @fw_name: name used to identify device to firmware interfaces"] + pub fw_name: *const ::std::os::raw::c_char, + #[doc = " @desc: human readable description of device"] + pub desc: *const ::std::os::raw::c_char, + #[doc = " @props_: properties associated with device, should only be\n assigned by using device_class_set_props(). The underscore\n ensures a compile-time error if someone attempts to assign\n dc->props directly."] + pub props_: *mut Property, + #[doc = " @user_creatable: Can user instantiate with -device / device_add?\n\n All devices should support instantiation with device_add, and\n this flag should not exist. But we're not there, yet. Some\n devices fail to instantiate with cryptic error messages.\n Others instantiate, but don't work. Exposing users to such\n behavior would be cruel; clearing this flag will protect them.\n It should never be cleared without a comment explaining why it\n is cleared.\n\n TODO remove once we're there"] + pub user_creatable: bool, + pub hotpluggable: bool, + #[doc = " @reset: deprecated device reset method pointer\n\n Modern code should use the ResettableClass interface to\n implement a multi-phase reset.\n\n TODO: remove once every reset callback is unused"] + pub reset: DeviceReset, + pub realize: DeviceRealize, + pub unrealize: DeviceUnrealize, + #[doc = " @vmsd: device state serialisation description for\n migration/save/restore"] + pub vmsd: *const VMStateDescription, + #[doc = " @bus_type: bus type\n private: to qdev / bus."] + pub bus_type: *const ::std::os::raw::c_char, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of DeviceClass"][::std::mem::size_of::() - 176usize]; + ["Alignment of DeviceClass"][::std::mem::align_of::() - 8usize]; + ["Offset of field: DeviceClass::parent_class"] + [::std::mem::offset_of!(DeviceClass, parent_class) - 0usize]; + ["Offset of field: DeviceClass::categories"] + [::std::mem::offset_of!(DeviceClass, categories) - 96usize]; + ["Offset of field: DeviceClass::fw_name"] + [::std::mem::offset_of!(DeviceClass, fw_name) - 104usize]; + ["Offset of field: DeviceClass::desc"][::std::mem::offset_of!(DeviceClass, desc) - 112usize]; + ["Offset of field: DeviceClass::props_"] + [::std::mem::offset_of!(DeviceClass, props_) - 120usize]; + ["Offset of field: DeviceClass::user_creatable"] + [::std::mem::offset_of!(DeviceClass, user_creatable) - 128usize]; + ["Offset of field: DeviceClass::hotpluggable"] + [::std::mem::offset_of!(DeviceClass, hotpluggable) - 129usize]; + ["Offset of field: DeviceClass::reset"][::std::mem::offset_of!(DeviceClass, reset) - 136usize]; + ["Offset of field: DeviceClass::realize"] + [::std::mem::offset_of!(DeviceClass, realize) - 144usize]; + ["Offset of field: DeviceClass::unrealize"] + [::std::mem::offset_of!(DeviceClass, unrealize) - 152usize]; + ["Offset of field: DeviceClass::vmsd"][::std::mem::offset_of!(DeviceClass, vmsd) - 160usize]; + ["Offset of field: DeviceClass::bus_type"] + [::std::mem::offset_of!(DeviceClass, bus_type) - 168usize]; +}; +impl Default for DeviceClass { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NamedGPIOList { + pub name: *mut ::std::os::raw::c_char, + pub in_: *mut qemu_irq, + pub num_in: ::std::os::raw::c_int, + pub num_out: ::std::os::raw::c_int, + pub node: NamedGPIOList__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NamedGPIOList__bindgen_ty_1 { + pub le_next: *mut NamedGPIOList, + pub le_prev: *mut *mut NamedGPIOList, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of NamedGPIOList__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of NamedGPIOList__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: NamedGPIOList__bindgen_ty_1::le_next"] + [::std::mem::offset_of!(NamedGPIOList__bindgen_ty_1, le_next) - 0usize]; + ["Offset of field: NamedGPIOList__bindgen_ty_1::le_prev"] + [::std::mem::offset_of!(NamedGPIOList__bindgen_ty_1, le_prev) - 8usize]; +}; +impl Default for NamedGPIOList__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of NamedGPIOList"][::std::mem::size_of::() - 40usize]; + ["Alignment of NamedGPIOList"][::std::mem::align_of::() - 8usize]; + ["Offset of field: NamedGPIOList::name"][::std::mem::offset_of!(NamedGPIOList, name) - 0usize]; + ["Offset of field: NamedGPIOList::in_"][::std::mem::offset_of!(NamedGPIOList, in_) - 8usize]; + ["Offset of field: NamedGPIOList::num_in"] + [::std::mem::offset_of!(NamedGPIOList, num_in) - 16usize]; + ["Offset of field: NamedGPIOList::num_out"] + [::std::mem::offset_of!(NamedGPIOList, num_out) - 20usize]; + ["Offset of field: NamedGPIOList::node"][::std::mem::offset_of!(NamedGPIOList, node) - 24usize]; +}; +impl Default for NamedGPIOList { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NamedClockList { + pub name: *mut ::std::os::raw::c_char, + pub clock: *mut Clock, + pub output: bool, + pub alias: bool, + pub node: NamedClockList__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NamedClockList__bindgen_ty_1 { + pub le_next: *mut NamedClockList, + pub le_prev: *mut *mut NamedClockList, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of NamedClockList__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of NamedClockList__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: NamedClockList__bindgen_ty_1::le_next"] + [::std::mem::offset_of!(NamedClockList__bindgen_ty_1, le_next) - 0usize]; + ["Offset of field: NamedClockList__bindgen_ty_1::le_prev"] + [::std::mem::offset_of!(NamedClockList__bindgen_ty_1, le_prev) - 8usize]; +}; +impl Default for NamedClockList__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of NamedClockList"][::std::mem::size_of::() - 40usize]; + ["Alignment of NamedClockList"][::std::mem::align_of::() - 8usize]; + ["Offset of field: NamedClockList::name"] + [::std::mem::offset_of!(NamedClockList, name) - 0usize]; + ["Offset of field: NamedClockList::clock"] + [::std::mem::offset_of!(NamedClockList, clock) - 8usize]; + ["Offset of field: NamedClockList::output"] + [::std::mem::offset_of!(NamedClockList, output) - 16usize]; + ["Offset of field: NamedClockList::alias"] + [::std::mem::offset_of!(NamedClockList, alias) - 17usize]; + ["Offset of field: NamedClockList::node"] + [::std::mem::offset_of!(NamedClockList, node) - 24usize]; +}; +impl Default for NamedClockList { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct MemReentrancyGuard { + pub engaged_in_io: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MemReentrancyGuard"][::std::mem::size_of::() - 1usize]; + ["Alignment of MemReentrancyGuard"][::std::mem::align_of::() - 1usize]; + ["Offset of field: MemReentrancyGuard::engaged_in_io"] + [::std::mem::offset_of!(MemReentrancyGuard, engaged_in_io) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NamedGPIOListHead { + pub lh_first: *mut NamedGPIOList, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of NamedGPIOListHead"][::std::mem::size_of::() - 8usize]; + ["Alignment of NamedGPIOListHead"][::std::mem::align_of::() - 8usize]; + ["Offset of field: NamedGPIOListHead::lh_first"] + [::std::mem::offset_of!(NamedGPIOListHead, lh_first) - 0usize]; +}; +impl Default for NamedGPIOListHead { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct NamedClockListHead { + pub lh_first: *mut NamedClockList, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of NamedClockListHead"][::std::mem::size_of::() - 8usize]; + ["Alignment of NamedClockListHead"][::std::mem::align_of::() - 8usize]; + ["Offset of field: NamedClockListHead::lh_first"] + [::std::mem::offset_of!(NamedClockListHead, lh_first) - 0usize]; +}; +impl Default for NamedClockListHead { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct BusStateHead { + pub lh_first: *mut BusState, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of BusStateHead"][::std::mem::size_of::() - 8usize]; + ["Alignment of BusStateHead"][::std::mem::align_of::() - 8usize]; + ["Offset of field: BusStateHead::lh_first"] + [::std::mem::offset_of!(BusStateHead, lh_first) - 0usize]; +}; +impl Default for BusStateHead { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[doc = " struct DeviceState - common device state, accessed with qdev helpers\n\n This structure should not be accessed directly. We declare it here\n so that it can be embedded in individual device state structures."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct DeviceState { + pub parent_obj: Object, + #[doc = " @id: global device id"] + pub id: *mut ::std::os::raw::c_char, + #[doc = " @canonical_path: canonical path of realized device in the QOM tree"] + pub canonical_path: *mut ::std::os::raw::c_char, + #[doc = " @realized: has device been realized?"] + pub realized: bool, + #[doc = " @pending_deleted_event: track pending deletion events during unplug"] + pub pending_deleted_event: bool, + #[doc = " @pending_deleted_expires_ms: optional timeout for deletion events"] + pub pending_deleted_expires_ms: i64, + #[doc = " @opts: QDict of options for the device"] + pub opts: *mut QDict, + #[doc = " @hotplugged: was device added after PHASE_MACHINE_READY?"] + pub hotplugged: ::std::os::raw::c_int, + #[doc = " @allow_unplug_during_migration: can device be unplugged during migration"] + pub allow_unplug_during_migration: bool, + #[doc = " @parent_bus: bus this device belongs to"] + pub parent_bus: *mut BusState, + #[doc = " @gpios: QLIST of named GPIOs the device provides."] + pub gpios: NamedGPIOListHead, + #[doc = " @clocks: QLIST of named clocks the device provides."] + pub clocks: NamedClockListHead, + #[doc = " @child_bus: QLIST of child buses"] + pub child_bus: BusStateHead, + #[doc = " @num_child_bus: number of @child_bus entries"] + pub num_child_bus: ::std::os::raw::c_int, + #[doc = " @instance_id_alias: device alias for handling legacy migration setups"] + pub instance_id_alias: ::std::os::raw::c_int, + #[doc = " @alias_required_for_version: indicates @instance_id_alias is\n needed for migration"] + pub alias_required_for_version: ::std::os::raw::c_int, + #[doc = " @reset: ResettableState for the device; handled by Resettable interface."] + pub reset: ResettableState, + #[doc = " @unplug_blockers: list of reasons to block unplugging of device"] + pub unplug_blockers: *mut GSList, + #[doc = " @mem_reentrancy_guard: Is the device currently in mmio/pio/dma?\n\n Used to prevent re-entrancy confusing things."] + pub mem_reentrancy_guard: MemReentrancyGuard, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of DeviceState"][::std::mem::size_of::() - 160usize]; + ["Alignment of DeviceState"][::std::mem::align_of::() - 8usize]; + ["Offset of field: DeviceState::parent_obj"] + [::std::mem::offset_of!(DeviceState, parent_obj) - 0usize]; + ["Offset of field: DeviceState::id"][::std::mem::offset_of!(DeviceState, id) - 40usize]; + ["Offset of field: DeviceState::canonical_path"] + [::std::mem::offset_of!(DeviceState, canonical_path) - 48usize]; + ["Offset of field: DeviceState::realized"] + [::std::mem::offset_of!(DeviceState, realized) - 56usize]; + ["Offset of field: DeviceState::pending_deleted_event"] + [::std::mem::offset_of!(DeviceState, pending_deleted_event) - 57usize]; + ["Offset of field: DeviceState::pending_deleted_expires_ms"] + [::std::mem::offset_of!(DeviceState, pending_deleted_expires_ms) - 64usize]; + ["Offset of field: DeviceState::opts"][::std::mem::offset_of!(DeviceState, opts) - 72usize]; + ["Offset of field: DeviceState::hotplugged"] + [::std::mem::offset_of!(DeviceState, hotplugged) - 80usize]; + ["Offset of field: DeviceState::allow_unplug_during_migration"] + [::std::mem::offset_of!(DeviceState, allow_unplug_during_migration) - 84usize]; + ["Offset of field: DeviceState::parent_bus"] + [::std::mem::offset_of!(DeviceState, parent_bus) - 88usize]; + ["Offset of field: DeviceState::gpios"][::std::mem::offset_of!(DeviceState, gpios) - 96usize]; + ["Offset of field: DeviceState::clocks"] + [::std::mem::offset_of!(DeviceState, clocks) - 104usize]; + ["Offset of field: DeviceState::child_bus"] + [::std::mem::offset_of!(DeviceState, child_bus) - 112usize]; + ["Offset of field: DeviceState::num_child_bus"] + [::std::mem::offset_of!(DeviceState, num_child_bus) - 120usize]; + ["Offset of field: DeviceState::instance_id_alias"] + [::std::mem::offset_of!(DeviceState, instance_id_alias) - 124usize]; + ["Offset of field: DeviceState::alias_required_for_version"] + [::std::mem::offset_of!(DeviceState, alias_required_for_version) - 128usize]; + ["Offset of field: DeviceState::reset"][::std::mem::offset_of!(DeviceState, reset) - 132usize]; + ["Offset of field: DeviceState::unplug_blockers"] + [::std::mem::offset_of!(DeviceState, unplug_blockers) - 144usize]; + ["Offset of field: DeviceState::mem_reentrancy_guard"] + [::std::mem::offset_of!(DeviceState, mem_reentrancy_guard) - 152usize]; +}; +impl Default for DeviceState { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct BusChild { + pub rcu: rcu_head, + pub child: *mut DeviceState, + pub index: ::std::os::raw::c_int, + pub sibling: BusChild__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union BusChild__bindgen_ty_1 { + pub tqe_next: *mut BusChild, + pub tqe_circ: QTailQLink, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of BusChild__bindgen_ty_1"][::std::mem::size_of::() - 16usize]; + ["Alignment of BusChild__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: BusChild__bindgen_ty_1::tqe_next"] + [::std::mem::offset_of!(BusChild__bindgen_ty_1, tqe_next) - 0usize]; + ["Offset of field: BusChild__bindgen_ty_1::tqe_circ"] + [::std::mem::offset_of!(BusChild__bindgen_ty_1, tqe_circ) - 0usize]; +}; +impl Default for BusChild__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for BusChild__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "BusChild__bindgen_ty_1 {{ union }}") + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of BusChild"][::std::mem::size_of::() - 48usize]; + ["Alignment of BusChild"][::std::mem::align_of::() - 8usize]; + ["Offset of field: BusChild::rcu"][::std::mem::offset_of!(BusChild, rcu) - 0usize]; + ["Offset of field: BusChild::child"][::std::mem::offset_of!(BusChild, child) - 16usize]; + ["Offset of field: BusChild::index"][::std::mem::offset_of!(BusChild, index) - 24usize]; + ["Offset of field: BusChild::sibling"][::std::mem::offset_of!(BusChild, sibling) - 32usize]; +}; +impl Default for BusChild { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for BusChild { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "BusChild {{ rcu: {:?}, child: {:?}, index: {:?}, sibling: {:?} }}", + self.rcu, self.child, self.index, self.sibling + ) + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union BusChildHead { + pub tqh_first: *mut BusChild, + pub tqh_circ: QTailQLink, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of BusChildHead"][::std::mem::size_of::() - 16usize]; + ["Alignment of BusChildHead"][::std::mem::align_of::() - 8usize]; + ["Offset of field: BusChildHead::tqh_first"] + [::std::mem::offset_of!(BusChildHead, tqh_first) - 0usize]; + ["Offset of field: BusChildHead::tqh_circ"] + [::std::mem::offset_of!(BusChildHead, tqh_circ) - 0usize]; +}; +impl Default for BusChildHead { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for BusChildHead { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "BusChildHead {{ union }}") + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct BusStateEntry { + pub le_next: *mut BusState, + pub le_prev: *mut *mut BusState, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of BusStateEntry"][::std::mem::size_of::() - 16usize]; + ["Alignment of BusStateEntry"][::std::mem::align_of::() - 8usize]; + ["Offset of field: BusStateEntry::le_next"] + [::std::mem::offset_of!(BusStateEntry, le_next) - 0usize]; + ["Offset of field: BusStateEntry::le_prev"] + [::std::mem::offset_of!(BusStateEntry, le_prev) - 8usize]; +}; +impl Default for BusStateEntry { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[doc = " struct BusState:\n @obj: parent object\n @parent: parent Device\n @name: name of bus\n @hotplug_handler: link to a hotplug handler associated with bus.\n @max_index: max number of child buses\n @realized: is the bus itself realized?\n @full: is the bus full?\n @num_children: current number of child buses"] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct BusState { + pub obj: Object, + pub parent: *mut DeviceState, + pub name: *mut ::std::os::raw::c_char, + pub hotplug_handler: *mut HotplugHandler, + pub max_index: ::std::os::raw::c_int, + pub realized: bool, + pub full: bool, + pub num_children: ::std::os::raw::c_int, + #[doc = " @children: an RCU protected QTAILQ, thus readers must use RCU\n to access it, and writers must hold the big qemu lock"] + pub children: BusChildHead, + #[doc = " @sibling: next bus"] + pub sibling: BusStateEntry, + #[doc = " @reset: ResettableState for the bus; handled by Resettable interface."] + pub reset: ResettableState, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of BusState"][::std::mem::size_of::() - 120usize]; + ["Alignment of BusState"][::std::mem::align_of::() - 8usize]; + ["Offset of field: BusState::obj"][::std::mem::offset_of!(BusState, obj) - 0usize]; + ["Offset of field: BusState::parent"][::std::mem::offset_of!(BusState, parent) - 40usize]; + ["Offset of field: BusState::name"][::std::mem::offset_of!(BusState, name) - 48usize]; + ["Offset of field: BusState::hotplug_handler"] + [::std::mem::offset_of!(BusState, hotplug_handler) - 56usize]; + ["Offset of field: BusState::max_index"][::std::mem::offset_of!(BusState, max_index) - 64usize]; + ["Offset of field: BusState::realized"][::std::mem::offset_of!(BusState, realized) - 68usize]; + ["Offset of field: BusState::full"][::std::mem::offset_of!(BusState, full) - 69usize]; + ["Offset of field: BusState::num_children"] + [::std::mem::offset_of!(BusState, num_children) - 72usize]; + ["Offset of field: BusState::children"][::std::mem::offset_of!(BusState, children) - 80usize]; + ["Offset of field: BusState::sibling"][::std::mem::offset_of!(BusState, sibling) - 96usize]; + ["Offset of field: BusState::reset"][::std::mem::offset_of!(BusState, reset) - 112usize]; +}; +impl Default for BusState { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for BusState { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "BusState {{ obj: {:?}, parent: {:?}, name: {:?}, hotplug_handler: {:?}, max_index: {:?}, realized: {:?}, full: {:?}, num_children: {:?}, children: {:?}, sibling: {:?}, reset: {:?} }}" , self . obj , self . parent , self . name , self . hotplug_handler , self . max_index , self . realized , self . full , self . num_children , self . children , self . sibling , self . reset) + } +} +pub type PTR = *mut ::std::os::raw::c_void; +pub type bfd_vma = u64; +pub type bfd_byte = u8; +pub const bfd_flavour_bfd_target_unknown_flavour: bfd_flavour = bfd_flavour(0); +pub const bfd_flavour_bfd_target_aout_flavour: bfd_flavour = bfd_flavour(1); +pub const bfd_flavour_bfd_target_coff_flavour: bfd_flavour = bfd_flavour(2); +pub const bfd_flavour_bfd_target_ecoff_flavour: bfd_flavour = bfd_flavour(3); +pub const bfd_flavour_bfd_target_elf_flavour: bfd_flavour = bfd_flavour(4); +pub const bfd_flavour_bfd_target_ieee_flavour: bfd_flavour = bfd_flavour(5); +pub const bfd_flavour_bfd_target_nlm_flavour: bfd_flavour = bfd_flavour(6); +pub const bfd_flavour_bfd_target_oasys_flavour: bfd_flavour = bfd_flavour(7); +pub const bfd_flavour_bfd_target_tekhex_flavour: bfd_flavour = bfd_flavour(8); +pub const bfd_flavour_bfd_target_srec_flavour: bfd_flavour = bfd_flavour(9); +pub const bfd_flavour_bfd_target_ihex_flavour: bfd_flavour = bfd_flavour(10); +pub const bfd_flavour_bfd_target_som_flavour: bfd_flavour = bfd_flavour(11); +pub const bfd_flavour_bfd_target_os9k_flavour: bfd_flavour = bfd_flavour(12); +pub const bfd_flavour_bfd_target_versados_flavour: bfd_flavour = bfd_flavour(13); +pub const bfd_flavour_bfd_target_msdos_flavour: bfd_flavour = bfd_flavour(14); +pub const bfd_flavour_bfd_target_evax_flavour: bfd_flavour = bfd_flavour(15); +impl ::std::ops::BitOr for bfd_flavour { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + bfd_flavour(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for bfd_flavour { + #[inline] + fn bitor_assign(&mut self, rhs: bfd_flavour) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for bfd_flavour { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + bfd_flavour(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for bfd_flavour { + #[inline] + fn bitand_assign(&mut self, rhs: bfd_flavour) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct bfd_flavour(pub ::std::os::raw::c_uint); +pub const bfd_endian_BFD_ENDIAN_BIG: bfd_endian = bfd_endian(0); +pub const bfd_endian_BFD_ENDIAN_LITTLE: bfd_endian = bfd_endian(1); +pub const bfd_endian_BFD_ENDIAN_UNKNOWN: bfd_endian = bfd_endian(2); +impl ::std::ops::BitOr for bfd_endian { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + bfd_endian(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for bfd_endian { + #[inline] + fn bitor_assign(&mut self, rhs: bfd_endian) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for bfd_endian { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + bfd_endian(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for bfd_endian { + #[inline] + fn bitand_assign(&mut self, rhs: bfd_endian) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct bfd_endian(pub ::std::os::raw::c_uint); +pub const bfd_architecture_bfd_arch_unknown: bfd_architecture = bfd_architecture(0); +pub const bfd_architecture_bfd_arch_obscure: bfd_architecture = bfd_architecture(1); +pub const bfd_architecture_bfd_arch_m68k: bfd_architecture = bfd_architecture(2); +pub const bfd_architecture_bfd_arch_vax: bfd_architecture = bfd_architecture(3); +pub const bfd_architecture_bfd_arch_i960: bfd_architecture = bfd_architecture(4); +pub const bfd_architecture_bfd_arch_a29k: bfd_architecture = bfd_architecture(5); +pub const bfd_architecture_bfd_arch_sparc: bfd_architecture = bfd_architecture(6); +pub const bfd_architecture_bfd_arch_mips: bfd_architecture = bfd_architecture(7); +pub const bfd_architecture_bfd_arch_i386: bfd_architecture = bfd_architecture(8); +pub const bfd_architecture_bfd_arch_we32k: bfd_architecture = bfd_architecture(9); +pub const bfd_architecture_bfd_arch_tahoe: bfd_architecture = bfd_architecture(10); +pub const bfd_architecture_bfd_arch_i860: bfd_architecture = bfd_architecture(11); +pub const bfd_architecture_bfd_arch_romp: bfd_architecture = bfd_architecture(12); +pub const bfd_architecture_bfd_arch_alliant: bfd_architecture = bfd_architecture(13); +pub const bfd_architecture_bfd_arch_convex: bfd_architecture = bfd_architecture(14); +pub const bfd_architecture_bfd_arch_m88k: bfd_architecture = bfd_architecture(15); +pub const bfd_architecture_bfd_arch_pyramid: bfd_architecture = bfd_architecture(16); +pub const bfd_architecture_bfd_arch_h8300: bfd_architecture = bfd_architecture(17); +pub const bfd_architecture_bfd_arch_powerpc: bfd_architecture = bfd_architecture(18); +pub const bfd_architecture_bfd_arch_rs6000: bfd_architecture = bfd_architecture(19); +pub const bfd_architecture_bfd_arch_hppa: bfd_architecture = bfd_architecture(20); +pub const bfd_architecture_bfd_arch_d10v: bfd_architecture = bfd_architecture(21); +pub const bfd_architecture_bfd_arch_z8k: bfd_architecture = bfd_architecture(22); +pub const bfd_architecture_bfd_arch_h8500: bfd_architecture = bfd_architecture(23); +pub const bfd_architecture_bfd_arch_sh: bfd_architecture = bfd_architecture(24); +pub const bfd_architecture_bfd_arch_alpha: bfd_architecture = bfd_architecture(25); +pub const bfd_architecture_bfd_arch_arm: bfd_architecture = bfd_architecture(26); +pub const bfd_architecture_bfd_arch_ns32k: bfd_architecture = bfd_architecture(27); +pub const bfd_architecture_bfd_arch_w65: bfd_architecture = bfd_architecture(28); +pub const bfd_architecture_bfd_arch_tic30: bfd_architecture = bfd_architecture(29); +pub const bfd_architecture_bfd_arch_v850: bfd_architecture = bfd_architecture(30); +pub const bfd_architecture_bfd_arch_arc: bfd_architecture = bfd_architecture(31); +pub const bfd_architecture_bfd_arch_m32r: bfd_architecture = bfd_architecture(32); +pub const bfd_architecture_bfd_arch_mn10200: bfd_architecture = bfd_architecture(33); +pub const bfd_architecture_bfd_arch_mn10300: bfd_architecture = bfd_architecture(34); +pub const bfd_architecture_bfd_arch_avr: bfd_architecture = bfd_architecture(35); +pub const bfd_architecture_bfd_arch_cris: bfd_architecture = bfd_architecture(36); +pub const bfd_architecture_bfd_arch_microblaze: bfd_architecture = bfd_architecture(37); +pub const bfd_architecture_bfd_arch_moxie: bfd_architecture = bfd_architecture(38); +pub const bfd_architecture_bfd_arch_ia64: bfd_architecture = bfd_architecture(39); +pub const bfd_architecture_bfd_arch_nios2: bfd_architecture = bfd_architecture(40); +pub const bfd_architecture_bfd_arch_rx: bfd_architecture = bfd_architecture(41); +pub const bfd_architecture_bfd_arch_loongarch: bfd_architecture = bfd_architecture(42); +pub const bfd_architecture_bfd_arch_last: bfd_architecture = bfd_architecture(43); +impl ::std::ops::BitOr for bfd_architecture { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + bfd_architecture(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for bfd_architecture { + #[inline] + fn bitor_assign(&mut self, rhs: bfd_architecture) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for bfd_architecture { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + bfd_architecture(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for bfd_architecture { + #[inline] + fn bitand_assign(&mut self, rhs: bfd_architecture) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct bfd_architecture(pub ::std::os::raw::c_uint); +#[repr(C)] +#[derive(Copy, Clone)] +pub struct symbol_cache_entry { + pub name: *const ::std::os::raw::c_char, + pub udata: symbol_cache_entry__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union symbol_cache_entry__bindgen_ty_1 { + pub p: PTR, + pub i: bfd_vma, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of symbol_cache_entry__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of symbol_cache_entry__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: symbol_cache_entry__bindgen_ty_1::p"] + [::std::mem::offset_of!(symbol_cache_entry__bindgen_ty_1, p) - 0usize]; + ["Offset of field: symbol_cache_entry__bindgen_ty_1::i"] + [::std::mem::offset_of!(symbol_cache_entry__bindgen_ty_1, i) - 0usize]; +}; +impl Default for symbol_cache_entry__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for symbol_cache_entry__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "symbol_cache_entry__bindgen_ty_1 {{ union }}") + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of symbol_cache_entry"][::std::mem::size_of::() - 16usize]; + ["Alignment of symbol_cache_entry"][::std::mem::align_of::() - 8usize]; + ["Offset of field: symbol_cache_entry::name"] + [::std::mem::offset_of!(symbol_cache_entry, name) - 0usize]; + ["Offset of field: symbol_cache_entry::udata"] + [::std::mem::offset_of!(symbol_cache_entry, udata) - 8usize]; +}; +impl Default for symbol_cache_entry { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for symbol_cache_entry { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "symbol_cache_entry {{ name: {:?}, udata: {:?} }}", + self.name, self.udata + ) + } +} +pub type asymbol = symbol_cache_entry; +pub type fprintf_function = ::std::option::Option< + unsafe extern "C" fn( + f: *mut FILE, + fmt: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int, +>; +pub const dis_insn_type_dis_noninsn: dis_insn_type = dis_insn_type(0); +pub const dis_insn_type_dis_nonbranch: dis_insn_type = dis_insn_type(1); +pub const dis_insn_type_dis_branch: dis_insn_type = dis_insn_type(2); +pub const dis_insn_type_dis_condbranch: dis_insn_type = dis_insn_type(3); +pub const dis_insn_type_dis_jsr: dis_insn_type = dis_insn_type(4); +pub const dis_insn_type_dis_condjsr: dis_insn_type = dis_insn_type(5); +pub const dis_insn_type_dis_dref: dis_insn_type = dis_insn_type(6); +pub const dis_insn_type_dis_dref2: dis_insn_type = dis_insn_type(7); +impl ::std::ops::BitOr for dis_insn_type { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + dis_insn_type(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for dis_insn_type { + #[inline] + fn bitor_assign(&mut self, rhs: dis_insn_type) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for dis_insn_type { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + dis_insn_type(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for dis_insn_type { + #[inline] + fn bitand_assign(&mut self, rhs: dis_insn_type) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct dis_insn_type(pub ::std::os::raw::c_uint); +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct disassemble_info { + pub fprintf_func: fprintf_function, + pub stream: *mut FILE, + pub application_data: PTR, + pub flavour: bfd_flavour, + pub arch: bfd_architecture, + pub mach: ::std::os::raw::c_ulong, + pub endian: bfd_endian, + pub symbols: *mut *mut asymbol, + pub num_symbols: ::std::os::raw::c_int, + pub flags: ::std::os::raw::c_ulong, + pub private_data: PTR, + pub read_memory_func: ::std::option::Option< + unsafe extern "C" fn( + memaddr: bfd_vma, + myaddr: *mut bfd_byte, + length: ::std::os::raw::c_int, + info: *mut disassemble_info, + ) -> ::std::os::raw::c_int, + >, + pub memory_error_func: ::std::option::Option< + unsafe extern "C" fn( + status: ::std::os::raw::c_int, + memaddr: bfd_vma, + info: *mut disassemble_info, + ), + >, + pub print_address_func: + ::std::option::Option, + pub print_insn: ::std::option::Option< + unsafe extern "C" fn(addr: bfd_vma, info: *mut disassemble_info) -> ::std::os::raw::c_int, + >, + pub symbol_at_address_func: ::std::option::Option< + unsafe extern "C" fn(addr: bfd_vma, info: *mut disassemble_info) -> ::std::os::raw::c_int, + >, + pub buffer: *const bfd_byte, + pub buffer_vma: bfd_vma, + pub buffer_length: ::std::os::raw::c_int, + pub bytes_per_line: ::std::os::raw::c_int, + pub bytes_per_chunk: ::std::os::raw::c_int, + pub display_endian: bfd_endian, + pub insn_info_valid: ::std::os::raw::c_char, + pub branch_delay_insns: ::std::os::raw::c_char, + pub data_size: ::std::os::raw::c_char, + pub insn_type: dis_insn_type, + pub target: bfd_vma, + pub target2: bfd_vma, + pub disassembler_options: *mut ::std::os::raw::c_char, + pub show_opcodes: bool, + pub target_info: *mut ::std::os::raw::c_void, + pub cap_arch: ::std::os::raw::c_int, + pub cap_mode: ::std::os::raw::c_int, + pub cap_insn_unit: ::std::os::raw::c_int, + pub cap_insn_split: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of disassemble_info"][::std::mem::size_of::() - 216usize]; + ["Alignment of disassemble_info"][::std::mem::align_of::() - 8usize]; + ["Offset of field: disassemble_info::fprintf_func"] + [::std::mem::offset_of!(disassemble_info, fprintf_func) - 0usize]; + ["Offset of field: disassemble_info::stream"] + [::std::mem::offset_of!(disassemble_info, stream) - 8usize]; + ["Offset of field: disassemble_info::application_data"] + [::std::mem::offset_of!(disassemble_info, application_data) - 16usize]; + ["Offset of field: disassemble_info::flavour"] + [::std::mem::offset_of!(disassemble_info, flavour) - 24usize]; + ["Offset of field: disassemble_info::arch"] + [::std::mem::offset_of!(disassemble_info, arch) - 28usize]; + ["Offset of field: disassemble_info::mach"] + [::std::mem::offset_of!(disassemble_info, mach) - 32usize]; + ["Offset of field: disassemble_info::endian"] + [::std::mem::offset_of!(disassemble_info, endian) - 40usize]; + ["Offset of field: disassemble_info::symbols"] + [::std::mem::offset_of!(disassemble_info, symbols) - 48usize]; + ["Offset of field: disassemble_info::num_symbols"] + [::std::mem::offset_of!(disassemble_info, num_symbols) - 56usize]; + ["Offset of field: disassemble_info::flags"] + [::std::mem::offset_of!(disassemble_info, flags) - 64usize]; + ["Offset of field: disassemble_info::private_data"] + [::std::mem::offset_of!(disassemble_info, private_data) - 72usize]; + ["Offset of field: disassemble_info::read_memory_func"] + [::std::mem::offset_of!(disassemble_info, read_memory_func) - 80usize]; + ["Offset of field: disassemble_info::memory_error_func"] + [::std::mem::offset_of!(disassemble_info, memory_error_func) - 88usize]; + ["Offset of field: disassemble_info::print_address_func"] + [::std::mem::offset_of!(disassemble_info, print_address_func) - 96usize]; + ["Offset of field: disassemble_info::print_insn"] + [::std::mem::offset_of!(disassemble_info, print_insn) - 104usize]; + ["Offset of field: disassemble_info::symbol_at_address_func"] + [::std::mem::offset_of!(disassemble_info, symbol_at_address_func) - 112usize]; + ["Offset of field: disassemble_info::buffer"] + [::std::mem::offset_of!(disassemble_info, buffer) - 120usize]; + ["Offset of field: disassemble_info::buffer_vma"] + [::std::mem::offset_of!(disassemble_info, buffer_vma) - 128usize]; + ["Offset of field: disassemble_info::buffer_length"] + [::std::mem::offset_of!(disassemble_info, buffer_length) - 136usize]; + ["Offset of field: disassemble_info::bytes_per_line"] + [::std::mem::offset_of!(disassemble_info, bytes_per_line) - 140usize]; + ["Offset of field: disassemble_info::bytes_per_chunk"] + [::std::mem::offset_of!(disassemble_info, bytes_per_chunk) - 144usize]; + ["Offset of field: disassemble_info::display_endian"] + [::std::mem::offset_of!(disassemble_info, display_endian) - 148usize]; + ["Offset of field: disassemble_info::insn_info_valid"] + [::std::mem::offset_of!(disassemble_info, insn_info_valid) - 152usize]; + ["Offset of field: disassemble_info::branch_delay_insns"] + [::std::mem::offset_of!(disassemble_info, branch_delay_insns) - 153usize]; + ["Offset of field: disassemble_info::data_size"] + [::std::mem::offset_of!(disassemble_info, data_size) - 154usize]; + ["Offset of field: disassemble_info::insn_type"] + [::std::mem::offset_of!(disassemble_info, insn_type) - 156usize]; + ["Offset of field: disassemble_info::target"] + [::std::mem::offset_of!(disassemble_info, target) - 160usize]; + ["Offset of field: disassemble_info::target2"] + [::std::mem::offset_of!(disassemble_info, target2) - 168usize]; + ["Offset of field: disassemble_info::disassembler_options"] + [::std::mem::offset_of!(disassemble_info, disassembler_options) - 176usize]; + ["Offset of field: disassemble_info::show_opcodes"] + [::std::mem::offset_of!(disassemble_info, show_opcodes) - 184usize]; + ["Offset of field: disassemble_info::target_info"] + [::std::mem::offset_of!(disassemble_info, target_info) - 192usize]; + ["Offset of field: disassemble_info::cap_arch"] + [::std::mem::offset_of!(disassemble_info, cap_arch) - 200usize]; + ["Offset of field: disassemble_info::cap_mode"] + [::std::mem::offset_of!(disassemble_info, cap_mode) - 204usize]; + ["Offset of field: disassemble_info::cap_insn_unit"] + [::std::mem::offset_of!(disassemble_info, cap_insn_unit) - 208usize]; + ["Offset of field: disassemble_info::cap_insn_split"] + [::std::mem::offset_of!(disassemble_info, cap_insn_split) - 212usize]; +}; +impl Default for disassemble_info { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type hwaddr = u64; +#[doc = " vaddr:\n Type wide enough to contain any #target_ulong virtual address."] +pub type vaddr = u64; +#[repr(C)] +#[derive(Copy, Clone)] +pub union CPUTLBEntry { + pub __bindgen_anon_1: CPUTLBEntry__bindgen_ty_1, + pub addr_idx: [u64; 4usize], +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CPUTLBEntry__bindgen_ty_1 { + pub addr_read: u64, + pub addr_write: u64, + pub addr_code: u64, + pub addend: usize, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUTLBEntry__bindgen_ty_1"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of CPUTLBEntry__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUTLBEntry__bindgen_ty_1::addr_read"] + [::std::mem::offset_of!(CPUTLBEntry__bindgen_ty_1, addr_read) - 0usize]; + ["Offset of field: CPUTLBEntry__bindgen_ty_1::addr_write"] + [::std::mem::offset_of!(CPUTLBEntry__bindgen_ty_1, addr_write) - 8usize]; + ["Offset of field: CPUTLBEntry__bindgen_ty_1::addr_code"] + [::std::mem::offset_of!(CPUTLBEntry__bindgen_ty_1, addr_code) - 16usize]; + ["Offset of field: CPUTLBEntry__bindgen_ty_1::addend"] + [::std::mem::offset_of!(CPUTLBEntry__bindgen_ty_1, addend) - 24usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUTLBEntry"][::std::mem::size_of::() - 32usize]; + ["Alignment of CPUTLBEntry"][::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUTLBEntry::addr_idx"] + [::std::mem::offset_of!(CPUTLBEntry, addr_idx) - 0usize]; +}; +impl Default for CPUTLBEntry { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUTLBEntry { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "CPUTLBEntry {{ union }}") + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CPUTLBDescFast { + pub mask: usize, + pub table: *mut CPUTLBEntry, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUTLBDescFast"][::std::mem::size_of::() - 16usize]; + ["Alignment of CPUTLBDescFast"][::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUTLBDescFast::mask"] + [::std::mem::offset_of!(CPUTLBDescFast, mask) - 0usize]; + ["Offset of field: CPUTLBDescFast::table"] + [::std::mem::offset_of!(CPUTLBDescFast, table) - 8usize]; +}; +impl Default for CPUTLBDescFast { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const ShutdownCause_SHUTDOWN_CAUSE_NONE: ShutdownCause = ShutdownCause(0); +pub const ShutdownCause_SHUTDOWN_CAUSE_HOST_ERROR: ShutdownCause = ShutdownCause(1); +pub const ShutdownCause_SHUTDOWN_CAUSE_HOST_QMP_QUIT: ShutdownCause = ShutdownCause(2); +pub const ShutdownCause_SHUTDOWN_CAUSE_HOST_QMP_SYSTEM_RESET: ShutdownCause = ShutdownCause(3); +pub const ShutdownCause_SHUTDOWN_CAUSE_HOST_SIGNAL: ShutdownCause = ShutdownCause(4); +pub const ShutdownCause_SHUTDOWN_CAUSE_HOST_UI: ShutdownCause = ShutdownCause(5); +pub const ShutdownCause_SHUTDOWN_CAUSE_GUEST_SHUTDOWN: ShutdownCause = ShutdownCause(6); +pub const ShutdownCause_SHUTDOWN_CAUSE_GUEST_RESET: ShutdownCause = ShutdownCause(7); +pub const ShutdownCause_SHUTDOWN_CAUSE_GUEST_PANIC: ShutdownCause = ShutdownCause(8); +pub const ShutdownCause_SHUTDOWN_CAUSE_SUBSYSTEM_RESET: ShutdownCause = ShutdownCause(9); +pub const ShutdownCause_SHUTDOWN_CAUSE_SNAPSHOT_LOAD: ShutdownCause = ShutdownCause(10); +pub const ShutdownCause_SHUTDOWN_CAUSE__MAX: ShutdownCause = ShutdownCause(11); +impl ::std::ops::BitOr for ShutdownCause { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + ShutdownCause(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for ShutdownCause { + #[inline] + fn bitor_assign(&mut self, rhs: ShutdownCause) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for ShutdownCause { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + ShutdownCause(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for ShutdownCause { + #[inline] + fn bitand_assign(&mut self, rhs: ShutdownCause) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct ShutdownCause(pub ::std::os::raw::c_uint); +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct SysemuCPUOps { + _unused: [u8; 0], +} +#[doc = " CPUClass:\n @class_by_name: Callback to map -cpu command line model name to an\n instantiatable CPU type.\n @parse_features: Callback to parse command line arguments.\n @reset_dump_flags: #CPUDumpFlags to use for reset logging.\n @has_work: Callback for checking if there is work to do.\n @mmu_index: Callback for choosing softmmu mmu index;\n may be used internally by memory_rw_debug without TCG.\n @memory_rw_debug: Callback for GDB memory access.\n @dump_state: Callback for dumping state.\n @query_cpu_fast:\n Fill in target specific information for the \"query-cpus-fast\"\n QAPI call.\n @get_arch_id: Callback for getting architecture-dependent CPU ID.\n @set_pc: Callback for setting the Program Counter register. This\n should have the semantics used by the target architecture when\n setting the PC from a source such as an ELF file entry point;\n for example on Arm it will also set the Thumb mode bit based\n on the least significant bit of the new PC value.\n If the target behaviour here is anything other than \"set\n the PC register to the value passed in\" then the target must\n also implement the synchronize_from_tb hook.\n @get_pc: Callback for getting the Program Counter register.\n As above, with the semantics of the target architecture.\n @gdb_read_register: Callback for letting GDB read a register.\n @gdb_write_register: Callback for letting GDB write a register.\n @gdb_adjust_breakpoint: Callback for adjusting the address of a\n breakpoint. Used by AVR to handle a gdb mis-feature with\n its Harvard architecture split code and data.\n @gdb_num_core_regs: Number of core registers accessible to GDB or 0 to infer\n from @gdb_core_xml_file.\n @gdb_core_xml_file: File name for core registers GDB XML description.\n @gdb_stop_before_watchpoint: Indicates whether GDB expects the CPU to stop\n before the insn which triggers a watchpoint rather than after it.\n @gdb_arch_name: Optional callback that returns the architecture name known\n to GDB. The caller must free the returned string with g_free.\n @disas_set_info: Setup architecture specific components of disassembly info\n @adjust_watchpoint_address: Perform a target-specific adjustment to an\n address before attempting to match it against watchpoints.\n @deprecation_note: If this CPUClass is deprecated, this field provides\n related information.\n\n Represents a CPU family or model."] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CPUClass { + pub parent_class: DeviceClass, + pub class_by_name: ::std::option::Option< + unsafe extern "C" fn(cpu_model: *const ::std::os::raw::c_char) -> *mut ObjectClass, + >, + pub parse_features: ::std::option::Option< + unsafe extern "C" fn( + typename: *const ::std::os::raw::c_char, + str_: *mut ::std::os::raw::c_char, + errp: *mut *mut Error, + ), + >, + pub has_work: ::std::option::Option bool>, + pub mmu_index: ::std::option::Option< + unsafe extern "C" fn(cpu: *mut CPUState, ifetch: bool) -> ::std::os::raw::c_int, + >, + pub memory_rw_debug: ::std::option::Option< + unsafe extern "C" fn( + cpu: *mut CPUState, + addr: vaddr, + buf: *mut u8, + len: ::std::os::raw::c_int, + is_write: bool, + ) -> ::std::os::raw::c_int, + >, + pub dump_state: ::std::option::Option< + unsafe extern "C" fn(cpu: *mut CPUState, arg1: *mut FILE, flags: ::std::os::raw::c_int), + >, + pub query_cpu_fast: + ::std::option::Option, + pub get_arch_id: ::std::option::Option i64>, + pub set_pc: ::std::option::Option, + pub get_pc: ::std::option::Option vaddr>, + pub gdb_read_register: ::std::option::Option< + unsafe extern "C" fn( + cpu: *mut CPUState, + buf: *mut GByteArray, + reg: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + pub gdb_write_register: ::std::option::Option< + unsafe extern "C" fn( + cpu: *mut CPUState, + buf: *mut u8, + reg: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + pub gdb_adjust_breakpoint: + ::std::option::Option vaddr>, + pub gdb_core_xml_file: *const ::std::os::raw::c_char, + pub gdb_arch_name: + ::std::option::Option *const gchar>, + pub disas_set_info: ::std::option::Option< + unsafe extern "C" fn(cpu: *mut CPUState, info: *mut disassemble_info), + >, + pub deprecation_note: *const ::std::os::raw::c_char, + pub accel_cpu: *mut AccelCPUClass, + pub sysemu_ops: *const SysemuCPUOps, + pub tcg_ops: *const TCGCPUOps, + pub init_accel_cpu: ::std::option::Option< + unsafe extern "C" fn(accel_cpu: *mut AccelCPUClass, cc: *mut CPUClass), + >, + pub reset_dump_flags: ::std::os::raw::c_int, + pub gdb_num_core_regs: ::std::os::raw::c_int, + pub gdb_stop_before_watchpoint: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUClass"][::std::mem::size_of::() - 360usize]; + ["Alignment of CPUClass"][::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUClass::parent_class"] + [::std::mem::offset_of!(CPUClass, parent_class) - 0usize]; + ["Offset of field: CPUClass::class_by_name"] + [::std::mem::offset_of!(CPUClass, class_by_name) - 176usize]; + ["Offset of field: CPUClass::parse_features"] + [::std::mem::offset_of!(CPUClass, parse_features) - 184usize]; + ["Offset of field: CPUClass::has_work"][::std::mem::offset_of!(CPUClass, has_work) - 192usize]; + ["Offset of field: CPUClass::mmu_index"] + [::std::mem::offset_of!(CPUClass, mmu_index) - 200usize]; + ["Offset of field: CPUClass::memory_rw_debug"] + [::std::mem::offset_of!(CPUClass, memory_rw_debug) - 208usize]; + ["Offset of field: CPUClass::dump_state"] + [::std::mem::offset_of!(CPUClass, dump_state) - 216usize]; + ["Offset of field: CPUClass::query_cpu_fast"] + [::std::mem::offset_of!(CPUClass, query_cpu_fast) - 224usize]; + ["Offset of field: CPUClass::get_arch_id"] + [::std::mem::offset_of!(CPUClass, get_arch_id) - 232usize]; + ["Offset of field: CPUClass::set_pc"][::std::mem::offset_of!(CPUClass, set_pc) - 240usize]; + ["Offset of field: CPUClass::get_pc"][::std::mem::offset_of!(CPUClass, get_pc) - 248usize]; + ["Offset of field: CPUClass::gdb_read_register"] + [::std::mem::offset_of!(CPUClass, gdb_read_register) - 256usize]; + ["Offset of field: CPUClass::gdb_write_register"] + [::std::mem::offset_of!(CPUClass, gdb_write_register) - 264usize]; + ["Offset of field: CPUClass::gdb_adjust_breakpoint"] + [::std::mem::offset_of!(CPUClass, gdb_adjust_breakpoint) - 272usize]; + ["Offset of field: CPUClass::gdb_core_xml_file"] + [::std::mem::offset_of!(CPUClass, gdb_core_xml_file) - 280usize]; + ["Offset of field: CPUClass::gdb_arch_name"] + [::std::mem::offset_of!(CPUClass, gdb_arch_name) - 288usize]; + ["Offset of field: CPUClass::disas_set_info"] + [::std::mem::offset_of!(CPUClass, disas_set_info) - 296usize]; + ["Offset of field: CPUClass::deprecation_note"] + [::std::mem::offset_of!(CPUClass, deprecation_note) - 304usize]; + ["Offset of field: CPUClass::accel_cpu"] + [::std::mem::offset_of!(CPUClass, accel_cpu) - 312usize]; + ["Offset of field: CPUClass::sysemu_ops"] + [::std::mem::offset_of!(CPUClass, sysemu_ops) - 320usize]; + ["Offset of field: CPUClass::tcg_ops"][::std::mem::offset_of!(CPUClass, tcg_ops) - 328usize]; + ["Offset of field: CPUClass::init_accel_cpu"] + [::std::mem::offset_of!(CPUClass, init_accel_cpu) - 336usize]; + ["Offset of field: CPUClass::reset_dump_flags"] + [::std::mem::offset_of!(CPUClass, reset_dump_flags) - 344usize]; + ["Offset of field: CPUClass::gdb_num_core_regs"] + [::std::mem::offset_of!(CPUClass, gdb_num_core_regs) - 348usize]; + ["Offset of field: CPUClass::gdb_stop_before_watchpoint"] + [::std::mem::offset_of!(CPUClass, gdb_stop_before_watchpoint) - 352usize]; +}; +impl Default for CPUClass { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct CPUTLBEntryFull { + pub xlat_section: hwaddr, + pub phys_addr: hwaddr, + pub attrs: MemTxAttrs, + pub prot: u8, + pub lg_page_size: u8, + pub tlb_fill_flags: u8, + pub slow_flags: [u8; 3usize], + pub extra: CPUTLBEntryFull__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union CPUTLBEntryFull__bindgen_ty_1 { + pub arm: CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1 { + pub pte_attrs: u8, + pub shareability: u8, + pub guarded: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 3usize]; + ["Alignment of CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1::pte_attrs"] + [::std::mem::offset_of!(CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1, pte_attrs) - 0usize]; + ["Offset of field: CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1::shareability"][::std::mem::offset_of!( + CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1, + shareability + ) - 1usize]; + ["Offset of field: CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1::guarded"] + [::std::mem::offset_of!(CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1, guarded) - 2usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUTLBEntryFull__bindgen_ty_1"] + [::std::mem::size_of::() - 3usize]; + ["Alignment of CPUTLBEntryFull__bindgen_ty_1"] + [::std::mem::align_of::() - 1usize]; + ["Offset of field: CPUTLBEntryFull__bindgen_ty_1::arm"] + [::std::mem::offset_of!(CPUTLBEntryFull__bindgen_ty_1, arm) - 0usize]; +}; +impl Default for CPUTLBEntryFull__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUTLBEntryFull__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "CPUTLBEntryFull__bindgen_ty_1 {{ union }}") + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUTLBEntryFull"][::std::mem::size_of::() - 32usize]; + ["Alignment of CPUTLBEntryFull"][::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUTLBEntryFull::xlat_section"] + [::std::mem::offset_of!(CPUTLBEntryFull, xlat_section) - 0usize]; + ["Offset of field: CPUTLBEntryFull::phys_addr"] + [::std::mem::offset_of!(CPUTLBEntryFull, phys_addr) - 8usize]; + ["Offset of field: CPUTLBEntryFull::attrs"] + [::std::mem::offset_of!(CPUTLBEntryFull, attrs) - 16usize]; + ["Offset of field: CPUTLBEntryFull::prot"] + [::std::mem::offset_of!(CPUTLBEntryFull, prot) - 20usize]; + ["Offset of field: CPUTLBEntryFull::lg_page_size"] + [::std::mem::offset_of!(CPUTLBEntryFull, lg_page_size) - 21usize]; + ["Offset of field: CPUTLBEntryFull::tlb_fill_flags"] + [::std::mem::offset_of!(CPUTLBEntryFull, tlb_fill_flags) - 22usize]; + ["Offset of field: CPUTLBEntryFull::slow_flags"] + [::std::mem::offset_of!(CPUTLBEntryFull, slow_flags) - 23usize]; + ["Offset of field: CPUTLBEntryFull::extra"] + [::std::mem::offset_of!(CPUTLBEntryFull, extra) - 26usize]; +}; +impl Default for CPUTLBEntryFull { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUTLBEntryFull { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "CPUTLBEntryFull {{ attrs: {:?}, slow_flags: {:?}, extra: {:?} }}", + self.attrs, self.slow_flags, self.extra + ) + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct CPUTLBDesc { + pub large_page_addr: vaddr, + pub large_page_mask: vaddr, + pub window_begin_ns: i64, + pub window_max_entries: usize, + pub n_used_entries: usize, + pub vindex: usize, + pub vtable: [CPUTLBEntry; 8usize], + pub vfulltlb: [CPUTLBEntryFull; 8usize], + pub fulltlb: *mut CPUTLBEntryFull, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUTLBDesc"][::std::mem::size_of::() - 568usize]; + ["Alignment of CPUTLBDesc"][::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUTLBDesc::large_page_addr"] + [::std::mem::offset_of!(CPUTLBDesc, large_page_addr) - 0usize]; + ["Offset of field: CPUTLBDesc::large_page_mask"] + [::std::mem::offset_of!(CPUTLBDesc, large_page_mask) - 8usize]; + ["Offset of field: CPUTLBDesc::window_begin_ns"] + [::std::mem::offset_of!(CPUTLBDesc, window_begin_ns) - 16usize]; + ["Offset of field: CPUTLBDesc::window_max_entries"] + [::std::mem::offset_of!(CPUTLBDesc, window_max_entries) - 24usize]; + ["Offset of field: CPUTLBDesc::n_used_entries"] + [::std::mem::offset_of!(CPUTLBDesc, n_used_entries) - 32usize]; + ["Offset of field: CPUTLBDesc::vindex"][::std::mem::offset_of!(CPUTLBDesc, vindex) - 40usize]; + ["Offset of field: CPUTLBDesc::vtable"][::std::mem::offset_of!(CPUTLBDesc, vtable) - 48usize]; + ["Offset of field: CPUTLBDesc::vfulltlb"] + [::std::mem::offset_of!(CPUTLBDesc, vfulltlb) - 304usize]; + ["Offset of field: CPUTLBDesc::fulltlb"] + [::std::mem::offset_of!(CPUTLBDesc, fulltlb) - 560usize]; +}; +impl Default for CPUTLBDesc { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUTLBDesc { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "CPUTLBDesc {{ vtable: {:?}, vfulltlb: {:?}, fulltlb: {:?} }}", + self.vtable, self.vfulltlb, self.fulltlb + ) + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CPUTLBCommon { + pub lock: QemuSpin, + pub dirty: u16, + pub full_flush_count: usize, + pub part_flush_count: usize, + pub elide_flush_count: usize, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUTLBCommon"][::std::mem::size_of::() - 32usize]; + ["Alignment of CPUTLBCommon"][::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUTLBCommon::lock"][::std::mem::offset_of!(CPUTLBCommon, lock) - 0usize]; + ["Offset of field: CPUTLBCommon::dirty"][::std::mem::offset_of!(CPUTLBCommon, dirty) - 4usize]; + ["Offset of field: CPUTLBCommon::full_flush_count"] + [::std::mem::offset_of!(CPUTLBCommon, full_flush_count) - 8usize]; + ["Offset of field: CPUTLBCommon::part_flush_count"] + [::std::mem::offset_of!(CPUTLBCommon, part_flush_count) - 16usize]; + ["Offset of field: CPUTLBCommon::elide_flush_count"] + [::std::mem::offset_of!(CPUTLBCommon, elide_flush_count) - 24usize]; +}; +#[repr(C)] +#[repr(align(16))] +#[derive(Copy, Clone)] +pub struct CPUTLB { + pub c: CPUTLBCommon, + pub d: [CPUTLBDesc; 16usize], + pub f: [CPUTLBDescFast; 16usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUTLB"][::std::mem::size_of::() - 9376usize]; + ["Alignment of CPUTLB"][::std::mem::align_of::() - 16usize]; + ["Offset of field: CPUTLB::c"][::std::mem::offset_of!(CPUTLB, c) - 0usize]; + ["Offset of field: CPUTLB::d"][::std::mem::offset_of!(CPUTLB, d) - 32usize]; + ["Offset of field: CPUTLB::f"][::std::mem::offset_of!(CPUTLB, f) - 9120usize]; +}; +impl Default for CPUTLB { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUTLB { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "CPUTLB {{ c: {:?}, d: {:?}, f: {:?} }}", + self.c, self.d, self.f + ) + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union IcountDecr { + pub u32_: u32, + pub u16_: IcountDecr__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct IcountDecr__bindgen_ty_1 { + pub low: u16, + pub high: u16, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of IcountDecr__bindgen_ty_1"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of IcountDecr__bindgen_ty_1"] + [::std::mem::align_of::() - 2usize]; + ["Offset of field: IcountDecr__bindgen_ty_1::low"] + [::std::mem::offset_of!(IcountDecr__bindgen_ty_1, low) - 0usize]; + ["Offset of field: IcountDecr__bindgen_ty_1::high"] + [::std::mem::offset_of!(IcountDecr__bindgen_ty_1, high) - 2usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of IcountDecr"][::std::mem::size_of::() - 4usize]; + ["Alignment of IcountDecr"][::std::mem::align_of::() - 4usize]; + ["Offset of field: IcountDecr::u32_"][::std::mem::offset_of!(IcountDecr, u32_) - 0usize]; + ["Offset of field: IcountDecr::u16_"][::std::mem::offset_of!(IcountDecr, u16_) - 0usize]; +}; +impl Default for IcountDecr { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for IcountDecr { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "IcountDecr {{ union }}") + } +} +#[repr(C)] +#[repr(align(16))] +#[derive(Copy, Clone)] +pub struct CPUNegativeOffsetState { + pub tlb: CPUTLB, + pub icount_decr: IcountDecr, + pub can_do_io: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUNegativeOffsetState"][::std::mem::size_of::() - 9392usize]; + ["Alignment of CPUNegativeOffsetState"] + [::std::mem::align_of::() - 16usize]; + ["Offset of field: CPUNegativeOffsetState::tlb"] + [::std::mem::offset_of!(CPUNegativeOffsetState, tlb) - 0usize]; + ["Offset of field: CPUNegativeOffsetState::icount_decr"] + [::std::mem::offset_of!(CPUNegativeOffsetState, icount_decr) - 9376usize]; + ["Offset of field: CPUNegativeOffsetState::can_do_io"] + [::std::mem::offset_of!(CPUNegativeOffsetState, can_do_io) - 9380usize]; +}; +impl Default for CPUNegativeOffsetState { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUNegativeOffsetState { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "CPUNegativeOffsetState {{ tlb: {:?}, icount_decr: {:?}, can_do_io: {:?} }}", + self.tlb, self.icount_decr, self.can_do_io + ) + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct CPUBreakpoint { + pub pc: vaddr, + pub flags: ::std::os::raw::c_int, + pub entry: CPUBreakpoint__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union CPUBreakpoint__bindgen_ty_1 { + pub tqe_next: *mut CPUBreakpoint, + pub tqe_circ: QTailQLink, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUBreakpoint__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of CPUBreakpoint__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUBreakpoint__bindgen_ty_1::tqe_next"] + [::std::mem::offset_of!(CPUBreakpoint__bindgen_ty_1, tqe_next) - 0usize]; + ["Offset of field: CPUBreakpoint__bindgen_ty_1::tqe_circ"] + [::std::mem::offset_of!(CPUBreakpoint__bindgen_ty_1, tqe_circ) - 0usize]; +}; +impl Default for CPUBreakpoint__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUBreakpoint__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "CPUBreakpoint__bindgen_ty_1 {{ union }}") + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUBreakpoint"][::std::mem::size_of::() - 32usize]; + ["Alignment of CPUBreakpoint"][::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUBreakpoint::pc"][::std::mem::offset_of!(CPUBreakpoint, pc) - 0usize]; + ["Offset of field: CPUBreakpoint::flags"] + [::std::mem::offset_of!(CPUBreakpoint, flags) - 8usize]; + ["Offset of field: CPUBreakpoint::entry"] + [::std::mem::offset_of!(CPUBreakpoint, entry) - 16usize]; +}; +impl Default for CPUBreakpoint { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUBreakpoint { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "CPUBreakpoint {{ flags: {:?}, entry: {:?} }}", + self.flags, self.entry + ) + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct CPUWatchpoint { + pub vaddr: vaddr, + pub len: vaddr, + pub hitaddr: vaddr, + pub hitattrs: MemTxAttrs, + pub flags: ::std::os::raw::c_int, + pub entry: CPUWatchpoint__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union CPUWatchpoint__bindgen_ty_1 { + pub tqe_next: *mut CPUWatchpoint, + pub tqe_circ: QTailQLink, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUWatchpoint__bindgen_ty_1"] + [::std::mem::size_of::() - 16usize]; + ["Alignment of CPUWatchpoint__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUWatchpoint__bindgen_ty_1::tqe_next"] + [::std::mem::offset_of!(CPUWatchpoint__bindgen_ty_1, tqe_next) - 0usize]; + ["Offset of field: CPUWatchpoint__bindgen_ty_1::tqe_circ"] + [::std::mem::offset_of!(CPUWatchpoint__bindgen_ty_1, tqe_circ) - 0usize]; +}; +impl Default for CPUWatchpoint__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUWatchpoint__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "CPUWatchpoint__bindgen_ty_1 {{ union }}") + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUWatchpoint"][::std::mem::size_of::() - 48usize]; + ["Alignment of CPUWatchpoint"][::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUWatchpoint::vaddr"] + [::std::mem::offset_of!(CPUWatchpoint, vaddr) - 0usize]; + ["Offset of field: CPUWatchpoint::len"][::std::mem::offset_of!(CPUWatchpoint, len) - 8usize]; + ["Offset of field: CPUWatchpoint::hitaddr"] + [::std::mem::offset_of!(CPUWatchpoint, hitaddr) - 16usize]; + ["Offset of field: CPUWatchpoint::hitattrs"] + [::std::mem::offset_of!(CPUWatchpoint, hitattrs) - 24usize]; + ["Offset of field: CPUWatchpoint::flags"] + [::std::mem::offset_of!(CPUWatchpoint, flags) - 28usize]; + ["Offset of field: CPUWatchpoint::entry"] + [::std::mem::offset_of!(CPUWatchpoint, entry) - 32usize]; +}; +impl Default for CPUWatchpoint { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUWatchpoint { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "CPUWatchpoint {{ hitattrs: {:?}, flags: {:?}, entry: {:?} }}", + self.hitattrs, self.flags, self.entry + ) + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct KVMState { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct kvm_run { + _unused: [u8; 0], +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct qemu_work_item { + _unused: [u8; 0], +} +#[doc = " CPUState:\n @cpu_index: CPU index (informative).\n @cluster_index: Identifies which cluster this CPU is in.\n For boards which don't define clusters or for \"loose\" CPUs not assigned\n to a cluster this will be UNASSIGNED_CLUSTER_INDEX; otherwise it will\n be the same as the cluster-id property of the CPU object's TYPE_CPU_CLUSTER\n QOM parent.\n Under TCG this value is propagated to @tcg_cflags.\n See TranslationBlock::TCG CF_CLUSTER_MASK.\n @tcg_cflags: Pre-computed cflags for this cpu.\n @nr_cores: Number of cores within this CPU package.\n @nr_threads: Number of threads within this CPU core.\n @running: #true if CPU is currently running (lockless).\n @has_waiter: #true if a CPU is currently waiting for the cpu_exec_end;\n valid under cpu_list_lock.\n @created: Indicates whether the CPU thread has been successfully created.\n @interrupt_request: Indicates a pending interrupt request.\n @halted: Nonzero if the CPU is in suspended state.\n @stop: Indicates a pending stop request.\n @stopped: Indicates the CPU has been artificially stopped.\n @unplug: Indicates a pending CPU unplug request.\n @crash_occurred: Indicates the OS reported a crash (panic) for this CPU\n @singlestep_enabled: Flags for single-stepping.\n @icount_extra: Instructions until next timer event.\n @neg.can_do_io: True if memory-mapped IO is allowed.\n @cpu_ases: Pointer to array of CPUAddressSpaces (which define the\n AddressSpaces this CPU has)\n @num_ases: number of CPUAddressSpaces in @cpu_ases\n @as: Pointer to the first AddressSpace, for the convenience of targets which\n only have a single AddressSpace\n @gdb_regs: Additional GDB registers.\n @gdb_num_regs: Number of total registers accessible to GDB.\n @gdb_num_g_regs: Number of registers in GDB 'g' packets.\n @node: QTAILQ of CPUs sharing TB cache.\n @opaque: User data.\n @mem_io_pc: Host Program Counter at which the memory was accessed.\n @accel: Pointer to accelerator specific state.\n @kvm_fd: vCPU file descriptor for KVM.\n @work_mutex: Lock to prevent multiple access to @work_list.\n @work_list: List of pending asynchronous work.\n @plugin_mem_cbs: active plugin memory callbacks\n @plugin_state: per-CPU plugin state\n @ignore_memory_transaction_failures: Cached copy of the MachineState\n flag of the same name: allows the board to suppress calling of the\n CPU do_transaction_failed hook function.\n @kvm_dirty_gfns: Points to the KVM dirty ring for this CPU when KVM dirty\n ring is enabled.\n @kvm_fetch_index: Keeps the index that we last fetched from the per-vCPU\n dirty ring structure.\n\n State of one CPU core or thread.\n\n Align, in order to match possible alignment required by CPUArchState,\n and eliminate a hole between CPUState and CPUArchState within ArchCPU."] +#[repr(C)] +#[repr(align(16))] +pub struct CPUState { + pub parent_obj: DeviceState, + pub cc: *mut CPUClass, + pub nr_cores: ::std::os::raw::c_int, + pub nr_threads: ::std::os::raw::c_int, + pub thread: *mut QemuThread, + pub thread_id: ::std::os::raw::c_int, + pub running: bool, + pub has_waiter: bool, + pub halt_cond: *mut QemuCond, + pub thread_kicked: bool, + pub created: bool, + pub stop: bool, + pub stopped: bool, + pub start_powered_off: bool, + pub unplug: bool, + pub crash_occurred: bool, + pub exit_request: bool, + pub exclusive_context_count: ::std::os::raw::c_int, + pub cflags_next_tb: u32, + pub interrupt_request: u32, + pub singlestep_enabled: ::std::os::raw::c_int, + pub icount_budget: i64, + pub icount_extra: i64, + pub random_seed: u64, + pub jmp_env: sigjmp_buf, + pub work_mutex: QemuMutex, + pub work_list: CPUState__bindgen_ty_1, + pub cpu_ases: *mut CPUAddressSpace, + pub num_ases: ::std::os::raw::c_int, + pub as_: *mut AddressSpace, + pub memory: *mut MemoryRegion, + pub tb_jmp_cache: *mut CPUJumpCache, + pub gdb_regs: *mut GArray, + pub gdb_num_regs: ::std::os::raw::c_int, + pub gdb_num_g_regs: ::std::os::raw::c_int, + pub node: CPUState__bindgen_ty_2, + pub breakpoints: CPUState__bindgen_ty_3, + pub watchpoints: CPUState__bindgen_ty_4, + pub watchpoint_hit: *mut CPUWatchpoint, + pub opaque: *mut ::std::os::raw::c_void, + pub mem_io_pc: usize, + pub kvm_fd: ::std::os::raw::c_int, + pub kvm_state: *mut KVMState, + pub kvm_run: *mut kvm_run, + pub kvm_dirty_gfns: *mut kvm_dirty_gfn, + pub kvm_fetch_index: u32, + pub dirty_pages: u64, + pub kvm_vcpu_stats_fd: ::std::os::raw::c_int, + pub in_ioctl_lock: QemuLockCnt, + pub plugin_mem_cbs: *mut GArray, + pub plugin_state: *mut CPUPluginState, + pub cpu_index: ::std::os::raw::c_int, + pub cluster_index: ::std::os::raw::c_int, + pub tcg_cflags: u32, + pub halted: u32, + pub exception_index: i32, + pub accel: *mut AccelCPUState, + pub vcpu_dirty: bool, + pub throttle_thread_scheduled: bool, + pub throttle_us_per_full: i64, + pub ignore_memory_transaction_failures: bool, + pub prctl_unalign_sigbus: bool, + pub iommu_notifiers: *mut GArray, + pub __bindgen_padding_0: [u8; 8usize], + pub neg_align: __IncompleteArrayField<::std::os::raw::c_char>, + pub neg: CPUNegativeOffsetState, +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CPUState__bindgen_ty_1 { + pub sqh_first: *mut qemu_work_item, + pub sqh_last: *mut *mut qemu_work_item, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUState__bindgen_ty_1"][::std::mem::size_of::() - 16usize]; + ["Alignment of CPUState__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUState__bindgen_ty_1::sqh_first"] + [::std::mem::offset_of!(CPUState__bindgen_ty_1, sqh_first) - 0usize]; + ["Offset of field: CPUState__bindgen_ty_1::sqh_last"] + [::std::mem::offset_of!(CPUState__bindgen_ty_1, sqh_last) - 8usize]; +}; +impl Default for CPUState__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union CPUState__bindgen_ty_2 { + pub tqe_next: *mut CPUState, + pub tqe_circ: QTailQLink, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUState__bindgen_ty_2"][::std::mem::size_of::() - 16usize]; + ["Alignment of CPUState__bindgen_ty_2"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUState__bindgen_ty_2::tqe_next"] + [::std::mem::offset_of!(CPUState__bindgen_ty_2, tqe_next) - 0usize]; + ["Offset of field: CPUState__bindgen_ty_2::tqe_circ"] + [::std::mem::offset_of!(CPUState__bindgen_ty_2, tqe_circ) - 0usize]; +}; +impl Default for CPUState__bindgen_ty_2 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUState__bindgen_ty_2 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "CPUState__bindgen_ty_2 {{ union }}") + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union CPUState__bindgen_ty_3 { + pub tqh_first: *mut CPUBreakpoint, + pub tqh_circ: QTailQLink, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUState__bindgen_ty_3"][::std::mem::size_of::() - 16usize]; + ["Alignment of CPUState__bindgen_ty_3"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUState__bindgen_ty_3::tqh_first"] + [::std::mem::offset_of!(CPUState__bindgen_ty_3, tqh_first) - 0usize]; + ["Offset of field: CPUState__bindgen_ty_3::tqh_circ"] + [::std::mem::offset_of!(CPUState__bindgen_ty_3, tqh_circ) - 0usize]; +}; +impl Default for CPUState__bindgen_ty_3 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUState__bindgen_ty_3 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "CPUState__bindgen_ty_3 {{ union }}") + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union CPUState__bindgen_ty_4 { + pub tqh_first: *mut CPUWatchpoint, + pub tqh_circ: QTailQLink, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUState__bindgen_ty_4"][::std::mem::size_of::() - 16usize]; + ["Alignment of CPUState__bindgen_ty_4"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUState__bindgen_ty_4::tqh_first"] + [::std::mem::offset_of!(CPUState__bindgen_ty_4, tqh_first) - 0usize]; + ["Offset of field: CPUState__bindgen_ty_4::tqh_circ"] + [::std::mem::offset_of!(CPUState__bindgen_ty_4, tqh_circ) - 0usize]; +}; +impl Default for CPUState__bindgen_ty_4 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUState__bindgen_ty_4 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "CPUState__bindgen_ty_4 {{ union }}") + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUState"][::std::mem::size_of::() - 10176usize]; + ["Alignment of CPUState"][::std::mem::align_of::() - 16usize]; + ["Offset of field: CPUState::parent_obj"] + [::std::mem::offset_of!(CPUState, parent_obj) - 0usize]; + ["Offset of field: CPUState::cc"][::std::mem::offset_of!(CPUState, cc) - 160usize]; + ["Offset of field: CPUState::nr_cores"][::std::mem::offset_of!(CPUState, nr_cores) - 168usize]; + ["Offset of field: CPUState::nr_threads"] + [::std::mem::offset_of!(CPUState, nr_threads) - 172usize]; + ["Offset of field: CPUState::thread"][::std::mem::offset_of!(CPUState, thread) - 176usize]; + ["Offset of field: CPUState::thread_id"] + [::std::mem::offset_of!(CPUState, thread_id) - 184usize]; + ["Offset of field: CPUState::running"][::std::mem::offset_of!(CPUState, running) - 188usize]; + ["Offset of field: CPUState::has_waiter"] + [::std::mem::offset_of!(CPUState, has_waiter) - 189usize]; + ["Offset of field: CPUState::halt_cond"] + [::std::mem::offset_of!(CPUState, halt_cond) - 192usize]; + ["Offset of field: CPUState::thread_kicked"] + [::std::mem::offset_of!(CPUState, thread_kicked) - 200usize]; + ["Offset of field: CPUState::created"][::std::mem::offset_of!(CPUState, created) - 201usize]; + ["Offset of field: CPUState::stop"][::std::mem::offset_of!(CPUState, stop) - 202usize]; + ["Offset of field: CPUState::stopped"][::std::mem::offset_of!(CPUState, stopped) - 203usize]; + ["Offset of field: CPUState::start_powered_off"] + [::std::mem::offset_of!(CPUState, start_powered_off) - 204usize]; + ["Offset of field: CPUState::unplug"][::std::mem::offset_of!(CPUState, unplug) - 205usize]; + ["Offset of field: CPUState::crash_occurred"] + [::std::mem::offset_of!(CPUState, crash_occurred) - 206usize]; + ["Offset of field: CPUState::exit_request"] + [::std::mem::offset_of!(CPUState, exit_request) - 207usize]; + ["Offset of field: CPUState::exclusive_context_count"] + [::std::mem::offset_of!(CPUState, exclusive_context_count) - 208usize]; + ["Offset of field: CPUState::cflags_next_tb"] + [::std::mem::offset_of!(CPUState, cflags_next_tb) - 212usize]; + ["Offset of field: CPUState::interrupt_request"] + [::std::mem::offset_of!(CPUState, interrupt_request) - 216usize]; + ["Offset of field: CPUState::singlestep_enabled"] + [::std::mem::offset_of!(CPUState, singlestep_enabled) - 220usize]; + ["Offset of field: CPUState::icount_budget"] + [::std::mem::offset_of!(CPUState, icount_budget) - 224usize]; + ["Offset of field: CPUState::icount_extra"] + [::std::mem::offset_of!(CPUState, icount_extra) - 232usize]; + ["Offset of field: CPUState::random_seed"] + [::std::mem::offset_of!(CPUState, random_seed) - 240usize]; + ["Offset of field: CPUState::jmp_env"][::std::mem::offset_of!(CPUState, jmp_env) - 248usize]; + ["Offset of field: CPUState::work_mutex"] + [::std::mem::offset_of!(CPUState, work_mutex) - 448usize]; + ["Offset of field: CPUState::work_list"] + [::std::mem::offset_of!(CPUState, work_list) - 496usize]; + ["Offset of field: CPUState::cpu_ases"][::std::mem::offset_of!(CPUState, cpu_ases) - 512usize]; + ["Offset of field: CPUState::num_ases"][::std::mem::offset_of!(CPUState, num_ases) - 520usize]; + ["Offset of field: CPUState::as_"][::std::mem::offset_of!(CPUState, as_) - 528usize]; + ["Offset of field: CPUState::memory"][::std::mem::offset_of!(CPUState, memory) - 536usize]; + ["Offset of field: CPUState::tb_jmp_cache"] + [::std::mem::offset_of!(CPUState, tb_jmp_cache) - 544usize]; + ["Offset of field: CPUState::gdb_regs"][::std::mem::offset_of!(CPUState, gdb_regs) - 552usize]; + ["Offset of field: CPUState::gdb_num_regs"] + [::std::mem::offset_of!(CPUState, gdb_num_regs) - 560usize]; + ["Offset of field: CPUState::gdb_num_g_regs"] + [::std::mem::offset_of!(CPUState, gdb_num_g_regs) - 564usize]; + ["Offset of field: CPUState::node"][::std::mem::offset_of!(CPUState, node) - 568usize]; + ["Offset of field: CPUState::breakpoints"] + [::std::mem::offset_of!(CPUState, breakpoints) - 584usize]; + ["Offset of field: CPUState::watchpoints"] + [::std::mem::offset_of!(CPUState, watchpoints) - 600usize]; + ["Offset of field: CPUState::watchpoint_hit"] + [::std::mem::offset_of!(CPUState, watchpoint_hit) - 616usize]; + ["Offset of field: CPUState::opaque"][::std::mem::offset_of!(CPUState, opaque) - 624usize]; + ["Offset of field: CPUState::mem_io_pc"] + [::std::mem::offset_of!(CPUState, mem_io_pc) - 632usize]; + ["Offset of field: CPUState::kvm_fd"][::std::mem::offset_of!(CPUState, kvm_fd) - 640usize]; + ["Offset of field: CPUState::kvm_state"] + [::std::mem::offset_of!(CPUState, kvm_state) - 648usize]; + ["Offset of field: CPUState::kvm_run"][::std::mem::offset_of!(CPUState, kvm_run) - 656usize]; + ["Offset of field: CPUState::kvm_dirty_gfns"] + [::std::mem::offset_of!(CPUState, kvm_dirty_gfns) - 664usize]; + ["Offset of field: CPUState::kvm_fetch_index"] + [::std::mem::offset_of!(CPUState, kvm_fetch_index) - 672usize]; + ["Offset of field: CPUState::dirty_pages"] + [::std::mem::offset_of!(CPUState, dirty_pages) - 680usize]; + ["Offset of field: CPUState::kvm_vcpu_stats_fd"] + [::std::mem::offset_of!(CPUState, kvm_vcpu_stats_fd) - 688usize]; + ["Offset of field: CPUState::in_ioctl_lock"] + [::std::mem::offset_of!(CPUState, in_ioctl_lock) - 692usize]; + ["Offset of field: CPUState::plugin_mem_cbs"] + [::std::mem::offset_of!(CPUState, plugin_mem_cbs) - 696usize]; + ["Offset of field: CPUState::plugin_state"] + [::std::mem::offset_of!(CPUState, plugin_state) - 704usize]; + ["Offset of field: CPUState::cpu_index"] + [::std::mem::offset_of!(CPUState, cpu_index) - 712usize]; + ["Offset of field: CPUState::cluster_index"] + [::std::mem::offset_of!(CPUState, cluster_index) - 716usize]; + ["Offset of field: CPUState::tcg_cflags"] + [::std::mem::offset_of!(CPUState, tcg_cflags) - 720usize]; + ["Offset of field: CPUState::halted"][::std::mem::offset_of!(CPUState, halted) - 724usize]; + ["Offset of field: CPUState::exception_index"] + [::std::mem::offset_of!(CPUState, exception_index) - 728usize]; + ["Offset of field: CPUState::accel"][::std::mem::offset_of!(CPUState, accel) - 736usize]; + ["Offset of field: CPUState::vcpu_dirty"] + [::std::mem::offset_of!(CPUState, vcpu_dirty) - 744usize]; + ["Offset of field: CPUState::throttle_thread_scheduled"] + [::std::mem::offset_of!(CPUState, throttle_thread_scheduled) - 745usize]; + ["Offset of field: CPUState::throttle_us_per_full"] + [::std::mem::offset_of!(CPUState, throttle_us_per_full) - 752usize]; + ["Offset of field: CPUState::ignore_memory_transaction_failures"] + [::std::mem::offset_of!(CPUState, ignore_memory_transaction_failures) - 760usize]; + ["Offset of field: CPUState::prctl_unalign_sigbus"] + [::std::mem::offset_of!(CPUState, prctl_unalign_sigbus) - 761usize]; + ["Offset of field: CPUState::iommu_notifiers"] + [::std::mem::offset_of!(CPUState, iommu_notifiers) - 768usize]; + ["Offset of field: CPUState::neg_align"] + [::std::mem::offset_of!(CPUState, neg_align) - 784usize]; + ["Offset of field: CPUState::neg"][::std::mem::offset_of!(CPUState, neg) - 784usize]; +}; +impl Default for CPUState { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUState { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "CPUState {{ parent_obj: {:?}, cc: {:?}, nr_cores: {:?}, nr_threads: {:?}, thread: {:?}, thread_id: {:?}, running: {:?}, has_waiter: {:?}, halt_cond: {:?}, thread_kicked: {:?}, created: {:?}, stop: {:?}, stopped: {:?}, start_powered_off: {:?}, unplug: {:?}, crash_occurred: {:?}, exit_request: {:?}, exclusive_context_count: {:?}, singlestep_enabled: {:?}, jmp_env: {:?}, work_mutex: {:?}, work_list: {:?}, cpu_ases: {:?}, num_ases: {:?}, as: {:?}, memory: {:?}, tb_jmp_cache: {:?}, gdb_regs: {:?}, gdb_num_regs: {:?}, gdb_num_g_regs: {:?}, node: {:?}, breakpoints: {:?}, watchpoints: {:?}, watchpoint_hit: {:?}, opaque: {:?}, kvm_fd: {:?}, kvm_state: {:?}, kvm_run: {:?}, kvm_dirty_gfns: {:?}, kvm_vcpu_stats_fd: {:?}, in_ioctl_lock: {:?}, plugin_mem_cbs: {:?}, plugin_state: {:?}, cpu_index: {:?}, cluster_index: {:?}, accel: {:?}, vcpu_dirty: {:?}, throttle_thread_scheduled: {:?}, ignore_memory_transaction_failures: {:?}, prctl_unalign_sigbus: {:?}, iommu_notifiers: {:?}, neg_align: {:?}, neg: {:?} }}" , self . parent_obj , self . cc , self . nr_cores , self . nr_threads , self . thread , self . thread_id , self . running , self . has_waiter , self . halt_cond , self . thread_kicked , self . created , self . stop , self . stopped , self . start_powered_off , self . unplug , self . crash_occurred , self . exit_request , self . exclusive_context_count , self . singlestep_enabled , self . jmp_env , self . work_mutex , self . work_list , self . cpu_ases , self . num_ases , self . as_ , self . memory , self . tb_jmp_cache , self . gdb_regs , self . gdb_num_regs , self . gdb_num_g_regs , self . node , self . breakpoints , self . watchpoints , self . watchpoint_hit , self . opaque , self . kvm_fd , self . kvm_state , self . kvm_run , self . kvm_dirty_gfns , self . kvm_vcpu_stats_fd , self . in_ioctl_lock , self . plugin_mem_cbs , self . plugin_state , self . cpu_index , self . cluster_index , self . accel , self . vcpu_dirty , self . throttle_thread_scheduled , self . ignore_memory_transaction_failures , self . prctl_unalign_sigbus , self . iommu_notifiers , self . neg_align , self . neg) + } +} +extern "C" { + #[doc = " cpu_reset:\n @cpu: The CPU whose state is to be reset."] + pub fn cpu_reset(cpu: *mut CPUState); +} +pub type target_long = i64; +pub type target_ulong = u64; +#[doc = " Property:\n @set_default: true if the default value should be set from @defval,\n in which case @info->set_default_value must not be NULL\n (if false then no default value is set by the property system\n and the field retains whatever value it was given by instance_init).\n @defval: default value for the property. This is used only if @set_default\n is true."] +#[repr(C)] +#[derive(Copy, Clone)] +pub struct Property { + pub name: *const ::std::os::raw::c_char, + pub info: *const PropertyInfo, + pub offset: isize, + pub bitnr: u8, + pub bitmask: u64, + pub set_default: bool, + pub defval: Property__bindgen_ty_1, + pub arrayoffset: ::std::os::raw::c_int, + pub arrayinfo: *const PropertyInfo, + pub arrayfieldsize: ::std::os::raw::c_int, + pub link_type: *const ::std::os::raw::c_char, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union Property__bindgen_ty_1 { + pub i: i64, + pub u: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of Property__bindgen_ty_1"][::std::mem::size_of::() - 8usize]; + ["Alignment of Property__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: Property__bindgen_ty_1::i"] + [::std::mem::offset_of!(Property__bindgen_ty_1, i) - 0usize]; + ["Offset of field: Property__bindgen_ty_1::u"] + [::std::mem::offset_of!(Property__bindgen_ty_1, u) - 0usize]; +}; +impl Default for Property__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for Property__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "Property__bindgen_ty_1 {{ union }}") + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of Property"][::std::mem::size_of::() - 88usize]; + ["Alignment of Property"][::std::mem::align_of::() - 8usize]; + ["Offset of field: Property::name"][::std::mem::offset_of!(Property, name) - 0usize]; + ["Offset of field: Property::info"][::std::mem::offset_of!(Property, info) - 8usize]; + ["Offset of field: Property::offset"][::std::mem::offset_of!(Property, offset) - 16usize]; + ["Offset of field: Property::bitnr"][::std::mem::offset_of!(Property, bitnr) - 24usize]; + ["Offset of field: Property::bitmask"][::std::mem::offset_of!(Property, bitmask) - 32usize]; + ["Offset of field: Property::set_default"] + [::std::mem::offset_of!(Property, set_default) - 40usize]; + ["Offset of field: Property::defval"][::std::mem::offset_of!(Property, defval) - 48usize]; + ["Offset of field: Property::arrayoffset"] + [::std::mem::offset_of!(Property, arrayoffset) - 56usize]; + ["Offset of field: Property::arrayinfo"][::std::mem::offset_of!(Property, arrayinfo) - 64usize]; + ["Offset of field: Property::arrayfieldsize"] + [::std::mem::offset_of!(Property, arrayfieldsize) - 72usize]; + ["Offset of field: Property::link_type"][::std::mem::offset_of!(Property, link_type) - 80usize]; +}; +impl Default for Property { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for Property { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "Property {{ name: {:?}, info: {:?}, set_default: {:?}, defval: {:?}, arrayoffset: {:?}, arrayinfo: {:?}, arrayfieldsize: {:?}, link_type: {:?} }}" , self . name , self . info , self . set_default , self . defval , self . arrayoffset , self . arrayinfo , self . arrayfieldsize , self . link_type) + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct PropertyInfo { + pub name: *const ::std::os::raw::c_char, + pub description: *const ::std::os::raw::c_char, + pub enum_table: *const QEnumLookup, + pub realized_set_allowed: bool, + pub print: ::std::option::Option< + unsafe extern "C" fn( + obj: *mut Object, + prop: *mut Property, + dest: *mut ::std::os::raw::c_char, + len: usize, + ) -> ::std::os::raw::c_int, + >, + pub set_default_value: + ::std::option::Option, + pub create: ::std::option::Option< + unsafe extern "C" fn( + oc: *mut ObjectClass, + name: *const ::std::os::raw::c_char, + prop: *mut Property, + ) -> *mut ObjectProperty, + >, + pub get: ObjectPropertyAccessor, + pub set: ObjectPropertyAccessor, + pub release: ObjectPropertyRelease, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of PropertyInfo"][::std::mem::size_of::() - 80usize]; + ["Alignment of PropertyInfo"][::std::mem::align_of::() - 8usize]; + ["Offset of field: PropertyInfo::name"][::std::mem::offset_of!(PropertyInfo, name) - 0usize]; + ["Offset of field: PropertyInfo::description"] + [::std::mem::offset_of!(PropertyInfo, description) - 8usize]; + ["Offset of field: PropertyInfo::enum_table"] + [::std::mem::offset_of!(PropertyInfo, enum_table) - 16usize]; + ["Offset of field: PropertyInfo::realized_set_allowed"] + [::std::mem::offset_of!(PropertyInfo, realized_set_allowed) - 24usize]; + ["Offset of field: PropertyInfo::print"][::std::mem::offset_of!(PropertyInfo, print) - 32usize]; + ["Offset of field: PropertyInfo::set_default_value"] + [::std::mem::offset_of!(PropertyInfo, set_default_value) - 40usize]; + ["Offset of field: PropertyInfo::create"] + [::std::mem::offset_of!(PropertyInfo, create) - 48usize]; + ["Offset of field: PropertyInfo::get"][::std::mem::offset_of!(PropertyInfo, get) - 56usize]; + ["Offset of field: PropertyInfo::set"][::std::mem::offset_of!(PropertyInfo, set) - 64usize]; + ["Offset of field: PropertyInfo::release"] + [::std::mem::offset_of!(PropertyInfo, release) - 72usize]; +}; +impl Default for PropertyInfo { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[doc = " X86CPU:\n @env: #CPUX86State\n @migratable: If set, only migratable flags will be accepted when \"enforce\"\n mode is used, and only migratable flags will be included in the \"host\"\n CPU model.\n\n An x86 CPU."] +pub type X86CPU = ArchCPU; +pub const OnOffAuto_ON_OFF_AUTO_AUTO: OnOffAuto = OnOffAuto(0); +pub const OnOffAuto_ON_OFF_AUTO_ON: OnOffAuto = OnOffAuto(1); +pub const OnOffAuto_ON_OFF_AUTO_OFF: OnOffAuto = OnOffAuto(2); +pub const OnOffAuto_ON_OFF_AUTO__MAX: OnOffAuto = OnOffAuto(3); +impl ::std::ops::BitOr for OnOffAuto { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + OnOffAuto(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for OnOffAuto { + #[inline] + fn bitor_assign(&mut self, rhs: OnOffAuto) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for OnOffAuto { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + OnOffAuto(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for OnOffAuto { + #[inline] + fn bitand_assign(&mut self, rhs: OnOffAuto) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct OnOffAuto(pub ::std::os::raw::c_uint); +pub type float16 = u16; +pub type float32 = u32; +pub type float64 = u64; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct floatx80 { + pub low: u64, + pub high: u16, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of floatx80"][::std::mem::size_of::() - 16usize]; + ["Alignment of floatx80"][::std::mem::align_of::() - 8usize]; + ["Offset of field: floatx80::low"][::std::mem::offset_of!(floatx80, low) - 0usize]; + ["Offset of field: floatx80::high"][::std::mem::offset_of!(floatx80, high) - 8usize]; +}; +pub const FloatRoundMode_float_round_nearest_even: FloatRoundMode = FloatRoundMode(0); +pub const FloatRoundMode_float_round_down: FloatRoundMode = FloatRoundMode(1); +pub const FloatRoundMode_float_round_up: FloatRoundMode = FloatRoundMode(2); +pub const FloatRoundMode_float_round_to_zero: FloatRoundMode = FloatRoundMode(3); +pub const FloatRoundMode_float_round_ties_away: FloatRoundMode = FloatRoundMode(4); +pub const FloatRoundMode_float_round_to_odd: FloatRoundMode = FloatRoundMode(5); +pub const FloatRoundMode_float_round_to_odd_inf: FloatRoundMode = FloatRoundMode(6); +impl ::std::ops::BitOr for FloatRoundMode { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + FloatRoundMode(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for FloatRoundMode { + #[inline] + fn bitor_assign(&mut self, rhs: FloatRoundMode) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for FloatRoundMode { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + FloatRoundMode(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for FloatRoundMode { + #[inline] + fn bitand_assign(&mut self, rhs: FloatRoundMode) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct FloatRoundMode(pub ::std::os::raw::c_uchar); +pub const FloatX80RoundPrec_floatx80_precision_x: FloatX80RoundPrec = FloatX80RoundPrec(0); +pub const FloatX80RoundPrec_floatx80_precision_d: FloatX80RoundPrec = FloatX80RoundPrec(1); +pub const FloatX80RoundPrec_floatx80_precision_s: FloatX80RoundPrec = FloatX80RoundPrec(2); +impl ::std::ops::BitOr for FloatX80RoundPrec { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + FloatX80RoundPrec(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for FloatX80RoundPrec { + #[inline] + fn bitor_assign(&mut self, rhs: FloatX80RoundPrec) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for FloatX80RoundPrec { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + FloatX80RoundPrec(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for FloatX80RoundPrec { + #[inline] + fn bitand_assign(&mut self, rhs: FloatX80RoundPrec) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct FloatX80RoundPrec(pub ::std::os::raw::c_uchar); +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct float_status { + pub float_exception_flags: u16, + pub float_rounding_mode: FloatRoundMode, + pub floatx80_rounding_precision: FloatX80RoundPrec, + pub tininess_before_rounding: bool, + pub flush_to_zero: bool, + pub flush_inputs_to_zero: bool, + pub default_nan_mode: bool, + pub snan_bit_is_one: bool, + pub use_first_nan: bool, + pub no_signaling_nans: bool, + pub rebias_overflow: bool, + pub rebias_underflow: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of float_status"][::std::mem::size_of::() - 14usize]; + ["Alignment of float_status"][::std::mem::align_of::() - 2usize]; + ["Offset of field: float_status::float_exception_flags"] + [::std::mem::offset_of!(float_status, float_exception_flags) - 0usize]; + ["Offset of field: float_status::float_rounding_mode"] + [::std::mem::offset_of!(float_status, float_rounding_mode) - 2usize]; + ["Offset of field: float_status::floatx80_rounding_precision"] + [::std::mem::offset_of!(float_status, floatx80_rounding_precision) - 3usize]; + ["Offset of field: float_status::tininess_before_rounding"] + [::std::mem::offset_of!(float_status, tininess_before_rounding) - 4usize]; + ["Offset of field: float_status::flush_to_zero"] + [::std::mem::offset_of!(float_status, flush_to_zero) - 5usize]; + ["Offset of field: float_status::flush_inputs_to_zero"] + [::std::mem::offset_of!(float_status, flush_inputs_to_zero) - 6usize]; + ["Offset of field: float_status::default_nan_mode"] + [::std::mem::offset_of!(float_status, default_nan_mode) - 7usize]; + ["Offset of field: float_status::snan_bit_is_one"] + [::std::mem::offset_of!(float_status, snan_bit_is_one) - 8usize]; + ["Offset of field: float_status::use_first_nan"] + [::std::mem::offset_of!(float_status, use_first_nan) - 9usize]; + ["Offset of field: float_status::no_signaling_nans"] + [::std::mem::offset_of!(float_status, no_signaling_nans) - 10usize]; + ["Offset of field: float_status::rebias_overflow"] + [::std::mem::offset_of!(float_status, rebias_overflow) - 11usize]; + ["Offset of field: float_status::rebias_underflow"] + [::std::mem::offset_of!(float_status, rebias_underflow) - 12usize]; +}; +impl Default for float_status { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type FeatureWordArray = [u64; 39usize]; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct SegmentCache { + pub selector: u32, + pub base: target_ulong, + pub limit: u32, + pub flags: u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of SegmentCache"][::std::mem::size_of::() - 24usize]; + ["Alignment of SegmentCache"][::std::mem::align_of::() - 8usize]; + ["Offset of field: SegmentCache::selector"] + [::std::mem::offset_of!(SegmentCache, selector) - 0usize]; + ["Offset of field: SegmentCache::base"][::std::mem::offset_of!(SegmentCache, base) - 8usize]; + ["Offset of field: SegmentCache::limit"][::std::mem::offset_of!(SegmentCache, limit) - 16usize]; + ["Offset of field: SegmentCache::flags"][::std::mem::offset_of!(SegmentCache, flags) - 20usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub union MMXReg { + pub _b_MMXReg: [u8; 8usize], + pub _w_MMXReg: [u16; 4usize], + pub _l_MMXReg: [u32; 2usize], + pub _q_MMXReg: [u64; 1usize], + pub _s_MMXReg: [float32; 2usize], + pub _d_MMXReg: [float64; 1usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MMXReg"][::std::mem::size_of::() - 8usize]; + ["Alignment of MMXReg"][::std::mem::align_of::() - 8usize]; + ["Offset of field: MMXReg::_b_MMXReg"][::std::mem::offset_of!(MMXReg, _b_MMXReg) - 0usize]; + ["Offset of field: MMXReg::_w_MMXReg"][::std::mem::offset_of!(MMXReg, _w_MMXReg) - 0usize]; + ["Offset of field: MMXReg::_l_MMXReg"][::std::mem::offset_of!(MMXReg, _l_MMXReg) - 0usize]; + ["Offset of field: MMXReg::_q_MMXReg"][::std::mem::offset_of!(MMXReg, _q_MMXReg) - 0usize]; + ["Offset of field: MMXReg::_s_MMXReg"][::std::mem::offset_of!(MMXReg, _s_MMXReg) - 0usize]; + ["Offset of field: MMXReg::_d_MMXReg"][::std::mem::offset_of!(MMXReg, _d_MMXReg) - 0usize]; +}; +impl Default for MMXReg { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for MMXReg { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "MMXReg {{ union }}") + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union XMMReg { + pub _q_XMMReg: [u64; 2usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of XMMReg"][::std::mem::size_of::() - 16usize]; + ["Alignment of XMMReg"][::std::mem::align_of::() - 8usize]; + ["Offset of field: XMMReg::_q_XMMReg"][::std::mem::offset_of!(XMMReg, _q_XMMReg) - 0usize]; +}; +impl Default for XMMReg { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for XMMReg { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "XMMReg {{ union }}") + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union YMMReg { + pub _q_YMMReg: [u64; 4usize], + pub _x_YMMReg: [XMMReg; 2usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of YMMReg"][::std::mem::size_of::() - 32usize]; + ["Alignment of YMMReg"][::std::mem::align_of::() - 8usize]; + ["Offset of field: YMMReg::_q_YMMReg"][::std::mem::offset_of!(YMMReg, _q_YMMReg) - 0usize]; + ["Offset of field: YMMReg::_x_YMMReg"][::std::mem::offset_of!(YMMReg, _x_YMMReg) - 0usize]; +}; +impl Default for YMMReg { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for YMMReg { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "YMMReg {{ union }}") + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union ZMMReg { + pub _b_ZMMReg: [u8; 64usize], + pub _w_ZMMReg: [u16; 32usize], + pub _l_ZMMReg: [u32; 16usize], + pub _q_ZMMReg: [u64; 8usize], + pub _h_ZMMReg: [float16; 32usize], + pub _s_ZMMReg: [float32; 16usize], + pub _d_ZMMReg: [float64; 8usize], + pub _x_ZMMReg: [XMMReg; 4usize], + pub _y_ZMMReg: [YMMReg; 2usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ZMMReg"][::std::mem::size_of::() - 64usize]; + ["Alignment of ZMMReg"][::std::mem::align_of::() - 8usize]; + ["Offset of field: ZMMReg::_b_ZMMReg"][::std::mem::offset_of!(ZMMReg, _b_ZMMReg) - 0usize]; + ["Offset of field: ZMMReg::_w_ZMMReg"][::std::mem::offset_of!(ZMMReg, _w_ZMMReg) - 0usize]; + ["Offset of field: ZMMReg::_l_ZMMReg"][::std::mem::offset_of!(ZMMReg, _l_ZMMReg) - 0usize]; + ["Offset of field: ZMMReg::_q_ZMMReg"][::std::mem::offset_of!(ZMMReg, _q_ZMMReg) - 0usize]; + ["Offset of field: ZMMReg::_h_ZMMReg"][::std::mem::offset_of!(ZMMReg, _h_ZMMReg) - 0usize]; + ["Offset of field: ZMMReg::_s_ZMMReg"][::std::mem::offset_of!(ZMMReg, _s_ZMMReg) - 0usize]; + ["Offset of field: ZMMReg::_d_ZMMReg"][::std::mem::offset_of!(ZMMReg, _d_ZMMReg) - 0usize]; + ["Offset of field: ZMMReg::_x_ZMMReg"][::std::mem::offset_of!(ZMMReg, _x_ZMMReg) - 0usize]; + ["Offset of field: ZMMReg::_y_ZMMReg"][::std::mem::offset_of!(ZMMReg, _y_ZMMReg) - 0usize]; +}; +impl Default for ZMMReg { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for ZMMReg { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "ZMMReg {{ union }}") + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct BNDReg { + pub lb: u64, + pub ub: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of BNDReg"][::std::mem::size_of::() - 16usize]; + ["Alignment of BNDReg"][::std::mem::align_of::() - 8usize]; + ["Offset of field: BNDReg::lb"][::std::mem::offset_of!(BNDReg, lb) - 0usize]; + ["Offset of field: BNDReg::ub"][::std::mem::offset_of!(BNDReg, ub) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct BNDCSReg { + pub cfgu: u64, + pub sts: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of BNDCSReg"][::std::mem::size_of::() - 16usize]; + ["Alignment of BNDCSReg"][::std::mem::align_of::() - 8usize]; + ["Offset of field: BNDCSReg::cfgu"][::std::mem::offset_of!(BNDCSReg, cfgu) - 0usize]; + ["Offset of field: BNDCSReg::sts"][::std::mem::offset_of!(BNDCSReg, sts) - 8usize]; +}; +#[repr(C)] +#[repr(align(16))] +#[derive(Copy, Clone)] +pub union FPReg { + pub d: floatx80, + pub mmx: MMXReg, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of FPReg"][::std::mem::size_of::() - 16usize]; + ["Alignment of FPReg"][::std::mem::align_of::() - 16usize]; + ["Offset of field: FPReg::d"][::std::mem::offset_of!(FPReg, d) - 0usize]; + ["Offset of field: FPReg::mmx"][::std::mem::offset_of!(FPReg, mmx) - 0usize]; +}; +impl Default for FPReg { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for FPReg { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "FPReg {{ union }}") + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct MTRRVar { + pub base: u64, + pub mask: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of MTRRVar"][::std::mem::size_of::() - 16usize]; + ["Alignment of MTRRVar"][::std::mem::align_of::() - 8usize]; + ["Offset of field: MTRRVar::base"][::std::mem::offset_of!(MTRRVar, base) - 0usize]; + ["Offset of field: MTRRVar::mask"][::std::mem::offset_of!(MTRRVar, mask) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct LBREntry { + pub from: u64, + pub to: u64, + pub info: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of LBREntry"][::std::mem::size_of::() - 24usize]; + ["Alignment of LBREntry"][::std::mem::align_of::() - 8usize]; + ["Offset of field: LBREntry::from"][::std::mem::offset_of!(LBREntry, from) - 0usize]; + ["Offset of field: LBREntry::to"][::std::mem::offset_of!(LBREntry, to) - 8usize]; + ["Offset of field: LBREntry::info"][::std::mem::offset_of!(LBREntry, info) - 16usize]; +}; +pub const TPRAccess_TPR_ACCESS_READ: TPRAccess = TPRAccess(0); +pub const TPRAccess_TPR_ACCESS_WRITE: TPRAccess = TPRAccess(1); +impl ::std::ops::BitOr for TPRAccess { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TPRAccess(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TPRAccess { + #[inline] + fn bitor_assign(&mut self, rhs: TPRAccess) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TPRAccess { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TPRAccess(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TPRAccess { + #[inline] + fn bitand_assign(&mut self, rhs: TPRAccess) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct TPRAccess(pub ::std::os::raw::c_uint); +pub const CacheType_DATA_CACHE: CacheType = CacheType(0); +pub const CacheType_INSTRUCTION_CACHE: CacheType = CacheType(1); +pub const CacheType_UNIFIED_CACHE: CacheType = CacheType(2); +impl ::std::ops::BitOr for CacheType { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + CacheType(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for CacheType { + #[inline] + fn bitor_assign(&mut self, rhs: CacheType) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for CacheType { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + CacheType(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for CacheType { + #[inline] + fn bitand_assign(&mut self, rhs: CacheType) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct CacheType(pub ::std::os::raw::c_uint); +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CPUCacheInfo { + pub type_: CacheType, + pub level: u8, + pub size: u32, + pub line_size: u16, + pub associativity: u8, + pub partitions: u8, + pub sets: u32, + pub lines_per_tag: u8, + pub self_init: bool, + pub no_invd_sharing: bool, + pub inclusive: bool, + pub complex_indexing: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUCacheInfo"][::std::mem::size_of::() - 28usize]; + ["Alignment of CPUCacheInfo"][::std::mem::align_of::() - 4usize]; + ["Offset of field: CPUCacheInfo::type_"][::std::mem::offset_of!(CPUCacheInfo, type_) - 0usize]; + ["Offset of field: CPUCacheInfo::level"][::std::mem::offset_of!(CPUCacheInfo, level) - 4usize]; + ["Offset of field: CPUCacheInfo::size"][::std::mem::offset_of!(CPUCacheInfo, size) - 8usize]; + ["Offset of field: CPUCacheInfo::line_size"] + [::std::mem::offset_of!(CPUCacheInfo, line_size) - 12usize]; + ["Offset of field: CPUCacheInfo::associativity"] + [::std::mem::offset_of!(CPUCacheInfo, associativity) - 14usize]; + ["Offset of field: CPUCacheInfo::partitions"] + [::std::mem::offset_of!(CPUCacheInfo, partitions) - 15usize]; + ["Offset of field: CPUCacheInfo::sets"][::std::mem::offset_of!(CPUCacheInfo, sets) - 16usize]; + ["Offset of field: CPUCacheInfo::lines_per_tag"] + [::std::mem::offset_of!(CPUCacheInfo, lines_per_tag) - 20usize]; + ["Offset of field: CPUCacheInfo::self_init"] + [::std::mem::offset_of!(CPUCacheInfo, self_init) - 21usize]; + ["Offset of field: CPUCacheInfo::no_invd_sharing"] + [::std::mem::offset_of!(CPUCacheInfo, no_invd_sharing) - 22usize]; + ["Offset of field: CPUCacheInfo::inclusive"] + [::std::mem::offset_of!(CPUCacheInfo, inclusive) - 23usize]; + ["Offset of field: CPUCacheInfo::complex_indexing"] + [::std::mem::offset_of!(CPUCacheInfo, complex_indexing) - 24usize]; +}; +impl Default for CPUCacheInfo { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct CPUCaches { + pub l1d_cache: *mut CPUCacheInfo, + pub l1i_cache: *mut CPUCacheInfo, + pub l2_cache: *mut CPUCacheInfo, + pub l3_cache: *mut CPUCacheInfo, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUCaches"][::std::mem::size_of::() - 32usize]; + ["Alignment of CPUCaches"][::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUCaches::l1d_cache"] + [::std::mem::offset_of!(CPUCaches, l1d_cache) - 0usize]; + ["Offset of field: CPUCaches::l1i_cache"] + [::std::mem::offset_of!(CPUCaches, l1i_cache) - 8usize]; + ["Offset of field: CPUCaches::l2_cache"][::std::mem::offset_of!(CPUCaches, l2_cache) - 16usize]; + ["Offset of field: CPUCaches::l3_cache"][::std::mem::offset_of!(CPUCaches, l3_cache) - 24usize]; +}; +impl Default for CPUCaches { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[repr(align(16))] +#[derive(Copy, Clone)] +pub struct CPUArchState { + pub regs: [target_ulong; 16usize], + pub eip: target_ulong, + pub eflags: target_ulong, + pub cc_dst: target_ulong, + pub cc_src: target_ulong, + pub cc_src2: target_ulong, + pub cc_op: u32, + pub df: i32, + pub hflags: u32, + pub hflags2: u32, + pub segs: [SegmentCache; 6usize], + pub ldt: SegmentCache, + pub tr: SegmentCache, + pub gdt: SegmentCache, + pub idt: SegmentCache, + pub cr: [target_ulong; 5usize], + pub pdptrs_valid: bool, + pub pdptrs: [u64; 4usize], + pub a20_mask: i32, + pub bnd_regs: [BNDReg; 4usize], + pub bndcs_regs: BNDCSReg, + pub msr_bndcfgs: u64, + pub efer: u64, + pub start_init_save: CPUArchState__bindgen_ty_1, + pub fpstt: ::std::os::raw::c_uint, + pub fpus: u16, + pub fpuc: u16, + pub fptags: [u8; 8usize], + pub fpregs: [FPReg; 8usize], + pub fpop: u16, + pub fpcs: u16, + pub fpds: u16, + pub fpip: u64, + pub fpdp: u64, + pub fp_status: float_status, + pub ft0: floatx80, + pub mmx_status: float_status, + pub sse_status: float_status, + pub mxcsr: u32, + pub __bindgen_padding_0: u64, + pub xmm_regs: [ZMMReg; 32usize], + pub xmm_t0: ZMMReg, + pub mmx_t0: MMXReg, + pub opmask_regs: [u64; 8usize], + pub xtilecfg: [u8; 64usize], + pub xtiledata: [u8; 8192usize], + pub sysenter_cs: u32, + pub sysenter_esp: target_ulong, + pub sysenter_eip: target_ulong, + pub star: u64, + pub vm_hsave: u64, + pub lstar: target_ulong, + pub cstar: target_ulong, + pub fmask: target_ulong, + pub kernelgsbase: target_ulong, + pub tsc_adjust: u64, + pub tsc_deadline: u64, + pub tsc_aux: u64, + pub xcr0: u64, + pub mcg_status: u64, + pub msr_ia32_misc_enable: u64, + pub msr_ia32_feature_control: u64, + pub msr_ia32_sgxlepubkeyhash: [u64; 4usize], + pub msr_fixed_ctr_ctrl: u64, + pub msr_global_ctrl: u64, + pub msr_global_status: u64, + pub msr_global_ovf_ctrl: u64, + pub msr_fixed_counters: [u64; 3usize], + pub msr_gp_counters: [u64; 18usize], + pub msr_gp_evtsel: [u64; 18usize], + pub pat: u64, + pub smbase: u32, + pub msr_smi_count: u64, + pub pkru: u32, + pub pkrs: u32, + pub tsx_ctrl: u32, + pub spec_ctrl: u64, + pub amd_tsc_scale_msr: u64, + pub virt_ssbd: u64, + pub end_init_save: CPUArchState__bindgen_ty_2, + pub system_time_msr: u64, + pub wall_clock_msr: u64, + pub steal_time_msr: u64, + pub async_pf_en_msr: u64, + pub async_pf_int_msr: u64, + pub pv_eoi_en_msr: u64, + pub poll_control_msr: u64, + pub msr_hv_hypercall: u64, + pub msr_hv_guest_os_id: u64, + pub msr_hv_tsc: u64, + pub msr_hv_syndbg_control: u64, + pub msr_hv_syndbg_status: u64, + pub msr_hv_syndbg_send_page: u64, + pub msr_hv_syndbg_recv_page: u64, + pub msr_hv_syndbg_pending_page: u64, + pub msr_hv_syndbg_options: u64, + pub msr_hv_vapic: u64, + pub msr_hv_crash_params: [u64; 5usize], + pub msr_hv_runtime: u64, + pub msr_hv_synic_control: u64, + pub msr_hv_synic_evt_page: u64, + pub msr_hv_synic_msg_page: u64, + pub msr_hv_synic_sint: [u64; 16usize], + pub msr_hv_stimer_config: [u64; 4usize], + pub msr_hv_stimer_count: [u64; 4usize], + pub msr_hv_reenlightenment_control: u64, + pub msr_hv_tsc_emulation_control: u64, + pub msr_hv_tsc_emulation_status: u64, + pub msr_rtit_ctrl: u64, + pub msr_rtit_status: u64, + pub msr_rtit_output_base: u64, + pub msr_rtit_output_mask: u64, + pub msr_rtit_cr3_match: u64, + pub msr_rtit_addrs: [u64; 8usize], + pub msr_xfd: u64, + pub msr_xfd_err: u64, + pub msr_lbr_ctl: u64, + pub msr_lbr_depth: u64, + pub lbr_records: [LBREntry; 32usize], + pub error_code: ::std::os::raw::c_int, + pub exception_is_int: ::std::os::raw::c_int, + pub exception_next_eip: target_ulong, + pub dr: [target_ulong; 8usize], + pub __bindgen_anon_1: CPUArchState__bindgen_ty_3, + pub old_exception: ::std::os::raw::c_int, + pub vm_vmcb: u64, + pub tsc_offset: u64, + pub intercept: u64, + pub intercept_cr_read: u16, + pub intercept_cr_write: u16, + pub intercept_dr_read: u16, + pub intercept_dr_write: u16, + pub intercept_exceptions: u32, + pub nested_cr3: u64, + pub nested_pg_mode: u32, + pub v_tpr: u8, + pub int_ctl: u32, + pub nmi_injected: u8, + pub nmi_pending: u8, + pub retaddr: usize, + pub end_reset_fields: CPUArchState__bindgen_ty_4, + pub cpuid_level_func7: u32, + pub cpuid_min_level_func7: u32, + pub cpuid_min_level: u32, + pub cpuid_min_xlevel: u32, + pub cpuid_min_xlevel2: u32, + pub cpuid_max_level: u32, + pub cpuid_max_xlevel: u32, + pub cpuid_max_xlevel2: u32, + pub cpuid_level: u32, + pub cpuid_xlevel: u32, + pub cpuid_xlevel2: u32, + pub cpuid_vendor1: u32, + pub cpuid_vendor2: u32, + pub cpuid_vendor3: u32, + pub cpuid_version: u32, + pub features: FeatureWordArray, + pub user_features: FeatureWordArray, + pub cpuid_model: [u32; 12usize], + pub cache_info_cpuid2: CPUCaches, + pub cache_info_cpuid4: CPUCaches, + pub cache_info_amd: CPUCaches, + pub mtrr_fixed: [u64; 11usize], + pub mtrr_deftype: u64, + pub mtrr_var: [MTRRVar; 8usize], + pub mp_state: u32, + pub exception_nr: i32, + pub interrupt_injected: i32, + pub soft_interrupt: u8, + pub exception_pending: u8, + pub exception_injected: u8, + pub has_error_code: u8, + pub exception_has_payload: u8, + pub exception_payload: u64, + pub triple_fault_pending: u8, + pub ins_len: u32, + pub sipi_vector: u32, + pub tsc_valid: bool, + pub tsc_khz: i64, + pub user_tsc_khz: i64, + pub apic_bus_freq: u64, + pub tsc: u64, + pub mcg_cap: u64, + pub mcg_ctl: u64, + pub mcg_ext_ctl: u64, + pub mce_banks: [u64; 40usize], + pub xstate_bv: u64, + pub fpus_vmstate: u16, + pub fptag_vmstate: u16, + pub fpregs_format_vmstate: u16, + pub xss: u64, + pub umwait: u32, + pub tpr_access_type: TPRAccess, + pub nr_dies: ::std::os::raw::c_uint, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CPUArchState__bindgen_ty_1 {} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUArchState__bindgen_ty_1"] + [::std::mem::size_of::() - 0usize]; + ["Alignment of CPUArchState__bindgen_ty_1"] + [::std::mem::align_of::() - 1usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CPUArchState__bindgen_ty_2 {} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUArchState__bindgen_ty_2"] + [::std::mem::size_of::() - 0usize]; + ["Alignment of CPUArchState__bindgen_ty_2"] + [::std::mem::align_of::() - 1usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub union CPUArchState__bindgen_ty_3 { + pub cpu_breakpoint: [*mut CPUBreakpoint; 4usize], + pub cpu_watchpoint: [*mut CPUWatchpoint; 4usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUArchState__bindgen_ty_3"] + [::std::mem::size_of::() - 32usize]; + ["Alignment of CPUArchState__bindgen_ty_3"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUArchState__bindgen_ty_3::cpu_breakpoint"] + [::std::mem::offset_of!(CPUArchState__bindgen_ty_3, cpu_breakpoint) - 0usize]; + ["Offset of field: CPUArchState__bindgen_ty_3::cpu_watchpoint"] + [::std::mem::offset_of!(CPUArchState__bindgen_ty_3, cpu_watchpoint) - 0usize]; +}; +impl Default for CPUArchState__bindgen_ty_3 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUArchState__bindgen_ty_3 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "CPUArchState__bindgen_ty_3 {{ union }}") + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CPUArchState__bindgen_ty_4 {} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUArchState__bindgen_ty_4"] + [::std::mem::size_of::() - 0usize]; + ["Alignment of CPUArchState__bindgen_ty_4"] + [::std::mem::align_of::() - 1usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUArchState"][::std::mem::size_of::() - 14896usize]; + ["Alignment of CPUArchState"][::std::mem::align_of::() - 16usize]; + ["Offset of field: CPUArchState::regs"][::std::mem::offset_of!(CPUArchState, regs) - 0usize]; + ["Offset of field: CPUArchState::eip"][::std::mem::offset_of!(CPUArchState, eip) - 128usize]; + ["Offset of field: CPUArchState::eflags"] + [::std::mem::offset_of!(CPUArchState, eflags) - 136usize]; + ["Offset of field: CPUArchState::cc_dst"] + [::std::mem::offset_of!(CPUArchState, cc_dst) - 144usize]; + ["Offset of field: CPUArchState::cc_src"] + [::std::mem::offset_of!(CPUArchState, cc_src) - 152usize]; + ["Offset of field: CPUArchState::cc_src2"] + [::std::mem::offset_of!(CPUArchState, cc_src2) - 160usize]; + ["Offset of field: CPUArchState::cc_op"] + [::std::mem::offset_of!(CPUArchState, cc_op) - 168usize]; + ["Offset of field: CPUArchState::df"][::std::mem::offset_of!(CPUArchState, df) - 172usize]; + ["Offset of field: CPUArchState::hflags"] + [::std::mem::offset_of!(CPUArchState, hflags) - 176usize]; + ["Offset of field: CPUArchState::hflags2"] + [::std::mem::offset_of!(CPUArchState, hflags2) - 180usize]; + ["Offset of field: CPUArchState::segs"][::std::mem::offset_of!(CPUArchState, segs) - 184usize]; + ["Offset of field: CPUArchState::ldt"][::std::mem::offset_of!(CPUArchState, ldt) - 328usize]; + ["Offset of field: CPUArchState::tr"][::std::mem::offset_of!(CPUArchState, tr) - 352usize]; + ["Offset of field: CPUArchState::gdt"][::std::mem::offset_of!(CPUArchState, gdt) - 376usize]; + ["Offset of field: CPUArchState::idt"][::std::mem::offset_of!(CPUArchState, idt) - 400usize]; + ["Offset of field: CPUArchState::cr"][::std::mem::offset_of!(CPUArchState, cr) - 424usize]; + ["Offset of field: CPUArchState::pdptrs_valid"] + [::std::mem::offset_of!(CPUArchState, pdptrs_valid) - 464usize]; + ["Offset of field: CPUArchState::pdptrs"] + [::std::mem::offset_of!(CPUArchState, pdptrs) - 472usize]; + ["Offset of field: CPUArchState::a20_mask"] + [::std::mem::offset_of!(CPUArchState, a20_mask) - 504usize]; + ["Offset of field: CPUArchState::bnd_regs"] + [::std::mem::offset_of!(CPUArchState, bnd_regs) - 512usize]; + ["Offset of field: CPUArchState::bndcs_regs"] + [::std::mem::offset_of!(CPUArchState, bndcs_regs) - 576usize]; + ["Offset of field: CPUArchState::msr_bndcfgs"] + [::std::mem::offset_of!(CPUArchState, msr_bndcfgs) - 592usize]; + ["Offset of field: CPUArchState::efer"][::std::mem::offset_of!(CPUArchState, efer) - 600usize]; + ["Offset of field: CPUArchState::start_init_save"] + [::std::mem::offset_of!(CPUArchState, start_init_save) - 608usize]; + ["Offset of field: CPUArchState::fpstt"] + [::std::mem::offset_of!(CPUArchState, fpstt) - 608usize]; + ["Offset of field: CPUArchState::fpus"][::std::mem::offset_of!(CPUArchState, fpus) - 612usize]; + ["Offset of field: CPUArchState::fpuc"][::std::mem::offset_of!(CPUArchState, fpuc) - 614usize]; + ["Offset of field: CPUArchState::fptags"] + [::std::mem::offset_of!(CPUArchState, fptags) - 616usize]; + ["Offset of field: CPUArchState::fpregs"] + [::std::mem::offset_of!(CPUArchState, fpregs) - 624usize]; + ["Offset of field: CPUArchState::fpop"][::std::mem::offset_of!(CPUArchState, fpop) - 752usize]; + ["Offset of field: CPUArchState::fpcs"][::std::mem::offset_of!(CPUArchState, fpcs) - 754usize]; + ["Offset of field: CPUArchState::fpds"][::std::mem::offset_of!(CPUArchState, fpds) - 756usize]; + ["Offset of field: CPUArchState::fpip"][::std::mem::offset_of!(CPUArchState, fpip) - 760usize]; + ["Offset of field: CPUArchState::fpdp"][::std::mem::offset_of!(CPUArchState, fpdp) - 768usize]; + ["Offset of field: CPUArchState::fp_status"] + [::std::mem::offset_of!(CPUArchState, fp_status) - 776usize]; + ["Offset of field: CPUArchState::ft0"][::std::mem::offset_of!(CPUArchState, ft0) - 792usize]; + ["Offset of field: CPUArchState::mmx_status"] + [::std::mem::offset_of!(CPUArchState, mmx_status) - 808usize]; + ["Offset of field: CPUArchState::sse_status"] + [::std::mem::offset_of!(CPUArchState, sse_status) - 822usize]; + ["Offset of field: CPUArchState::mxcsr"] + [::std::mem::offset_of!(CPUArchState, mxcsr) - 836usize]; + ["Offset of field: CPUArchState::xmm_regs"] + [::std::mem::offset_of!(CPUArchState, xmm_regs) - 848usize]; + ["Offset of field: CPUArchState::xmm_t0"] + [::std::mem::offset_of!(CPUArchState, xmm_t0) - 2896usize]; + ["Offset of field: CPUArchState::mmx_t0"] + [::std::mem::offset_of!(CPUArchState, mmx_t0) - 2960usize]; + ["Offset of field: CPUArchState::opmask_regs"] + [::std::mem::offset_of!(CPUArchState, opmask_regs) - 2968usize]; + ["Offset of field: CPUArchState::xtilecfg"] + [::std::mem::offset_of!(CPUArchState, xtilecfg) - 3032usize]; + ["Offset of field: CPUArchState::xtiledata"] + [::std::mem::offset_of!(CPUArchState, xtiledata) - 3096usize]; + ["Offset of field: CPUArchState::sysenter_cs"] + [::std::mem::offset_of!(CPUArchState, sysenter_cs) - 11288usize]; + ["Offset of field: CPUArchState::sysenter_esp"] + [::std::mem::offset_of!(CPUArchState, sysenter_esp) - 11296usize]; + ["Offset of field: CPUArchState::sysenter_eip"] + [::std::mem::offset_of!(CPUArchState, sysenter_eip) - 11304usize]; + ["Offset of field: CPUArchState::star"] + [::std::mem::offset_of!(CPUArchState, star) - 11312usize]; + ["Offset of field: CPUArchState::vm_hsave"] + [::std::mem::offset_of!(CPUArchState, vm_hsave) - 11320usize]; + ["Offset of field: CPUArchState::lstar"] + [::std::mem::offset_of!(CPUArchState, lstar) - 11328usize]; + ["Offset of field: CPUArchState::cstar"] + [::std::mem::offset_of!(CPUArchState, cstar) - 11336usize]; + ["Offset of field: CPUArchState::fmask"] + [::std::mem::offset_of!(CPUArchState, fmask) - 11344usize]; + ["Offset of field: CPUArchState::kernelgsbase"] + [::std::mem::offset_of!(CPUArchState, kernelgsbase) - 11352usize]; + ["Offset of field: CPUArchState::tsc_adjust"] + [::std::mem::offset_of!(CPUArchState, tsc_adjust) - 11360usize]; + ["Offset of field: CPUArchState::tsc_deadline"] + [::std::mem::offset_of!(CPUArchState, tsc_deadline) - 11368usize]; + ["Offset of field: CPUArchState::tsc_aux"] + [::std::mem::offset_of!(CPUArchState, tsc_aux) - 11376usize]; + ["Offset of field: CPUArchState::xcr0"] + [::std::mem::offset_of!(CPUArchState, xcr0) - 11384usize]; + ["Offset of field: CPUArchState::mcg_status"] + [::std::mem::offset_of!(CPUArchState, mcg_status) - 11392usize]; + ["Offset of field: CPUArchState::msr_ia32_misc_enable"] + [::std::mem::offset_of!(CPUArchState, msr_ia32_misc_enable) - 11400usize]; + ["Offset of field: CPUArchState::msr_ia32_feature_control"] + [::std::mem::offset_of!(CPUArchState, msr_ia32_feature_control) - 11408usize]; + ["Offset of field: CPUArchState::msr_ia32_sgxlepubkeyhash"] + [::std::mem::offset_of!(CPUArchState, msr_ia32_sgxlepubkeyhash) - 11416usize]; + ["Offset of field: CPUArchState::msr_fixed_ctr_ctrl"] + [::std::mem::offset_of!(CPUArchState, msr_fixed_ctr_ctrl) - 11448usize]; + ["Offset of field: CPUArchState::msr_global_ctrl"] + [::std::mem::offset_of!(CPUArchState, msr_global_ctrl) - 11456usize]; + ["Offset of field: CPUArchState::msr_global_status"] + [::std::mem::offset_of!(CPUArchState, msr_global_status) - 11464usize]; + ["Offset of field: CPUArchState::msr_global_ovf_ctrl"] + [::std::mem::offset_of!(CPUArchState, msr_global_ovf_ctrl) - 11472usize]; + ["Offset of field: CPUArchState::msr_fixed_counters"] + [::std::mem::offset_of!(CPUArchState, msr_fixed_counters) - 11480usize]; + ["Offset of field: CPUArchState::msr_gp_counters"] + [::std::mem::offset_of!(CPUArchState, msr_gp_counters) - 11504usize]; + ["Offset of field: CPUArchState::msr_gp_evtsel"] + [::std::mem::offset_of!(CPUArchState, msr_gp_evtsel) - 11648usize]; + ["Offset of field: CPUArchState::pat"][::std::mem::offset_of!(CPUArchState, pat) - 11792usize]; + ["Offset of field: CPUArchState::smbase"] + [::std::mem::offset_of!(CPUArchState, smbase) - 11800usize]; + ["Offset of field: CPUArchState::msr_smi_count"] + [::std::mem::offset_of!(CPUArchState, msr_smi_count) - 11808usize]; + ["Offset of field: CPUArchState::pkru"] + [::std::mem::offset_of!(CPUArchState, pkru) - 11816usize]; + ["Offset of field: CPUArchState::pkrs"] + [::std::mem::offset_of!(CPUArchState, pkrs) - 11820usize]; + ["Offset of field: CPUArchState::tsx_ctrl"] + [::std::mem::offset_of!(CPUArchState, tsx_ctrl) - 11824usize]; + ["Offset of field: CPUArchState::spec_ctrl"] + [::std::mem::offset_of!(CPUArchState, spec_ctrl) - 11832usize]; + ["Offset of field: CPUArchState::amd_tsc_scale_msr"] + [::std::mem::offset_of!(CPUArchState, amd_tsc_scale_msr) - 11840usize]; + ["Offset of field: CPUArchState::virt_ssbd"] + [::std::mem::offset_of!(CPUArchState, virt_ssbd) - 11848usize]; + ["Offset of field: CPUArchState::end_init_save"] + [::std::mem::offset_of!(CPUArchState, end_init_save) - 11856usize]; + ["Offset of field: CPUArchState::system_time_msr"] + [::std::mem::offset_of!(CPUArchState, system_time_msr) - 11856usize]; + ["Offset of field: CPUArchState::wall_clock_msr"] + [::std::mem::offset_of!(CPUArchState, wall_clock_msr) - 11864usize]; + ["Offset of field: CPUArchState::steal_time_msr"] + [::std::mem::offset_of!(CPUArchState, steal_time_msr) - 11872usize]; + ["Offset of field: CPUArchState::async_pf_en_msr"] + [::std::mem::offset_of!(CPUArchState, async_pf_en_msr) - 11880usize]; + ["Offset of field: CPUArchState::async_pf_int_msr"] + [::std::mem::offset_of!(CPUArchState, async_pf_int_msr) - 11888usize]; + ["Offset of field: CPUArchState::pv_eoi_en_msr"] + [::std::mem::offset_of!(CPUArchState, pv_eoi_en_msr) - 11896usize]; + ["Offset of field: CPUArchState::poll_control_msr"] + [::std::mem::offset_of!(CPUArchState, poll_control_msr) - 11904usize]; + ["Offset of field: CPUArchState::msr_hv_hypercall"] + [::std::mem::offset_of!(CPUArchState, msr_hv_hypercall) - 11912usize]; + ["Offset of field: CPUArchState::msr_hv_guest_os_id"] + [::std::mem::offset_of!(CPUArchState, msr_hv_guest_os_id) - 11920usize]; + ["Offset of field: CPUArchState::msr_hv_tsc"] + [::std::mem::offset_of!(CPUArchState, msr_hv_tsc) - 11928usize]; + ["Offset of field: CPUArchState::msr_hv_syndbg_control"] + [::std::mem::offset_of!(CPUArchState, msr_hv_syndbg_control) - 11936usize]; + ["Offset of field: CPUArchState::msr_hv_syndbg_status"] + [::std::mem::offset_of!(CPUArchState, msr_hv_syndbg_status) - 11944usize]; + ["Offset of field: CPUArchState::msr_hv_syndbg_send_page"] + [::std::mem::offset_of!(CPUArchState, msr_hv_syndbg_send_page) - 11952usize]; + ["Offset of field: CPUArchState::msr_hv_syndbg_recv_page"] + [::std::mem::offset_of!(CPUArchState, msr_hv_syndbg_recv_page) - 11960usize]; + ["Offset of field: CPUArchState::msr_hv_syndbg_pending_page"] + [::std::mem::offset_of!(CPUArchState, msr_hv_syndbg_pending_page) - 11968usize]; + ["Offset of field: CPUArchState::msr_hv_syndbg_options"] + [::std::mem::offset_of!(CPUArchState, msr_hv_syndbg_options) - 11976usize]; + ["Offset of field: CPUArchState::msr_hv_vapic"] + [::std::mem::offset_of!(CPUArchState, msr_hv_vapic) - 11984usize]; + ["Offset of field: CPUArchState::msr_hv_crash_params"] + [::std::mem::offset_of!(CPUArchState, msr_hv_crash_params) - 11992usize]; + ["Offset of field: CPUArchState::msr_hv_runtime"] + [::std::mem::offset_of!(CPUArchState, msr_hv_runtime) - 12032usize]; + ["Offset of field: CPUArchState::msr_hv_synic_control"] + [::std::mem::offset_of!(CPUArchState, msr_hv_synic_control) - 12040usize]; + ["Offset of field: CPUArchState::msr_hv_synic_evt_page"] + [::std::mem::offset_of!(CPUArchState, msr_hv_synic_evt_page) - 12048usize]; + ["Offset of field: CPUArchState::msr_hv_synic_msg_page"] + [::std::mem::offset_of!(CPUArchState, msr_hv_synic_msg_page) - 12056usize]; + ["Offset of field: CPUArchState::msr_hv_synic_sint"] + [::std::mem::offset_of!(CPUArchState, msr_hv_synic_sint) - 12064usize]; + ["Offset of field: CPUArchState::msr_hv_stimer_config"] + [::std::mem::offset_of!(CPUArchState, msr_hv_stimer_config) - 12192usize]; + ["Offset of field: CPUArchState::msr_hv_stimer_count"] + [::std::mem::offset_of!(CPUArchState, msr_hv_stimer_count) - 12224usize]; + ["Offset of field: CPUArchState::msr_hv_reenlightenment_control"] + [::std::mem::offset_of!(CPUArchState, msr_hv_reenlightenment_control) - 12256usize]; + ["Offset of field: CPUArchState::msr_hv_tsc_emulation_control"] + [::std::mem::offset_of!(CPUArchState, msr_hv_tsc_emulation_control) - 12264usize]; + ["Offset of field: CPUArchState::msr_hv_tsc_emulation_status"] + [::std::mem::offset_of!(CPUArchState, msr_hv_tsc_emulation_status) - 12272usize]; + ["Offset of field: CPUArchState::msr_rtit_ctrl"] + [::std::mem::offset_of!(CPUArchState, msr_rtit_ctrl) - 12280usize]; + ["Offset of field: CPUArchState::msr_rtit_status"] + [::std::mem::offset_of!(CPUArchState, msr_rtit_status) - 12288usize]; + ["Offset of field: CPUArchState::msr_rtit_output_base"] + [::std::mem::offset_of!(CPUArchState, msr_rtit_output_base) - 12296usize]; + ["Offset of field: CPUArchState::msr_rtit_output_mask"] + [::std::mem::offset_of!(CPUArchState, msr_rtit_output_mask) - 12304usize]; + ["Offset of field: CPUArchState::msr_rtit_cr3_match"] + [::std::mem::offset_of!(CPUArchState, msr_rtit_cr3_match) - 12312usize]; + ["Offset of field: CPUArchState::msr_rtit_addrs"] + [::std::mem::offset_of!(CPUArchState, msr_rtit_addrs) - 12320usize]; + ["Offset of field: CPUArchState::msr_xfd"] + [::std::mem::offset_of!(CPUArchState, msr_xfd) - 12384usize]; + ["Offset of field: CPUArchState::msr_xfd_err"] + [::std::mem::offset_of!(CPUArchState, msr_xfd_err) - 12392usize]; + ["Offset of field: CPUArchState::msr_lbr_ctl"] + [::std::mem::offset_of!(CPUArchState, msr_lbr_ctl) - 12400usize]; + ["Offset of field: CPUArchState::msr_lbr_depth"] + [::std::mem::offset_of!(CPUArchState, msr_lbr_depth) - 12408usize]; + ["Offset of field: CPUArchState::lbr_records"] + [::std::mem::offset_of!(CPUArchState, lbr_records) - 12416usize]; + ["Offset of field: CPUArchState::error_code"] + [::std::mem::offset_of!(CPUArchState, error_code) - 13184usize]; + ["Offset of field: CPUArchState::exception_is_int"] + [::std::mem::offset_of!(CPUArchState, exception_is_int) - 13188usize]; + ["Offset of field: CPUArchState::exception_next_eip"] + [::std::mem::offset_of!(CPUArchState, exception_next_eip) - 13192usize]; + ["Offset of field: CPUArchState::dr"][::std::mem::offset_of!(CPUArchState, dr) - 13200usize]; + ["Offset of field: CPUArchState::old_exception"] + [::std::mem::offset_of!(CPUArchState, old_exception) - 13296usize]; + ["Offset of field: CPUArchState::vm_vmcb"] + [::std::mem::offset_of!(CPUArchState, vm_vmcb) - 13304usize]; + ["Offset of field: CPUArchState::tsc_offset"] + [::std::mem::offset_of!(CPUArchState, tsc_offset) - 13312usize]; + ["Offset of field: CPUArchState::intercept"] + [::std::mem::offset_of!(CPUArchState, intercept) - 13320usize]; + ["Offset of field: CPUArchState::intercept_cr_read"] + [::std::mem::offset_of!(CPUArchState, intercept_cr_read) - 13328usize]; + ["Offset of field: CPUArchState::intercept_cr_write"] + [::std::mem::offset_of!(CPUArchState, intercept_cr_write) - 13330usize]; + ["Offset of field: CPUArchState::intercept_dr_read"] + [::std::mem::offset_of!(CPUArchState, intercept_dr_read) - 13332usize]; + ["Offset of field: CPUArchState::intercept_dr_write"] + [::std::mem::offset_of!(CPUArchState, intercept_dr_write) - 13334usize]; + ["Offset of field: CPUArchState::intercept_exceptions"] + [::std::mem::offset_of!(CPUArchState, intercept_exceptions) - 13336usize]; + ["Offset of field: CPUArchState::nested_cr3"] + [::std::mem::offset_of!(CPUArchState, nested_cr3) - 13344usize]; + ["Offset of field: CPUArchState::nested_pg_mode"] + [::std::mem::offset_of!(CPUArchState, nested_pg_mode) - 13352usize]; + ["Offset of field: CPUArchState::v_tpr"] + [::std::mem::offset_of!(CPUArchState, v_tpr) - 13356usize]; + ["Offset of field: CPUArchState::int_ctl"] + [::std::mem::offset_of!(CPUArchState, int_ctl) - 13360usize]; + ["Offset of field: CPUArchState::nmi_injected"] + [::std::mem::offset_of!(CPUArchState, nmi_injected) - 13364usize]; + ["Offset of field: CPUArchState::nmi_pending"] + [::std::mem::offset_of!(CPUArchState, nmi_pending) - 13365usize]; + ["Offset of field: CPUArchState::retaddr"] + [::std::mem::offset_of!(CPUArchState, retaddr) - 13368usize]; + ["Offset of field: CPUArchState::end_reset_fields"] + [::std::mem::offset_of!(CPUArchState, end_reset_fields) - 13376usize]; + ["Offset of field: CPUArchState::cpuid_level_func7"] + [::std::mem::offset_of!(CPUArchState, cpuid_level_func7) - 13376usize]; + ["Offset of field: CPUArchState::cpuid_min_level_func7"] + [::std::mem::offset_of!(CPUArchState, cpuid_min_level_func7) - 13380usize]; + ["Offset of field: CPUArchState::cpuid_min_level"] + [::std::mem::offset_of!(CPUArchState, cpuid_min_level) - 13384usize]; + ["Offset of field: CPUArchState::cpuid_min_xlevel"] + [::std::mem::offset_of!(CPUArchState, cpuid_min_xlevel) - 13388usize]; + ["Offset of field: CPUArchState::cpuid_min_xlevel2"] + [::std::mem::offset_of!(CPUArchState, cpuid_min_xlevel2) - 13392usize]; + ["Offset of field: CPUArchState::cpuid_max_level"] + [::std::mem::offset_of!(CPUArchState, cpuid_max_level) - 13396usize]; + ["Offset of field: CPUArchState::cpuid_max_xlevel"] + [::std::mem::offset_of!(CPUArchState, cpuid_max_xlevel) - 13400usize]; + ["Offset of field: CPUArchState::cpuid_max_xlevel2"] + [::std::mem::offset_of!(CPUArchState, cpuid_max_xlevel2) - 13404usize]; + ["Offset of field: CPUArchState::cpuid_level"] + [::std::mem::offset_of!(CPUArchState, cpuid_level) - 13408usize]; + ["Offset of field: CPUArchState::cpuid_xlevel"] + [::std::mem::offset_of!(CPUArchState, cpuid_xlevel) - 13412usize]; + ["Offset of field: CPUArchState::cpuid_xlevel2"] + [::std::mem::offset_of!(CPUArchState, cpuid_xlevel2) - 13416usize]; + ["Offset of field: CPUArchState::cpuid_vendor1"] + [::std::mem::offset_of!(CPUArchState, cpuid_vendor1) - 13420usize]; + ["Offset of field: CPUArchState::cpuid_vendor2"] + [::std::mem::offset_of!(CPUArchState, cpuid_vendor2) - 13424usize]; + ["Offset of field: CPUArchState::cpuid_vendor3"] + [::std::mem::offset_of!(CPUArchState, cpuid_vendor3) - 13428usize]; + ["Offset of field: CPUArchState::cpuid_version"] + [::std::mem::offset_of!(CPUArchState, cpuid_version) - 13432usize]; + ["Offset of field: CPUArchState::features"] + [::std::mem::offset_of!(CPUArchState, features) - 13440usize]; + ["Offset of field: CPUArchState::user_features"] + [::std::mem::offset_of!(CPUArchState, user_features) - 13752usize]; + ["Offset of field: CPUArchState::cpuid_model"] + [::std::mem::offset_of!(CPUArchState, cpuid_model) - 14064usize]; + ["Offset of field: CPUArchState::cache_info_cpuid2"] + [::std::mem::offset_of!(CPUArchState, cache_info_cpuid2) - 14112usize]; + ["Offset of field: CPUArchState::cache_info_cpuid4"] + [::std::mem::offset_of!(CPUArchState, cache_info_cpuid4) - 14144usize]; + ["Offset of field: CPUArchState::cache_info_amd"] + [::std::mem::offset_of!(CPUArchState, cache_info_amd) - 14176usize]; + ["Offset of field: CPUArchState::mtrr_fixed"] + [::std::mem::offset_of!(CPUArchState, mtrr_fixed) - 14208usize]; + ["Offset of field: CPUArchState::mtrr_deftype"] + [::std::mem::offset_of!(CPUArchState, mtrr_deftype) - 14296usize]; + ["Offset of field: CPUArchState::mtrr_var"] + [::std::mem::offset_of!(CPUArchState, mtrr_var) - 14304usize]; + ["Offset of field: CPUArchState::mp_state"] + [::std::mem::offset_of!(CPUArchState, mp_state) - 14432usize]; + ["Offset of field: CPUArchState::exception_nr"] + [::std::mem::offset_of!(CPUArchState, exception_nr) - 14436usize]; + ["Offset of field: CPUArchState::interrupt_injected"] + [::std::mem::offset_of!(CPUArchState, interrupt_injected) - 14440usize]; + ["Offset of field: CPUArchState::soft_interrupt"] + [::std::mem::offset_of!(CPUArchState, soft_interrupt) - 14444usize]; + ["Offset of field: CPUArchState::exception_pending"] + [::std::mem::offset_of!(CPUArchState, exception_pending) - 14445usize]; + ["Offset of field: CPUArchState::exception_injected"] + [::std::mem::offset_of!(CPUArchState, exception_injected) - 14446usize]; + ["Offset of field: CPUArchState::has_error_code"] + [::std::mem::offset_of!(CPUArchState, has_error_code) - 14447usize]; + ["Offset of field: CPUArchState::exception_has_payload"] + [::std::mem::offset_of!(CPUArchState, exception_has_payload) - 14448usize]; + ["Offset of field: CPUArchState::exception_payload"] + [::std::mem::offset_of!(CPUArchState, exception_payload) - 14456usize]; + ["Offset of field: CPUArchState::triple_fault_pending"] + [::std::mem::offset_of!(CPUArchState, triple_fault_pending) - 14464usize]; + ["Offset of field: CPUArchState::ins_len"] + [::std::mem::offset_of!(CPUArchState, ins_len) - 14468usize]; + ["Offset of field: CPUArchState::sipi_vector"] + [::std::mem::offset_of!(CPUArchState, sipi_vector) - 14472usize]; + ["Offset of field: CPUArchState::tsc_valid"] + [::std::mem::offset_of!(CPUArchState, tsc_valid) - 14476usize]; + ["Offset of field: CPUArchState::tsc_khz"] + [::std::mem::offset_of!(CPUArchState, tsc_khz) - 14480usize]; + ["Offset of field: CPUArchState::user_tsc_khz"] + [::std::mem::offset_of!(CPUArchState, user_tsc_khz) - 14488usize]; + ["Offset of field: CPUArchState::apic_bus_freq"] + [::std::mem::offset_of!(CPUArchState, apic_bus_freq) - 14496usize]; + ["Offset of field: CPUArchState::tsc"][::std::mem::offset_of!(CPUArchState, tsc) - 14504usize]; + ["Offset of field: CPUArchState::mcg_cap"] + [::std::mem::offset_of!(CPUArchState, mcg_cap) - 14512usize]; + ["Offset of field: CPUArchState::mcg_ctl"] + [::std::mem::offset_of!(CPUArchState, mcg_ctl) - 14520usize]; + ["Offset of field: CPUArchState::mcg_ext_ctl"] + [::std::mem::offset_of!(CPUArchState, mcg_ext_ctl) - 14528usize]; + ["Offset of field: CPUArchState::mce_banks"] + [::std::mem::offset_of!(CPUArchState, mce_banks) - 14536usize]; + ["Offset of field: CPUArchState::xstate_bv"] + [::std::mem::offset_of!(CPUArchState, xstate_bv) - 14856usize]; + ["Offset of field: CPUArchState::fpus_vmstate"] + [::std::mem::offset_of!(CPUArchState, fpus_vmstate) - 14864usize]; + ["Offset of field: CPUArchState::fptag_vmstate"] + [::std::mem::offset_of!(CPUArchState, fptag_vmstate) - 14866usize]; + ["Offset of field: CPUArchState::fpregs_format_vmstate"] + [::std::mem::offset_of!(CPUArchState, fpregs_format_vmstate) - 14868usize]; + ["Offset of field: CPUArchState::xss"][::std::mem::offset_of!(CPUArchState, xss) - 14872usize]; + ["Offset of field: CPUArchState::umwait"] + [::std::mem::offset_of!(CPUArchState, umwait) - 14880usize]; + ["Offset of field: CPUArchState::tpr_access_type"] + [::std::mem::offset_of!(CPUArchState, tpr_access_type) - 14884usize]; + ["Offset of field: CPUArchState::nr_dies"] + [::std::mem::offset_of!(CPUArchState, nr_dies) - 14888usize]; +}; +impl Default for CPUArchState { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for CPUArchState { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "CPUArchState {{ regs: {:?}, segs: {:?}, ldt: {:?}, tr: {:?}, gdt: {:?}, idt: {:?}, cr: {:?}, pdptrs_valid: {:?}, pdptrs: {:?}, bnd_regs: {:?}, bndcs_regs: {:?}, start_init_save: {:?}, fpstt: {:?}, fptags: {:?}, fpregs: {:?}, fp_status: {:?}, ft0: {:?}, mmx_status: {:?}, sse_status: {:?}, xmm_regs: {:?}, xmm_t0: {:?}, mmx_t0: {:?}, opmask_regs: {:?}, xtilecfg: {:?}, xtiledata: {:?}, msr_ia32_sgxlepubkeyhash: {:?}, msr_fixed_counters: {:?}, msr_gp_counters: {:?}, msr_gp_evtsel: {:?}, end_init_save: {:?}, msr_hv_crash_params: {:?}, msr_hv_synic_sint: {:?}, msr_hv_stimer_config: {:?}, msr_hv_stimer_count: {:?}, msr_rtit_addrs: {:?}, lbr_records: {:?}, error_code: {:?}, exception_is_int: {:?}, dr: {:?}, __bindgen_anon_1: {:?}, old_exception: {:?}, end_reset_fields: {:?}, features: {:?}, user_features: {:?}, cpuid_model: {:?}, cache_info_cpuid2: {:?}, cache_info_cpuid4: {:?}, cache_info_amd: {:?}, mtrr_fixed: {:?}, mtrr_var: {:?}, tsc_valid: {:?}, mce_banks: {:?}, tpr_access_type: {:?}, nr_dies: {:?} }}" , self . regs , self . segs , self . ldt , self . tr , self . gdt , self . idt , self . cr , self . pdptrs_valid , self . pdptrs , self . bnd_regs , self . bndcs_regs , self . start_init_save , self . fpstt , self . fptags , self . fpregs , self . fp_status , self . ft0 , self . mmx_status , self . sse_status , self . xmm_regs , self . xmm_t0 , self . mmx_t0 , self . opmask_regs , self . xtilecfg , self . xtiledata , self . msr_ia32_sgxlepubkeyhash , self . msr_fixed_counters , self . msr_gp_counters , self . msr_gp_evtsel , self . end_init_save , self . msr_hv_crash_params , self . msr_hv_synic_sint , self . msr_hv_stimer_config , self . msr_hv_stimer_count , self . msr_rtit_addrs , self . lbr_records , self . error_code , self . exception_is_int , self . dr , self . __bindgen_anon_1 , self . old_exception , self . end_reset_fields , self . features , self . user_features , self . cpuid_model , self . cache_info_cpuid2 , self . cache_info_cpuid4 , self . cache_info_amd , self . mtrr_fixed , self . mtrr_var , self . tsc_valid , self . mce_banks , self . tpr_access_type , self . nr_dies) + } +} +pub type CPUX86State = CPUArchState; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct kvm_msrs { + _unused: [u8; 0], +} +#[doc = " X86CPU:\n @env: #CPUX86State\n @migratable: If set, only migratable flags will be accepted when \"enforce\"\n mode is used, and only migratable flags will be included in the \"host\"\n CPU model.\n\n An x86 CPU."] +#[repr(C)] +#[repr(align(16))] +pub struct ArchCPU { + pub parent_obj: CPUState, + pub env: CPUX86State, + pub vmsentry: *mut VMChangeStateEntry, + pub ucode_rev: u64, + pub hyperv_spinlock_attempts: u32, + pub hyperv_vendor: *mut ::std::os::raw::c_char, + pub hyperv_synic_kvm_only: bool, + pub hyperv_features: u64, + pub hyperv_passthrough: bool, + pub hyperv_no_nonarch_cs: OnOffAuto, + pub hyperv_vendor_id: [u32; 3usize], + pub hyperv_interface_id: [u32; 4usize], + pub hyperv_limits: [u32; 3usize], + pub hyperv_enforce_cpuid: bool, + pub hyperv_ver_id_build: u32, + pub hyperv_ver_id_major: u16, + pub hyperv_ver_id_minor: u16, + pub hyperv_ver_id_sp: u32, + pub hyperv_ver_id_sb: u8, + pub hyperv_ver_id_sn: u32, + pub check_cpuid: bool, + pub enforce_cpuid: bool, + pub force_features: bool, + pub expose_kvm: bool, + pub expose_tcg: bool, + pub migratable: bool, + pub migrate_smi_count: bool, + pub max_features: bool, + pub apic_id: u32, + pub vmware_cpuid_freq: bool, + pub cache_info_passthrough: bool, + pub mwait: ArchCPU__bindgen_ty_1, + pub filtered_features: FeatureWordArray, + pub enable_pmu: bool, + pub lbr_fmt: u64, + pub enable_lmce: bool, + pub enable_l3_cache: bool, + pub legacy_cache: bool, + pub enable_cpuid_0xb: bool, + pub full_cpuid_auto_level: bool, + pub vendor_cpuid_only: bool, + pub intel_pt_auto_level: bool, + pub fill_mtrr_mask: bool, + pub host_phys_bits: bool, + pub host_phys_bits_limit: u8, + pub kvm_no_smi_migration: bool, + pub kvm_pv_enforce_cpuid: bool, + pub phys_bits: u32, + pub apic_state: *mut DeviceState, + pub cpu_as_root: *mut MemoryRegion, + pub cpu_as_mem: *mut MemoryRegion, + pub smram: *mut MemoryRegion, + pub machine_done: Notifier, + pub kvm_msr_buf: *mut kvm_msrs, + pub node_id: i32, + pub socket_id: i32, + pub die_id: i32, + pub core_id: i32, + pub thread_id: i32, + pub hv_max_vps: i32, + pub xen_vapic: bool, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct ArchCPU__bindgen_ty_1 { + pub eax: u32, + pub ebx: u32, + pub ecx: u32, + pub edx: u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ArchCPU__bindgen_ty_1"][::std::mem::size_of::() - 16usize]; + ["Alignment of ArchCPU__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: ArchCPU__bindgen_ty_1::eax"] + [::std::mem::offset_of!(ArchCPU__bindgen_ty_1, eax) - 0usize]; + ["Offset of field: ArchCPU__bindgen_ty_1::ebx"] + [::std::mem::offset_of!(ArchCPU__bindgen_ty_1, ebx) - 4usize]; + ["Offset of field: ArchCPU__bindgen_ty_1::ecx"] + [::std::mem::offset_of!(ArchCPU__bindgen_ty_1, ecx) - 8usize]; + ["Offset of field: ArchCPU__bindgen_ty_1::edx"] + [::std::mem::offset_of!(ArchCPU__bindgen_ty_1, edx) - 12usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of ArchCPU"][::std::mem::size_of::() - 25664usize]; + ["Alignment of ArchCPU"][::std::mem::align_of::() - 16usize]; + ["Offset of field: ArchCPU::parent_obj"][::std::mem::offset_of!(ArchCPU, parent_obj) - 0usize]; + ["Offset of field: ArchCPU::env"][::std::mem::offset_of!(ArchCPU, env) - 10176usize]; + ["Offset of field: ArchCPU::vmsentry"][::std::mem::offset_of!(ArchCPU, vmsentry) - 25072usize]; + ["Offset of field: ArchCPU::ucode_rev"] + [::std::mem::offset_of!(ArchCPU, ucode_rev) - 25080usize]; + ["Offset of field: ArchCPU::hyperv_spinlock_attempts"] + [::std::mem::offset_of!(ArchCPU, hyperv_spinlock_attempts) - 25088usize]; + ["Offset of field: ArchCPU::hyperv_vendor"] + [::std::mem::offset_of!(ArchCPU, hyperv_vendor) - 25096usize]; + ["Offset of field: ArchCPU::hyperv_synic_kvm_only"] + [::std::mem::offset_of!(ArchCPU, hyperv_synic_kvm_only) - 25104usize]; + ["Offset of field: ArchCPU::hyperv_features"] + [::std::mem::offset_of!(ArchCPU, hyperv_features) - 25112usize]; + ["Offset of field: ArchCPU::hyperv_passthrough"] + [::std::mem::offset_of!(ArchCPU, hyperv_passthrough) - 25120usize]; + ["Offset of field: ArchCPU::hyperv_no_nonarch_cs"] + [::std::mem::offset_of!(ArchCPU, hyperv_no_nonarch_cs) - 25124usize]; + ["Offset of field: ArchCPU::hyperv_vendor_id"] + [::std::mem::offset_of!(ArchCPU, hyperv_vendor_id) - 25128usize]; + ["Offset of field: ArchCPU::hyperv_interface_id"] + [::std::mem::offset_of!(ArchCPU, hyperv_interface_id) - 25140usize]; + ["Offset of field: ArchCPU::hyperv_limits"] + [::std::mem::offset_of!(ArchCPU, hyperv_limits) - 25156usize]; + ["Offset of field: ArchCPU::hyperv_enforce_cpuid"] + [::std::mem::offset_of!(ArchCPU, hyperv_enforce_cpuid) - 25168usize]; + ["Offset of field: ArchCPU::hyperv_ver_id_build"] + [::std::mem::offset_of!(ArchCPU, hyperv_ver_id_build) - 25172usize]; + ["Offset of field: ArchCPU::hyperv_ver_id_major"] + [::std::mem::offset_of!(ArchCPU, hyperv_ver_id_major) - 25176usize]; + ["Offset of field: ArchCPU::hyperv_ver_id_minor"] + [::std::mem::offset_of!(ArchCPU, hyperv_ver_id_minor) - 25178usize]; + ["Offset of field: ArchCPU::hyperv_ver_id_sp"] + [::std::mem::offset_of!(ArchCPU, hyperv_ver_id_sp) - 25180usize]; + ["Offset of field: ArchCPU::hyperv_ver_id_sb"] + [::std::mem::offset_of!(ArchCPU, hyperv_ver_id_sb) - 25184usize]; + ["Offset of field: ArchCPU::hyperv_ver_id_sn"] + [::std::mem::offset_of!(ArchCPU, hyperv_ver_id_sn) - 25188usize]; + ["Offset of field: ArchCPU::check_cpuid"] + [::std::mem::offset_of!(ArchCPU, check_cpuid) - 25192usize]; + ["Offset of field: ArchCPU::enforce_cpuid"] + [::std::mem::offset_of!(ArchCPU, enforce_cpuid) - 25193usize]; + ["Offset of field: ArchCPU::force_features"] + [::std::mem::offset_of!(ArchCPU, force_features) - 25194usize]; + ["Offset of field: ArchCPU::expose_kvm"] + [::std::mem::offset_of!(ArchCPU, expose_kvm) - 25195usize]; + ["Offset of field: ArchCPU::expose_tcg"] + [::std::mem::offset_of!(ArchCPU, expose_tcg) - 25196usize]; + ["Offset of field: ArchCPU::migratable"] + [::std::mem::offset_of!(ArchCPU, migratable) - 25197usize]; + ["Offset of field: ArchCPU::migrate_smi_count"] + [::std::mem::offset_of!(ArchCPU, migrate_smi_count) - 25198usize]; + ["Offset of field: ArchCPU::max_features"] + [::std::mem::offset_of!(ArchCPU, max_features) - 25199usize]; + ["Offset of field: ArchCPU::apic_id"][::std::mem::offset_of!(ArchCPU, apic_id) - 25200usize]; + ["Offset of field: ArchCPU::vmware_cpuid_freq"] + [::std::mem::offset_of!(ArchCPU, vmware_cpuid_freq) - 25204usize]; + ["Offset of field: ArchCPU::cache_info_passthrough"] + [::std::mem::offset_of!(ArchCPU, cache_info_passthrough) - 25205usize]; + ["Offset of field: ArchCPU::mwait"][::std::mem::offset_of!(ArchCPU, mwait) - 25208usize]; + ["Offset of field: ArchCPU::filtered_features"] + [::std::mem::offset_of!(ArchCPU, filtered_features) - 25224usize]; + ["Offset of field: ArchCPU::enable_pmu"] + [::std::mem::offset_of!(ArchCPU, enable_pmu) - 25536usize]; + ["Offset of field: ArchCPU::lbr_fmt"][::std::mem::offset_of!(ArchCPU, lbr_fmt) - 25544usize]; + ["Offset of field: ArchCPU::enable_lmce"] + [::std::mem::offset_of!(ArchCPU, enable_lmce) - 25552usize]; + ["Offset of field: ArchCPU::enable_l3_cache"] + [::std::mem::offset_of!(ArchCPU, enable_l3_cache) - 25553usize]; + ["Offset of field: ArchCPU::legacy_cache"] + [::std::mem::offset_of!(ArchCPU, legacy_cache) - 25554usize]; + ["Offset of field: ArchCPU::enable_cpuid_0xb"] + [::std::mem::offset_of!(ArchCPU, enable_cpuid_0xb) - 25555usize]; + ["Offset of field: ArchCPU::full_cpuid_auto_level"] + [::std::mem::offset_of!(ArchCPU, full_cpuid_auto_level) - 25556usize]; + ["Offset of field: ArchCPU::vendor_cpuid_only"] + [::std::mem::offset_of!(ArchCPU, vendor_cpuid_only) - 25557usize]; + ["Offset of field: ArchCPU::intel_pt_auto_level"] + [::std::mem::offset_of!(ArchCPU, intel_pt_auto_level) - 25558usize]; + ["Offset of field: ArchCPU::fill_mtrr_mask"] + [::std::mem::offset_of!(ArchCPU, fill_mtrr_mask) - 25559usize]; + ["Offset of field: ArchCPU::host_phys_bits"] + [::std::mem::offset_of!(ArchCPU, host_phys_bits) - 25560usize]; + ["Offset of field: ArchCPU::host_phys_bits_limit"] + [::std::mem::offset_of!(ArchCPU, host_phys_bits_limit) - 25561usize]; + ["Offset of field: ArchCPU::kvm_no_smi_migration"] + [::std::mem::offset_of!(ArchCPU, kvm_no_smi_migration) - 25562usize]; + ["Offset of field: ArchCPU::kvm_pv_enforce_cpuid"] + [::std::mem::offset_of!(ArchCPU, kvm_pv_enforce_cpuid) - 25563usize]; + ["Offset of field: ArchCPU::phys_bits"] + [::std::mem::offset_of!(ArchCPU, phys_bits) - 25564usize]; + ["Offset of field: ArchCPU::apic_state"] + [::std::mem::offset_of!(ArchCPU, apic_state) - 25568usize]; + ["Offset of field: ArchCPU::cpu_as_root"] + [::std::mem::offset_of!(ArchCPU, cpu_as_root) - 25576usize]; + ["Offset of field: ArchCPU::cpu_as_mem"] + [::std::mem::offset_of!(ArchCPU, cpu_as_mem) - 25584usize]; + ["Offset of field: ArchCPU::smram"][::std::mem::offset_of!(ArchCPU, smram) - 25592usize]; + ["Offset of field: ArchCPU::machine_done"] + [::std::mem::offset_of!(ArchCPU, machine_done) - 25600usize]; + ["Offset of field: ArchCPU::kvm_msr_buf"] + [::std::mem::offset_of!(ArchCPU, kvm_msr_buf) - 25624usize]; + ["Offset of field: ArchCPU::node_id"][::std::mem::offset_of!(ArchCPU, node_id) - 25632usize]; + ["Offset of field: ArchCPU::socket_id"] + [::std::mem::offset_of!(ArchCPU, socket_id) - 25636usize]; + ["Offset of field: ArchCPU::die_id"][::std::mem::offset_of!(ArchCPU, die_id) - 25640usize]; + ["Offset of field: ArchCPU::core_id"][::std::mem::offset_of!(ArchCPU, core_id) - 25644usize]; + ["Offset of field: ArchCPU::thread_id"] + [::std::mem::offset_of!(ArchCPU, thread_id) - 25648usize]; + ["Offset of field: ArchCPU::hv_max_vps"] + [::std::mem::offset_of!(ArchCPU, hv_max_vps) - 25652usize]; + ["Offset of field: ArchCPU::xen_vapic"] + [::std::mem::offset_of!(ArchCPU, xen_vapic) - 25656usize]; +}; +impl Default for ArchCPU { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for ArchCPU { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "ArchCPU {{ parent_obj: {:?}, env: {:?}, vmsentry: {:?}, hyperv_vendor: {:?}, hyperv_synic_kvm_only: {:?}, hyperv_passthrough: {:?}, hyperv_no_nonarch_cs: {:?}, hyperv_vendor_id: {:?}, hyperv_interface_id: {:?}, hyperv_limits: {:?}, hyperv_enforce_cpuid: {:?}, check_cpuid: {:?}, enforce_cpuid: {:?}, force_features: {:?}, expose_kvm: {:?}, expose_tcg: {:?}, migratable: {:?}, migrate_smi_count: {:?}, max_features: {:?}, vmware_cpuid_freq: {:?}, cache_info_passthrough: {:?}, mwait: {:?}, filtered_features: {:?}, enable_pmu: {:?}, enable_lmce: {:?}, enable_l3_cache: {:?}, legacy_cache: {:?}, enable_cpuid_0xb: {:?}, full_cpuid_auto_level: {:?}, vendor_cpuid_only: {:?}, intel_pt_auto_level: {:?}, fill_mtrr_mask: {:?}, host_phys_bits: {:?}, kvm_no_smi_migration: {:?}, kvm_pv_enforce_cpuid: {:?}, apic_state: {:?}, cpu_as_root: {:?}, cpu_as_mem: {:?}, smram: {:?}, machine_done: {:?}, kvm_msr_buf: {:?}, xen_vapic: {:?} }}" , self . parent_obj , self . env , self . vmsentry , self . hyperv_vendor , self . hyperv_synic_kvm_only , self . hyperv_passthrough , self . hyperv_no_nonarch_cs , self . hyperv_vendor_id , self . hyperv_interface_id , self . hyperv_limits , self . hyperv_enforce_cpuid , self . check_cpuid , self . enforce_cpuid , self . force_features , self . expose_kvm , self . expose_tcg , self . migratable , self . migrate_smi_count , self . max_features , self . vmware_cpuid_freq , self . cache_info_passthrough , self . mwait , self . filtered_features , self . enable_pmu , self . enable_lmce , self . enable_l3_cache , self . legacy_cache , self . enable_cpuid_0xb , self . full_cpuid_auto_level , self . vendor_cpuid_only , self . intel_pt_auto_level , self . fill_mtrr_mask , self . host_phys_bits , self . kvm_no_smi_migration , self . kvm_pv_enforce_cpuid , self . apic_state , self . cpu_as_root , self . cpu_as_mem , self . smram , self . machine_done , self . kvm_msr_buf , self . xen_vapic) + } +} +extern "C" { + pub fn cpu_memory_rw_debug( + cpu: *mut CPUState, + addr: vaddr, + ptr: *mut ::std::os::raw::c_void, + len: usize, + is_write: bool, + ) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct RBNode { + pub rb_parent_color: usize, + pub rb_right: *mut RBNode, + pub rb_left: *mut RBNode, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of RBNode"][::std::mem::size_of::() - 24usize]; + ["Alignment of RBNode"][::std::mem::align_of::() - 8usize]; + ["Offset of field: RBNode::rb_parent_color"] + [::std::mem::offset_of!(RBNode, rb_parent_color) - 0usize]; + ["Offset of field: RBNode::rb_right"][::std::mem::offset_of!(RBNode, rb_right) - 8usize]; + ["Offset of field: RBNode::rb_left"][::std::mem::offset_of!(RBNode, rb_left) - 16usize]; +}; +impl Default for RBNode { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct RBRoot { + pub rb_node: *mut RBNode, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of RBRoot"][::std::mem::size_of::() - 8usize]; + ["Alignment of RBRoot"][::std::mem::align_of::() - 8usize]; + ["Offset of field: RBRoot::rb_node"][::std::mem::offset_of!(RBRoot, rb_node) - 0usize]; +}; +impl Default for RBRoot { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct RBRootLeftCached { + pub rb_root: RBRoot, + pub rb_leftmost: *mut RBNode, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of RBRootLeftCached"][::std::mem::size_of::() - 16usize]; + ["Alignment of RBRootLeftCached"][::std::mem::align_of::() - 8usize]; + ["Offset of field: RBRootLeftCached::rb_root"] + [::std::mem::offset_of!(RBRootLeftCached, rb_root) - 0usize]; + ["Offset of field: RBRootLeftCached::rb_leftmost"] + [::std::mem::offset_of!(RBRootLeftCached, rb_leftmost) - 8usize]; +}; +impl Default for RBRootLeftCached { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct IntervalTreeNode { + pub rb: RBNode, + pub start: u64, + pub last: u64, + pub subtree_last: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of IntervalTreeNode"][::std::mem::size_of::() - 48usize]; + ["Alignment of IntervalTreeNode"][::std::mem::align_of::() - 8usize]; + ["Offset of field: IntervalTreeNode::rb"] + [::std::mem::offset_of!(IntervalTreeNode, rb) - 0usize]; + ["Offset of field: IntervalTreeNode::start"] + [::std::mem::offset_of!(IntervalTreeNode, start) - 24usize]; + ["Offset of field: IntervalTreeNode::last"] + [::std::mem::offset_of!(IntervalTreeNode, last) - 32usize]; + ["Offset of field: IntervalTreeNode::subtree_last"] + [::std::mem::offset_of!(IntervalTreeNode, subtree_last) - 40usize]; +}; +impl Default for IntervalTreeNode { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub type IntervalTreeRoot = RBRootLeftCached; +pub type abi_ulong = target_ulong; +pub type abi_long = target_long; +extern "C" { + pub static mut guest_base: usize; +} +extern "C" { + #[doc = " --- Begin LibAFL code ---"] + pub fn pageflags_get_root() -> *mut IntervalTreeRoot; +} +extern "C" { + #[doc = " page_check_range\n @start: first byte of range\n @len: length of range\n @flags: flags required for each page\n\n Return true if every page in [@start, @start+@len) has @flags set.\n Return false if any page is unmapped. Thus testing flags == 0 is\n equivalent to testing for flags == PAGE_VALID."] + pub fn page_check_range( + start: target_ulong, + last: target_ulong, + flags: ::std::os::raw::c_int, + ) -> bool; +} +pub const MemOp_MO_8: MemOp = MemOp(0); +pub const MemOp_MO_16: MemOp = MemOp(1); +pub const MemOp_MO_32: MemOp = MemOp(2); +pub const MemOp_MO_64: MemOp = MemOp(3); +pub const MemOp_MO_128: MemOp = MemOp(4); +pub const MemOp_MO_256: MemOp = MemOp(5); +pub const MemOp_MO_512: MemOp = MemOp(6); +pub const MemOp_MO_1024: MemOp = MemOp(7); +pub const MemOp_MO_SIZE: MemOp = MemOp(7); +pub const MemOp_MO_SIGN: MemOp = MemOp(8); +pub const MemOp_MO_BSWAP: MemOp = MemOp(16); +pub const MemOp_MO_LE: MemOp = MemOp(0); +pub const MemOp_MO_BE: MemOp = MemOp(16); +pub const MemOp_MO_TE: MemOp = MemOp(0); +pub const MemOp_MO_ASHIFT: MemOp = MemOp(5); +pub const MemOp_MO_AMASK: MemOp = MemOp(224); +pub const MemOp_MO_UNALN: MemOp = MemOp(0); +pub const MemOp_MO_ALIGN_2: MemOp = MemOp(32); +pub const MemOp_MO_ALIGN_4: MemOp = MemOp(64); +pub const MemOp_MO_ALIGN_8: MemOp = MemOp(96); +pub const MemOp_MO_ALIGN_16: MemOp = MemOp(128); +pub const MemOp_MO_ALIGN_32: MemOp = MemOp(160); +pub const MemOp_MO_ALIGN_64: MemOp = MemOp(192); +pub const MemOp_MO_ALIGN: MemOp = MemOp(224); +pub const MemOp_MO_ATOM_SHIFT: MemOp = MemOp(8); +pub const MemOp_MO_ATOM_IFALIGN: MemOp = MemOp(0); +pub const MemOp_MO_ATOM_IFALIGN_PAIR: MemOp = MemOp(256); +pub const MemOp_MO_ATOM_WITHIN16: MemOp = MemOp(512); +pub const MemOp_MO_ATOM_WITHIN16_PAIR: MemOp = MemOp(768); +pub const MemOp_MO_ATOM_SUBALIGN: MemOp = MemOp(1024); +pub const MemOp_MO_ATOM_NONE: MemOp = MemOp(1280); +pub const MemOp_MO_ATOM_MASK: MemOp = MemOp(1792); +pub const MemOp_MO_UB: MemOp = MemOp(0); +pub const MemOp_MO_UW: MemOp = MemOp(1); +pub const MemOp_MO_UL: MemOp = MemOp(2); +pub const MemOp_MO_UQ: MemOp = MemOp(3); +pub const MemOp_MO_UO: MemOp = MemOp(4); +pub const MemOp_MO_SB: MemOp = MemOp(8); +pub const MemOp_MO_SW: MemOp = MemOp(9); +pub const MemOp_MO_SL: MemOp = MemOp(10); +pub const MemOp_MO_SQ: MemOp = MemOp(11); +pub const MemOp_MO_SO: MemOp = MemOp(12); +pub const MemOp_MO_LEUW: MemOp = MemOp(1); +pub const MemOp_MO_LEUL: MemOp = MemOp(2); +pub const MemOp_MO_LEUQ: MemOp = MemOp(3); +pub const MemOp_MO_LESW: MemOp = MemOp(9); +pub const MemOp_MO_LESL: MemOp = MemOp(10); +pub const MemOp_MO_LESQ: MemOp = MemOp(11); +pub const MemOp_MO_BEUW: MemOp = MemOp(17); +pub const MemOp_MO_BEUL: MemOp = MemOp(18); +pub const MemOp_MO_BEUQ: MemOp = MemOp(19); +pub const MemOp_MO_BESW: MemOp = MemOp(25); +pub const MemOp_MO_BESL: MemOp = MemOp(26); +pub const MemOp_MO_BESQ: MemOp = MemOp(27); +pub const MemOp_MO_TEUW: MemOp = MemOp(1); +pub const MemOp_MO_TEUL: MemOp = MemOp(2); +pub const MemOp_MO_TEUQ: MemOp = MemOp(3); +pub const MemOp_MO_TEUO: MemOp = MemOp(4); +pub const MemOp_MO_TESW: MemOp = MemOp(9); +pub const MemOp_MO_TESL: MemOp = MemOp(10); +pub const MemOp_MO_TESQ: MemOp = MemOp(11); +pub const MemOp_MO_SSIZE: MemOp = MemOp(15); +impl ::std::ops::BitOr for MemOp { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + MemOp(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for MemOp { + #[inline] + fn bitor_assign(&mut self, rhs: MemOp) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for MemOp { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + MemOp(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for MemOp { + #[inline] + fn bitand_assign(&mut self, rhs: MemOp) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct MemOp(pub ::std::os::raw::c_uint); +pub type MemOpIdx = u32; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct image_info { + pub load_bias: abi_ulong, + pub load_addr: abi_ulong, + pub start_code: abi_ulong, + pub end_code: abi_ulong, + pub start_data: abi_ulong, + pub end_data: abi_ulong, + pub brk: abi_ulong, + pub start_stack: abi_ulong, + pub stack_limit: abi_ulong, + pub vdso: abi_ulong, + pub entry: abi_ulong, + pub code_offset: abi_ulong, + pub data_offset: abi_ulong, + pub saved_auxv: abi_ulong, + pub auxv_len: abi_ulong, + pub argc: abi_ulong, + pub argv: abi_ulong, + pub envc: abi_ulong, + pub envp: abi_ulong, + pub file_string: abi_ulong, + pub elf_flags: u32, + pub personality: ::std::os::raw::c_int, + pub alignment: abi_ulong, + pub exec_stack: bool, + pub arg_strings: abi_ulong, + pub env_strings: abi_ulong, + pub loadmap_addr: abi_ulong, + pub nsegs: u16, + pub loadsegs: *mut ::std::os::raw::c_void, + pub pt_dynamic_addr: abi_ulong, + pub interpreter_loadmap_addr: abi_ulong, + pub interpreter_pt_dynamic_addr: abi_ulong, + pub other_info: *mut image_info, + pub note_flags: u32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of image_info"][::std::mem::size_of::() - 264usize]; + ["Alignment of image_info"][::std::mem::align_of::() - 8usize]; + ["Offset of field: image_info::load_bias"] + [::std::mem::offset_of!(image_info, load_bias) - 0usize]; + ["Offset of field: image_info::load_addr"] + [::std::mem::offset_of!(image_info, load_addr) - 8usize]; + ["Offset of field: image_info::start_code"] + [::std::mem::offset_of!(image_info, start_code) - 16usize]; + ["Offset of field: image_info::end_code"] + [::std::mem::offset_of!(image_info, end_code) - 24usize]; + ["Offset of field: image_info::start_data"] + [::std::mem::offset_of!(image_info, start_data) - 32usize]; + ["Offset of field: image_info::end_data"] + [::std::mem::offset_of!(image_info, end_data) - 40usize]; + ["Offset of field: image_info::brk"][::std::mem::offset_of!(image_info, brk) - 48usize]; + ["Offset of field: image_info::start_stack"] + [::std::mem::offset_of!(image_info, start_stack) - 56usize]; + ["Offset of field: image_info::stack_limit"] + [::std::mem::offset_of!(image_info, stack_limit) - 64usize]; + ["Offset of field: image_info::vdso"][::std::mem::offset_of!(image_info, vdso) - 72usize]; + ["Offset of field: image_info::entry"][::std::mem::offset_of!(image_info, entry) - 80usize]; + ["Offset of field: image_info::code_offset"] + [::std::mem::offset_of!(image_info, code_offset) - 88usize]; + ["Offset of field: image_info::data_offset"] + [::std::mem::offset_of!(image_info, data_offset) - 96usize]; + ["Offset of field: image_info::saved_auxv"] + [::std::mem::offset_of!(image_info, saved_auxv) - 104usize]; + ["Offset of field: image_info::auxv_len"] + [::std::mem::offset_of!(image_info, auxv_len) - 112usize]; + ["Offset of field: image_info::argc"][::std::mem::offset_of!(image_info, argc) - 120usize]; + ["Offset of field: image_info::argv"][::std::mem::offset_of!(image_info, argv) - 128usize]; + ["Offset of field: image_info::envc"][::std::mem::offset_of!(image_info, envc) - 136usize]; + ["Offset of field: image_info::envp"][::std::mem::offset_of!(image_info, envp) - 144usize]; + ["Offset of field: image_info::file_string"] + [::std::mem::offset_of!(image_info, file_string) - 152usize]; + ["Offset of field: image_info::elf_flags"] + [::std::mem::offset_of!(image_info, elf_flags) - 160usize]; + ["Offset of field: image_info::personality"] + [::std::mem::offset_of!(image_info, personality) - 164usize]; + ["Offset of field: image_info::alignment"] + [::std::mem::offset_of!(image_info, alignment) - 168usize]; + ["Offset of field: image_info::exec_stack"] + [::std::mem::offset_of!(image_info, exec_stack) - 176usize]; + ["Offset of field: image_info::arg_strings"] + [::std::mem::offset_of!(image_info, arg_strings) - 184usize]; + ["Offset of field: image_info::env_strings"] + [::std::mem::offset_of!(image_info, env_strings) - 192usize]; + ["Offset of field: image_info::loadmap_addr"] + [::std::mem::offset_of!(image_info, loadmap_addr) - 200usize]; + ["Offset of field: image_info::nsegs"][::std::mem::offset_of!(image_info, nsegs) - 208usize]; + ["Offset of field: image_info::loadsegs"] + [::std::mem::offset_of!(image_info, loadsegs) - 216usize]; + ["Offset of field: image_info::pt_dynamic_addr"] + [::std::mem::offset_of!(image_info, pt_dynamic_addr) - 224usize]; + ["Offset of field: image_info::interpreter_loadmap_addr"] + [::std::mem::offset_of!(image_info, interpreter_loadmap_addr) - 232usize]; + ["Offset of field: image_info::interpreter_pt_dynamic_addr"] + [::std::mem::offset_of!(image_info, interpreter_pt_dynamic_addr) - 240usize]; + ["Offset of field: image_info::other_info"] + [::std::mem::offset_of!(image_info, other_info) - 248usize]; + ["Offset of field: image_info::note_flags"] + [::std::mem::offset_of!(image_info, note_flags) - 256usize]; +}; +impl Default for image_info { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct tb_tc { + pub ptr: *const ::std::os::raw::c_void, + pub size: usize, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of tb_tc"][::std::mem::size_of::() - 16usize]; + ["Alignment of tb_tc"][::std::mem::align_of::() - 8usize]; + ["Offset of field: tb_tc::ptr"][::std::mem::offset_of!(tb_tc, ptr) - 0usize]; + ["Offset of field: tb_tc::size"][::std::mem::offset_of!(tb_tc, size) - 8usize]; +}; +impl Default for tb_tc { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TranslationBlock { + pub pc: vaddr, + pub cs_base: u64, + pub flags: u32, + pub cflags: u32, + pub size: u16, + pub icount: u16, + pub tc: tb_tc, + pub itree: IntervalTreeNode, + pub jmp_lock: QemuSpin, + pub jmp_reset_offset: [u16; 2usize], + pub jmp_insn_offset: [u16; 2usize], + pub jmp_target_addr: [usize; 2usize], + pub jmp_list_head: usize, + pub jmp_list_next: [usize; 2usize], + pub jmp_dest: [usize; 2usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of TranslationBlock"][::std::mem::size_of::() - 168usize]; + ["Alignment of TranslationBlock"][::std::mem::align_of::() - 8usize]; + ["Offset of field: TranslationBlock::pc"] + [::std::mem::offset_of!(TranslationBlock, pc) - 0usize]; + ["Offset of field: TranslationBlock::cs_base"] + [::std::mem::offset_of!(TranslationBlock, cs_base) - 8usize]; + ["Offset of field: TranslationBlock::flags"] + [::std::mem::offset_of!(TranslationBlock, flags) - 16usize]; + ["Offset of field: TranslationBlock::cflags"] + [::std::mem::offset_of!(TranslationBlock, cflags) - 20usize]; + ["Offset of field: TranslationBlock::size"] + [::std::mem::offset_of!(TranslationBlock, size) - 24usize]; + ["Offset of field: TranslationBlock::icount"] + [::std::mem::offset_of!(TranslationBlock, icount) - 26usize]; + ["Offset of field: TranslationBlock::tc"] + [::std::mem::offset_of!(TranslationBlock, tc) - 32usize]; + ["Offset of field: TranslationBlock::itree"] + [::std::mem::offset_of!(TranslationBlock, itree) - 48usize]; + ["Offset of field: TranslationBlock::jmp_lock"] + [::std::mem::offset_of!(TranslationBlock, jmp_lock) - 96usize]; + ["Offset of field: TranslationBlock::jmp_reset_offset"] + [::std::mem::offset_of!(TranslationBlock, jmp_reset_offset) - 100usize]; + ["Offset of field: TranslationBlock::jmp_insn_offset"] + [::std::mem::offset_of!(TranslationBlock, jmp_insn_offset) - 104usize]; + ["Offset of field: TranslationBlock::jmp_target_addr"] + [::std::mem::offset_of!(TranslationBlock, jmp_target_addr) - 112usize]; + ["Offset of field: TranslationBlock::jmp_list_head"] + [::std::mem::offset_of!(TranslationBlock, jmp_list_head) - 128usize]; + ["Offset of field: TranslationBlock::jmp_list_next"] + [::std::mem::offset_of!(TranslationBlock, jmp_list_next) - 136usize]; + ["Offset of field: TranslationBlock::jmp_dest"] + [::std::mem::offset_of!(TranslationBlock, jmp_dest) - 152usize]; +}; +impl Default for TranslationBlock { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +extern "C" { + pub static mut exec_path: *mut ::std::os::raw::c_char; +} +extern "C" { + pub static mut mmap_next_start: abi_ulong; +} +extern "C" { + pub fn target_mprotect( + start: abi_ulong, + len: abi_ulong, + prot: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn target_mmap( + start: abi_ulong, + len: abi_ulong, + prot: ::std::os::raw::c_int, + flags: ::std::os::raw::c_int, + fd: ::std::os::raw::c_int, + offset: off_t, + ) -> abi_long; +} +extern "C" { + pub fn target_munmap(start: abi_ulong, len: abi_ulong) -> ::std::os::raw::c_int; +} +extern "C" { + #[doc = " read_self_maps:\n\n Read /proc/self/maps and return a tree of MapInfo structures."] + pub fn read_self_maps() -> *mut IntervalTreeRoot; +} +extern "C" { + #[doc = " free_self_maps:\n @info: an interval tree\n\n Free a tree of MapInfo structures."] + pub fn free_self_maps(root: *mut IntervalTreeRoot); +} +extern "C" { + pub fn libafl_qemu_set_breakpoint(pc: target_ulong) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_remove_breakpoint(pc: target_ulong) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_trigger_breakpoint(cpu: *mut CPUState); +} +extern "C" { + pub fn libafl_qemu_breakpoint_run(pc_next: vaddr); +} +pub const libafl_exit_reason_kind_INTERNAL: libafl_exit_reason_kind = libafl_exit_reason_kind(0); +pub const libafl_exit_reason_kind_BREAKPOINT: libafl_exit_reason_kind = libafl_exit_reason_kind(1); +pub const libafl_exit_reason_kind_SYNC_EXIT: libafl_exit_reason_kind = libafl_exit_reason_kind(2); +pub const libafl_exit_reason_kind_TIMEOUT: libafl_exit_reason_kind = libafl_exit_reason_kind(3); +impl ::std::ops::BitOr for libafl_exit_reason_kind { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + libafl_exit_reason_kind(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for libafl_exit_reason_kind { + #[inline] + fn bitor_assign(&mut self, rhs: libafl_exit_reason_kind) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for libafl_exit_reason_kind { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + libafl_exit_reason_kind(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for libafl_exit_reason_kind { + #[inline] + fn bitand_assign(&mut self, rhs: libafl_exit_reason_kind) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct libafl_exit_reason_kind(pub ::std::os::raw::c_uint); +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct libafl_exit_reason_internal { + pub cause: ShutdownCause, + pub signal: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libafl_exit_reason_internal"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of libafl_exit_reason_internal"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: libafl_exit_reason_internal::cause"] + [::std::mem::offset_of!(libafl_exit_reason_internal, cause) - 0usize]; + ["Offset of field: libafl_exit_reason_internal::signal"] + [::std::mem::offset_of!(libafl_exit_reason_internal, signal) - 4usize]; +}; +impl Default for libafl_exit_reason_internal { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct libafl_exit_reason_breakpoint { + pub addr: target_ulong, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libafl_exit_reason_breakpoint"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of libafl_exit_reason_breakpoint"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: libafl_exit_reason_breakpoint::addr"] + [::std::mem::offset_of!(libafl_exit_reason_breakpoint, addr) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct libafl_exit_reason_sync_exit {} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libafl_exit_reason_sync_exit"] + [::std::mem::size_of::() - 0usize]; + ["Alignment of libafl_exit_reason_sync_exit"] + [::std::mem::align_of::() - 1usize]; +}; +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct libafl_exit_reason_timeout {} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libafl_exit_reason_timeout"] + [::std::mem::size_of::() - 0usize]; + ["Alignment of libafl_exit_reason_timeout"] + [::std::mem::align_of::() - 1usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct libafl_exit_reason { + pub kind: libafl_exit_reason_kind, + pub cpu: *mut CPUState, + pub next_pc: vaddr, + pub data: libafl_exit_reason__bindgen_ty_1, +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union libafl_exit_reason__bindgen_ty_1 { + pub internal: libafl_exit_reason_internal, + pub breakpoint: libafl_exit_reason_breakpoint, + pub sync_exit: libafl_exit_reason_sync_exit, + pub timeout: libafl_exit_reason_timeout, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libafl_exit_reason__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of libafl_exit_reason__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: libafl_exit_reason__bindgen_ty_1::internal"] + [::std::mem::offset_of!(libafl_exit_reason__bindgen_ty_1, internal) - 0usize]; + ["Offset of field: libafl_exit_reason__bindgen_ty_1::breakpoint"] + [::std::mem::offset_of!(libafl_exit_reason__bindgen_ty_1, breakpoint) - 0usize]; + ["Offset of field: libafl_exit_reason__bindgen_ty_1::sync_exit"] + [::std::mem::offset_of!(libafl_exit_reason__bindgen_ty_1, sync_exit) - 0usize]; + ["Offset of field: libafl_exit_reason__bindgen_ty_1::timeout"] + [::std::mem::offset_of!(libafl_exit_reason__bindgen_ty_1, timeout) - 0usize]; +}; +impl Default for libafl_exit_reason__bindgen_ty_1 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for libafl_exit_reason__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "libafl_exit_reason__bindgen_ty_1 {{ union }}") + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libafl_exit_reason"][::std::mem::size_of::() - 32usize]; + ["Alignment of libafl_exit_reason"][::std::mem::align_of::() - 8usize]; + ["Offset of field: libafl_exit_reason::kind"] + [::std::mem::offset_of!(libafl_exit_reason, kind) - 0usize]; + ["Offset of field: libafl_exit_reason::cpu"] + [::std::mem::offset_of!(libafl_exit_reason, cpu) - 8usize]; + ["Offset of field: libafl_exit_reason::next_pc"] + [::std::mem::offset_of!(libafl_exit_reason, next_pc) - 16usize]; + ["Offset of field: libafl_exit_reason::data"] + [::std::mem::offset_of!(libafl_exit_reason, data) - 24usize]; +}; +impl Default for libafl_exit_reason { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl ::std::fmt::Debug for libafl_exit_reason { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!( + f, + "libafl_exit_reason {{ kind: {:?}, cpu: {:?}, data: {:?} }}", + self.kind, self.cpu, self.data + ) + } +} +extern "C" { + pub fn libafl_last_exit_cpu() -> *mut CPUState; +} +extern "C" { + pub fn libafl_exit_signal_vm_start(); +} +extern "C" { + pub fn libafl_exit_asap() -> bool; +} +extern "C" { + pub fn libafl_sync_exit_cpu(); +} +extern "C" { + pub fn libafl_exit_request_internal( + cpu: *mut CPUState, + pc: u64, + cause: ShutdownCause, + signal: ::std::os::raw::c_int, + ); +} +extern "C" { + pub fn libafl_exit_request_breakpoint(cpu: *mut CPUState, pc: target_ulong); +} +extern "C" { + pub fn libafl_exit_request_sync_backdoor(cpu: *mut CPUState, pc: target_ulong); +} +extern "C" { + pub fn libafl_get_exit_reason() -> *mut libafl_exit_reason; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct libafl_mapinfo { + pub start: target_ulong, + pub end: target_ulong, + pub offset: target_ulong, + pub path: *const ::std::os::raw::c_char, + pub flags: ::std::os::raw::c_int, + pub is_priv: ::std::os::raw::c_int, + pub is_valid: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libafl_mapinfo"][::std::mem::size_of::() - 48usize]; + ["Alignment of libafl_mapinfo"][::std::mem::align_of::() - 8usize]; + ["Offset of field: libafl_mapinfo::start"] + [::std::mem::offset_of!(libafl_mapinfo, start) - 0usize]; + ["Offset of field: libafl_mapinfo::end"][::std::mem::offset_of!(libafl_mapinfo, end) - 8usize]; + ["Offset of field: libafl_mapinfo::offset"] + [::std::mem::offset_of!(libafl_mapinfo, offset) - 16usize]; + ["Offset of field: libafl_mapinfo::path"] + [::std::mem::offset_of!(libafl_mapinfo, path) - 24usize]; + ["Offset of field: libafl_mapinfo::flags"] + [::std::mem::offset_of!(libafl_mapinfo, flags) - 32usize]; + ["Offset of field: libafl_mapinfo::is_priv"] + [::std::mem::offset_of!(libafl_mapinfo, is_priv) - 36usize]; + ["Offset of field: libafl_mapinfo::is_valid"] + [::std::mem::offset_of!(libafl_mapinfo, is_valid) - 40usize]; +}; +impl Default for libafl_mapinfo { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +extern "C" { + pub static mut libafl_dump_core_hook: + ::std::option::Option; +} +extern "C" { + pub static mut libafl_force_dfl: ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_dump_core_exec(signal: ::std::os::raw::c_int); +} +extern "C" { + pub fn libafl_qemu_handle_crash( + host_sig: ::std::os::raw::c_int, + info: *mut siginfo_t, + puc: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn libafl_maps_first(map_info: *mut IntervalTreeRoot) -> *mut IntervalTreeNode; +} +extern "C" { + pub fn libafl_maps_next( + pageflags_maps_node: *mut IntervalTreeNode, + proc_maps_node: *mut IntervalTreeRoot, + ret: *mut libafl_mapinfo, + ) -> *mut IntervalTreeNode; +} +extern "C" { + pub fn libafl_load_addr() -> u64; +} +extern "C" { + pub fn libafl_get_image_info() -> *mut image_info; +} +extern "C" { + pub fn libafl_get_brk() -> u64; +} +extern "C" { + pub fn libafl_set_brk(new_brk: u64) -> u64; +} +extern "C" { + pub fn libafl_qemu_init(argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct AccelCPUClass { + pub parent_class: ObjectClass, + pub cpu_class_init: ::std::option::Option, + pub cpu_instance_init: ::std::option::Option, + pub cpu_target_realize: ::std::option::Option< + unsafe extern "C" fn(cpu: *mut CPUState, errp: *mut *mut Error) -> bool, + >, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of AccelCPUClass"][::std::mem::size_of::() - 120usize]; + ["Alignment of AccelCPUClass"][::std::mem::align_of::() - 8usize]; + ["Offset of field: AccelCPUClass::parent_class"] + [::std::mem::offset_of!(AccelCPUClass, parent_class) - 0usize]; + ["Offset of field: AccelCPUClass::cpu_class_init"] + [::std::mem::offset_of!(AccelCPUClass, cpu_class_init) - 96usize]; + ["Offset of field: AccelCPUClass::cpu_instance_init"] + [::std::mem::offset_of!(AccelCPUClass, cpu_instance_init) - 104usize]; + ["Offset of field: AccelCPUClass::cpu_target_realize"] + [::std::mem::offset_of!(AccelCPUClass, cpu_target_realize) - 112usize]; +}; +impl Default for AccelCPUClass { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const qemu_plugin_mem_rw_QEMU_PLUGIN_MEM_R: qemu_plugin_mem_rw = qemu_plugin_mem_rw(1); +pub const qemu_plugin_mem_rw_QEMU_PLUGIN_MEM_W: qemu_plugin_mem_rw = qemu_plugin_mem_rw(2); +pub const qemu_plugin_mem_rw_QEMU_PLUGIN_MEM_RW: qemu_plugin_mem_rw = qemu_plugin_mem_rw(3); +impl ::std::ops::BitOr for qemu_plugin_mem_rw { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + qemu_plugin_mem_rw(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for qemu_plugin_mem_rw { + #[inline] + fn bitor_assign(&mut self, rhs: qemu_plugin_mem_rw) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for qemu_plugin_mem_rw { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + qemu_plugin_mem_rw(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for qemu_plugin_mem_rw { + #[inline] + fn bitand_assign(&mut self, rhs: qemu_plugin_mem_rw) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct qemu_plugin_mem_rw(pub ::std::os::raw::c_uint); +#[doc = " typedef qemu_plugin_meminfo_t - opaque memory transaction handle\n\n This can be further queried using the qemu_plugin_mem_* query\n functions."] +pub type qemu_plugin_meminfo_t = u32; +extern "C" { + #[doc = " qemu_plugin_get_hwaddr() - return handle for memory operation\n @info: opaque memory info structure\n @vaddr: the virtual address of the memory operation\n\n For system emulation returns a qemu_plugin_hwaddr handle to query\n details about the actual physical address backing the virtual\n address. For linux-user guests it just returns NULL.\n\n This handle is *only* valid for the duration of the callback. Any\n information about the handle should be recovered before the\n callback returns."] + pub fn qemu_plugin_get_hwaddr( + info: qemu_plugin_meminfo_t, + vaddr: u64, + ) -> *mut qemu_plugin_hwaddr; +} +extern "C" { + #[doc = " qemu_plugin_hwaddr_phys_addr() - query physical address for memory operation\n @haddr: address handle from qemu_plugin_get_hwaddr()\n\n Returns the physical address associated with the memory operation\n\n Note that the returned physical address may not be unique if you are dealing\n with multiple address spaces."] + pub fn qemu_plugin_hwaddr_phys_addr(haddr: *const qemu_plugin_hwaddr) -> u64; +} +#[doc = " struct CPUPluginState - per-CPU state for plugins\n @event_mask: plugin event bitmap. Modified only via async work."] +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct CPUPluginState { + pub event_mask: [::std::os::raw::c_ulong; 1usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of CPUPluginState"][::std::mem::size_of::() - 8usize]; + ["Alignment of CPUPluginState"][::std::mem::align_of::() - 8usize]; + ["Offset of field: CPUPluginState::event_mask"] + [::std::mem::offset_of!(CPUPluginState, event_mask) - 0usize]; +}; +pub const TCGReg_TCG_REG_EAX: TCGReg = TCGReg(0); +pub const TCGReg_TCG_REG_ECX: TCGReg = TCGReg(1); +pub const TCGReg_TCG_REG_EDX: TCGReg = TCGReg(2); +pub const TCGReg_TCG_REG_EBX: TCGReg = TCGReg(3); +pub const TCGReg_TCG_REG_ESP: TCGReg = TCGReg(4); +pub const TCGReg_TCG_REG_EBP: TCGReg = TCGReg(5); +pub const TCGReg_TCG_REG_ESI: TCGReg = TCGReg(6); +pub const TCGReg_TCG_REG_EDI: TCGReg = TCGReg(7); +pub const TCGReg_TCG_REG_R8: TCGReg = TCGReg(8); +pub const TCGReg_TCG_REG_R9: TCGReg = TCGReg(9); +pub const TCGReg_TCG_REG_R10: TCGReg = TCGReg(10); +pub const TCGReg_TCG_REG_R11: TCGReg = TCGReg(11); +pub const TCGReg_TCG_REG_R12: TCGReg = TCGReg(12); +pub const TCGReg_TCG_REG_R13: TCGReg = TCGReg(13); +pub const TCGReg_TCG_REG_R14: TCGReg = TCGReg(14); +pub const TCGReg_TCG_REG_R15: TCGReg = TCGReg(15); +pub const TCGReg_TCG_REG_XMM0: TCGReg = TCGReg(16); +pub const TCGReg_TCG_REG_XMM1: TCGReg = TCGReg(17); +pub const TCGReg_TCG_REG_XMM2: TCGReg = TCGReg(18); +pub const TCGReg_TCG_REG_XMM3: TCGReg = TCGReg(19); +pub const TCGReg_TCG_REG_XMM4: TCGReg = TCGReg(20); +pub const TCGReg_TCG_REG_XMM5: TCGReg = TCGReg(21); +pub const TCGReg_TCG_REG_XMM6: TCGReg = TCGReg(22); +pub const TCGReg_TCG_REG_XMM7: TCGReg = TCGReg(23); +pub const TCGReg_TCG_REG_XMM8: TCGReg = TCGReg(24); +pub const TCGReg_TCG_REG_XMM9: TCGReg = TCGReg(25); +pub const TCGReg_TCG_REG_XMM10: TCGReg = TCGReg(26); +pub const TCGReg_TCG_REG_XMM11: TCGReg = TCGReg(27); +pub const TCGReg_TCG_REG_XMM12: TCGReg = TCGReg(28); +pub const TCGReg_TCG_REG_XMM13: TCGReg = TCGReg(29); +pub const TCGReg_TCG_REG_XMM14: TCGReg = TCGReg(30); +pub const TCGReg_TCG_REG_XMM15: TCGReg = TCGReg(31); +pub const TCGReg_TCG_REG_RAX: TCGReg = TCGReg(0); +pub const TCGReg_TCG_REG_RCX: TCGReg = TCGReg(1); +pub const TCGReg_TCG_REG_RDX: TCGReg = TCGReg(2); +pub const TCGReg_TCG_REG_RBX: TCGReg = TCGReg(3); +pub const TCGReg_TCG_REG_RSP: TCGReg = TCGReg(4); +pub const TCGReg_TCG_REG_RBP: TCGReg = TCGReg(5); +pub const TCGReg_TCG_REG_RSI: TCGReg = TCGReg(6); +pub const TCGReg_TCG_REG_RDI: TCGReg = TCGReg(7); +pub const TCGReg_TCG_AREG0: TCGReg = TCGReg(5); +pub const TCGReg_TCG_REG_CALL_STACK: TCGReg = TCGReg(4); +impl ::std::ops::BitOr for TCGReg { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCGReg(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCGReg { + #[inline] + fn bitor_assign(&mut self, rhs: TCGReg) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCGReg { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCGReg(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCGReg { + #[inline] + fn bitand_assign(&mut self, rhs: TCGReg) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct TCGReg(pub ::std::os::raw::c_uint); +pub const TCGType_TCG_TYPE_I32: TCGType = TCGType(0); +pub const TCGType_TCG_TYPE_I64: TCGType = TCGType(1); +pub const TCGType_TCG_TYPE_I128: TCGType = TCGType(2); +pub const TCGType_TCG_TYPE_V64: TCGType = TCGType(3); +pub const TCGType_TCG_TYPE_V128: TCGType = TCGType(4); +pub const TCGType_TCG_TYPE_V256: TCGType = TCGType(5); +pub const TCGType_TCG_TYPE_REG: TCGType = TCGType(1); +pub const TCGType_TCG_TYPE_PTR: TCGType = TCGType(1); +impl ::std::ops::BitOr for TCGType { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCGType(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCGType { + #[inline] + fn bitor_assign(&mut self, rhs: TCGType) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCGType { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCGType(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCGType { + #[inline] + fn bitand_assign(&mut self, rhs: TCGType) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct TCGType(pub ::std::os::raw::c_uint); +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCGv_i64_d { + _unused: [u8; 0], +} +pub type TCGv_i64 = *mut TCGv_i64_d; +pub const TCGTempVal_TEMP_VAL_DEAD: TCGTempVal = TCGTempVal(0); +pub const TCGTempVal_TEMP_VAL_REG: TCGTempVal = TCGTempVal(1); +pub const TCGTempVal_TEMP_VAL_MEM: TCGTempVal = TCGTempVal(2); +pub const TCGTempVal_TEMP_VAL_CONST: TCGTempVal = TCGTempVal(3); +impl ::std::ops::BitOr for TCGTempVal { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCGTempVal(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCGTempVal { + #[inline] + fn bitor_assign(&mut self, rhs: TCGTempVal) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCGTempVal { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCGTempVal(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCGTempVal { + #[inline] + fn bitand_assign(&mut self, rhs: TCGTempVal) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct TCGTempVal(pub ::std::os::raw::c_uint); +pub const TCGTempKind_TEMP_EBB: TCGTempKind = TCGTempKind(0); +pub const TCGTempKind_TEMP_TB: TCGTempKind = TCGTempKind(1); +pub const TCGTempKind_TEMP_GLOBAL: TCGTempKind = TCGTempKind(2); +pub const TCGTempKind_TEMP_FIXED: TCGTempKind = TCGTempKind(3); +pub const TCGTempKind_TEMP_CONST: TCGTempKind = TCGTempKind(4); +impl ::std::ops::BitOr for TCGTempKind { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCGTempKind(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCGTempKind { + #[inline] + fn bitor_assign(&mut self, rhs: TCGTempKind) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCGTempKind { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCGTempKind(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCGTempKind { + #[inline] + fn bitand_assign(&mut self, rhs: TCGTempKind) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct TCGTempKind(pub ::std::os::raw::c_uint); +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCGTemp { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 6usize]>, + pub val: i64, + pub mem_base: *mut TCGTemp, + pub mem_offset: isize, + pub name: *const ::std::os::raw::c_char, + pub state: usize, + pub state_ptr: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of TCGTemp"][::std::mem::size_of::() - 56usize]; + ["Alignment of TCGTemp"][::std::mem::align_of::() - 8usize]; + ["Offset of field: TCGTemp::val"][::std::mem::offset_of!(TCGTemp, val) - 8usize]; + ["Offset of field: TCGTemp::mem_base"][::std::mem::offset_of!(TCGTemp, mem_base) - 16usize]; + ["Offset of field: TCGTemp::mem_offset"][::std::mem::offset_of!(TCGTemp, mem_offset) - 24usize]; + ["Offset of field: TCGTemp::name"][::std::mem::offset_of!(TCGTemp, name) - 32usize]; + ["Offset of field: TCGTemp::state"][::std::mem::offset_of!(TCGTemp, state) - 40usize]; + ["Offset of field: TCGTemp::state_ptr"][::std::mem::offset_of!(TCGTemp, state_ptr) - 48usize]; +}; +impl Default for TCGTemp { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl TCGTemp { + #[inline] + pub fn reg(&self) -> TCGReg { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_reg(&mut self, val: TCGReg) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn val_type(&self) -> TCGTempVal { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } + } + #[inline] + pub fn set_val_type(&mut self, val: TCGTempVal) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn base_type(&self) -> TCGType { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u32) } + } + #[inline] + pub fn set_base_type(&mut self, val: TCGType) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 8u8, val as u64) + } + } + #[inline] + pub fn type_(&self) -> TCGType { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } + } + #[inline] + pub fn set_type(&mut self, val: TCGType) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 8u8, val as u64) + } + } + #[inline] + pub fn kind(&self) -> TCGTempKind { + unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 3u8) as u32) } + } + #[inline] + pub fn set_kind(&mut self, val: TCGTempKind) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(32usize, 3u8, val as u64) + } + } + #[inline] + pub fn indirect_reg(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u32) } + } + #[inline] + pub fn set_indirect_reg(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(35usize, 1u8, val as u64) + } + } + #[inline] + pub fn indirect_base(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(36usize, 1u8) as u32) } + } + #[inline] + pub fn set_indirect_base(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(36usize, 1u8, val as u64) + } + } + #[inline] + pub fn mem_coherent(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u32) } + } + #[inline] + pub fn set_mem_coherent(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(37usize, 1u8, val as u64) + } + } + #[inline] + pub fn mem_allocated(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 1u8) as u32) } + } + #[inline] + pub fn set_mem_allocated(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(38usize, 1u8, val as u64) + } + } + #[inline] + pub fn temp_allocated(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(39usize, 1u8) as u32) } + } + #[inline] + pub fn set_temp_allocated(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(39usize, 1u8, val as u64) + } + } + #[inline] + pub fn temp_subindex(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 2u8) as u32) } + } + #[inline] + pub fn set_temp_subindex(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(40usize, 2u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + reg: TCGReg, + val_type: TCGTempVal, + base_type: TCGType, + type_: TCGType, + kind: TCGTempKind, + indirect_reg: ::std::os::raw::c_uint, + indirect_base: ::std::os::raw::c_uint, + mem_coherent: ::std::os::raw::c_uint, + mem_allocated: ::std::os::raw::c_uint, + temp_allocated: ::std::os::raw::c_uint, + temp_subindex: ::std::os::raw::c_uint, + ) -> __BindgenBitfieldUnit<[u8; 6usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 6usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let reg: u32 = unsafe { ::std::mem::transmute(reg) }; + reg as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let val_type: u32 = unsafe { ::std::mem::transmute(val_type) }; + val_type as u64 + }); + __bindgen_bitfield_unit.set(16usize, 8u8, { + let base_type: u32 = unsafe { ::std::mem::transmute(base_type) }; + base_type as u64 + }); + __bindgen_bitfield_unit.set(24usize, 8u8, { + let type_: u32 = unsafe { ::std::mem::transmute(type_) }; + type_ as u64 + }); + __bindgen_bitfield_unit.set(32usize, 3u8, { + let kind: u32 = unsafe { ::std::mem::transmute(kind) }; + kind as u64 + }); + __bindgen_bitfield_unit.set(35usize, 1u8, { + let indirect_reg: u32 = unsafe { ::std::mem::transmute(indirect_reg) }; + indirect_reg as u64 + }); + __bindgen_bitfield_unit.set(36usize, 1u8, { + let indirect_base: u32 = unsafe { ::std::mem::transmute(indirect_base) }; + indirect_base as u64 + }); + __bindgen_bitfield_unit.set(37usize, 1u8, { + let mem_coherent: u32 = unsafe { ::std::mem::transmute(mem_coherent) }; + mem_coherent as u64 + }); + __bindgen_bitfield_unit.set(38usize, 1u8, { + let mem_allocated: u32 = unsafe { ::std::mem::transmute(mem_allocated) }; + mem_allocated as u64 + }); + __bindgen_bitfield_unit.set(39usize, 1u8, { + let temp_allocated: u32 = unsafe { ::std::mem::transmute(temp_allocated) }; + temp_allocated as u64 + }); + __bindgen_bitfield_unit.set(40usize, 2u8, { + let temp_subindex: u32 = unsafe { ::std::mem::transmute(temp_subindex) }; + temp_subindex as u64 + }); + __bindgen_bitfield_unit + } +} +pub const TCGCallReturnKind_TCG_CALL_RET_NORMAL: TCGCallReturnKind = TCGCallReturnKind(0); +pub const TCGCallReturnKind_TCG_CALL_RET_BY_REF: TCGCallReturnKind = TCGCallReturnKind(1); +pub const TCGCallReturnKind_TCG_CALL_RET_BY_VEC: TCGCallReturnKind = TCGCallReturnKind(2); +impl ::std::ops::BitOr for TCGCallReturnKind { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCGCallReturnKind(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCGCallReturnKind { + #[inline] + fn bitor_assign(&mut self, rhs: TCGCallReturnKind) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCGCallReturnKind { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCGCallReturnKind(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCGCallReturnKind { + #[inline] + fn bitand_assign(&mut self, rhs: TCGCallReturnKind) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct TCGCallReturnKind(pub ::std::os::raw::c_uint); +pub const TCGCallArgumentKind_TCG_CALL_ARG_NORMAL: TCGCallArgumentKind = TCGCallArgumentKind(0); +pub const TCGCallArgumentKind_TCG_CALL_ARG_EVEN: TCGCallArgumentKind = TCGCallArgumentKind(1); +pub const TCGCallArgumentKind_TCG_CALL_ARG_EXTEND: TCGCallArgumentKind = TCGCallArgumentKind(2); +pub const TCGCallArgumentKind_TCG_CALL_ARG_EXTEND_U: TCGCallArgumentKind = TCGCallArgumentKind(3); +pub const TCGCallArgumentKind_TCG_CALL_ARG_EXTEND_S: TCGCallArgumentKind = TCGCallArgumentKind(4); +pub const TCGCallArgumentKind_TCG_CALL_ARG_BY_REF: TCGCallArgumentKind = TCGCallArgumentKind(5); +pub const TCGCallArgumentKind_TCG_CALL_ARG_BY_REF_N: TCGCallArgumentKind = TCGCallArgumentKind(6); +impl ::std::ops::BitOr for TCGCallArgumentKind { + type Output = Self; + #[inline] + fn bitor(self, other: Self) -> Self { + TCGCallArgumentKind(self.0 | other.0) + } +} +impl ::std::ops::BitOrAssign for TCGCallArgumentKind { + #[inline] + fn bitor_assign(&mut self, rhs: TCGCallArgumentKind) { + self.0 |= rhs.0; + } +} +impl ::std::ops::BitAnd for TCGCallArgumentKind { + type Output = Self; + #[inline] + fn bitand(self, other: Self) -> Self { + TCGCallArgumentKind(self.0 & other.0) + } +} +impl ::std::ops::BitAndAssign for TCGCallArgumentKind { + #[inline] + fn bitand_assign(&mut self, rhs: TCGCallArgumentKind) { + self.0 &= rhs.0; + } +} +#[repr(transparent)] +#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] +pub struct TCGCallArgumentKind(pub ::std::os::raw::c_uint); +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct TCGCallArgumentLoc { + pub _bitfield_align_1: [u8; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of TCGCallArgumentLoc"][::std::mem::size_of::() - 4usize]; + ["Alignment of TCGCallArgumentLoc"][::std::mem::align_of::() - 4usize]; +}; +impl Default for TCGCallArgumentLoc { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl TCGCallArgumentLoc { + #[inline] + pub fn kind(&self) -> TCGCallArgumentKind { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_kind(&mut self, val: TCGCallArgumentKind) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn arg_slot(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } + } + #[inline] + pub fn set_arg_slot(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn ref_slot(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u32) } + } + #[inline] + pub fn set_ref_slot(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 8u8, val as u64) + } + } + #[inline] + pub fn arg_idx(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 4u8) as u32) } + } + #[inline] + pub fn set_arg_idx(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 4u8, val as u64) + } + } + #[inline] + pub fn tmp_subindex(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 2u8) as u32) } + } + #[inline] + pub fn set_tmp_subindex(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(28usize, 2u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + kind: TCGCallArgumentKind, + arg_slot: ::std::os::raw::c_uint, + ref_slot: ::std::os::raw::c_uint, + arg_idx: ::std::os::raw::c_uint, + tmp_subindex: ::std::os::raw::c_uint, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let kind: u32 = unsafe { ::std::mem::transmute(kind) }; + kind as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let arg_slot: u32 = unsafe { ::std::mem::transmute(arg_slot) }; + arg_slot as u64 + }); + __bindgen_bitfield_unit.set(16usize, 8u8, { + let ref_slot: u32 = unsafe { ::std::mem::transmute(ref_slot) }; + ref_slot as u64 + }); + __bindgen_bitfield_unit.set(24usize, 4u8, { + let arg_idx: u32 = unsafe { ::std::mem::transmute(arg_idx) }; + arg_idx as u64 + }); + __bindgen_bitfield_unit.set(28usize, 2u8, { + let tmp_subindex: u32 = unsafe { ::std::mem::transmute(tmp_subindex) }; + tmp_subindex as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct TCGHelperInfo { + pub func: *mut ::std::os::raw::c_void, + pub name: *const ::std::os::raw::c_char, + pub init: usize, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, + pub in_: [TCGCallArgumentLoc; 14usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of TCGHelperInfo"][::std::mem::size_of::() - 88usize]; + ["Alignment of TCGHelperInfo"][::std::mem::align_of::() - 8usize]; + ["Offset of field: TCGHelperInfo::func"][::std::mem::offset_of!(TCGHelperInfo, func) - 0usize]; + ["Offset of field: TCGHelperInfo::name"][::std::mem::offset_of!(TCGHelperInfo, name) - 8usize]; + ["Offset of field: TCGHelperInfo::init"][::std::mem::offset_of!(TCGHelperInfo, init) - 16usize]; + ["Offset of field: TCGHelperInfo::in_"][::std::mem::offset_of!(TCGHelperInfo, in_) - 32usize]; +}; +impl Default for TCGHelperInfo { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +impl TCGHelperInfo { + #[inline] + pub fn typemask(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 32u8) as u32) } + } + #[inline] + pub fn set_typemask(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 32u8, val as u64) + } + } + #[inline] + pub fn flags(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 8u8) as u32) } + } + #[inline] + pub fn set_flags(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(32usize, 8u8, val as u64) + } + } + #[inline] + pub fn nr_in(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 8u8) as u32) } + } + #[inline] + pub fn set_nr_in(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(40usize, 8u8, val as u64) + } + } + #[inline] + pub fn nr_out(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(48usize, 8u8) as u32) } + } + #[inline] + pub fn set_nr_out(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(48usize, 8u8, val as u64) + } + } + #[inline] + pub fn out_kind(&self) -> TCGCallReturnKind { + unsafe { ::std::mem::transmute(self._bitfield_1.get(56usize, 8u8) as u32) } + } + #[inline] + pub fn set_out_kind(&mut self, val: TCGCallReturnKind) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(56usize, 8u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + typemask: ::std::os::raw::c_uint, + flags: ::std::os::raw::c_uint, + nr_in: ::std::os::raw::c_uint, + nr_out: ::std::os::raw::c_uint, + out_kind: TCGCallReturnKind, + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 32u8, { + let typemask: u32 = unsafe { ::std::mem::transmute(typemask) }; + typemask as u64 + }); + __bindgen_bitfield_unit.set(32usize, 8u8, { + let flags: u32 = unsafe { ::std::mem::transmute(flags) }; + flags as u64 + }); + __bindgen_bitfield_unit.set(40usize, 8u8, { + let nr_in: u32 = unsafe { ::std::mem::transmute(nr_in) }; + nr_in as u64 + }); + __bindgen_bitfield_unit.set(48usize, 8u8, { + let nr_out: u32 = unsafe { ::std::mem::transmute(nr_out) }; + nr_out as u64 + }); + __bindgen_bitfield_unit.set(56usize, 8u8, { + let out_kind: u32 = unsafe { ::std::mem::transmute(out_kind) }; + out_kind as u64 + }); + __bindgen_bitfield_unit + } +} +pub type TCGv = TCGv_i64; +#[doc = " struct qemu_plugin_hwaddr - opaque hw address handle"] +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct qemu_plugin_hwaddr { + pub is_io: bool, + pub is_store: bool, + pub phys_addr: hwaddr, + pub mr: *mut MemoryRegion, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of qemu_plugin_hwaddr"][::std::mem::size_of::() - 24usize]; + ["Alignment of qemu_plugin_hwaddr"][::std::mem::align_of::() - 8usize]; + ["Offset of field: qemu_plugin_hwaddr::is_io"] + [::std::mem::offset_of!(qemu_plugin_hwaddr, is_io) - 0usize]; + ["Offset of field: qemu_plugin_hwaddr::is_store"] + [::std::mem::offset_of!(qemu_plugin_hwaddr, is_store) - 1usize]; + ["Offset of field: qemu_plugin_hwaddr::phys_addr"] + [::std::mem::offset_of!(qemu_plugin_hwaddr, phys_addr) - 8usize]; + ["Offset of field: qemu_plugin_hwaddr::mr"] + [::std::mem::offset_of!(qemu_plugin_hwaddr, mr) - 16usize]; +}; +impl Default for qemu_plugin_hwaddr { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +extern "C" { + #[doc = " tlb_plugin_lookup: query last TLB lookup\n @cpu: cpu environment\n\n This function can be used directly after a memory operation to\n query information about the access. It is used by the plugin\n infrastructure to expose more information about the address.\n\n It would only fail if not called from an instrumented memory access\n which would be an abuse of the API."] + pub fn tlb_plugin_lookup( + cpu: *mut CPUState, + addr: vaddr, + mmu_idx: ::std::os::raw::c_int, + is_store: bool, + data: *mut qemu_plugin_hwaddr, + ) -> bool; +} +extern "C" { + pub fn libafl_page_from_addr(addr: target_ulong) -> target_ulong; +} +extern "C" { + pub fn libafl_qemu_get_cpu(cpu_index: ::std::os::raw::c_int) -> *mut CPUState; +} +extern "C" { + pub fn libafl_qemu_num_cpus() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_current_cpu() -> *mut CPUState; +} +extern "C" { + pub fn libafl_qemu_cpu_index(arg1: *mut CPUState) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_write_reg( + cpu: *mut CPUState, + reg: ::std::os::raw::c_int, + val: *mut u8, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_read_reg( + cpu: *mut CPUState, + reg: ::std::os::raw::c_int, + val: *mut u8, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_num_regs(cpu: *mut CPUState) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_flush_jit(); +} +extern "C" { + pub fn libafl_breakpoint_invalidate(cpu: *mut CPUState, pc: target_ulong); +} +extern "C" { + pub fn libafl_qemu_main() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_run() -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_set_qemu_env(env: *mut CPUArchState); +} +extern "C" { + pub fn libafl_qemu_add_gdb_cmd( + callback: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut u8, + arg3: usize, + ) -> bool, + >, + data: *mut ::std::os::raw::c_void, + ); +} +extern "C" { + pub fn libafl_qemu_gdb_reply(buf: *const u8, len: usize); +} +extern "C" { + pub fn libafl_qemu_gdb_exec() -> bool; +} +extern "C" { + pub fn libafl_jit_trace_edge_hitcount(data: u64, id: u64) -> usize; +} +extern "C" { + pub fn libafl_jit_trace_edge_single(data: u64, id: u64) -> usize; +} +extern "C" { + pub fn libafl_jit_trace_block_hitcount(data: u64, id: u64) -> usize; +} +extern "C" { + pub fn libafl_jit_trace_block_single(data: u64, id: u64) -> usize; +} +extern "C" { + pub fn libafl_qemu_host_page_size() -> usize; +} +extern "C" { + pub fn libafl_tcg_gen_asan(addr: *mut TCGTemp, size: usize); +} +extern "C" { + pub fn libafl_gen_backdoor(pc: target_ulong); +} +extern "C" { + pub fn libafl_add_backdoor_hook( + exec: ::std::option::Option< + unsafe extern "C" fn(data: u64, cpu: *mut CPUArchState, pc: target_ulong), + >, + data: u64, + ) -> usize; +} +extern "C" { + pub fn libafl_qemu_remove_backdoor_hook( + num: usize, + invalidate: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_hook_backdoor_run(pc_next: vaddr); +} +extern "C" { + pub fn libafl_qemu_hook_block_post_gen(tb: *mut TranslationBlock, pc: vaddr); +} +extern "C" { + pub fn libafl_qemu_hook_block_run(pc: target_ulong); +} +extern "C" { + pub fn libafl_qemu_block_hook_set_jit( + num: usize, + jit: ::std::option::Option usize>, + ) -> bool; +} +extern "C" { + pub fn libafl_qemu_remove_block_hook( + num: usize, + invalidate: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_add_block_hook( + gen: ::std::option::Option u64>, + post_gen: ::std::option::Option< + unsafe extern "C" fn(data: u64, pc: target_ulong, block_length: target_ulong), + >, + exec: ::std::option::Option, + data: u64, + ) -> usize; +} +extern "C" { + pub fn libafl_gen_cmp(pc: target_ulong, op0: TCGv, op1: TCGv, ot: MemOp); +} +extern "C" { + pub fn libafl_add_cmp_hook( + gen: ::std::option::Option< + unsafe extern "C" fn(data: u64, pc: target_ulong, size: usize) -> u64, + >, + exec1: ::std::option::Option, + exec2: ::std::option::Option, + exec4: ::std::option::Option, + exec8: ::std::option::Option, + data: u64, + ) -> usize; +} +extern "C" { + pub fn libafl_qemu_remove_cmp_hook( + num: usize, + invalidate: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_gen_edge( + cpu: *mut CPUState, + src_block: target_ulong, + dst_block: target_ulong, + exit_n: ::std::os::raw::c_int, + cs_base: target_ulong, + flags: u32, + cflags: ::std::os::raw::c_int, + ) -> *mut TranslationBlock; +} +extern "C" { + pub fn libafl_add_edge_hook( + gen: ::std::option::Option< + unsafe extern "C" fn(data: u64, src: target_ulong, dst: target_ulong) -> u64, + >, + exec: ::std::option::Option, + data: u64, + ) -> usize; +} +extern "C" { + pub fn libafl_qemu_edge_hook_set_jit( + num: usize, + jit: ::std::option::Option usize>, + ) -> bool; +} +extern "C" { + pub fn libafl_qemu_remove_edge_hook( + num: usize, + invalidate: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_hook_edge_gen(src_block: target_ulong, dst_block: target_ulong) -> bool; +} +extern "C" { + pub fn libafl_qemu_hook_edge_run(); +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct libafl_instruction_hook { + pub data: u64, + pub num: usize, + pub addr: target_ulong, + pub helper_info: TCGHelperInfo, + pub next: *mut libafl_instruction_hook, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of libafl_instruction_hook"] + [::std::mem::size_of::() - 120usize]; + ["Alignment of libafl_instruction_hook"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: libafl_instruction_hook::data"] + [::std::mem::offset_of!(libafl_instruction_hook, data) - 0usize]; + ["Offset of field: libafl_instruction_hook::num"] + [::std::mem::offset_of!(libafl_instruction_hook, num) - 8usize]; + ["Offset of field: libafl_instruction_hook::addr"] + [::std::mem::offset_of!(libafl_instruction_hook, addr) - 16usize]; + ["Offset of field: libafl_instruction_hook::helper_info"] + [::std::mem::offset_of!(libafl_instruction_hook, helper_info) - 24usize]; + ["Offset of field: libafl_instruction_hook::next"] + [::std::mem::offset_of!(libafl_instruction_hook, next) - 112usize]; +}; +impl Default for libafl_instruction_hook { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +extern "C" { + pub fn libafl_qemu_add_instruction_hooks( + pc: target_ulong, + callback: ::std::option::Option, + data: u64, + invalidate: ::std::os::raw::c_int, + ) -> usize; +} +extern "C" { + pub fn libafl_qemu_remove_instruction_hook( + num: usize, + invalidate: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_remove_instruction_hooks_at( + addr: target_ulong, + invalidate: ::std::os::raw::c_int, + ) -> usize; +} +extern "C" { + pub fn libafl_search_instruction_hook(addr: target_ulong) -> *mut libafl_instruction_hook; +} +extern "C" { + pub fn libafl_qemu_hook_instruction_run(pc_next: vaddr); +} +extern "C" { + pub fn libafl_gen_read(addr: *mut TCGTemp, oi: MemOpIdx); +} +extern "C" { + pub fn libafl_gen_write(addr: *mut TCGTemp, oi: MemOpIdx); +} +extern "C" { + pub fn libafl_add_read_hook( + gen: ::std::option::Option< + unsafe extern "C" fn( + data: u64, + pc: target_ulong, + addr: *mut TCGTemp, + oi: MemOpIdx, + ) -> u64, + >, + exec1: ::std::option::Option, + exec2: ::std::option::Option, + exec4: ::std::option::Option, + exec8: ::std::option::Option, + execN: ::std::option::Option< + unsafe extern "C" fn(data: u64, id: u64, addr: target_ulong, size: usize), + >, + data: u64, + ) -> usize; +} +extern "C" { + pub fn libafl_add_write_hook( + gen: ::std::option::Option< + unsafe extern "C" fn( + data: u64, + pc: target_ulong, + addr: *mut TCGTemp, + oi: MemOpIdx, + ) -> u64, + >, + exec1: ::std::option::Option, + exec2: ::std::option::Option, + exec4: ::std::option::Option, + exec8: ::std::option::Option, + execN: ::std::option::Option< + unsafe extern "C" fn(data: u64, id: u64, addr: target_ulong, size: usize), + >, + data: u64, + ) -> usize; +} +extern "C" { + pub fn libafl_qemu_remove_read_hook( + num: usize, + invalidate: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_remove_write_hook( + num: usize, + invalidate: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +pub type libafl_cpu_run_fn = + ::std::option::Option; +extern "C" { + pub fn libafl_hook_cpu_run_add( + pre_cpu_run: libafl_cpu_run_fn, + post_cpu_run: libafl_cpu_run_fn, + data: u64, + ) -> usize; +} +extern "C" { + pub fn libafl_hook_cpu_run_remove(num: usize) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_remove_cpu_run_hook(num: usize) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_hook_cpu_run_pre_exec(cpu: *mut CPUState); +} +extern "C" { + pub fn libafl_hook_cpu_run_post_exec(cpu: *mut CPUState); +} +extern "C" { + pub fn libafl_add_new_thread_hook( + callback: ::std::option::Option< + unsafe extern "C" fn(data: u64, env: *mut CPUArchState, tid: u32) -> bool, + >, + data: u64, + ) -> usize; +} +extern "C" { + pub fn libafl_qemu_remove_new_thread_hook(num: usize) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_hook_new_thread_run(env: *mut CPUArchState, tid: u32) -> bool; +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct syshook_ret { + pub retval: target_ulong, + pub skip_syscall: bool, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of syshook_ret"][::std::mem::size_of::() - 16usize]; + ["Alignment of syshook_ret"][::std::mem::align_of::() - 8usize]; + ["Offset of field: syshook_ret::retval"][::std::mem::offset_of!(syshook_ret, retval) - 0usize]; + ["Offset of field: syshook_ret::skip_syscall"] + [::std::mem::offset_of!(syshook_ret, skip_syscall) - 8usize]; +}; +extern "C" { + pub fn libafl_add_pre_syscall_hook( + callback: ::std::option::Option< + unsafe extern "C" fn( + data: u64, + sys_num: ::std::os::raw::c_int, + arg0: target_ulong, + arg1: target_ulong, + arg2: target_ulong, + arg3: target_ulong, + arg4: target_ulong, + arg5: target_ulong, + arg6: target_ulong, + arg7: target_ulong, + ) -> syshook_ret, + >, + data: u64, + ) -> usize; +} +extern "C" { + pub fn libafl_add_post_syscall_hook( + callback: ::std::option::Option< + unsafe extern "C" fn( + data: u64, + ret: target_ulong, + sys_num: ::std::os::raw::c_int, + arg0: target_ulong, + arg1: target_ulong, + arg2: target_ulong, + arg3: target_ulong, + arg4: target_ulong, + arg5: target_ulong, + arg6: target_ulong, + arg7: target_ulong, + ) -> target_ulong, + >, + data: u64, + ) -> usize; +} +extern "C" { + pub fn libafl_qemu_remove_pre_syscall_hook(num: usize) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_qemu_remove_post_syscall_hook(num: usize) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn libafl_hook_syscall_pre_run( + env: *mut CPUArchState, + num: ::std::os::raw::c_int, + arg1: abi_long, + arg2: abi_long, + arg3: abi_long, + arg4: abi_long, + arg5: abi_long, + arg6: abi_long, + arg7: abi_long, + arg8: abi_long, + ret: *mut abi_long, + ) -> bool; +} +extern "C" { + pub fn libafl_hook_syscall_post_run( + num: ::std::os::raw::c_int, + arg1: abi_long, + arg2: abi_long, + arg3: abi_long, + arg4: abi_long, + arg5: abi_long, + arg6: abi_long, + arg7: abi_long, + arg8: abi_long, + ret: *mut abi_long, + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct kvm_dirty_gfn { + pub _address: u8, +} diff --git a/libafl_qemu/libafl_qemu_sys/src/lib.rs b/libafl_qemu/libafl_qemu_sys/src/lib.rs index e3c480ee4e..110af4e39f 100644 --- a/libafl_qemu/libafl_qemu_sys/src/lib.rs +++ b/libafl_qemu/libafl_qemu_sys/src/lib.rs @@ -5,14 +5,6 @@ Have a look at `libafl_qemu` for higher-level abstractions. __Warning__: The documentation is built by default for `x86_64` in `usermode`. To access the documentation of other architectures or systemmode, the documentation must be rebuilt with the right features. */ -#![forbid(unexpected_cfgs)] -#![allow(non_upper_case_globals)] -#![allow(non_camel_case_types)] -#![allow(non_snake_case)] -#![allow(improper_ctypes)] -#![allow(unused_mut)] -#![allow(clippy::all)] -#![allow(clippy::pedantic)] #![cfg_attr(nightly, feature(used_with_arg))] #[cfg(target_os = "linux")] @@ -22,30 +14,9 @@ use std::ffi::c_void; use num_enum::{IntoPrimitive, TryFromPrimitive}; use strum_macros::EnumIter; -#[cfg(all(not(feature = "clippy"), target_os = "linux"))] -mod bindings { - #![allow(non_upper_case_globals)] - #![allow(non_camel_case_types)] - #![allow(non_snake_case)] - #![allow(improper_ctypes)] - #![allow(unused_mut)] - #![allow(unused)] - #![allow(unused_variables)] - #![allow(clippy::all)] - #![allow(clippy::pedantic)] - - include!(concat!(env!("OUT_DIR"), "/bindings.rs")); -} -#[cfg(all(not(feature = "clippy"), target_os = "linux"))] +mod bindings; pub use bindings::*; -#[cfg(any(feature = "clippy", not(target_os = "linux")))] -#[allow(dead_code)] -#[rustfmt::skip] -mod x86_64_stub_bindings; -#[cfg(any(feature = "clippy", not(target_os = "linux")))] -pub use x86_64_stub_bindings::*; - #[cfg(emulation_mode = "usermode")] mod usermode; #[cfg(emulation_mode = "usermode")] @@ -57,6 +28,7 @@ pub use usermode::*; // pub use systemmode::*; /// Safe linking with of extern "C" functions. +/// /// This macro makes sure the declared symbol is defined *at link time*, avoiding declaring non-existant symbols /// that could be silently ignored during linking if unused. /// @@ -153,11 +125,13 @@ pub enum MmapPerms { // from include/exec/memop.h #[cfg(target_os = "linux")] +#[must_use] pub fn memop_size(op: MemOp) -> u32 { 1 << op.bitand(MemOp_MO_SIZE).0 } #[cfg(target_os = "linux")] +#[must_use] pub fn memop_big_endian(op: MemOp) -> bool { op.bitand(MemOp_MO_BSWAP) == MemOp_MO_BE } @@ -165,6 +139,7 @@ pub fn memop_big_endian(op: MemOp) -> bool { // from include/qemu/plugin.h #[cfg(target_os = "linux")] +#[must_use] pub fn make_plugin_meminfo(oi: MemOpIdx, rw: qemu_plugin_mem_rw) -> qemu_plugin_meminfo_t { oi | (rw.0 << 16) } diff --git a/libafl_qemu/libafl_qemu_sys/src/x86_64_stub_bindings.rs b/libafl_qemu/libafl_qemu_sys/src/x86_64_stub_bindings.rs deleted file mode 100644 index 175527eb42..0000000000 --- a/libafl_qemu/libafl_qemu_sys/src/x86_64_stub_bindings.rs +++ /dev/null @@ -1,15365 +0,0 @@ -/* 1.83.0-nightly */ -/* qemu git hash: d6637939526f453c69f4c6bfe4635feb5dc5c0be */ -/* automatically generated by rust-bindgen 0.69.4 */ - -#[repr(C)] -#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub struct __BindgenBitfieldUnit { - storage: Storage, -} -impl __BindgenBitfieldUnit { - #[inline] - pub const fn new(storage: Storage) -> Self { - Self { storage } - } -} -impl __BindgenBitfieldUnit -where - Storage: AsRef<[u8]> + AsMut<[u8]>, -{ - #[inline] - pub fn get_bit(&self, index: usize) -> bool { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = self.storage.as_ref()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - byte & mask == mask - } - #[inline] - pub fn set_bit(&mut self, index: usize, val: bool) { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = &mut self.storage.as_mut()[byte_index]; - let bit_index = if cfg!(target_endian = "big") { - 7 - (index % 8) - } else { - index % 8 - }; - let mask = 1 << bit_index; - if val { - *byte |= mask; - } else { - *byte &= !mask; - } - } - #[inline] - pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - let mut val = 0; - for i in 0..(bit_width as usize) { - if self.get_bit(i + bit_offset) { - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - val |= 1 << index; - } - } - val - } - #[inline] - pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { - debug_assert!(bit_width <= 64); - debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); - debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len()); - for i in 0..(bit_width as usize) { - let mask = 1 << i; - let val_bit_is_set = val & mask == mask; - let index = if cfg!(target_endian = "big") { - bit_width as usize - 1 - i - } else { - i - }; - self.set_bit(index + bit_offset, val_bit_is_set); - } - } -} -#[repr(C)] -#[derive(Default)] -pub struct __IncompleteArrayField(::std::marker::PhantomData, [T; 0]); -impl __IncompleteArrayField { - #[inline] - pub const fn new() -> Self { - __IncompleteArrayField(::std::marker::PhantomData, []) - } - #[inline] - pub fn as_ptr(&self) -> *const T { - self as *const _ as *const T - } - #[inline] - pub fn as_mut_ptr(&mut self) -> *mut T { - self as *mut _ as *mut T - } - #[inline] - pub unsafe fn as_slice(&self, len: usize) -> &[T] { - ::std::slice::from_raw_parts(self.as_ptr(), len) - } - #[inline] - pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { - ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) - } -} -impl ::std::fmt::Debug for __IncompleteArrayField { - fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - fmt.write_str("__IncompleteArrayField") - } -} -pub type __uint32_t = ::std::os::raw::c_uint; -pub type __uid_t = ::std::os::raw::c_uint; -pub type __off_t = ::std::os::raw::c_long; -pub type __off64_t = ::std::os::raw::c_long; -pub type __pid_t = ::std::os::raw::c_int; -pub type __clock_t = ::std::os::raw::c_long; -pub type off_t = __off64_t; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct __sigset_t { - pub __val: [::std::os::raw::c_ulong; 16usize], -} -#[test] -fn bindgen_test_layout___sigset_t() { - const UNINIT: ::std::mem::MaybeUninit<__sigset_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__sigset_t>(), - 128usize, - concat!("Size of: ", stringify!(__sigset_t)) - ); - assert_eq!( - ::std::mem::align_of::<__sigset_t>(), - 8usize, - concat!("Alignment of ", stringify!(__sigset_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sigset_t), - "::", - stringify!(__val) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union __atomic_wide_counter { - pub __value64: ::std::os::raw::c_ulonglong, - pub __value32: __atomic_wide_counter__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct __atomic_wide_counter__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___atomic_wide_counter__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__atomic_wide_counter__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__atomic_wide_counter__bindgen_ty_1>(), - 8usize, - concat!("Size of: ", stringify!(__atomic_wide_counter__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__atomic_wide_counter__bindgen_ty_1>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__atomic_wide_counter__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__low) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter__bindgen_ty_1), - "::", - stringify!(__low) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__high) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter__bindgen_ty_1), - "::", - stringify!(__high) - ) - ); -} -#[test] -fn bindgen_test_layout___atomic_wide_counter() { - const UNINIT: ::std::mem::MaybeUninit<__atomic_wide_counter> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__atomic_wide_counter>(), - 8usize, - concat!("Size of: ", stringify!(__atomic_wide_counter)) - ); - assert_eq!( - ::std::mem::align_of::<__atomic_wide_counter>(), - 8usize, - concat!("Alignment of ", stringify!(__atomic_wide_counter)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__value64) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter), - "::", - stringify!(__value64) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__value32) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__atomic_wide_counter), - "::", - stringify!(__value32) - ) - ); -} -impl Default for __atomic_wide_counter { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for __atomic_wide_counter { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "__atomic_wide_counter {{ union }}") - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_list { - pub __prev: *mut __pthread_internal_list, - pub __next: *mut __pthread_internal_list, -} -#[test] -fn bindgen_test_layout___pthread_internal_list() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_internal_list> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_internal_list>(), - 16usize, - concat!("Size of: ", stringify!(__pthread_internal_list)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_internal_list>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_list)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__prev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__prev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__next) - ) - ); -} -impl Default for __pthread_internal_list { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type __pthread_list_t = __pthread_internal_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_mutex_s { - pub __lock: ::std::os::raw::c_int, - pub __count: ::std::os::raw::c_uint, - pub __owner: ::std::os::raw::c_int, - pub __nusers: ::std::os::raw::c_uint, - pub __kind: ::std::os::raw::c_int, - pub __spins: ::std::os::raw::c_short, - pub __elision: ::std::os::raw::c_short, - pub __list: __pthread_list_t, -} -#[test] -fn bindgen_test_layout___pthread_mutex_s() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_mutex_s> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_mutex_s>(), - 40usize, - concat!("Size of: ", stringify!(__pthread_mutex_s)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_mutex_s>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_mutex_s)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__lock) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__owner) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__owner) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__nusers) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__nusers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__kind) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__kind) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__spins) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__spins) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__elision) as usize - ptr as usize }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__elision) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__list) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__list) - ) - ); -} -impl Default for __pthread_mutex_s { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __pthread_cond_s { - pub __wseq: __atomic_wide_counter, - pub __g1_start: __atomic_wide_counter, - pub __g_refs: [::std::os::raw::c_uint; 2usize], - pub __g_size: [::std::os::raw::c_uint; 2usize], - pub __g1_orig_size: ::std::os::raw::c_uint, - pub __wrefs: ::std::os::raw::c_uint, - pub __g_signals: [::std::os::raw::c_uint; 2usize], -} -#[test] -fn bindgen_test_layout___pthread_cond_s() { - const UNINIT: ::std::mem::MaybeUninit<__pthread_cond_s> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s>(), - 48usize, - concat!("Size of: ", stringify!(__pthread_cond_s)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wseq) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wseq) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g1_start) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_start) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g_refs) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_refs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g_size) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g1_orig_size) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_orig_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wrefs) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wrefs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__g_signals) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_signals) - ) - ); -} -impl Default for __pthread_cond_s { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for __pthread_cond_s { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! (f , "__pthread_cond_s {{ __wseq: {:?}, __g1_start: {:?}, __g_refs: {:?}, __g_size: {:?}, __g1_orig_size: {:?}, __wrefs: {:?}, __g_signals: {:?} }}" , self . __wseq , self . __g1_start , self . __g_refs , self . __g_size , self . __g1_orig_size , self . __wrefs , self . __g_signals) - } -} -pub type pthread_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutex_t { - pub __data: __pthread_mutex_s, - pub __size: [::std::os::raw::c_char; 40usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_mutex_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__align) - ) - ); -} -impl Default for pthread_mutex_t { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for pthread_mutex_t { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "pthread_mutex_t {{ union }}") - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_cond_t { - pub __data: __pthread_cond_s, - pub __size: [::std::os::raw::c_char; 48usize], - pub __align: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout_pthread_cond_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__size) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__align) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__align) - ) - ); -} -impl Default for pthread_cond_t { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for pthread_cond_t { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "pthread_cond_t {{ union }}") - } -} -pub type FILE = _IO_FILE; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_marker { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_codecvt { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_wide_data { - _unused: [u8; 0], -} -pub type _IO_lock_t = ::std::os::raw::c_void; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_FILE { - pub _flags: ::std::os::raw::c_int, - pub _IO_read_ptr: *mut ::std::os::raw::c_char, - pub _IO_read_end: *mut ::std::os::raw::c_char, - pub _IO_read_base: *mut ::std::os::raw::c_char, - pub _IO_write_base: *mut ::std::os::raw::c_char, - pub _IO_write_ptr: *mut ::std::os::raw::c_char, - pub _IO_write_end: *mut ::std::os::raw::c_char, - pub _IO_buf_base: *mut ::std::os::raw::c_char, - pub _IO_buf_end: *mut ::std::os::raw::c_char, - pub _IO_save_base: *mut ::std::os::raw::c_char, - pub _IO_backup_base: *mut ::std::os::raw::c_char, - pub _IO_save_end: *mut ::std::os::raw::c_char, - pub _markers: *mut _IO_marker, - pub _chain: *mut _IO_FILE, - pub _fileno: ::std::os::raw::c_int, - pub _flags2: ::std::os::raw::c_int, - pub _old_offset: __off_t, - pub _cur_column: ::std::os::raw::c_ushort, - pub _vtable_offset: ::std::os::raw::c_schar, - pub _shortbuf: [::std::os::raw::c_char; 1usize], - pub _lock: *mut _IO_lock_t, - pub _offset: __off64_t, - pub _codecvt: *mut _IO_codecvt, - pub _wide_data: *mut _IO_wide_data, - pub _freeres_list: *mut _IO_FILE, - pub _freeres_buf: *mut ::std::os::raw::c_void, - pub _prevchain: *mut *mut _IO_FILE, - pub _mode: ::std::os::raw::c_int, - pub _unused2: [::std::os::raw::c_char; 20usize], -} -#[test] -fn bindgen_test_layout__IO_FILE() { - const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._prevchain) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_prevchain) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); -} -impl Default for _IO_FILE { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type __jmp_buf = [::std::os::raw::c_long; 8usize]; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct __jmp_buf_tag { - pub __jmpbuf: __jmp_buf, - pub __mask_was_saved: ::std::os::raw::c_int, - pub __saved_mask: __sigset_t, -} -#[test] -fn bindgen_test_layout___jmp_buf_tag() { - const UNINIT: ::std::mem::MaybeUninit<__jmp_buf_tag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__jmp_buf_tag>(), - 200usize, - concat!("Size of: ", stringify!(__jmp_buf_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__jmp_buf_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__jmp_buf_tag)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__jmpbuf) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__jmp_buf_tag), - "::", - stringify!(__jmpbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__mask_was_saved) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(__jmp_buf_tag), - "::", - stringify!(__mask_was_saved) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__saved_mask) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(__jmp_buf_tag), - "::", - stringify!(__saved_mask) - ) - ); -} -pub type sigjmp_buf = [__jmp_buf_tag; 1usize]; -#[repr(C)] -#[derive(Copy, Clone)] -pub union sigval { - pub sival_int: ::std::os::raw::c_int, - pub sival_ptr: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_sigval() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(sigval)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(sigval)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sival_int) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigval), - "::", - stringify!(sival_int) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sival_ptr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(sigval), - "::", - stringify!(sival_ptr) - ) - ); -} -impl Default for sigval { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for sigval { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "sigval {{ union }}") - } -} -pub type __sigval_t = sigval; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct siginfo_t { - pub si_signo: ::std::os::raw::c_int, - pub si_errno: ::std::os::raw::c_int, - pub si_code: ::std::os::raw::c_int, - pub __pad0: ::std::os::raw::c_int, - pub _sifields: siginfo_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union siginfo_t__bindgen_ty_1 { - pub _pad: [::std::os::raw::c_int; 28usize], - pub _kill: siginfo_t__bindgen_ty_1__bindgen_ty_1, - pub _timer: siginfo_t__bindgen_ty_1__bindgen_ty_2, - pub _rt: siginfo_t__bindgen_ty_1__bindgen_ty_3, - pub _sigchld: siginfo_t__bindgen_ty_1__bindgen_ty_4, - pub _sigfault: siginfo_t__bindgen_ty_1__bindgen_ty_5, - pub _sigpoll: siginfo_t__bindgen_ty_1__bindgen_ty_6, - pub _sigsys: siginfo_t__bindgen_ty_1__bindgen_ty_7, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_1 { - pub si_pid: __pid_t, - pub si_uid: __uid_t, -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_pid) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(si_pid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_uid) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(si_uid) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_2 { - pub si_tid: ::std::os::raw::c_int, - pub si_overrun: ::std::os::raw::c_int, - pub si_sigval: __sigval_t, -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_tid) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(si_tid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_overrun) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(si_overrun) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_sigval) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_2), - "::", - stringify!(si_sigval) - ) - ); -} -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_2 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for siginfo_t__bindgen_ty_1__bindgen_ty_2 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! (f , "siginfo_t__bindgen_ty_1__bindgen_ty_2 {{ si_tid: {:?}, si_overrun: {:?}, si_sigval: {:?} }}" , self . si_tid , self . si_overrun , self . si_sigval) - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_3 { - pub si_pid: __pid_t, - pub si_uid: __uid_t, - pub si_sigval: __sigval_t, -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_pid) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(si_pid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_uid) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(si_uid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_sigval) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_3), - "::", - stringify!(si_sigval) - ) - ); -} -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_3 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for siginfo_t__bindgen_ty_1__bindgen_ty_3 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! (f , "siginfo_t__bindgen_ty_1__bindgen_ty_3 {{ si_pid: {:?}, si_uid: {:?}, si_sigval: {:?} }}" , self . si_pid , self . si_uid , self . si_sigval) - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_4 { - pub si_pid: __pid_t, - pub si_uid: __uid_t, - pub si_status: ::std::os::raw::c_int, - pub si_utime: __clock_t, - pub si_stime: __clock_t, -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_4() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_pid) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), - "::", - stringify!(si_pid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_uid) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), - "::", - stringify!(si_uid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_status) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), - "::", - stringify!(si_status) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_utime) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), - "::", - stringify!(si_utime) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_stime) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_4), - "::", - stringify!(si_stime) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_5 { - pub si_addr: *mut ::std::os::raw::c_void, - pub si_addr_lsb: ::std::os::raw::c_short, - pub _bounds: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 { - pub _addr_bnd: siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, - pub _pkey: __uint32_t, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { - pub _lower: *mut ::std::os::raw::c_void, - pub _upper: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit< - siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1, - > = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lower) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(_lower) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._upper) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(_upper) - ) - ); -} -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._addr_bnd) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_addr_bnd) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pkey) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1), - "::", - stringify!(_pkey) - ) - ); -} -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "siginfo_t__bindgen_ty_1__bindgen_ty_5__bindgen_ty_1 {{ union }}" - ) - } -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_5() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5), - "::", - stringify!(si_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_addr_lsb) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5), - "::", - stringify!(si_addr_lsb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._bounds) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_5), - "::", - stringify!(_bounds) - ) - ); -} -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_5 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for siginfo_t__bindgen_ty_1__bindgen_ty_5 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! (f , "siginfo_t__bindgen_ty_1__bindgen_ty_5 {{ si_addr: {:?}, si_addr_lsb: {:?}, _bounds: {:?} }}" , self . si_addr , self . si_addr_lsb , self . _bounds) - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_6 { - pub si_band: ::std::os::raw::c_long, - pub si_fd: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_6() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_band) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6), - "::", - stringify!(si_band) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_fd) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_6), - "::", - stringify!(si_fd) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct siginfo_t__bindgen_ty_1__bindgen_ty_7 { - pub _call_addr: *mut ::std::os::raw::c_void, - pub _syscall: ::std::os::raw::c_int, - pub _arch: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1__bindgen_ty_7() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._call_addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7), - "::", - stringify!(_call_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._syscall) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7), - "::", - stringify!(_syscall) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._arch) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1__bindgen_ty_7), - "::", - stringify!(_arch) - ) - ); -} -impl Default for siginfo_t__bindgen_ty_1__bindgen_ty_7 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_siginfo_t__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 112usize, - concat!("Size of: ", stringify!(siginfo_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(siginfo_t__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._pad) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_pad) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._kill) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_kill) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._timer) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_timer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._rt) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_rt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigchld) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_sigchld) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigfault) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_sigfault) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigpoll) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_sigpoll) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sigsys) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t__bindgen_ty_1), - "::", - stringify!(_sigsys) - ) - ); -} -impl Default for siginfo_t__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for siginfo_t__bindgen_ty_1 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "siginfo_t__bindgen_ty_1 {{ union }}") - } -} -#[test] -fn bindgen_test_layout_siginfo_t() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(siginfo_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(siginfo_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_signo) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t), - "::", - stringify!(si_signo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_errno) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t), - "::", - stringify!(si_errno) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).si_code) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t), - "::", - stringify!(si_code) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pad0) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t), - "::", - stringify!(__pad0) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._sifields) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(siginfo_t), - "::", - stringify!(_sifields) - ) - ); -} -impl Default for siginfo_t { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for siginfo_t { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! (f , "siginfo_t {{ si_signo: {:?}, si_errno: {:?}, si_code: {:?}, __pad0: {:?}, _sifields: {:?} }}" , self . si_signo , self . si_errno , self . si_code , self . __pad0 , self . _sifields) - } -} -pub type guint8 = ::std::os::raw::c_uchar; -pub type gchar = ::std::os::raw::c_char; -pub type guint = ::std::os::raw::c_uint; -pub type gpointer = *mut ::std::os::raw::c_void; -pub type GArray = _GArray; -pub type GByteArray = _GByteArray; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _GArray { - pub data: *mut gchar, - pub len: guint, -} -#[test] -fn bindgen_test_layout__GArray() { - const UNINIT: ::std::mem::MaybeUninit<_GArray> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_GArray>(), - 16usize, - concat!("Size of: ", stringify!(_GArray)) - ); - assert_eq!( - ::std::mem::align_of::<_GArray>(), - 8usize, - concat!("Alignment of ", stringify!(_GArray)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_GArray), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_GArray), - "::", - stringify!(len) - ) - ); -} -impl Default for _GArray { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _GByteArray { - pub data: *mut guint8, - pub len: guint, -} -#[test] -fn bindgen_test_layout__GByteArray() { - const UNINIT: ::std::mem::MaybeUninit<_GByteArray> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_GByteArray>(), - 16usize, - concat!("Size of: ", stringify!(_GByteArray)) - ); - assert_eq!( - ::std::mem::align_of::<_GByteArray>(), - 8usize, - concat!("Alignment of ", stringify!(_GByteArray)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_GByteArray), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_GByteArray), - "::", - stringify!(len) - ) - ); -} -impl Default for _GByteArray { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _GHashTable { - _unused: [u8; 0], -} -pub type GHashTable = _GHashTable; -pub type GSList = _GSList; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _GSList { - pub data: gpointer, - pub next: *mut GSList, -} -#[test] -fn bindgen_test_layout__GSList() { - const UNINIT: ::std::mem::MaybeUninit<_GSList> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_GSList>(), - 16usize, - concat!("Size of: ", stringify!(_GSList)) - ); - assert_eq!( - ::std::mem::align_of::<_GSList>(), - 8usize, - concat!("Alignment of ", stringify!(_GSList)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_GSList), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_GSList), - "::", - stringify!(next) - ) - ); -} -impl Default for _GSList { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AccelCPUState { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AddressSpace { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Clock { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CPUAddressSpace { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CpuInfoFast { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CPUJumpCache { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Error { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct MemoryRegion { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct QDict { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct QObject { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RAMBlock { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TCGCPUOps { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Visitor { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VMChangeStateEntry { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct VMStateDescription { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct IRQState { - _unused: [u8; 0], -} -pub type qemu_irq = *mut IRQState; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct QEnumLookup { - pub array: *const *const ::std::os::raw::c_char, - pub special_features: *const ::std::os::raw::c_uchar, - pub size: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_QEnumLookup() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(QEnumLookup)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(QEnumLookup)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).array) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(QEnumLookup), - "::", - stringify!(array) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).special_features) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(QEnumLookup), - "::", - stringify!(special_features) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(QEnumLookup), - "::", - stringify!(size) - ) - ); -} -impl Default for QEnumLookup { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - pub fn qemu_target_page_size() -> usize; -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct QemuMutex { - pub lock: pthread_mutex_t, - pub initialized: bool, -} -#[test] -fn bindgen_test_layout_QemuMutex() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(QemuMutex)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(QemuMutex)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lock) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(QemuMutex), - "::", - stringify!(lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).initialized) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(QemuMutex), - "::", - stringify!(initialized) - ) - ); -} -impl Default for QemuMutex { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for QemuMutex { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "QemuMutex {{ lock: {:?}, initialized: {:?} }}", - self.lock, self.initialized - ) - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct QemuCond { - pub cond: pthread_cond_t, - pub initialized: bool, -} -#[test] -fn bindgen_test_layout_QemuCond() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(QemuCond)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(QemuCond)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cond) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(QemuCond), - "::", - stringify!(cond) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).initialized) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(QemuCond), - "::", - stringify!(initialized) - ) - ); -} -impl Default for QemuCond { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for QemuCond { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "QemuCond {{ cond: {:?}, initialized: {:?} }}", - self.cond, self.initialized - ) - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct QemuThread { - pub thread: pthread_t, -} -#[test] -fn bindgen_test_layout_QemuThread() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(QemuThread)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(QemuThread)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(QemuThread), - "::", - stringify!(thread) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct QemuSpin { - pub value: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_QemuSpin() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(QemuSpin)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(QemuSpin)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).value) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(QemuSpin), - "::", - stringify!(value) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct QemuLockCnt { - pub count: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout_QemuLockCnt() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(QemuLockCnt)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(QemuLockCnt)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(QemuLockCnt), - "::", - stringify!(count) - ) - ); -} -#[repr(C)] -#[repr(align(4))] -#[derive(Debug, Default, Copy, Clone)] -pub struct MemTxAttrs { - pub _bitfield_align_1: [u16; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>, -} -#[test] -fn bindgen_test_layout_MemTxAttrs() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(MemTxAttrs)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(MemTxAttrs)) - ); -} -impl MemTxAttrs { - #[inline] - pub fn unspecified(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } - } - #[inline] - pub fn set_unspecified(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 1u8, val as u64) - } - } - #[inline] - pub fn secure(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } - } - #[inline] - pub fn set_secure(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) - } - } - #[inline] - pub fn space(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 2u8) as u32) } - } - #[inline] - pub fn set_space(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 2u8, val as u64) - } - } - #[inline] - pub fn user(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) } - } - #[inline] - pub fn set_user(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) - } - } - #[inline] - pub fn memory(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) } - } - #[inline] - pub fn set_memory(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) - } - } - #[inline] - pub fn requester_id(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 16u8) as u32) } - } - #[inline] - pub fn set_requester_id(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 16u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - unspecified: ::std::os::raw::c_uint, - secure: ::std::os::raw::c_uint, - space: ::std::os::raw::c_uint, - user: ::std::os::raw::c_uint, - memory: ::std::os::raw::c_uint, - requester_id: ::std::os::raw::c_uint, - ) -> __BindgenBitfieldUnit<[u8; 3usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 1u8, { - let unspecified: u32 = unsafe { ::std::mem::transmute(unspecified) }; - unspecified as u64 - }); - __bindgen_bitfield_unit.set(1usize, 1u8, { - let secure: u32 = unsafe { ::std::mem::transmute(secure) }; - secure as u64 - }); - __bindgen_bitfield_unit.set(2usize, 2u8, { - let space: u32 = unsafe { ::std::mem::transmute(space) }; - space as u64 - }); - __bindgen_bitfield_unit.set(4usize, 1u8, { - let user: u32 = unsafe { ::std::mem::transmute(user) }; - user as u64 - }); - __bindgen_bitfield_unit.set(5usize, 1u8, { - let memory: u32 = unsafe { ::std::mem::transmute(memory) }; - memory as u64 - }); - __bindgen_bitfield_unit.set(6usize, 16u8, { - let requester_id: u32 = unsafe { ::std::mem::transmute(requester_id) }; - requester_id as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct QTailQLink { - pub tql_next: *mut ::std::os::raw::c_void, - pub tql_prev: *mut QTailQLink, -} -#[test] -fn bindgen_test_layout_QTailQLink() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(QTailQLink)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(QTailQLink)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tql_next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(QTailQLink), - "::", - stringify!(tql_next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tql_prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(QTailQLink), - "::", - stringify!(tql_prev) - ) - ); -} -impl Default for QTailQLink { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Notifier { - pub notify: ::std::option::Option< - unsafe extern "C" fn(notifier: *mut Notifier, data: *mut ::std::os::raw::c_void), - >, - pub node: Notifier__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Notifier__bindgen_ty_1 { - pub le_next: *mut Notifier, - pub le_prev: *mut *mut Notifier, -} -#[test] -fn bindgen_test_layout_Notifier__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(Notifier__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Notifier__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).le_next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Notifier__bindgen_ty_1), - "::", - stringify!(le_next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).le_prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Notifier__bindgen_ty_1), - "::", - stringify!(le_prev) - ) - ); -} -impl Default for Notifier__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_Notifier() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(Notifier)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Notifier)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).notify) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Notifier), - "::", - stringify!(notify) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Notifier), - "::", - stringify!(node) - ) - ); -} -impl Default for Notifier { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type RCUCBFunc = ::std::option::Option; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct rcu_head { - pub next: *mut rcu_head, - pub func: RCUCBFunc, -} -#[test] -fn bindgen_test_layout_rcu_head() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(rcu_head)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(rcu_head)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(rcu_head), - "::", - stringify!(next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).func) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(rcu_head), - "::", - stringify!(func) - ) - ); -} -impl Default for rcu_head { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TypeImpl { - _unused: [u8; 0], -} -pub type Type = *mut TypeImpl; -#[doc = " typedef ObjectPropertyAccessor:\n @obj: the object that owns the property\n @v: the visitor that contains the property data\n @name: the name of the property\n @opaque: the object property opaque\n @errp: a pointer to an Error that is filled if getting/setting fails.\n\n Called when trying to get/set a property."] -pub type ObjectPropertyAccessor = ::std::option::Option< - unsafe extern "C" fn( - obj: *mut Object, - v: *mut Visitor, - name: *const ::std::os::raw::c_char, - opaque: *mut ::std::os::raw::c_void, - errp: *mut *mut Error, - ), ->; -#[doc = " typedef ObjectPropertyResolve:\n @obj: the object that owns the property\n @opaque: the opaque registered with the property\n @part: the name of the property\n\n Resolves the #Object corresponding to property @part.\n\n The returned object can also be used as a starting point\n to resolve a relative path starting with \"@part\".\n\n Returns: If @path is the path that led to @obj, the function\n returns the #Object corresponding to \"@path/@part\".\n If \"@path/@part\" is not a valid object path, it returns #NULL."] -pub type ObjectPropertyResolve = ::std::option::Option< - unsafe extern "C" fn( - obj: *mut Object, - opaque: *mut ::std::os::raw::c_void, - part: *const ::std::os::raw::c_char, - ) -> *mut Object, ->; -#[doc = " typedef ObjectPropertyRelease:\n @obj: the object that owns the property\n @name: the name of the property\n @opaque: the opaque registered with the property\n\n Called when a property is removed from a object."] -pub type ObjectPropertyRelease = ::std::option::Option< - unsafe extern "C" fn( - obj: *mut Object, - name: *const ::std::os::raw::c_char, - opaque: *mut ::std::os::raw::c_void, - ), ->; -#[doc = " typedef ObjectPropertyInit:\n @obj: the object that owns the property\n @prop: the property to set\n\n Called when a property is initialized."] -pub type ObjectPropertyInit = - ::std::option::Option; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ObjectProperty { - pub name: *mut ::std::os::raw::c_char, - pub type_: *mut ::std::os::raw::c_char, - pub description: *mut ::std::os::raw::c_char, - pub get: ObjectPropertyAccessor, - pub set: ObjectPropertyAccessor, - pub resolve: ObjectPropertyResolve, - pub release: ObjectPropertyRelease, - pub init: ObjectPropertyInit, - pub opaque: *mut ::std::os::raw::c_void, - pub defval: *mut QObject, -} -#[test] -fn bindgen_test_layout_ObjectProperty() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 80usize, - concat!("Size of: ", stringify!(ObjectProperty)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ObjectProperty)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ObjectProperty), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ObjectProperty), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).description) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ObjectProperty), - "::", - stringify!(description) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).get) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(ObjectProperty), - "::", - stringify!(get) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(ObjectProperty), - "::", - stringify!(set) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).resolve) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(ObjectProperty), - "::", - stringify!(resolve) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).release) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(ObjectProperty), - "::", - stringify!(release) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(ObjectProperty), - "::", - stringify!(init) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(ObjectProperty), - "::", - stringify!(opaque) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).defval) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(ObjectProperty), - "::", - stringify!(defval) - ) - ); -} -impl Default for ObjectProperty { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = " typedef ObjectUnparent:\n @obj: the object that is being removed from the composition tree\n\n Called when an object is being removed from the QOM composition tree.\n The function should remove any backlinks from children objects to @obj."] -pub type ObjectUnparent = ::std::option::Option; -#[doc = " typedef ObjectFree:\n @obj: the object being freed\n\n Called when an object's last reference is removed."] -pub type ObjectFree = ::std::option::Option; -#[doc = " struct ObjectClass:\n\n The base for all classes. The only thing that #ObjectClass contains is an\n integer type handle."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ObjectClass { - pub type_: Type, - pub interfaces: *mut GSList, - pub object_cast_cache: [*const ::std::os::raw::c_char; 4usize], - pub class_cast_cache: [*const ::std::os::raw::c_char; 4usize], - pub unparent: ObjectUnparent, - pub properties: *mut GHashTable, -} -#[test] -fn bindgen_test_layout_ObjectClass() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 96usize, - concat!("Size of: ", stringify!(ObjectClass)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ObjectClass)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ObjectClass), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).interfaces) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ObjectClass), - "::", - stringify!(interfaces) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).object_cast_cache) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(ObjectClass), - "::", - stringify!(object_cast_cache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).class_cast_cache) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(ObjectClass), - "::", - stringify!(class_cast_cache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).unparent) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(ObjectClass), - "::", - stringify!(unparent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).properties) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(ObjectClass), - "::", - stringify!(properties) - ) - ); -} -impl Default for ObjectClass { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = " struct Object:\n\n The base for all objects. The first member of this object is a pointer to\n a #ObjectClass. Since C guarantees that the first member of a structure\n always begins at byte 0 of that structure, as long as any sub-object places\n its parent as the first member, we can cast directly to a #Object.\n\n As a result, #Object contains a reference to the objects type as its\n first member. This allows identification of the real type of the object at\n run time."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct Object { - pub class: *mut ObjectClass, - pub free: ObjectFree, - pub properties: *mut GHashTable, - pub ref_: u32, - pub parent: *mut Object, -} -#[test] -fn bindgen_test_layout_Object() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(Object)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Object)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).class) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Object), - "::", - stringify!(class) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).free) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Object), - "::", - stringify!(free) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).properties) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Object), - "::", - stringify!(properties) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ref_) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Object), - "::", - stringify!(ref_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Object), - "::", - stringify!(parent) - ) - ); -} -impl Default for Object { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct HotplugHandler { - _unused: [u8; 0], -} -#[doc = " ResettableState:\n Structure holding reset related state. The fields should not be accessed\n directly; the definition is here to allow further inclusion into other\n objects.\n\n @count: Number of reset level the object is into. It is incremented when\n the reset operation starts and decremented when it finishes.\n @hold_phase_pending: flag which indicates that we need to invoke the 'hold'\n phase handler for this object.\n @exit_phase_in_progress: true if we are currently in the exit phase"] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ResettableState { - pub count: ::std::os::raw::c_uint, - pub hold_phase_pending: bool, - pub exit_phase_in_progress: bool, -} -#[test] -fn bindgen_test_layout_ResettableState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(ResettableState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ResettableState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ResettableState), - "::", - stringify!(count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hold_phase_pending) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ResettableState), - "::", - stringify!(hold_phase_pending) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exit_phase_in_progress) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(ResettableState), - "::", - stringify!(exit_phase_in_progress) - ) - ); -} -pub type DeviceRealize = - ::std::option::Option; -pub type DeviceUnrealize = ::std::option::Option; -pub type DeviceReset = ::std::option::Option; -#[doc = " struct DeviceClass - The base class for all devices.\n @props: Properties accessing state fields.\n @realize: Callback function invoked when the #DeviceState:realized\n property is changed to %true.\n @unrealize: Callback function invoked when the #DeviceState:realized\n property is changed to %false.\n @hotpluggable: indicates if #DeviceClass is hotpluggable, available\n as readonly \"hotpluggable\" property of #DeviceState instance\n"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct DeviceClass { - pub parent_class: ObjectClass, - #[doc = " @categories: device categories device belongs to"] - pub categories: [::std::os::raw::c_ulong; 1usize], - #[doc = " @fw_name: name used to identify device to firmware interfaces"] - pub fw_name: *const ::std::os::raw::c_char, - #[doc = " @desc: human readable description of device"] - pub desc: *const ::std::os::raw::c_char, - #[doc = " @props_: properties associated with device, should only be\n assigned by using device_class_set_props(). The underscore\n ensures a compile-time error if someone attempts to assign\n dc->props directly."] - pub props_: *mut Property, - #[doc = " @user_creatable: Can user instantiate with -device / device_add?\n\n All devices should support instantiation with device_add, and\n this flag should not exist. But we're not there, yet. Some\n devices fail to instantiate with cryptic error messages.\n Others instantiate, but don't work. Exposing users to such\n behavior would be cruel; clearing this flag will protect them.\n It should never be cleared without a comment explaining why it\n is cleared.\n\n TODO remove once we're there"] - pub user_creatable: bool, - pub hotpluggable: bool, - #[doc = " @reset: deprecated device reset method pointer\n\n Modern code should use the ResettableClass interface to\n implement a multi-phase reset.\n\n TODO: remove once every reset callback is unused"] - pub reset: DeviceReset, - pub realize: DeviceRealize, - pub unrealize: DeviceUnrealize, - #[doc = " @vmsd: device state serialisation description for\n migration/save/restore"] - pub vmsd: *const VMStateDescription, - #[doc = " @bus_type: bus type\n private: to qdev / bus."] - pub bus_type: *const ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_DeviceClass() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 176usize, - concat!("Size of: ", stringify!(DeviceClass)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(DeviceClass)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_class) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(parent_class) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).categories) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(categories) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fw_name) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(fw_name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).desc) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(desc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).props_) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(props_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).user_creatable) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(user_creatable) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hotpluggable) as usize - ptr as usize }, - 129usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(hotpluggable) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reset) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(reset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).realize) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(realize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).unrealize) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(unrealize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vmsd) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(vmsd) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bus_type) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(DeviceClass), - "::", - stringify!(bus_type) - ) - ); -} -impl Default for DeviceClass { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NamedGPIOList { - pub name: *mut ::std::os::raw::c_char, - pub in_: *mut qemu_irq, - pub num_in: ::std::os::raw::c_int, - pub num_out: ::std::os::raw::c_int, - pub node: NamedGPIOList__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NamedGPIOList__bindgen_ty_1 { - pub le_next: *mut NamedGPIOList, - pub le_prev: *mut *mut NamedGPIOList, -} -#[test] -fn bindgen_test_layout_NamedGPIOList__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(NamedGPIOList__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(NamedGPIOList__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).le_next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(NamedGPIOList__bindgen_ty_1), - "::", - stringify!(le_next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).le_prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(NamedGPIOList__bindgen_ty_1), - "::", - stringify!(le_prev) - ) - ); -} -impl Default for NamedGPIOList__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_NamedGPIOList() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(NamedGPIOList)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(NamedGPIOList)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(NamedGPIOList), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).in_) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(NamedGPIOList), - "::", - stringify!(in_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).num_in) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(NamedGPIOList), - "::", - stringify!(num_in) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).num_out) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(NamedGPIOList), - "::", - stringify!(num_out) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(NamedGPIOList), - "::", - stringify!(node) - ) - ); -} -impl Default for NamedGPIOList { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NamedClockList { - pub name: *mut ::std::os::raw::c_char, - pub clock: *mut Clock, - pub output: bool, - pub alias: bool, - pub node: NamedClockList__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NamedClockList__bindgen_ty_1 { - pub le_next: *mut NamedClockList, - pub le_prev: *mut *mut NamedClockList, -} -#[test] -fn bindgen_test_layout_NamedClockList__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(NamedClockList__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(NamedClockList__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).le_next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(NamedClockList__bindgen_ty_1), - "::", - stringify!(le_next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).le_prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(NamedClockList__bindgen_ty_1), - "::", - stringify!(le_prev) - ) - ); -} -impl Default for NamedClockList__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[test] -fn bindgen_test_layout_NamedClockList() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(NamedClockList)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(NamedClockList)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(NamedClockList), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).clock) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(NamedClockList), - "::", - stringify!(clock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).output) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(NamedClockList), - "::", - stringify!(output) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alias) as usize - ptr as usize }, - 17usize, - concat!( - "Offset of field: ", - stringify!(NamedClockList), - "::", - stringify!(alias) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(NamedClockList), - "::", - stringify!(node) - ) - ); -} -impl Default for NamedClockList { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct MemReentrancyGuard { - pub engaged_in_io: bool, -} -#[test] -fn bindgen_test_layout_MemReentrancyGuard() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 1usize, - concat!("Size of: ", stringify!(MemReentrancyGuard)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(MemReentrancyGuard)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).engaged_in_io) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MemReentrancyGuard), - "::", - stringify!(engaged_in_io) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NamedGPIOListHead { - pub lh_first: *mut NamedGPIOList, -} -#[test] -fn bindgen_test_layout_NamedGPIOListHead() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(NamedGPIOListHead)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(NamedGPIOListHead)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lh_first) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(NamedGPIOListHead), - "::", - stringify!(lh_first) - ) - ); -} -impl Default for NamedGPIOListHead { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct NamedClockListHead { - pub lh_first: *mut NamedClockList, -} -#[test] -fn bindgen_test_layout_NamedClockListHead() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(NamedClockListHead)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(NamedClockListHead)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lh_first) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(NamedClockListHead), - "::", - stringify!(lh_first) - ) - ); -} -impl Default for NamedClockListHead { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BusStateHead { - pub lh_first: *mut BusState, -} -#[test] -fn bindgen_test_layout_BusStateHead() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(BusStateHead)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(BusStateHead)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lh_first) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BusStateHead), - "::", - stringify!(lh_first) - ) - ); -} -impl Default for BusStateHead { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = " struct DeviceState - common device state, accessed with qdev helpers\n\n This structure should not be accessed directly. We declare it here\n so that it can be embedded in individual device state structures."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct DeviceState { - pub parent_obj: Object, - #[doc = " @id: global device id"] - pub id: *mut ::std::os::raw::c_char, - #[doc = " @canonical_path: canonical path of realized device in the QOM tree"] - pub canonical_path: *mut ::std::os::raw::c_char, - #[doc = " @realized: has device been realized?"] - pub realized: bool, - #[doc = " @pending_deleted_event: track pending deletion events during unplug"] - pub pending_deleted_event: bool, - #[doc = " @pending_deleted_expires_ms: optional timeout for deletion events"] - pub pending_deleted_expires_ms: i64, - #[doc = " @opts: QDict of options for the device"] - pub opts: *mut QDict, - #[doc = " @hotplugged: was device added after PHASE_MACHINE_READY?"] - pub hotplugged: ::std::os::raw::c_int, - #[doc = " @allow_unplug_during_migration: can device be unplugged during migration"] - pub allow_unplug_during_migration: bool, - #[doc = " @parent_bus: bus this device belongs to"] - pub parent_bus: *mut BusState, - #[doc = " @gpios: QLIST of named GPIOs the device provides."] - pub gpios: NamedGPIOListHead, - #[doc = " @clocks: QLIST of named clocks the device provides."] - pub clocks: NamedClockListHead, - #[doc = " @child_bus: QLIST of child buses"] - pub child_bus: BusStateHead, - #[doc = " @num_child_bus: number of @child_bus entries"] - pub num_child_bus: ::std::os::raw::c_int, - #[doc = " @instance_id_alias: device alias for handling legacy migration setups"] - pub instance_id_alias: ::std::os::raw::c_int, - #[doc = " @alias_required_for_version: indicates @instance_id_alias is\n needed for migration"] - pub alias_required_for_version: ::std::os::raw::c_int, - #[doc = " @reset: ResettableState for the device; handled by Resettable interface."] - pub reset: ResettableState, - #[doc = " @unplug_blockers: list of reasons to block unplugging of device"] - pub unplug_blockers: *mut GSList, - #[doc = " @mem_reentrancy_guard: Is the device currently in mmio/pio/dma?\n\n Used to prevent re-entrancy confusing things."] - pub mem_reentrancy_guard: MemReentrancyGuard, -} -#[test] -fn bindgen_test_layout_DeviceState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 160usize, - concat!("Size of: ", stringify!(DeviceState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(DeviceState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_obj) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(parent_obj) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).id) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).canonical_path) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(canonical_path) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).realized) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(realized) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pending_deleted_event) as usize - ptr as usize }, - 57usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(pending_deleted_event) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pending_deleted_expires_ms) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(pending_deleted_expires_ms) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opts) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(opts) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hotplugged) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(hotplugged) - ) - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).allow_unplug_during_migration) as usize - ptr as usize - }, - 84usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(allow_unplug_during_migration) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_bus) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(parent_bus) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gpios) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(gpios) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).clocks) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(clocks) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).child_bus) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(child_bus) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).num_child_bus) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(num_child_bus) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).instance_id_alias) as usize - ptr as usize }, - 124usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(instance_id_alias) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alias_required_for_version) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(alias_required_for_version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reset) as usize - ptr as usize }, - 132usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(reset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).unplug_blockers) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(unplug_blockers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mem_reentrancy_guard) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(DeviceState), - "::", - stringify!(mem_reentrancy_guard) - ) - ); -} -impl Default for DeviceState { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct BusChild { - pub rcu: rcu_head, - pub child: *mut DeviceState, - pub index: ::std::os::raw::c_int, - pub sibling: BusChild__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union BusChild__bindgen_ty_1 { - pub tqe_next: *mut BusChild, - pub tqe_circ: QTailQLink, -} -#[test] -fn bindgen_test_layout_BusChild__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(BusChild__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(BusChild__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BusChild__bindgen_ty_1), - "::", - stringify!(tqe_next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_circ) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BusChild__bindgen_ty_1), - "::", - stringify!(tqe_circ) - ) - ); -} -impl Default for BusChild__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for BusChild__bindgen_ty_1 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "BusChild__bindgen_ty_1 {{ union }}") - } -} -#[test] -fn bindgen_test_layout_BusChild() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(BusChild)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(BusChild)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rcu) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BusChild), - "::", - stringify!(rcu) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).child) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(BusChild), - "::", - stringify!(child) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(BusChild), - "::", - stringify!(index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sibling) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(BusChild), - "::", - stringify!(sibling) - ) - ); -} -impl Default for BusChild { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for BusChild { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "BusChild {{ rcu: {:?}, child: {:?}, index: {:?}, sibling: {:?} }}", - self.rcu, self.child, self.index, self.sibling - ) - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union BusChildHead { - pub tqh_first: *mut BusChild, - pub tqh_circ: QTailQLink, -} -#[test] -fn bindgen_test_layout_BusChildHead() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(BusChildHead)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(BusChildHead)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BusChildHead), - "::", - stringify!(tqh_first) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_circ) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BusChildHead), - "::", - stringify!(tqh_circ) - ) - ); -} -impl Default for BusChildHead { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for BusChildHead { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "BusChildHead {{ union }}") - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct BusStateEntry { - pub le_next: *mut BusState, - pub le_prev: *mut *mut BusState, -} -#[test] -fn bindgen_test_layout_BusStateEntry() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(BusStateEntry)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(BusStateEntry)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).le_next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BusStateEntry), - "::", - stringify!(le_next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).le_prev) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(BusStateEntry), - "::", - stringify!(le_prev) - ) - ); -} -impl Default for BusStateEntry { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = " struct BusState:\n @obj: parent object\n @parent: parent Device\n @name: name of bus\n @hotplug_handler: link to a hotplug handler associated with bus.\n @max_index: max number of child buses\n @realized: is the bus itself realized?\n @full: is the bus full?\n @num_children: current number of child buses"] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct BusState { - pub obj: Object, - pub parent: *mut DeviceState, - pub name: *mut ::std::os::raw::c_char, - pub hotplug_handler: *mut HotplugHandler, - pub max_index: ::std::os::raw::c_int, - pub realized: bool, - pub full: bool, - pub num_children: ::std::os::raw::c_int, - #[doc = " @children: an RCU protected QTAILQ, thus readers must use RCU\n to access it, and writers must hold the big qemu lock"] - pub children: BusChildHead, - #[doc = " @sibling: next bus"] - pub sibling: BusStateEntry, - #[doc = " @reset: ResettableState for the bus; handled by Resettable interface."] - pub reset: ResettableState, -} -#[test] -fn bindgen_test_layout_BusState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 120usize, - concat!("Size of: ", stringify!(BusState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(BusState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).obj) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(obj) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(parent) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hotplug_handler) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(hotplug_handler) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_index) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(max_index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).realized) as usize - ptr as usize }, - 68usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(realized) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).full) as usize - ptr as usize }, - 69usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(full) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).num_children) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(num_children) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).children) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(children) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sibling) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(sibling) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reset) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(BusState), - "::", - stringify!(reset) - ) - ); -} -impl Default for BusState { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for BusState { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! (f , "BusState {{ obj: {:?}, parent: {:?}, name: {:?}, hotplug_handler: {:?}, max_index: {:?}, realized: {:?}, full: {:?}, num_children: {:?}, children: {:?}, sibling: {:?}, reset: {:?} }}" , self . obj , self . parent , self . name , self . hotplug_handler , self . max_index , self . realized , self . full , self . num_children , self . children , self . sibling , self . reset) - } -} -pub type PTR = *mut ::std::os::raw::c_void; -pub type bfd_vma = u64; -pub type bfd_byte = u8; -pub const bfd_flavour_bfd_target_unknown_flavour: bfd_flavour = bfd_flavour(0); -pub const bfd_flavour_bfd_target_aout_flavour: bfd_flavour = bfd_flavour(1); -pub const bfd_flavour_bfd_target_coff_flavour: bfd_flavour = bfd_flavour(2); -pub const bfd_flavour_bfd_target_ecoff_flavour: bfd_flavour = bfd_flavour(3); -pub const bfd_flavour_bfd_target_elf_flavour: bfd_flavour = bfd_flavour(4); -pub const bfd_flavour_bfd_target_ieee_flavour: bfd_flavour = bfd_flavour(5); -pub const bfd_flavour_bfd_target_nlm_flavour: bfd_flavour = bfd_flavour(6); -pub const bfd_flavour_bfd_target_oasys_flavour: bfd_flavour = bfd_flavour(7); -pub const bfd_flavour_bfd_target_tekhex_flavour: bfd_flavour = bfd_flavour(8); -pub const bfd_flavour_bfd_target_srec_flavour: bfd_flavour = bfd_flavour(9); -pub const bfd_flavour_bfd_target_ihex_flavour: bfd_flavour = bfd_flavour(10); -pub const bfd_flavour_bfd_target_som_flavour: bfd_flavour = bfd_flavour(11); -pub const bfd_flavour_bfd_target_os9k_flavour: bfd_flavour = bfd_flavour(12); -pub const bfd_flavour_bfd_target_versados_flavour: bfd_flavour = bfd_flavour(13); -pub const bfd_flavour_bfd_target_msdos_flavour: bfd_flavour = bfd_flavour(14); -pub const bfd_flavour_bfd_target_evax_flavour: bfd_flavour = bfd_flavour(15); -impl ::std::ops::BitOr for bfd_flavour { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - bfd_flavour(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for bfd_flavour { - #[inline] - fn bitor_assign(&mut self, rhs: bfd_flavour) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for bfd_flavour { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - bfd_flavour(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for bfd_flavour { - #[inline] - fn bitand_assign(&mut self, rhs: bfd_flavour) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct bfd_flavour(pub ::std::os::raw::c_uint); -pub const bfd_endian_BFD_ENDIAN_BIG: bfd_endian = bfd_endian(0); -pub const bfd_endian_BFD_ENDIAN_LITTLE: bfd_endian = bfd_endian(1); -pub const bfd_endian_BFD_ENDIAN_UNKNOWN: bfd_endian = bfd_endian(2); -impl ::std::ops::BitOr for bfd_endian { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - bfd_endian(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for bfd_endian { - #[inline] - fn bitor_assign(&mut self, rhs: bfd_endian) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for bfd_endian { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - bfd_endian(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for bfd_endian { - #[inline] - fn bitand_assign(&mut self, rhs: bfd_endian) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct bfd_endian(pub ::std::os::raw::c_uint); -pub const bfd_architecture_bfd_arch_unknown: bfd_architecture = bfd_architecture(0); -pub const bfd_architecture_bfd_arch_obscure: bfd_architecture = bfd_architecture(1); -pub const bfd_architecture_bfd_arch_m68k: bfd_architecture = bfd_architecture(2); -pub const bfd_architecture_bfd_arch_vax: bfd_architecture = bfd_architecture(3); -pub const bfd_architecture_bfd_arch_i960: bfd_architecture = bfd_architecture(4); -pub const bfd_architecture_bfd_arch_a29k: bfd_architecture = bfd_architecture(5); -pub const bfd_architecture_bfd_arch_sparc: bfd_architecture = bfd_architecture(6); -pub const bfd_architecture_bfd_arch_mips: bfd_architecture = bfd_architecture(7); -pub const bfd_architecture_bfd_arch_i386: bfd_architecture = bfd_architecture(8); -pub const bfd_architecture_bfd_arch_we32k: bfd_architecture = bfd_architecture(9); -pub const bfd_architecture_bfd_arch_tahoe: bfd_architecture = bfd_architecture(10); -pub const bfd_architecture_bfd_arch_i860: bfd_architecture = bfd_architecture(11); -pub const bfd_architecture_bfd_arch_romp: bfd_architecture = bfd_architecture(12); -pub const bfd_architecture_bfd_arch_alliant: bfd_architecture = bfd_architecture(13); -pub const bfd_architecture_bfd_arch_convex: bfd_architecture = bfd_architecture(14); -pub const bfd_architecture_bfd_arch_m88k: bfd_architecture = bfd_architecture(15); -pub const bfd_architecture_bfd_arch_pyramid: bfd_architecture = bfd_architecture(16); -pub const bfd_architecture_bfd_arch_h8300: bfd_architecture = bfd_architecture(17); -pub const bfd_architecture_bfd_arch_powerpc: bfd_architecture = bfd_architecture(18); -pub const bfd_architecture_bfd_arch_rs6000: bfd_architecture = bfd_architecture(19); -pub const bfd_architecture_bfd_arch_hppa: bfd_architecture = bfd_architecture(20); -pub const bfd_architecture_bfd_arch_d10v: bfd_architecture = bfd_architecture(21); -pub const bfd_architecture_bfd_arch_z8k: bfd_architecture = bfd_architecture(22); -pub const bfd_architecture_bfd_arch_h8500: bfd_architecture = bfd_architecture(23); -pub const bfd_architecture_bfd_arch_sh: bfd_architecture = bfd_architecture(24); -pub const bfd_architecture_bfd_arch_alpha: bfd_architecture = bfd_architecture(25); -pub const bfd_architecture_bfd_arch_arm: bfd_architecture = bfd_architecture(26); -pub const bfd_architecture_bfd_arch_ns32k: bfd_architecture = bfd_architecture(27); -pub const bfd_architecture_bfd_arch_w65: bfd_architecture = bfd_architecture(28); -pub const bfd_architecture_bfd_arch_tic30: bfd_architecture = bfd_architecture(29); -pub const bfd_architecture_bfd_arch_v850: bfd_architecture = bfd_architecture(30); -pub const bfd_architecture_bfd_arch_arc: bfd_architecture = bfd_architecture(31); -pub const bfd_architecture_bfd_arch_m32r: bfd_architecture = bfd_architecture(32); -pub const bfd_architecture_bfd_arch_mn10200: bfd_architecture = bfd_architecture(33); -pub const bfd_architecture_bfd_arch_mn10300: bfd_architecture = bfd_architecture(34); -pub const bfd_architecture_bfd_arch_avr: bfd_architecture = bfd_architecture(35); -pub const bfd_architecture_bfd_arch_cris: bfd_architecture = bfd_architecture(36); -pub const bfd_architecture_bfd_arch_microblaze: bfd_architecture = bfd_architecture(37); -pub const bfd_architecture_bfd_arch_moxie: bfd_architecture = bfd_architecture(38); -pub const bfd_architecture_bfd_arch_ia64: bfd_architecture = bfd_architecture(39); -pub const bfd_architecture_bfd_arch_nios2: bfd_architecture = bfd_architecture(40); -pub const bfd_architecture_bfd_arch_rx: bfd_architecture = bfd_architecture(41); -pub const bfd_architecture_bfd_arch_loongarch: bfd_architecture = bfd_architecture(42); -pub const bfd_architecture_bfd_arch_last: bfd_architecture = bfd_architecture(43); -impl ::std::ops::BitOr for bfd_architecture { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - bfd_architecture(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for bfd_architecture { - #[inline] - fn bitor_assign(&mut self, rhs: bfd_architecture) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for bfd_architecture { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - bfd_architecture(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for bfd_architecture { - #[inline] - fn bitand_assign(&mut self, rhs: bfd_architecture) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct bfd_architecture(pub ::std::os::raw::c_uint); -#[repr(C)] -#[derive(Copy, Clone)] -pub struct symbol_cache_entry { - pub name: *const ::std::os::raw::c_char, - pub udata: symbol_cache_entry__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union symbol_cache_entry__bindgen_ty_1 { - pub p: PTR, - pub i: bfd_vma, -} -#[test] -fn bindgen_test_layout_symbol_cache_entry__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(symbol_cache_entry__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(symbol_cache_entry__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).p) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(symbol_cache_entry__bindgen_ty_1), - "::", - stringify!(p) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).i) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(symbol_cache_entry__bindgen_ty_1), - "::", - stringify!(i) - ) - ); -} -impl Default for symbol_cache_entry__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for symbol_cache_entry__bindgen_ty_1 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "symbol_cache_entry__bindgen_ty_1 {{ union }}") - } -} -#[test] -fn bindgen_test_layout_symbol_cache_entry() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(symbol_cache_entry)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(symbol_cache_entry)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(symbol_cache_entry), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).udata) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(symbol_cache_entry), - "::", - stringify!(udata) - ) - ); -} -impl Default for symbol_cache_entry { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for symbol_cache_entry { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "symbol_cache_entry {{ name: {:?}, udata: {:?} }}", - self.name, self.udata - ) - } -} -pub type asymbol = symbol_cache_entry; -pub type fprintf_function = ::std::option::Option< - unsafe extern "C" fn( - f: *mut FILE, - fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int, ->; -pub const dis_insn_type_dis_noninsn: dis_insn_type = dis_insn_type(0); -pub const dis_insn_type_dis_nonbranch: dis_insn_type = dis_insn_type(1); -pub const dis_insn_type_dis_branch: dis_insn_type = dis_insn_type(2); -pub const dis_insn_type_dis_condbranch: dis_insn_type = dis_insn_type(3); -pub const dis_insn_type_dis_jsr: dis_insn_type = dis_insn_type(4); -pub const dis_insn_type_dis_condjsr: dis_insn_type = dis_insn_type(5); -pub const dis_insn_type_dis_dref: dis_insn_type = dis_insn_type(6); -pub const dis_insn_type_dis_dref2: dis_insn_type = dis_insn_type(7); -impl ::std::ops::BitOr for dis_insn_type { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - dis_insn_type(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for dis_insn_type { - #[inline] - fn bitor_assign(&mut self, rhs: dis_insn_type) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for dis_insn_type { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - dis_insn_type(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for dis_insn_type { - #[inline] - fn bitand_assign(&mut self, rhs: dis_insn_type) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct dis_insn_type(pub ::std::os::raw::c_uint); -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct disassemble_info { - pub fprintf_func: fprintf_function, - pub stream: *mut FILE, - pub application_data: PTR, - pub flavour: bfd_flavour, - pub arch: bfd_architecture, - pub mach: ::std::os::raw::c_ulong, - pub endian: bfd_endian, - pub symbols: *mut *mut asymbol, - pub num_symbols: ::std::os::raw::c_int, - pub flags: ::std::os::raw::c_ulong, - pub private_data: PTR, - pub read_memory_func: ::std::option::Option< - unsafe extern "C" fn( - memaddr: bfd_vma, - myaddr: *mut bfd_byte, - length: ::std::os::raw::c_int, - info: *mut disassemble_info, - ) -> ::std::os::raw::c_int, - >, - pub memory_error_func: ::std::option::Option< - unsafe extern "C" fn( - status: ::std::os::raw::c_int, - memaddr: bfd_vma, - info: *mut disassemble_info, - ), - >, - pub print_address_func: - ::std::option::Option, - pub print_insn: ::std::option::Option< - unsafe extern "C" fn(addr: bfd_vma, info: *mut disassemble_info) -> ::std::os::raw::c_int, - >, - pub symbol_at_address_func: ::std::option::Option< - unsafe extern "C" fn(addr: bfd_vma, info: *mut disassemble_info) -> ::std::os::raw::c_int, - >, - pub buffer: *const bfd_byte, - pub buffer_vma: bfd_vma, - pub buffer_length: ::std::os::raw::c_int, - pub bytes_per_line: ::std::os::raw::c_int, - pub bytes_per_chunk: ::std::os::raw::c_int, - pub display_endian: bfd_endian, - pub insn_info_valid: ::std::os::raw::c_char, - pub branch_delay_insns: ::std::os::raw::c_char, - pub data_size: ::std::os::raw::c_char, - pub insn_type: dis_insn_type, - pub target: bfd_vma, - pub target2: bfd_vma, - pub disassembler_options: *mut ::std::os::raw::c_char, - pub show_opcodes: bool, - pub target_info: *mut ::std::os::raw::c_void, - pub cap_arch: ::std::os::raw::c_int, - pub cap_mode: ::std::os::raw::c_int, - pub cap_insn_unit: ::std::os::raw::c_int, - pub cap_insn_split: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_disassemble_info() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 216usize, - concat!("Size of: ", stringify!(disassemble_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(disassemble_info)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fprintf_func) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(fprintf_func) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stream) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(stream) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).application_data) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(application_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flavour) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(flavour) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arch) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(arch) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mach) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(mach) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).endian) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(endian) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).symbols) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(symbols) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).num_symbols) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(num_symbols) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).private_data) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(private_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read_memory_func) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(read_memory_func) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).memory_error_func) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(memory_error_func) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).print_address_func) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(print_address_func) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).print_insn) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(print_insn) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).symbol_at_address_func) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(symbol_at_address_func) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buffer) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(buffer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buffer_vma) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(buffer_vma) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).buffer_length) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(buffer_length) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bytes_per_line) as usize - ptr as usize }, - 140usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(bytes_per_line) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bytes_per_chunk) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(bytes_per_chunk) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).display_endian) as usize - ptr as usize }, - 148usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(display_endian) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).insn_info_valid) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(insn_info_valid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).branch_delay_insns) as usize - ptr as usize }, - 153usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(branch_delay_insns) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data_size) as usize - ptr as usize }, - 154usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(data_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).insn_type) as usize - ptr as usize }, - 156usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(insn_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).target) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(target) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).target2) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(target2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).disassembler_options) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(disassembler_options) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).show_opcodes) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(show_opcodes) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).target_info) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(target_info) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cap_arch) as usize - ptr as usize }, - 200usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(cap_arch) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cap_mode) as usize - ptr as usize }, - 204usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(cap_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cap_insn_unit) as usize - ptr as usize }, - 208usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(cap_insn_unit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cap_insn_split) as usize - ptr as usize }, - 212usize, - concat!( - "Offset of field: ", - stringify!(disassemble_info), - "::", - stringify!(cap_insn_split) - ) - ); -} -impl Default for disassemble_info { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type hwaddr = u64; -#[doc = " vaddr:\n Type wide enough to contain any #target_ulong virtual address."] -pub type vaddr = u64; -#[repr(C)] -#[derive(Copy, Clone)] -pub union CPUTLBEntry { - pub __bindgen_anon_1: CPUTLBEntry__bindgen_ty_1, - pub addr_idx: [u64; 4usize], -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CPUTLBEntry__bindgen_ty_1 { - pub addr_read: u64, - pub addr_write: u64, - pub addr_code: u64, - pub addend: usize, -} -#[test] -fn bindgen_test_layout_CPUTLBEntry__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CPUTLBEntry__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUTLBEntry__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr_read) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntry__bindgen_ty_1), - "::", - stringify!(addr_read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr_write) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntry__bindgen_ty_1), - "::", - stringify!(addr_write) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr_code) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntry__bindgen_ty_1), - "::", - stringify!(addr_code) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addend) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntry__bindgen_ty_1), - "::", - stringify!(addend) - ) - ); -} -#[test] -fn bindgen_test_layout_CPUTLBEntry() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CPUTLBEntry)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUTLBEntry)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr_idx) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntry), - "::", - stringify!(addr_idx) - ) - ); -} -impl Default for CPUTLBEntry { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUTLBEntry { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "CPUTLBEntry {{ union }}") - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CPUTLBDescFast { - pub mask: usize, - pub table: *mut CPUTLBEntry, -} -#[test] -fn bindgen_test_layout_CPUTLBDescFast() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(CPUTLBDescFast)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUTLBDescFast)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDescFast), - "::", - stringify!(mask) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).table) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDescFast), - "::", - stringify!(table) - ) - ); -} -impl Default for CPUTLBDescFast { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub const ShutdownCause_SHUTDOWN_CAUSE_NONE: ShutdownCause = ShutdownCause(0); -pub const ShutdownCause_SHUTDOWN_CAUSE_HOST_ERROR: ShutdownCause = ShutdownCause(1); -pub const ShutdownCause_SHUTDOWN_CAUSE_HOST_QMP_QUIT: ShutdownCause = ShutdownCause(2); -pub const ShutdownCause_SHUTDOWN_CAUSE_HOST_QMP_SYSTEM_RESET: ShutdownCause = ShutdownCause(3); -pub const ShutdownCause_SHUTDOWN_CAUSE_HOST_SIGNAL: ShutdownCause = ShutdownCause(4); -pub const ShutdownCause_SHUTDOWN_CAUSE_HOST_UI: ShutdownCause = ShutdownCause(5); -pub const ShutdownCause_SHUTDOWN_CAUSE_GUEST_SHUTDOWN: ShutdownCause = ShutdownCause(6); -pub const ShutdownCause_SHUTDOWN_CAUSE_GUEST_RESET: ShutdownCause = ShutdownCause(7); -pub const ShutdownCause_SHUTDOWN_CAUSE_GUEST_PANIC: ShutdownCause = ShutdownCause(8); -pub const ShutdownCause_SHUTDOWN_CAUSE_SUBSYSTEM_RESET: ShutdownCause = ShutdownCause(9); -pub const ShutdownCause_SHUTDOWN_CAUSE_SNAPSHOT_LOAD: ShutdownCause = ShutdownCause(10); -pub const ShutdownCause_SHUTDOWN_CAUSE__MAX: ShutdownCause = ShutdownCause(11); -impl ::std::ops::BitOr for ShutdownCause { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - ShutdownCause(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for ShutdownCause { - #[inline] - fn bitor_assign(&mut self, rhs: ShutdownCause) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for ShutdownCause { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - ShutdownCause(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for ShutdownCause { - #[inline] - fn bitand_assign(&mut self, rhs: ShutdownCause) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct ShutdownCause(pub ::std::os::raw::c_uint); -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct SysemuCPUOps { - _unused: [u8; 0], -} -#[doc = " CPUClass:\n @class_by_name: Callback to map -cpu command line model name to an\n instantiatable CPU type.\n @parse_features: Callback to parse command line arguments.\n @reset_dump_flags: #CPUDumpFlags to use for reset logging.\n @has_work: Callback for checking if there is work to do.\n @mmu_index: Callback for choosing softmmu mmu index;\n may be used internally by memory_rw_debug without TCG.\n @memory_rw_debug: Callback for GDB memory access.\n @dump_state: Callback for dumping state.\n @query_cpu_fast:\n Fill in target specific information for the \"query-cpus-fast\"\n QAPI call.\n @get_arch_id: Callback for getting architecture-dependent CPU ID.\n @set_pc: Callback for setting the Program Counter register. This\n should have the semantics used by the target architecture when\n setting the PC from a source such as an ELF file entry point;\n for example on Arm it will also set the Thumb mode bit based\n on the least significant bit of the new PC value.\n If the target behaviour here is anything other than \"set\n the PC register to the value passed in\" then the target must\n also implement the synchronize_from_tb hook.\n @get_pc: Callback for getting the Program Counter register.\n As above, with the semantics of the target architecture.\n @gdb_read_register: Callback for letting GDB read a register.\n @gdb_write_register: Callback for letting GDB write a register.\n @gdb_adjust_breakpoint: Callback for adjusting the address of a\n breakpoint. Used by AVR to handle a gdb mis-feature with\n its Harvard architecture split code and data.\n @gdb_num_core_regs: Number of core registers accessible to GDB or 0 to infer\n from @gdb_core_xml_file.\n @gdb_core_xml_file: File name for core registers GDB XML description.\n @gdb_stop_before_watchpoint: Indicates whether GDB expects the CPU to stop\n before the insn which triggers a watchpoint rather than after it.\n @gdb_arch_name: Optional callback that returns the architecture name known\n to GDB. The caller must free the returned string with g_free.\n @disas_set_info: Setup architecture specific components of disassembly info\n @adjust_watchpoint_address: Perform a target-specific adjustment to an\n address before attempting to match it against watchpoints.\n @deprecation_note: If this CPUClass is deprecated, this field provides\n related information.\n\n Represents a CPU family or model."] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CPUClass { - pub parent_class: DeviceClass, - pub class_by_name: ::std::option::Option< - unsafe extern "C" fn(cpu_model: *const ::std::os::raw::c_char) -> *mut ObjectClass, - >, - pub parse_features: ::std::option::Option< - unsafe extern "C" fn( - typename: *const ::std::os::raw::c_char, - str_: *mut ::std::os::raw::c_char, - errp: *mut *mut Error, - ), - >, - pub has_work: ::std::option::Option bool>, - pub mmu_index: ::std::option::Option< - unsafe extern "C" fn(cpu: *mut CPUState, ifetch: bool) -> ::std::os::raw::c_int, - >, - pub memory_rw_debug: ::std::option::Option< - unsafe extern "C" fn( - cpu: *mut CPUState, - addr: vaddr, - buf: *mut u8, - len: ::std::os::raw::c_int, - is_write: bool, - ) -> ::std::os::raw::c_int, - >, - pub dump_state: ::std::option::Option< - unsafe extern "C" fn(cpu: *mut CPUState, arg1: *mut FILE, flags: ::std::os::raw::c_int), - >, - pub query_cpu_fast: - ::std::option::Option, - pub get_arch_id: ::std::option::Option i64>, - pub set_pc: ::std::option::Option, - pub get_pc: ::std::option::Option vaddr>, - pub gdb_read_register: ::std::option::Option< - unsafe extern "C" fn( - cpu: *mut CPUState, - buf: *mut GByteArray, - reg: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int, - >, - pub gdb_write_register: ::std::option::Option< - unsafe extern "C" fn( - cpu: *mut CPUState, - buf: *mut u8, - reg: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int, - >, - pub gdb_adjust_breakpoint: - ::std::option::Option vaddr>, - pub gdb_core_xml_file: *const ::std::os::raw::c_char, - pub gdb_arch_name: - ::std::option::Option *const gchar>, - pub disas_set_info: ::std::option::Option< - unsafe extern "C" fn(cpu: *mut CPUState, info: *mut disassemble_info), - >, - pub deprecation_note: *const ::std::os::raw::c_char, - pub accel_cpu: *mut AccelCPUClass, - pub sysemu_ops: *const SysemuCPUOps, - pub tcg_ops: *const TCGCPUOps, - pub init_accel_cpu: ::std::option::Option< - unsafe extern "C" fn(accel_cpu: *mut AccelCPUClass, cc: *mut CPUClass), - >, - pub reset_dump_flags: ::std::os::raw::c_int, - pub gdb_num_core_regs: ::std::os::raw::c_int, - pub gdb_stop_before_watchpoint: bool, -} -#[test] -fn bindgen_test_layout_CPUClass() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 360usize, - concat!("Size of: ", stringify!(CPUClass)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUClass)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_class) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(parent_class) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).class_by_name) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(class_by_name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parse_features) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(parse_features) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).has_work) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(has_work) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mmu_index) as usize - ptr as usize }, - 200usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(mmu_index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).memory_rw_debug) as usize - ptr as usize }, - 208usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(memory_rw_debug) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dump_state) as usize - ptr as usize }, - 216usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(dump_state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).query_cpu_fast) as usize - ptr as usize }, - 224usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(query_cpu_fast) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).get_arch_id) as usize - ptr as usize }, - 232usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(get_arch_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_pc) as usize - ptr as usize }, - 240usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(set_pc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).get_pc) as usize - ptr as usize }, - 248usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(get_pc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdb_read_register) as usize - ptr as usize }, - 256usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(gdb_read_register) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdb_write_register) as usize - ptr as usize }, - 264usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(gdb_write_register) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdb_adjust_breakpoint) as usize - ptr as usize }, - 272usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(gdb_adjust_breakpoint) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdb_core_xml_file) as usize - ptr as usize }, - 280usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(gdb_core_xml_file) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdb_arch_name) as usize - ptr as usize }, - 288usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(gdb_arch_name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).disas_set_info) as usize - ptr as usize }, - 296usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(disas_set_info) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).deprecation_note) as usize - ptr as usize }, - 304usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(deprecation_note) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accel_cpu) as usize - ptr as usize }, - 312usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(accel_cpu) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sysemu_ops) as usize - ptr as usize }, - 320usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(sysemu_ops) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tcg_ops) as usize - ptr as usize }, - 328usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(tcg_ops) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).init_accel_cpu) as usize - ptr as usize }, - 336usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(init_accel_cpu) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reset_dump_flags) as usize - ptr as usize }, - 344usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(reset_dump_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdb_num_core_regs) as usize - ptr as usize }, - 348usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(gdb_num_core_regs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdb_stop_before_watchpoint) as usize - ptr as usize }, - 352usize, - concat!( - "Offset of field: ", - stringify!(CPUClass), - "::", - stringify!(gdb_stop_before_watchpoint) - ) - ); -} -impl Default for CPUClass { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct CPUTLBEntryFull { - pub xlat_section: hwaddr, - pub phys_addr: hwaddr, - pub attrs: MemTxAttrs, - pub prot: u8, - pub lg_page_size: u8, - pub tlb_fill_flags: u8, - pub slow_flags: [u8; 3usize], - pub extra: CPUTLBEntryFull__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union CPUTLBEntryFull__bindgen_ty_1 { - pub arm: CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1 { - pub pte_attrs: u8, - pub shareability: u8, - pub guarded: bool, -} -#[test] -fn bindgen_test_layout_CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 3usize, - concat!( - "Size of: ", - stringify!(CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pte_attrs) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(pte_attrs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).shareability) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(shareability) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).guarded) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(guarded) - ) - ); -} -#[test] -fn bindgen_test_layout_CPUTLBEntryFull__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 3usize, - concat!("Size of: ", stringify!(CPUTLBEntryFull__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CPUTLBEntryFull__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arm) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull__bindgen_ty_1), - "::", - stringify!(arm) - ) - ); -} -impl Default for CPUTLBEntryFull__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUTLBEntryFull__bindgen_ty_1 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "CPUTLBEntryFull__bindgen_ty_1 {{ union }}") - } -} -#[test] -fn bindgen_test_layout_CPUTLBEntryFull() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CPUTLBEntryFull)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUTLBEntryFull)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xlat_section) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull), - "::", - stringify!(xlat_section) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phys_addr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull), - "::", - stringify!(phys_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).attrs) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull), - "::", - stringify!(attrs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prot) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull), - "::", - stringify!(prot) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lg_page_size) as usize - ptr as usize }, - 21usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull), - "::", - stringify!(lg_page_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tlb_fill_flags) as usize - ptr as usize }, - 22usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull), - "::", - stringify!(tlb_fill_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).slow_flags) as usize - ptr as usize }, - 23usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull), - "::", - stringify!(slow_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).extra) as usize - ptr as usize }, - 26usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBEntryFull), - "::", - stringify!(extra) - ) - ); -} -impl Default for CPUTLBEntryFull { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUTLBEntryFull { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "CPUTLBEntryFull {{ attrs: {:?}, slow_flags: {:?}, extra: {:?} }}", - self.attrs, self.slow_flags, self.extra - ) - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct CPUTLBDesc { - pub large_page_addr: vaddr, - pub large_page_mask: vaddr, - pub window_begin_ns: i64, - pub window_max_entries: usize, - pub n_used_entries: usize, - pub vindex: usize, - pub vtable: [CPUTLBEntry; 8usize], - pub vfulltlb: [CPUTLBEntryFull; 8usize], - pub fulltlb: *mut CPUTLBEntryFull, -} -#[test] -fn bindgen_test_layout_CPUTLBDesc() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 568usize, - concat!("Size of: ", stringify!(CPUTLBDesc)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUTLBDesc)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).large_page_addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDesc), - "::", - stringify!(large_page_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).large_page_mask) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDesc), - "::", - stringify!(large_page_mask) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).window_begin_ns) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDesc), - "::", - stringify!(window_begin_ns) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).window_max_entries) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDesc), - "::", - stringify!(window_max_entries) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).n_used_entries) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDesc), - "::", - stringify!(n_used_entries) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vindex) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDesc), - "::", - stringify!(vindex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vtable) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDesc), - "::", - stringify!(vtable) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vfulltlb) as usize - ptr as usize }, - 304usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDesc), - "::", - stringify!(vfulltlb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fulltlb) as usize - ptr as usize }, - 560usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBDesc), - "::", - stringify!(fulltlb) - ) - ); -} -impl Default for CPUTLBDesc { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUTLBDesc { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "CPUTLBDesc {{ vtable: {:?}, vfulltlb: {:?}, fulltlb: {:?} }}", - self.vtable, self.vfulltlb, self.fulltlb - ) - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CPUTLBCommon { - pub lock: QemuSpin, - pub dirty: u16, - pub full_flush_count: usize, - pub part_flush_count: usize, - pub elide_flush_count: usize, -} -#[test] -fn bindgen_test_layout_CPUTLBCommon() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CPUTLBCommon)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUTLBCommon)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lock) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBCommon), - "::", - stringify!(lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dirty) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBCommon), - "::", - stringify!(dirty) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).full_flush_count) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBCommon), - "::", - stringify!(full_flush_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).part_flush_count) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBCommon), - "::", - stringify!(part_flush_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).elide_flush_count) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CPUTLBCommon), - "::", - stringify!(elide_flush_count) - ) - ); -} -#[repr(C)] -#[repr(align(16))] -#[derive(Copy, Clone)] -pub struct CPUTLB { - pub c: CPUTLBCommon, - pub d: [CPUTLBDesc; 16usize], - pub f: [CPUTLBDescFast; 16usize], -} -#[test] -fn bindgen_test_layout_CPUTLB() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 9376usize, - concat!("Size of: ", stringify!(CPUTLB)) - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - concat!("Alignment of ", stringify!(CPUTLB)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).c) as usize - ptr as usize }, - 0usize, - concat!("Offset of field: ", stringify!(CPUTLB), "::", stringify!(c)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize }, - 32usize, - concat!("Offset of field: ", stringify!(CPUTLB), "::", stringify!(d)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).f) as usize - ptr as usize }, - 9120usize, - concat!("Offset of field: ", stringify!(CPUTLB), "::", stringify!(f)) - ); -} -impl Default for CPUTLB { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUTLB { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "CPUTLB {{ c: {:?}, d: {:?}, f: {:?} }}", - self.c, self.d, self.f - ) - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union IcountDecr { - pub u32_: u32, - pub u16_: IcountDecr__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct IcountDecr__bindgen_ty_1 { - pub low: u16, - pub high: u16, -} -#[test] -fn bindgen_test_layout_IcountDecr__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(IcountDecr__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(IcountDecr__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).low) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(IcountDecr__bindgen_ty_1), - "::", - stringify!(low) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).high) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(IcountDecr__bindgen_ty_1), - "::", - stringify!(high) - ) - ); -} -#[test] -fn bindgen_test_layout_IcountDecr() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(IcountDecr)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(IcountDecr)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u32_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(IcountDecr), - "::", - stringify!(u32_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u16_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(IcountDecr), - "::", - stringify!(u16_) - ) - ); -} -impl Default for IcountDecr { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for IcountDecr { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "IcountDecr {{ union }}") - } -} -#[repr(C)] -#[repr(align(16))] -#[derive(Copy, Clone)] -pub struct CPUNegativeOffsetState { - pub tlb: CPUTLB, - pub icount_decr: IcountDecr, - pub can_do_io: bool, -} -#[test] -fn bindgen_test_layout_CPUNegativeOffsetState() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 9392usize, - concat!("Size of: ", stringify!(CPUNegativeOffsetState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - concat!("Alignment of ", stringify!(CPUNegativeOffsetState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tlb) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUNegativeOffsetState), - "::", - stringify!(tlb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).icount_decr) as usize - ptr as usize }, - 9376usize, - concat!( - "Offset of field: ", - stringify!(CPUNegativeOffsetState), - "::", - stringify!(icount_decr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).can_do_io) as usize - ptr as usize }, - 9380usize, - concat!( - "Offset of field: ", - stringify!(CPUNegativeOffsetState), - "::", - stringify!(can_do_io) - ) - ); -} -impl Default for CPUNegativeOffsetState { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUNegativeOffsetState { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "CPUNegativeOffsetState {{ tlb: {:?}, icount_decr: {:?}, can_do_io: {:?} }}", - self.tlb, self.icount_decr, self.can_do_io - ) - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct CPUBreakpoint { - pub pc: vaddr, - pub flags: ::std::os::raw::c_int, - pub entry: CPUBreakpoint__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union CPUBreakpoint__bindgen_ty_1 { - pub tqe_next: *mut CPUBreakpoint, - pub tqe_circ: QTailQLink, -} -#[test] -fn bindgen_test_layout_CPUBreakpoint__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(CPUBreakpoint__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUBreakpoint__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUBreakpoint__bindgen_ty_1), - "::", - stringify!(tqe_next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_circ) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUBreakpoint__bindgen_ty_1), - "::", - stringify!(tqe_circ) - ) - ); -} -impl Default for CPUBreakpoint__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUBreakpoint__bindgen_ty_1 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "CPUBreakpoint__bindgen_ty_1 {{ union }}") - } -} -#[test] -fn bindgen_test_layout_CPUBreakpoint() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CPUBreakpoint)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUBreakpoint)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pc) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUBreakpoint), - "::", - stringify!(pc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CPUBreakpoint), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).entry) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CPUBreakpoint), - "::", - stringify!(entry) - ) - ); -} -impl Default for CPUBreakpoint { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUBreakpoint { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "CPUBreakpoint {{ flags: {:?}, entry: {:?} }}", - self.flags, self.entry - ) - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct CPUWatchpoint { - pub vaddr: vaddr, - pub len: vaddr, - pub hitaddr: vaddr, - pub hitattrs: MemTxAttrs, - pub flags: ::std::os::raw::c_int, - pub entry: CPUWatchpoint__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union CPUWatchpoint__bindgen_ty_1 { - pub tqe_next: *mut CPUWatchpoint, - pub tqe_circ: QTailQLink, -} -#[test] -fn bindgen_test_layout_CPUWatchpoint__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(CPUWatchpoint__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUWatchpoint__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUWatchpoint__bindgen_ty_1), - "::", - stringify!(tqe_next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_circ) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUWatchpoint__bindgen_ty_1), - "::", - stringify!(tqe_circ) - ) - ); -} -impl Default for CPUWatchpoint__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUWatchpoint__bindgen_ty_1 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "CPUWatchpoint__bindgen_ty_1 {{ union }}") - } -} -#[test] -fn bindgen_test_layout_CPUWatchpoint() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(CPUWatchpoint)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUWatchpoint)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vaddr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUWatchpoint), - "::", - stringify!(vaddr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).len) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CPUWatchpoint), - "::", - stringify!(len) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hitaddr) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CPUWatchpoint), - "::", - stringify!(hitaddr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hitattrs) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CPUWatchpoint), - "::", - stringify!(hitattrs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 28usize, - concat!( - "Offset of field: ", - stringify!(CPUWatchpoint), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).entry) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(CPUWatchpoint), - "::", - stringify!(entry) - ) - ); -} -impl Default for CPUWatchpoint { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUWatchpoint { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "CPUWatchpoint {{ hitattrs: {:?}, flags: {:?}, entry: {:?} }}", - self.hitattrs, self.flags, self.entry - ) - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct KVMState { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct kvm_run { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct qemu_work_item { - _unused: [u8; 0], -} -#[doc = " CPUState:\n @cpu_index: CPU index (informative).\n @cluster_index: Identifies which cluster this CPU is in.\n For boards which don't define clusters or for \"loose\" CPUs not assigned\n to a cluster this will be UNASSIGNED_CLUSTER_INDEX; otherwise it will\n be the same as the cluster-id property of the CPU object's TYPE_CPU_CLUSTER\n QOM parent.\n Under TCG this value is propagated to @tcg_cflags.\n See TranslationBlock::TCG CF_CLUSTER_MASK.\n @tcg_cflags: Pre-computed cflags for this cpu.\n @nr_cores: Number of cores within this CPU package.\n @nr_threads: Number of threads within this CPU core.\n @running: #true if CPU is currently running (lockless).\n @has_waiter: #true if a CPU is currently waiting for the cpu_exec_end;\n valid under cpu_list_lock.\n @created: Indicates whether the CPU thread has been successfully created.\n @interrupt_request: Indicates a pending interrupt request.\n @halted: Nonzero if the CPU is in suspended state.\n @stop: Indicates a pending stop request.\n @stopped: Indicates the CPU has been artificially stopped.\n @unplug: Indicates a pending CPU unplug request.\n @crash_occurred: Indicates the OS reported a crash (panic) for this CPU\n @singlestep_enabled: Flags for single-stepping.\n @icount_extra: Instructions until next timer event.\n @neg.can_do_io: True if memory-mapped IO is allowed.\n @cpu_ases: Pointer to array of CPUAddressSpaces (which define the\n AddressSpaces this CPU has)\n @num_ases: number of CPUAddressSpaces in @cpu_ases\n @as: Pointer to the first AddressSpace, for the convenience of targets which\n only have a single AddressSpace\n @gdb_regs: Additional GDB registers.\n @gdb_num_regs: Number of total registers accessible to GDB.\n @gdb_num_g_regs: Number of registers in GDB 'g' packets.\n @node: QTAILQ of CPUs sharing TB cache.\n @opaque: User data.\n @mem_io_pc: Host Program Counter at which the memory was accessed.\n @accel: Pointer to accelerator specific state.\n @kvm_fd: vCPU file descriptor for KVM.\n @work_mutex: Lock to prevent multiple access to @work_list.\n @work_list: List of pending asynchronous work.\n @plugin_mem_cbs: active plugin memory callbacks\n @plugin_state: per-CPU plugin state\n @ignore_memory_transaction_failures: Cached copy of the MachineState\n flag of the same name: allows the board to suppress calling of the\n CPU do_transaction_failed hook function.\n @kvm_dirty_gfns: Points to the KVM dirty ring for this CPU when KVM dirty\n ring is enabled.\n @kvm_fetch_index: Keeps the index that we last fetched from the per-vCPU\n dirty ring structure.\n\n State of one CPU core or thread.\n\n Align, in order to match possible alignment required by CPUArchState,\n and eliminate a hole between CPUState and CPUArchState within ArchCPU."] -#[repr(C)] -#[repr(align(16))] -pub struct CPUState { - pub parent_obj: DeviceState, - pub cc: *mut CPUClass, - pub nr_cores: ::std::os::raw::c_int, - pub nr_threads: ::std::os::raw::c_int, - pub thread: *mut QemuThread, - pub thread_id: ::std::os::raw::c_int, - pub running: bool, - pub has_waiter: bool, - pub halt_cond: *mut QemuCond, - pub thread_kicked: bool, - pub created: bool, - pub stop: bool, - pub stopped: bool, - pub start_powered_off: bool, - pub unplug: bool, - pub crash_occurred: bool, - pub exit_request: bool, - pub exclusive_context_count: ::std::os::raw::c_int, - pub cflags_next_tb: u32, - pub interrupt_request: u32, - pub singlestep_enabled: ::std::os::raw::c_int, - pub icount_budget: i64, - pub icount_extra: i64, - pub random_seed: u64, - pub jmp_env: sigjmp_buf, - pub work_mutex: QemuMutex, - pub work_list: CPUState__bindgen_ty_1, - pub cpu_ases: *mut CPUAddressSpace, - pub num_ases: ::std::os::raw::c_int, - pub as_: *mut AddressSpace, - pub memory: *mut MemoryRegion, - pub tb_jmp_cache: *mut CPUJumpCache, - pub gdb_regs: *mut GArray, - pub gdb_num_regs: ::std::os::raw::c_int, - pub gdb_num_g_regs: ::std::os::raw::c_int, - pub node: CPUState__bindgen_ty_2, - pub breakpoints: CPUState__bindgen_ty_3, - pub watchpoints: CPUState__bindgen_ty_4, - pub watchpoint_hit: *mut CPUWatchpoint, - pub opaque: *mut ::std::os::raw::c_void, - pub mem_io_pc: usize, - pub kvm_fd: ::std::os::raw::c_int, - pub kvm_state: *mut KVMState, - pub kvm_run: *mut kvm_run, - pub kvm_dirty_gfns: *mut kvm_dirty_gfn, - pub kvm_fetch_index: u32, - pub dirty_pages: u64, - pub kvm_vcpu_stats_fd: ::std::os::raw::c_int, - pub in_ioctl_lock: QemuLockCnt, - pub plugin_mem_cbs: *mut GArray, - pub plugin_state: *mut CPUPluginState, - pub cpu_index: ::std::os::raw::c_int, - pub cluster_index: ::std::os::raw::c_int, - pub tcg_cflags: u32, - pub halted: u32, - pub exception_index: i32, - pub accel: *mut AccelCPUState, - pub vcpu_dirty: bool, - pub throttle_thread_scheduled: bool, - pub throttle_us_per_full: i64, - pub ignore_memory_transaction_failures: bool, - pub prctl_unalign_sigbus: bool, - pub iommu_notifiers: *mut GArray, - pub __bindgen_padding_0: [u8; 8usize], - pub neg_align: __IncompleteArrayField<::std::os::raw::c_char>, - pub neg: CPUNegativeOffsetState, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CPUState__bindgen_ty_1 { - pub sqh_first: *mut qemu_work_item, - pub sqh_last: *mut *mut qemu_work_item, -} -#[test] -fn bindgen_test_layout_CPUState__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(CPUState__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUState__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sqh_first) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUState__bindgen_ty_1), - "::", - stringify!(sqh_first) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sqh_last) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CPUState__bindgen_ty_1), - "::", - stringify!(sqh_last) - ) - ); -} -impl Default for CPUState__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union CPUState__bindgen_ty_2 { - pub tqe_next: *mut CPUState, - pub tqe_circ: QTailQLink, -} -#[test] -fn bindgen_test_layout_CPUState__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(CPUState__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUState__bindgen_ty_2)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_next) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUState__bindgen_ty_2), - "::", - stringify!(tqe_next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqe_circ) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUState__bindgen_ty_2), - "::", - stringify!(tqe_circ) - ) - ); -} -impl Default for CPUState__bindgen_ty_2 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUState__bindgen_ty_2 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "CPUState__bindgen_ty_2 {{ union }}") - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union CPUState__bindgen_ty_3 { - pub tqh_first: *mut CPUBreakpoint, - pub tqh_circ: QTailQLink, -} -#[test] -fn bindgen_test_layout_CPUState__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(CPUState__bindgen_ty_3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUState__bindgen_ty_3)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUState__bindgen_ty_3), - "::", - stringify!(tqh_first) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_circ) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUState__bindgen_ty_3), - "::", - stringify!(tqh_circ) - ) - ); -} -impl Default for CPUState__bindgen_ty_3 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUState__bindgen_ty_3 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "CPUState__bindgen_ty_3 {{ union }}") - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union CPUState__bindgen_ty_4 { - pub tqh_first: *mut CPUWatchpoint, - pub tqh_circ: QTailQLink, -} -#[test] -fn bindgen_test_layout_CPUState__bindgen_ty_4() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(CPUState__bindgen_ty_4)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUState__bindgen_ty_4)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_first) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUState__bindgen_ty_4), - "::", - stringify!(tqh_first) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tqh_circ) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUState__bindgen_ty_4), - "::", - stringify!(tqh_circ) - ) - ); -} -impl Default for CPUState__bindgen_ty_4 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUState__bindgen_ty_4 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "CPUState__bindgen_ty_4 {{ union }}") - } -} -#[test] -fn bindgen_test_layout_CPUState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 10176usize, - concat!("Size of: ", stringify!(CPUState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - concat!("Alignment of ", stringify!(CPUState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_obj) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(parent_obj) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cc) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(cc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nr_cores) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(nr_cores) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nr_threads) as usize - ptr as usize }, - 172usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(nr_threads) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thread) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(thread) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thread_id) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(thread_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).running) as usize - ptr as usize }, - 188usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(running) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).has_waiter) as usize - ptr as usize }, - 189usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(has_waiter) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).halt_cond) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(halt_cond) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thread_kicked) as usize - ptr as usize }, - 200usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(thread_kicked) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).created) as usize - ptr as usize }, - 201usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(created) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stop) as usize - ptr as usize }, - 202usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(stop) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stopped) as usize - ptr as usize }, - 203usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(stopped) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_powered_off) as usize - ptr as usize }, - 204usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(start_powered_off) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).unplug) as usize - ptr as usize }, - 205usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(unplug) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).crash_occurred) as usize - ptr as usize }, - 206usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(crash_occurred) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exit_request) as usize - ptr as usize }, - 207usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(exit_request) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exclusive_context_count) as usize - ptr as usize }, - 208usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(exclusive_context_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cflags_next_tb) as usize - ptr as usize }, - 212usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(cflags_next_tb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).interrupt_request) as usize - ptr as usize }, - 216usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(interrupt_request) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).singlestep_enabled) as usize - ptr as usize }, - 220usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(singlestep_enabled) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).icount_budget) as usize - ptr as usize }, - 224usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(icount_budget) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).icount_extra) as usize - ptr as usize }, - 232usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(icount_extra) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).random_seed) as usize - ptr as usize }, - 240usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(random_seed) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jmp_env) as usize - ptr as usize }, - 248usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(jmp_env) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).work_mutex) as usize - ptr as usize }, - 448usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(work_mutex) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).work_list) as usize - ptr as usize }, - 496usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(work_list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpu_ases) as usize - ptr as usize }, - 512usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(cpu_ases) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).num_ases) as usize - ptr as usize }, - 520usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(num_ases) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).as_) as usize - ptr as usize }, - 528usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(as_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).memory) as usize - ptr as usize }, - 536usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(memory) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tb_jmp_cache) as usize - ptr as usize }, - 544usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(tb_jmp_cache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdb_regs) as usize - ptr as usize }, - 552usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(gdb_regs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdb_num_regs) as usize - ptr as usize }, - 560usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(gdb_num_regs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdb_num_g_regs) as usize - ptr as usize }, - 564usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(gdb_num_g_regs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).node) as usize - ptr as usize }, - 568usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(node) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breakpoints) as usize - ptr as usize }, - 584usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(breakpoints) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).watchpoints) as usize - ptr as usize }, - 600usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(watchpoints) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).watchpoint_hit) as usize - ptr as usize }, - 616usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(watchpoint_hit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opaque) as usize - ptr as usize }, - 624usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(opaque) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mem_io_pc) as usize - ptr as usize }, - 632usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(mem_io_pc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kvm_fd) as usize - ptr as usize }, - 640usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(kvm_fd) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kvm_state) as usize - ptr as usize }, - 648usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(kvm_state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kvm_run) as usize - ptr as usize }, - 656usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(kvm_run) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kvm_dirty_gfns) as usize - ptr as usize }, - 664usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(kvm_dirty_gfns) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kvm_fetch_index) as usize - ptr as usize }, - 672usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(kvm_fetch_index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dirty_pages) as usize - ptr as usize }, - 680usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(dirty_pages) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kvm_vcpu_stats_fd) as usize - ptr as usize }, - 688usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(kvm_vcpu_stats_fd) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).in_ioctl_lock) as usize - ptr as usize }, - 692usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(in_ioctl_lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).plugin_mem_cbs) as usize - ptr as usize }, - 696usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(plugin_mem_cbs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).plugin_state) as usize - ptr as usize }, - 704usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(plugin_state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpu_index) as usize - ptr as usize }, - 712usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(cpu_index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cluster_index) as usize - ptr as usize }, - 716usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(cluster_index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tcg_cflags) as usize - ptr as usize }, - 720usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(tcg_cflags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).halted) as usize - ptr as usize }, - 724usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(halted) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exception_index) as usize - ptr as usize }, - 728usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(exception_index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).accel) as usize - ptr as usize }, - 736usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(accel) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vcpu_dirty) as usize - ptr as usize }, - 744usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(vcpu_dirty) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).throttle_thread_scheduled) as usize - ptr as usize }, - 745usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(throttle_thread_scheduled) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).throttle_us_per_full) as usize - ptr as usize }, - 752usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(throttle_us_per_full) - ) - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).ignore_memory_transaction_failures) as usize - ptr as usize - }, - 760usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(ignore_memory_transaction_failures) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prctl_unalign_sigbus) as usize - ptr as usize }, - 761usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(prctl_unalign_sigbus) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).iommu_notifiers) as usize - ptr as usize }, - 768usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(iommu_notifiers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).neg_align) as usize - ptr as usize }, - 784usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(neg_align) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).neg) as usize - ptr as usize }, - 784usize, - concat!( - "Offset of field: ", - stringify!(CPUState), - "::", - stringify!(neg) - ) - ); -} -impl Default for CPUState { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUState { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! (f , "CPUState {{ parent_obj: {:?}, cc: {:?}, nr_cores: {:?}, nr_threads: {:?}, thread: {:?}, thread_id: {:?}, running: {:?}, has_waiter: {:?}, halt_cond: {:?}, thread_kicked: {:?}, created: {:?}, stop: {:?}, stopped: {:?}, start_powered_off: {:?}, unplug: {:?}, crash_occurred: {:?}, exit_request: {:?}, exclusive_context_count: {:?}, singlestep_enabled: {:?}, jmp_env: {:?}, work_mutex: {:?}, work_list: {:?}, cpu_ases: {:?}, num_ases: {:?}, as: {:?}, memory: {:?}, tb_jmp_cache: {:?}, gdb_regs: {:?}, gdb_num_regs: {:?}, gdb_num_g_regs: {:?}, node: {:?}, breakpoints: {:?}, watchpoints: {:?}, watchpoint_hit: {:?}, opaque: {:?}, kvm_fd: {:?}, kvm_state: {:?}, kvm_run: {:?}, kvm_dirty_gfns: {:?}, kvm_vcpu_stats_fd: {:?}, in_ioctl_lock: {:?}, plugin_mem_cbs: {:?}, plugin_state: {:?}, cpu_index: {:?}, cluster_index: {:?}, accel: {:?}, vcpu_dirty: {:?}, throttle_thread_scheduled: {:?}, ignore_memory_transaction_failures: {:?}, prctl_unalign_sigbus: {:?}, iommu_notifiers: {:?}, neg_align: {:?}, neg: {:?} }}" , self . parent_obj , self . cc , self . nr_cores , self . nr_threads , self . thread , self . thread_id , self . running , self . has_waiter , self . halt_cond , self . thread_kicked , self . created , self . stop , self . stopped , self . start_powered_off , self . unplug , self . crash_occurred , self . exit_request , self . exclusive_context_count , self . singlestep_enabled , self . jmp_env , self . work_mutex , self . work_list , self . cpu_ases , self . num_ases , self . as_ , self . memory , self . tb_jmp_cache , self . gdb_regs , self . gdb_num_regs , self . gdb_num_g_regs , self . node , self . breakpoints , self . watchpoints , self . watchpoint_hit , self . opaque , self . kvm_fd , self . kvm_state , self . kvm_run , self . kvm_dirty_gfns , self . kvm_vcpu_stats_fd , self . in_ioctl_lock , self . plugin_mem_cbs , self . plugin_state , self . cpu_index , self . cluster_index , self . accel , self . vcpu_dirty , self . throttle_thread_scheduled , self . ignore_memory_transaction_failures , self . prctl_unalign_sigbus , self . iommu_notifiers , self . neg_align , self . neg) - } -} -extern "C" { - #[doc = " cpu_reset:\n @cpu: The CPU whose state is to be reset."] - pub fn cpu_reset(cpu: *mut CPUState); -} -pub type target_long = i64; -pub type target_ulong = u64; -#[doc = " Property:\n @set_default: true if the default value should be set from @defval,\n in which case @info->set_default_value must not be NULL\n (if false then no default value is set by the property system\n and the field retains whatever value it was given by instance_init).\n @defval: default value for the property. This is used only if @set_default\n is true."] -#[repr(C)] -#[derive(Copy, Clone)] -pub struct Property { - pub name: *const ::std::os::raw::c_char, - pub info: *const PropertyInfo, - pub offset: isize, - pub bitnr: u8, - pub bitmask: u64, - pub set_default: bool, - pub defval: Property__bindgen_ty_1, - pub arrayoffset: ::std::os::raw::c_int, - pub arrayinfo: *const PropertyInfo, - pub arrayfieldsize: ::std::os::raw::c_int, - pub link_type: *const ::std::os::raw::c_char, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union Property__bindgen_ty_1 { - pub i: i64, - pub u: u64, -} -#[test] -fn bindgen_test_layout_Property__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(Property__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Property__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).i) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Property__bindgen_ty_1), - "::", - stringify!(i) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).u) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Property__bindgen_ty_1), - "::", - stringify!(u) - ) - ); -} -impl Default for Property__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for Property__bindgen_ty_1 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "Property__bindgen_ty_1 {{ union }}") - } -} -#[test] -fn bindgen_test_layout_Property() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - concat!("Size of: ", stringify!(Property)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(Property)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).info) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(info) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bitnr) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(bitnr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bitmask) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(bitmask) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_default) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(set_default) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).defval) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(defval) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arrayoffset) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(arrayoffset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arrayinfo) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(arrayinfo) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arrayfieldsize) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(arrayfieldsize) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).link_type) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(Property), - "::", - stringify!(link_type) - ) - ); -} -impl Default for Property { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for Property { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! (f , "Property {{ name: {:?}, info: {:?}, set_default: {:?}, defval: {:?}, arrayoffset: {:?}, arrayinfo: {:?}, arrayfieldsize: {:?}, link_type: {:?} }}" , self . name , self . info , self . set_default , self . defval , self . arrayoffset , self . arrayinfo , self . arrayfieldsize , self . link_type) - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct PropertyInfo { - pub name: *const ::std::os::raw::c_char, - pub description: *const ::std::os::raw::c_char, - pub enum_table: *const QEnumLookup, - pub realized_set_allowed: bool, - pub print: ::std::option::Option< - unsafe extern "C" fn( - obj: *mut Object, - prop: *mut Property, - dest: *mut ::std::os::raw::c_char, - len: usize, - ) -> ::std::os::raw::c_int, - >, - pub set_default_value: - ::std::option::Option, - pub create: ::std::option::Option< - unsafe extern "C" fn( - oc: *mut ObjectClass, - name: *const ::std::os::raw::c_char, - prop: *mut Property, - ) -> *mut ObjectProperty, - >, - pub get: ObjectPropertyAccessor, - pub set: ObjectPropertyAccessor, - pub release: ObjectPropertyRelease, -} -#[test] -fn bindgen_test_layout_PropertyInfo() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 80usize, - concat!("Size of: ", stringify!(PropertyInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(PropertyInfo)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(PropertyInfo), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).description) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(PropertyInfo), - "::", - stringify!(description) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enum_table) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(PropertyInfo), - "::", - stringify!(enum_table) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).realized_set_allowed) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(PropertyInfo), - "::", - stringify!(realized_set_allowed) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).print) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(PropertyInfo), - "::", - stringify!(print) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set_default_value) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(PropertyInfo), - "::", - stringify!(set_default_value) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).create) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(PropertyInfo), - "::", - stringify!(create) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).get) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(PropertyInfo), - "::", - stringify!(get) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).set) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(PropertyInfo), - "::", - stringify!(set) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).release) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(PropertyInfo), - "::", - stringify!(release) - ) - ); -} -impl Default for PropertyInfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[doc = " X86CPU:\n @env: #CPUX86State\n @migratable: If set, only migratable flags will be accepted when \"enforce\"\n mode is used, and only migratable flags will be included in the \"host\"\n CPU model.\n\n An x86 CPU."] -pub type X86CPU = ArchCPU; -pub const OnOffAuto_ON_OFF_AUTO_AUTO: OnOffAuto = OnOffAuto(0); -pub const OnOffAuto_ON_OFF_AUTO_ON: OnOffAuto = OnOffAuto(1); -pub const OnOffAuto_ON_OFF_AUTO_OFF: OnOffAuto = OnOffAuto(2); -pub const OnOffAuto_ON_OFF_AUTO__MAX: OnOffAuto = OnOffAuto(3); -impl ::std::ops::BitOr for OnOffAuto { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - OnOffAuto(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for OnOffAuto { - #[inline] - fn bitor_assign(&mut self, rhs: OnOffAuto) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for OnOffAuto { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - OnOffAuto(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for OnOffAuto { - #[inline] - fn bitand_assign(&mut self, rhs: OnOffAuto) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct OnOffAuto(pub ::std::os::raw::c_uint); -pub type float16 = u16; -pub type float32 = u32; -pub type float64 = u64; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct floatx80 { - pub low: u64, - pub high: u16, -} -#[test] -fn bindgen_test_layout_floatx80() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(floatx80)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(floatx80)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).low) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(floatx80), - "::", - stringify!(low) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).high) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(floatx80), - "::", - stringify!(high) - ) - ); -} -pub const FloatRoundMode_float_round_nearest_even: FloatRoundMode = FloatRoundMode(0); -pub const FloatRoundMode_float_round_down: FloatRoundMode = FloatRoundMode(1); -pub const FloatRoundMode_float_round_up: FloatRoundMode = FloatRoundMode(2); -pub const FloatRoundMode_float_round_to_zero: FloatRoundMode = FloatRoundMode(3); -pub const FloatRoundMode_float_round_ties_away: FloatRoundMode = FloatRoundMode(4); -pub const FloatRoundMode_float_round_to_odd: FloatRoundMode = FloatRoundMode(5); -pub const FloatRoundMode_float_round_to_odd_inf: FloatRoundMode = FloatRoundMode(6); -impl ::std::ops::BitOr for FloatRoundMode { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - FloatRoundMode(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for FloatRoundMode { - #[inline] - fn bitor_assign(&mut self, rhs: FloatRoundMode) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for FloatRoundMode { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - FloatRoundMode(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for FloatRoundMode { - #[inline] - fn bitand_assign(&mut self, rhs: FloatRoundMode) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct FloatRoundMode(pub ::std::os::raw::c_uchar); -pub const FloatX80RoundPrec_floatx80_precision_x: FloatX80RoundPrec = FloatX80RoundPrec(0); -pub const FloatX80RoundPrec_floatx80_precision_d: FloatX80RoundPrec = FloatX80RoundPrec(1); -pub const FloatX80RoundPrec_floatx80_precision_s: FloatX80RoundPrec = FloatX80RoundPrec(2); -impl ::std::ops::BitOr for FloatX80RoundPrec { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - FloatX80RoundPrec(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for FloatX80RoundPrec { - #[inline] - fn bitor_assign(&mut self, rhs: FloatX80RoundPrec) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for FloatX80RoundPrec { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - FloatX80RoundPrec(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for FloatX80RoundPrec { - #[inline] - fn bitand_assign(&mut self, rhs: FloatX80RoundPrec) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct FloatX80RoundPrec(pub ::std::os::raw::c_uchar); -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct float_status { - pub float_exception_flags: u16, - pub float_rounding_mode: FloatRoundMode, - pub floatx80_rounding_precision: FloatX80RoundPrec, - pub tininess_before_rounding: bool, - pub flush_to_zero: bool, - pub flush_inputs_to_zero: bool, - pub default_nan_mode: bool, - pub snan_bit_is_one: bool, - pub use_first_nan: bool, - pub no_signaling_nans: bool, - pub rebias_overflow: bool, - pub rebias_underflow: bool, -} -#[test] -fn bindgen_test_layout_float_status() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 14usize, - concat!("Size of: ", stringify!(float_status)) - ); - assert_eq!( - ::std::mem::align_of::(), - 2usize, - concat!("Alignment of ", stringify!(float_status)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).float_exception_flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(float_exception_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).float_rounding_mode) as usize - ptr as usize }, - 2usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(float_rounding_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).floatx80_rounding_precision) as usize - ptr as usize }, - 3usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(floatx80_rounding_precision) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tininess_before_rounding) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(tininess_before_rounding) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flush_to_zero) as usize - ptr as usize }, - 5usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(flush_to_zero) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flush_inputs_to_zero) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(flush_inputs_to_zero) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).default_nan_mode) as usize - ptr as usize }, - 7usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(default_nan_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).snan_bit_is_one) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(snan_bit_is_one) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).use_first_nan) as usize - ptr as usize }, - 9usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(use_first_nan) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).no_signaling_nans) as usize - ptr as usize }, - 10usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(no_signaling_nans) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rebias_overflow) as usize - ptr as usize }, - 11usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(rebias_overflow) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rebias_underflow) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(float_status), - "::", - stringify!(rebias_underflow) - ) - ); -} -impl Default for float_status { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type FeatureWordArray = [u64; 39usize]; -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct SegmentCache { - pub selector: u32, - pub base: target_ulong, - pub limit: u32, - pub flags: u32, -} -#[test] -fn bindgen_test_layout_SegmentCache() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(SegmentCache)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(SegmentCache)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).selector) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(SegmentCache), - "::", - stringify!(selector) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).base) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(SegmentCache), - "::", - stringify!(base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).limit) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(SegmentCache), - "::", - stringify!(limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(SegmentCache), - "::", - stringify!(flags) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union MMXReg { - pub _b_MMXReg: [u8; 8usize], - pub _w_MMXReg: [u16; 4usize], - pub _l_MMXReg: [u32; 2usize], - pub _q_MMXReg: [u64; 1usize], - pub _s_MMXReg: [float32; 2usize], - pub _d_MMXReg: [float64; 1usize], -} -#[test] -fn bindgen_test_layout_MMXReg() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(MMXReg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MMXReg)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._b_MMXReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MMXReg), - "::", - stringify!(_b_MMXReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._w_MMXReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MMXReg), - "::", - stringify!(_w_MMXReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._l_MMXReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MMXReg), - "::", - stringify!(_l_MMXReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._q_MMXReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MMXReg), - "::", - stringify!(_q_MMXReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._s_MMXReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MMXReg), - "::", - stringify!(_s_MMXReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._d_MMXReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MMXReg), - "::", - stringify!(_d_MMXReg) - ) - ); -} -impl Default for MMXReg { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for MMXReg { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "MMXReg {{ union }}") - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union XMMReg { - pub _q_XMMReg: [u64; 2usize], -} -#[test] -fn bindgen_test_layout_XMMReg() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(XMMReg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(XMMReg)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._q_XMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(XMMReg), - "::", - stringify!(_q_XMMReg) - ) - ); -} -impl Default for XMMReg { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for XMMReg { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "XMMReg {{ union }}") - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union YMMReg { - pub _q_YMMReg: [u64; 4usize], - pub _x_YMMReg: [XMMReg; 2usize], -} -#[test] -fn bindgen_test_layout_YMMReg() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(YMMReg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(YMMReg)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._q_YMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(YMMReg), - "::", - stringify!(_q_YMMReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._x_YMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(YMMReg), - "::", - stringify!(_x_YMMReg) - ) - ); -} -impl Default for YMMReg { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for YMMReg { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "YMMReg {{ union }}") - } -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union ZMMReg { - pub _b_ZMMReg: [u8; 64usize], - pub _w_ZMMReg: [u16; 32usize], - pub _l_ZMMReg: [u32; 16usize], - pub _q_ZMMReg: [u64; 8usize], - pub _h_ZMMReg: [float16; 32usize], - pub _s_ZMMReg: [float32; 16usize], - pub _d_ZMMReg: [float64; 8usize], - pub _x_ZMMReg: [XMMReg; 4usize], - pub _y_ZMMReg: [YMMReg; 2usize], -} -#[test] -fn bindgen_test_layout_ZMMReg() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(ZMMReg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ZMMReg)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._b_ZMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ZMMReg), - "::", - stringify!(_b_ZMMReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._w_ZMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ZMMReg), - "::", - stringify!(_w_ZMMReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._l_ZMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ZMMReg), - "::", - stringify!(_l_ZMMReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._q_ZMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ZMMReg), - "::", - stringify!(_q_ZMMReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._h_ZMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ZMMReg), - "::", - stringify!(_h_ZMMReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._s_ZMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ZMMReg), - "::", - stringify!(_s_ZMMReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._d_ZMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ZMMReg), - "::", - stringify!(_d_ZMMReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._x_ZMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ZMMReg), - "::", - stringify!(_x_ZMMReg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._y_ZMMReg) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ZMMReg), - "::", - stringify!(_y_ZMMReg) - ) - ); -} -impl Default for ZMMReg { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for ZMMReg { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "ZMMReg {{ union }}") - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct BNDReg { - pub lb: u64, - pub ub: u64, -} -#[test] -fn bindgen_test_layout_BNDReg() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(BNDReg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(BNDReg)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lb) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BNDReg), - "::", - stringify!(lb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ub) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(BNDReg), - "::", - stringify!(ub) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct BNDCSReg { - pub cfgu: u64, - pub sts: u64, -} -#[test] -fn bindgen_test_layout_BNDCSReg() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(BNDCSReg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(BNDCSReg)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cfgu) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(BNDCSReg), - "::", - stringify!(cfgu) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sts) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(BNDCSReg), - "::", - stringify!(sts) - ) - ); -} -#[repr(C)] -#[repr(align(16))] -#[derive(Copy, Clone)] -pub union FPReg { - pub d: floatx80, - pub mmx: MMXReg, -} -#[test] -fn bindgen_test_layout_FPReg() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(FPReg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - concat!("Alignment of ", stringify!(FPReg)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).d) as usize - ptr as usize }, - 0usize, - concat!("Offset of field: ", stringify!(FPReg), "::", stringify!(d)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mmx) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(FPReg), - "::", - stringify!(mmx) - ) - ); -} -impl Default for FPReg { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for FPReg { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "FPReg {{ union }}") - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct MTRRVar { - pub base: u64, - pub mask: u64, -} -#[test] -fn bindgen_test_layout_MTRRVar() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(MTRRVar)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(MTRRVar)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).base) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(MTRRVar), - "::", - stringify!(base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mask) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(MTRRVar), - "::", - stringify!(mask) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct LBREntry { - pub from: u64, - pub to: u64, - pub info: u64, -} -#[test] -fn bindgen_test_layout_LBREntry() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(LBREntry)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(LBREntry)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).from) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(LBREntry), - "::", - stringify!(from) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).to) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(LBREntry), - "::", - stringify!(to) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).info) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(LBREntry), - "::", - stringify!(info) - ) - ); -} -pub const TPRAccess_TPR_ACCESS_READ: TPRAccess = TPRAccess(0); -pub const TPRAccess_TPR_ACCESS_WRITE: TPRAccess = TPRAccess(1); -impl ::std::ops::BitOr for TPRAccess { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - TPRAccess(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for TPRAccess { - #[inline] - fn bitor_assign(&mut self, rhs: TPRAccess) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for TPRAccess { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - TPRAccess(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for TPRAccess { - #[inline] - fn bitand_assign(&mut self, rhs: TPRAccess) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct TPRAccess(pub ::std::os::raw::c_uint); -pub const CacheType_DATA_CACHE: CacheType = CacheType(0); -pub const CacheType_INSTRUCTION_CACHE: CacheType = CacheType(1); -pub const CacheType_UNIFIED_CACHE: CacheType = CacheType(2); -impl ::std::ops::BitOr for CacheType { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - CacheType(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for CacheType { - #[inline] - fn bitor_assign(&mut self, rhs: CacheType) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for CacheType { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - CacheType(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for CacheType { - #[inline] - fn bitand_assign(&mut self, rhs: CacheType) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct CacheType(pub ::std::os::raw::c_uint); -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CPUCacheInfo { - pub type_: CacheType, - pub level: u8, - pub size: u32, - pub line_size: u16, - pub associativity: u8, - pub partitions: u8, - pub sets: u32, - pub lines_per_tag: u8, - pub self_init: bool, - pub no_invd_sharing: bool, - pub inclusive: bool, - pub complex_indexing: bool, -} -#[test] -fn bindgen_test_layout_CPUCacheInfo() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 28usize, - concat!("Size of: ", stringify!(CPUCacheInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(CPUCacheInfo)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).level) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(level) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).line_size) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(line_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).associativity) as usize - ptr as usize }, - 14usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(associativity) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).partitions) as usize - ptr as usize }, - 15usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(partitions) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sets) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(sets) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lines_per_tag) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(lines_per_tag) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).self_init) as usize - ptr as usize }, - 21usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(self_init) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).no_invd_sharing) as usize - ptr as usize }, - 22usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(no_invd_sharing) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).inclusive) as usize - ptr as usize }, - 23usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(inclusive) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).complex_indexing) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CPUCacheInfo), - "::", - stringify!(complex_indexing) - ) - ); -} -impl Default for CPUCacheInfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct CPUCaches { - pub l1d_cache: *mut CPUCacheInfo, - pub l1i_cache: *mut CPUCacheInfo, - pub l2_cache: *mut CPUCacheInfo, - pub l3_cache: *mut CPUCacheInfo, -} -#[test] -fn bindgen_test_layout_CPUCaches() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CPUCaches)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUCaches)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).l1d_cache) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUCaches), - "::", - stringify!(l1d_cache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).l1i_cache) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(CPUCaches), - "::", - stringify!(l1i_cache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).l2_cache) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(CPUCaches), - "::", - stringify!(l2_cache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).l3_cache) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(CPUCaches), - "::", - stringify!(l3_cache) - ) - ); -} -impl Default for CPUCaches { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[repr(align(16))] -#[derive(Copy, Clone)] -pub struct CPUArchState { - pub regs: [target_ulong; 16usize], - pub eip: target_ulong, - pub eflags: target_ulong, - pub cc_dst: target_ulong, - pub cc_src: target_ulong, - pub cc_src2: target_ulong, - pub cc_op: u32, - pub df: i32, - pub hflags: u32, - pub hflags2: u32, - pub segs: [SegmentCache; 6usize], - pub ldt: SegmentCache, - pub tr: SegmentCache, - pub gdt: SegmentCache, - pub idt: SegmentCache, - pub cr: [target_ulong; 5usize], - pub pdptrs_valid: bool, - pub pdptrs: [u64; 4usize], - pub a20_mask: i32, - pub bnd_regs: [BNDReg; 4usize], - pub bndcs_regs: BNDCSReg, - pub msr_bndcfgs: u64, - pub efer: u64, - pub start_init_save: CPUArchState__bindgen_ty_1, - pub fpstt: ::std::os::raw::c_uint, - pub fpus: u16, - pub fpuc: u16, - pub fptags: [u8; 8usize], - pub fpregs: [FPReg; 8usize], - pub fpop: u16, - pub fpcs: u16, - pub fpds: u16, - pub fpip: u64, - pub fpdp: u64, - pub fp_status: float_status, - pub ft0: floatx80, - pub mmx_status: float_status, - pub sse_status: float_status, - pub mxcsr: u32, - pub __bindgen_padding_0: u64, - pub xmm_regs: [ZMMReg; 32usize], - pub xmm_t0: ZMMReg, - pub mmx_t0: MMXReg, - pub opmask_regs: [u64; 8usize], - pub xtilecfg: [u8; 64usize], - pub xtiledata: [u8; 8192usize], - pub sysenter_cs: u32, - pub sysenter_esp: target_ulong, - pub sysenter_eip: target_ulong, - pub star: u64, - pub vm_hsave: u64, - pub lstar: target_ulong, - pub cstar: target_ulong, - pub fmask: target_ulong, - pub kernelgsbase: target_ulong, - pub tsc_adjust: u64, - pub tsc_deadline: u64, - pub tsc_aux: u64, - pub xcr0: u64, - pub mcg_status: u64, - pub msr_ia32_misc_enable: u64, - pub msr_ia32_feature_control: u64, - pub msr_ia32_sgxlepubkeyhash: [u64; 4usize], - pub msr_fixed_ctr_ctrl: u64, - pub msr_global_ctrl: u64, - pub msr_global_status: u64, - pub msr_global_ovf_ctrl: u64, - pub msr_fixed_counters: [u64; 3usize], - pub msr_gp_counters: [u64; 18usize], - pub msr_gp_evtsel: [u64; 18usize], - pub pat: u64, - pub smbase: u32, - pub msr_smi_count: u64, - pub pkru: u32, - pub pkrs: u32, - pub tsx_ctrl: u32, - pub spec_ctrl: u64, - pub amd_tsc_scale_msr: u64, - pub virt_ssbd: u64, - pub end_init_save: CPUArchState__bindgen_ty_2, - pub system_time_msr: u64, - pub wall_clock_msr: u64, - pub steal_time_msr: u64, - pub async_pf_en_msr: u64, - pub async_pf_int_msr: u64, - pub pv_eoi_en_msr: u64, - pub poll_control_msr: u64, - pub msr_hv_hypercall: u64, - pub msr_hv_guest_os_id: u64, - pub msr_hv_tsc: u64, - pub msr_hv_syndbg_control: u64, - pub msr_hv_syndbg_status: u64, - pub msr_hv_syndbg_send_page: u64, - pub msr_hv_syndbg_recv_page: u64, - pub msr_hv_syndbg_pending_page: u64, - pub msr_hv_syndbg_options: u64, - pub msr_hv_vapic: u64, - pub msr_hv_crash_params: [u64; 5usize], - pub msr_hv_runtime: u64, - pub msr_hv_synic_control: u64, - pub msr_hv_synic_evt_page: u64, - pub msr_hv_synic_msg_page: u64, - pub msr_hv_synic_sint: [u64; 16usize], - pub msr_hv_stimer_config: [u64; 4usize], - pub msr_hv_stimer_count: [u64; 4usize], - pub msr_hv_reenlightenment_control: u64, - pub msr_hv_tsc_emulation_control: u64, - pub msr_hv_tsc_emulation_status: u64, - pub msr_rtit_ctrl: u64, - pub msr_rtit_status: u64, - pub msr_rtit_output_base: u64, - pub msr_rtit_output_mask: u64, - pub msr_rtit_cr3_match: u64, - pub msr_rtit_addrs: [u64; 8usize], - pub msr_xfd: u64, - pub msr_xfd_err: u64, - pub msr_lbr_ctl: u64, - pub msr_lbr_depth: u64, - pub lbr_records: [LBREntry; 32usize], - pub error_code: ::std::os::raw::c_int, - pub exception_is_int: ::std::os::raw::c_int, - pub exception_next_eip: target_ulong, - pub dr: [target_ulong; 8usize], - pub __bindgen_anon_1: CPUArchState__bindgen_ty_3, - pub old_exception: ::std::os::raw::c_int, - pub vm_vmcb: u64, - pub tsc_offset: u64, - pub intercept: u64, - pub intercept_cr_read: u16, - pub intercept_cr_write: u16, - pub intercept_dr_read: u16, - pub intercept_dr_write: u16, - pub intercept_exceptions: u32, - pub nested_cr3: u64, - pub nested_pg_mode: u32, - pub v_tpr: u8, - pub int_ctl: u32, - pub nmi_injected: u8, - pub nmi_pending: u8, - pub retaddr: usize, - pub end_reset_fields: CPUArchState__bindgen_ty_4, - pub cpuid_level_func7: u32, - pub cpuid_min_level_func7: u32, - pub cpuid_min_level: u32, - pub cpuid_min_xlevel: u32, - pub cpuid_min_xlevel2: u32, - pub cpuid_max_level: u32, - pub cpuid_max_xlevel: u32, - pub cpuid_max_xlevel2: u32, - pub cpuid_level: u32, - pub cpuid_xlevel: u32, - pub cpuid_xlevel2: u32, - pub cpuid_vendor1: u32, - pub cpuid_vendor2: u32, - pub cpuid_vendor3: u32, - pub cpuid_version: u32, - pub features: FeatureWordArray, - pub user_features: FeatureWordArray, - pub cpuid_model: [u32; 12usize], - pub cache_info_cpuid2: CPUCaches, - pub cache_info_cpuid4: CPUCaches, - pub cache_info_amd: CPUCaches, - pub mtrr_fixed: [u64; 11usize], - pub mtrr_deftype: u64, - pub mtrr_var: [MTRRVar; 8usize], - pub mp_state: u32, - pub exception_nr: i32, - pub interrupt_injected: i32, - pub soft_interrupt: u8, - pub exception_pending: u8, - pub exception_injected: u8, - pub has_error_code: u8, - pub exception_has_payload: u8, - pub exception_payload: u64, - pub triple_fault_pending: u8, - pub ins_len: u32, - pub sipi_vector: u32, - pub tsc_valid: bool, - pub tsc_khz: i64, - pub user_tsc_khz: i64, - pub apic_bus_freq: u64, - pub tsc: u64, - pub mcg_cap: u64, - pub mcg_ctl: u64, - pub mcg_ext_ctl: u64, - pub mce_banks: [u64; 40usize], - pub xstate_bv: u64, - pub fpus_vmstate: u16, - pub fptag_vmstate: u16, - pub fpregs_format_vmstate: u16, - pub xss: u64, - pub umwait: u32, - pub tpr_access_type: TPRAccess, - pub nr_dies: ::std::os::raw::c_uint, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CPUArchState__bindgen_ty_1 {} -#[test] -fn bindgen_test_layout_CPUArchState__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 0usize, - concat!("Size of: ", stringify!(CPUArchState__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CPUArchState__bindgen_ty_1)) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CPUArchState__bindgen_ty_2 {} -#[test] -fn bindgen_test_layout_CPUArchState__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 0usize, - concat!("Size of: ", stringify!(CPUArchState__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CPUArchState__bindgen_ty_2)) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union CPUArchState__bindgen_ty_3 { - pub cpu_breakpoint: [*mut CPUBreakpoint; 4usize], - pub cpu_watchpoint: [*mut CPUWatchpoint; 4usize], -} -#[test] -fn bindgen_test_layout_CPUArchState__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(CPUArchState__bindgen_ty_3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUArchState__bindgen_ty_3)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpu_breakpoint) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState__bindgen_ty_3), - "::", - stringify!(cpu_breakpoint) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpu_watchpoint) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState__bindgen_ty_3), - "::", - stringify!(cpu_watchpoint) - ) - ); -} -impl Default for CPUArchState__bindgen_ty_3 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUArchState__bindgen_ty_3 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "CPUArchState__bindgen_ty_3 {{ union }}") - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CPUArchState__bindgen_ty_4 {} -#[test] -fn bindgen_test_layout_CPUArchState__bindgen_ty_4() { - assert_eq!( - ::std::mem::size_of::(), - 0usize, - concat!("Size of: ", stringify!(CPUArchState__bindgen_ty_4)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(CPUArchState__bindgen_ty_4)) - ); -} -#[test] -fn bindgen_test_layout_CPUArchState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 14896usize, - concat!("Size of: ", stringify!(CPUArchState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - concat!("Alignment of ", stringify!(CPUArchState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).regs) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(regs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eip) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(eip) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eflags) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(eflags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cc_dst) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cc_dst) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cc_src) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cc_src) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cc_src2) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cc_src2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cc_op) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cc_op) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).df) as usize - ptr as usize }, - 172usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(df) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hflags) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(hflags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hflags2) as usize - ptr as usize }, - 180usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(hflags2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).segs) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(segs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ldt) as usize - ptr as usize }, - 328usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(ldt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tr) as usize - ptr as usize }, - 352usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(tr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gdt) as usize - ptr as usize }, - 376usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(gdt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).idt) as usize - ptr as usize }, - 400usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(idt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cr) as usize - ptr as usize }, - 424usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pdptrs_valid) as usize - ptr as usize }, - 464usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(pdptrs_valid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pdptrs) as usize - ptr as usize }, - 472usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(pdptrs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).a20_mask) as usize - ptr as usize }, - 504usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(a20_mask) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bnd_regs) as usize - ptr as usize }, - 512usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(bnd_regs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bndcs_regs) as usize - ptr as usize }, - 576usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(bndcs_regs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_bndcfgs) as usize - ptr as usize }, - 592usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_bndcfgs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).efer) as usize - ptr as usize }, - 600usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(efer) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_init_save) as usize - ptr as usize }, - 608usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(start_init_save) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpstt) as usize - ptr as usize }, - 608usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpstt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpus) as usize - ptr as usize }, - 612usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpus) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpuc) as usize - ptr as usize }, - 614usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpuc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fptags) as usize - ptr as usize }, - 616usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fptags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpregs) as usize - ptr as usize }, - 624usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpregs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpop) as usize - ptr as usize }, - 752usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpop) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpcs) as usize - ptr as usize }, - 754usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpcs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpds) as usize - ptr as usize }, - 756usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpds) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpip) as usize - ptr as usize }, - 760usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpip) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpdp) as usize - ptr as usize }, - 768usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpdp) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_status) as usize - ptr as usize }, - 776usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fp_status) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ft0) as usize - ptr as usize }, - 792usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(ft0) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mmx_status) as usize - ptr as usize }, - 808usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mmx_status) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sse_status) as usize - ptr as usize }, - 822usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(sse_status) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mxcsr) as usize - ptr as usize }, - 836usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mxcsr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xmm_regs) as usize - ptr as usize }, - 848usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(xmm_regs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xmm_t0) as usize - ptr as usize }, - 2896usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(xmm_t0) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mmx_t0) as usize - ptr as usize }, - 2960usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mmx_t0) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).opmask_regs) as usize - ptr as usize }, - 2968usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(opmask_regs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xtilecfg) as usize - ptr as usize }, - 3032usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(xtilecfg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xtiledata) as usize - ptr as usize }, - 3096usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(xtiledata) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sysenter_cs) as usize - ptr as usize }, - 11288usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(sysenter_cs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sysenter_esp) as usize - ptr as usize }, - 11296usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(sysenter_esp) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sysenter_eip) as usize - ptr as usize }, - 11304usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(sysenter_eip) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).star) as usize - ptr as usize }, - 11312usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(star) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vm_hsave) as usize - ptr as usize }, - 11320usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(vm_hsave) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lstar) as usize - ptr as usize }, - 11328usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(lstar) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cstar) as usize - ptr as usize }, - 11336usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cstar) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fmask) as usize - ptr as usize }, - 11344usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fmask) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kernelgsbase) as usize - ptr as usize }, - 11352usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(kernelgsbase) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tsc_adjust) as usize - ptr as usize }, - 11360usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(tsc_adjust) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tsc_deadline) as usize - ptr as usize }, - 11368usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(tsc_deadline) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tsc_aux) as usize - ptr as usize }, - 11376usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(tsc_aux) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xcr0) as usize - ptr as usize }, - 11384usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(xcr0) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mcg_status) as usize - ptr as usize }, - 11392usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mcg_status) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_ia32_misc_enable) as usize - ptr as usize }, - 11400usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_ia32_misc_enable) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_ia32_feature_control) as usize - ptr as usize }, - 11408usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_ia32_feature_control) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_ia32_sgxlepubkeyhash) as usize - ptr as usize }, - 11416usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_ia32_sgxlepubkeyhash) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_fixed_ctr_ctrl) as usize - ptr as usize }, - 11448usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_fixed_ctr_ctrl) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_global_ctrl) as usize - ptr as usize }, - 11456usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_global_ctrl) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_global_status) as usize - ptr as usize }, - 11464usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_global_status) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_global_ovf_ctrl) as usize - ptr as usize }, - 11472usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_global_ovf_ctrl) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_fixed_counters) as usize - ptr as usize }, - 11480usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_fixed_counters) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_gp_counters) as usize - ptr as usize }, - 11504usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_gp_counters) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_gp_evtsel) as usize - ptr as usize }, - 11648usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_gp_evtsel) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pat) as usize - ptr as usize }, - 11792usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(pat) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).smbase) as usize - ptr as usize }, - 11800usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(smbase) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_smi_count) as usize - ptr as usize }, - 11808usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_smi_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pkru) as usize - ptr as usize }, - 11816usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(pkru) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pkrs) as usize - ptr as usize }, - 11820usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(pkrs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tsx_ctrl) as usize - ptr as usize }, - 11824usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(tsx_ctrl) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).spec_ctrl) as usize - ptr as usize }, - 11832usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(spec_ctrl) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).amd_tsc_scale_msr) as usize - ptr as usize }, - 11840usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(amd_tsc_scale_msr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).virt_ssbd) as usize - ptr as usize }, - 11848usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(virt_ssbd) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end_init_save) as usize - ptr as usize }, - 11856usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(end_init_save) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).system_time_msr) as usize - ptr as usize }, - 11856usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(system_time_msr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wall_clock_msr) as usize - ptr as usize }, - 11864usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(wall_clock_msr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).steal_time_msr) as usize - ptr as usize }, - 11872usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(steal_time_msr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).async_pf_en_msr) as usize - ptr as usize }, - 11880usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(async_pf_en_msr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).async_pf_int_msr) as usize - ptr as usize }, - 11888usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(async_pf_int_msr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pv_eoi_en_msr) as usize - ptr as usize }, - 11896usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(pv_eoi_en_msr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).poll_control_msr) as usize - ptr as usize }, - 11904usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(poll_control_msr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_hypercall) as usize - ptr as usize }, - 11912usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_hypercall) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_guest_os_id) as usize - ptr as usize }, - 11920usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_guest_os_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_tsc) as usize - ptr as usize }, - 11928usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_tsc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_syndbg_control) as usize - ptr as usize }, - 11936usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_syndbg_control) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_syndbg_status) as usize - ptr as usize }, - 11944usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_syndbg_status) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_syndbg_send_page) as usize - ptr as usize }, - 11952usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_syndbg_send_page) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_syndbg_recv_page) as usize - ptr as usize }, - 11960usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_syndbg_recv_page) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_syndbg_pending_page) as usize - ptr as usize }, - 11968usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_syndbg_pending_page) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_syndbg_options) as usize - ptr as usize }, - 11976usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_syndbg_options) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_vapic) as usize - ptr as usize }, - 11984usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_vapic) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_crash_params) as usize - ptr as usize }, - 11992usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_crash_params) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_runtime) as usize - ptr as usize }, - 12032usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_runtime) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_synic_control) as usize - ptr as usize }, - 12040usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_synic_control) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_synic_evt_page) as usize - ptr as usize }, - 12048usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_synic_evt_page) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_synic_msg_page) as usize - ptr as usize }, - 12056usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_synic_msg_page) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_synic_sint) as usize - ptr as usize }, - 12064usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_synic_sint) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_stimer_config) as usize - ptr as usize }, - 12192usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_stimer_config) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_stimer_count) as usize - ptr as usize }, - 12224usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_stimer_count) - ) - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).msr_hv_reenlightenment_control) as usize - ptr as usize - }, - 12256usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_reenlightenment_control) - ) - ); - assert_eq!( - unsafe { - ::std::ptr::addr_of!((*ptr).msr_hv_tsc_emulation_control) as usize - ptr as usize - }, - 12264usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_tsc_emulation_control) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_hv_tsc_emulation_status) as usize - ptr as usize }, - 12272usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_hv_tsc_emulation_status) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_rtit_ctrl) as usize - ptr as usize }, - 12280usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_rtit_ctrl) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_rtit_status) as usize - ptr as usize }, - 12288usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_rtit_status) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_rtit_output_base) as usize - ptr as usize }, - 12296usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_rtit_output_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_rtit_output_mask) as usize - ptr as usize }, - 12304usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_rtit_output_mask) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_rtit_cr3_match) as usize - ptr as usize }, - 12312usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_rtit_cr3_match) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_rtit_addrs) as usize - ptr as usize }, - 12320usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_rtit_addrs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_xfd) as usize - ptr as usize }, - 12384usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_xfd) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_xfd_err) as usize - ptr as usize }, - 12392usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_xfd_err) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_lbr_ctl) as usize - ptr as usize }, - 12400usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_lbr_ctl) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).msr_lbr_depth) as usize - ptr as usize }, - 12408usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(msr_lbr_depth) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lbr_records) as usize - ptr as usize }, - 12416usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(lbr_records) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).error_code) as usize - ptr as usize }, - 13184usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(error_code) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exception_is_int) as usize - ptr as usize }, - 13188usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(exception_is_int) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exception_next_eip) as usize - ptr as usize }, - 13192usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(exception_next_eip) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dr) as usize - ptr as usize }, - 13200usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(dr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).old_exception) as usize - ptr as usize }, - 13296usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(old_exception) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vm_vmcb) as usize - ptr as usize }, - 13304usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(vm_vmcb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tsc_offset) as usize - ptr as usize }, - 13312usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(tsc_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept) as usize - ptr as usize }, - 13320usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(intercept) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept_cr_read) as usize - ptr as usize }, - 13328usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(intercept_cr_read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept_cr_write) as usize - ptr as usize }, - 13330usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(intercept_cr_write) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept_dr_read) as usize - ptr as usize }, - 13332usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(intercept_dr_read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept_dr_write) as usize - ptr as usize }, - 13334usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(intercept_dr_write) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intercept_exceptions) as usize - ptr as usize }, - 13336usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(intercept_exceptions) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nested_cr3) as usize - ptr as usize }, - 13344usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(nested_cr3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nested_pg_mode) as usize - ptr as usize }, - 13352usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(nested_pg_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).v_tpr) as usize - ptr as usize }, - 13356usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(v_tpr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).int_ctl) as usize - ptr as usize }, - 13360usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(int_ctl) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nmi_injected) as usize - ptr as usize }, - 13364usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(nmi_injected) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nmi_pending) as usize - ptr as usize }, - 13365usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(nmi_pending) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).retaddr) as usize - ptr as usize }, - 13368usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(retaddr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end_reset_fields) as usize - ptr as usize }, - 13376usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(end_reset_fields) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_level_func7) as usize - ptr as usize }, - 13376usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_level_func7) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_min_level_func7) as usize - ptr as usize }, - 13380usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_min_level_func7) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_min_level) as usize - ptr as usize }, - 13384usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_min_level) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_min_xlevel) as usize - ptr as usize }, - 13388usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_min_xlevel) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_min_xlevel2) as usize - ptr as usize }, - 13392usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_min_xlevel2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_max_level) as usize - ptr as usize }, - 13396usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_max_level) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_max_xlevel) as usize - ptr as usize }, - 13400usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_max_xlevel) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_max_xlevel2) as usize - ptr as usize }, - 13404usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_max_xlevel2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_level) as usize - ptr as usize }, - 13408usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_level) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_xlevel) as usize - ptr as usize }, - 13412usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_xlevel) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_xlevel2) as usize - ptr as usize }, - 13416usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_xlevel2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_vendor1) as usize - ptr as usize }, - 13420usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_vendor1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_vendor2) as usize - ptr as usize }, - 13424usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_vendor2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_vendor3) as usize - ptr as usize }, - 13428usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_vendor3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_version) as usize - ptr as usize }, - 13432usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).features) as usize - ptr as usize }, - 13440usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(features) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).user_features) as usize - ptr as usize }, - 13752usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(user_features) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpuid_model) as usize - ptr as usize }, - 14064usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cpuid_model) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cache_info_cpuid2) as usize - ptr as usize }, - 14112usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cache_info_cpuid2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cache_info_cpuid4) as usize - ptr as usize }, - 14144usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cache_info_cpuid4) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cache_info_amd) as usize - ptr as usize }, - 14176usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(cache_info_amd) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mtrr_fixed) as usize - ptr as usize }, - 14208usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mtrr_fixed) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mtrr_deftype) as usize - ptr as usize }, - 14296usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mtrr_deftype) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mtrr_var) as usize - ptr as usize }, - 14304usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mtrr_var) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mp_state) as usize - ptr as usize }, - 14432usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mp_state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exception_nr) as usize - ptr as usize }, - 14436usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(exception_nr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).interrupt_injected) as usize - ptr as usize }, - 14440usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(interrupt_injected) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).soft_interrupt) as usize - ptr as usize }, - 14444usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(soft_interrupt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exception_pending) as usize - ptr as usize }, - 14445usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(exception_pending) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exception_injected) as usize - ptr as usize }, - 14446usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(exception_injected) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).has_error_code) as usize - ptr as usize }, - 14447usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(has_error_code) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exception_has_payload) as usize - ptr as usize }, - 14448usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(exception_has_payload) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exception_payload) as usize - ptr as usize }, - 14456usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(exception_payload) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).triple_fault_pending) as usize - ptr as usize }, - 14464usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(triple_fault_pending) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ins_len) as usize - ptr as usize }, - 14468usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(ins_len) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sipi_vector) as usize - ptr as usize }, - 14472usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(sipi_vector) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tsc_valid) as usize - ptr as usize }, - 14476usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(tsc_valid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tsc_khz) as usize - ptr as usize }, - 14480usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(tsc_khz) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).user_tsc_khz) as usize - ptr as usize }, - 14488usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(user_tsc_khz) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).apic_bus_freq) as usize - ptr as usize }, - 14496usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(apic_bus_freq) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tsc) as usize - ptr as usize }, - 14504usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(tsc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mcg_cap) as usize - ptr as usize }, - 14512usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mcg_cap) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mcg_ctl) as usize - ptr as usize }, - 14520usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mcg_ctl) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mcg_ext_ctl) as usize - ptr as usize }, - 14528usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mcg_ext_ctl) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mce_banks) as usize - ptr as usize }, - 14536usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(mce_banks) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xstate_bv) as usize - ptr as usize }, - 14856usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(xstate_bv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpus_vmstate) as usize - ptr as usize }, - 14864usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpus_vmstate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fptag_vmstate) as usize - ptr as usize }, - 14866usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fptag_vmstate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fpregs_format_vmstate) as usize - ptr as usize }, - 14868usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(fpregs_format_vmstate) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xss) as usize - ptr as usize }, - 14872usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(xss) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).umwait) as usize - ptr as usize }, - 14880usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(umwait) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tpr_access_type) as usize - ptr as usize }, - 14884usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(tpr_access_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nr_dies) as usize - ptr as usize }, - 14888usize, - concat!( - "Offset of field: ", - stringify!(CPUArchState), - "::", - stringify!(nr_dies) - ) - ); -} -impl Default for CPUArchState { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for CPUArchState { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! (f , "CPUArchState {{ regs: {:?}, segs: {:?}, ldt: {:?}, tr: {:?}, gdt: {:?}, idt: {:?}, cr: {:?}, pdptrs_valid: {:?}, pdptrs: {:?}, bnd_regs: {:?}, bndcs_regs: {:?}, start_init_save: {:?}, fpstt: {:?}, fptags: {:?}, fpregs: {:?}, fp_status: {:?}, ft0: {:?}, mmx_status: {:?}, sse_status: {:?}, xmm_regs: {:?}, xmm_t0: {:?}, mmx_t0: {:?}, opmask_regs: {:?}, xtilecfg: {:?}, xtiledata: {:?}, msr_ia32_sgxlepubkeyhash: {:?}, msr_fixed_counters: {:?}, msr_gp_counters: {:?}, msr_gp_evtsel: {:?}, end_init_save: {:?}, msr_hv_crash_params: {:?}, msr_hv_synic_sint: {:?}, msr_hv_stimer_config: {:?}, msr_hv_stimer_count: {:?}, msr_rtit_addrs: {:?}, lbr_records: {:?}, error_code: {:?}, exception_is_int: {:?}, dr: {:?}, __bindgen_anon_1: {:?}, old_exception: {:?}, end_reset_fields: {:?}, features: {:?}, user_features: {:?}, cpuid_model: {:?}, cache_info_cpuid2: {:?}, cache_info_cpuid4: {:?}, cache_info_amd: {:?}, mtrr_fixed: {:?}, mtrr_var: {:?}, tsc_valid: {:?}, mce_banks: {:?}, tpr_access_type: {:?}, nr_dies: {:?} }}" , self . regs , self . segs , self . ldt , self . tr , self . gdt , self . idt , self . cr , self . pdptrs_valid , self . pdptrs , self . bnd_regs , self . bndcs_regs , self . start_init_save , self . fpstt , self . fptags , self . fpregs , self . fp_status , self . ft0 , self . mmx_status , self . sse_status , self . xmm_regs , self . xmm_t0 , self . mmx_t0 , self . opmask_regs , self . xtilecfg , self . xtiledata , self . msr_ia32_sgxlepubkeyhash , self . msr_fixed_counters , self . msr_gp_counters , self . msr_gp_evtsel , self . end_init_save , self . msr_hv_crash_params , self . msr_hv_synic_sint , self . msr_hv_stimer_config , self . msr_hv_stimer_count , self . msr_rtit_addrs , self . lbr_records , self . error_code , self . exception_is_int , self . dr , self . __bindgen_anon_1 , self . old_exception , self . end_reset_fields , self . features , self . user_features , self . cpuid_model , self . cache_info_cpuid2 , self . cache_info_cpuid4 , self . cache_info_amd , self . mtrr_fixed , self . mtrr_var , self . tsc_valid , self . mce_banks , self . tpr_access_type , self . nr_dies) - } -} -pub type CPUX86State = CPUArchState; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct kvm_msrs { - _unused: [u8; 0], -} -#[doc = " X86CPU:\n @env: #CPUX86State\n @migratable: If set, only migratable flags will be accepted when \"enforce\"\n mode is used, and only migratable flags will be included in the \"host\"\n CPU model.\n\n An x86 CPU."] -#[repr(C)] -#[repr(align(16))] -pub struct ArchCPU { - pub parent_obj: CPUState, - pub env: CPUX86State, - pub vmsentry: *mut VMChangeStateEntry, - pub ucode_rev: u64, - pub hyperv_spinlock_attempts: u32, - pub hyperv_vendor: *mut ::std::os::raw::c_char, - pub hyperv_synic_kvm_only: bool, - pub hyperv_features: u64, - pub hyperv_passthrough: bool, - pub hyperv_no_nonarch_cs: OnOffAuto, - pub hyperv_vendor_id: [u32; 3usize], - pub hyperv_interface_id: [u32; 4usize], - pub hyperv_limits: [u32; 3usize], - pub hyperv_enforce_cpuid: bool, - pub hyperv_ver_id_build: u32, - pub hyperv_ver_id_major: u16, - pub hyperv_ver_id_minor: u16, - pub hyperv_ver_id_sp: u32, - pub hyperv_ver_id_sb: u8, - pub hyperv_ver_id_sn: u32, - pub check_cpuid: bool, - pub enforce_cpuid: bool, - pub force_features: bool, - pub expose_kvm: bool, - pub expose_tcg: bool, - pub migratable: bool, - pub migrate_smi_count: bool, - pub max_features: bool, - pub apic_id: u32, - pub vmware_cpuid_freq: bool, - pub cache_info_passthrough: bool, - pub mwait: ArchCPU__bindgen_ty_1, - pub filtered_features: FeatureWordArray, - pub enable_pmu: bool, - pub lbr_fmt: u64, - pub enable_lmce: bool, - pub enable_l3_cache: bool, - pub legacy_cache: bool, - pub enable_cpuid_0xb: bool, - pub full_cpuid_auto_level: bool, - pub vendor_cpuid_only: bool, - pub intel_pt_auto_level: bool, - pub fill_mtrr_mask: bool, - pub host_phys_bits: bool, - pub host_phys_bits_limit: u8, - pub kvm_no_smi_migration: bool, - pub kvm_pv_enforce_cpuid: bool, - pub phys_bits: u32, - pub apic_state: *mut DeviceState, - pub cpu_as_root: *mut MemoryRegion, - pub cpu_as_mem: *mut MemoryRegion, - pub smram: *mut MemoryRegion, - pub machine_done: Notifier, - pub kvm_msr_buf: *mut kvm_msrs, - pub node_id: i32, - pub socket_id: i32, - pub die_id: i32, - pub core_id: i32, - pub thread_id: i32, - pub hv_max_vps: i32, - pub xen_vapic: bool, -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct ArchCPU__bindgen_ty_1 { - pub eax: u32, - pub ebx: u32, - pub ecx: u32, - pub edx: u32, -} -#[test] -fn bindgen_test_layout_ArchCPU__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(ArchCPU__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(ArchCPU__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).eax) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU__bindgen_ty_1), - "::", - stringify!(eax) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ebx) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU__bindgen_ty_1), - "::", - stringify!(ebx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ecx) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU__bindgen_ty_1), - "::", - stringify!(ecx) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).edx) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU__bindgen_ty_1), - "::", - stringify!(edx) - ) - ); -} -#[test] -fn bindgen_test_layout_ArchCPU() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 25664usize, - concat!("Size of: ", stringify!(ArchCPU)) - ); - assert_eq!( - ::std::mem::align_of::(), - 16usize, - concat!("Alignment of ", stringify!(ArchCPU)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_obj) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(parent_obj) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).env) as usize - ptr as usize }, - 10176usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(env) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vmsentry) as usize - ptr as usize }, - 25072usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(vmsentry) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ucode_rev) as usize - ptr as usize }, - 25080usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(ucode_rev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_spinlock_attempts) as usize - ptr as usize }, - 25088usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_spinlock_attempts) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_vendor) as usize - ptr as usize }, - 25096usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_vendor) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_synic_kvm_only) as usize - ptr as usize }, - 25104usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_synic_kvm_only) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_features) as usize - ptr as usize }, - 25112usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_features) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_passthrough) as usize - ptr as usize }, - 25120usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_passthrough) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_no_nonarch_cs) as usize - ptr as usize }, - 25124usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_no_nonarch_cs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_vendor_id) as usize - ptr as usize }, - 25128usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_vendor_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_interface_id) as usize - ptr as usize }, - 25140usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_interface_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_limits) as usize - ptr as usize }, - 25156usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_limits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_enforce_cpuid) as usize - ptr as usize }, - 25168usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_enforce_cpuid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_ver_id_build) as usize - ptr as usize }, - 25172usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_ver_id_build) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_ver_id_major) as usize - ptr as usize }, - 25176usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_ver_id_major) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_ver_id_minor) as usize - ptr as usize }, - 25178usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_ver_id_minor) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_ver_id_sp) as usize - ptr as usize }, - 25180usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_ver_id_sp) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_ver_id_sb) as usize - ptr as usize }, - 25184usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_ver_id_sb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hyperv_ver_id_sn) as usize - ptr as usize }, - 25188usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hyperv_ver_id_sn) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).check_cpuid) as usize - ptr as usize }, - 25192usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(check_cpuid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enforce_cpuid) as usize - ptr as usize }, - 25193usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(enforce_cpuid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).force_features) as usize - ptr as usize }, - 25194usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(force_features) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).expose_kvm) as usize - ptr as usize }, - 25195usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(expose_kvm) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).expose_tcg) as usize - ptr as usize }, - 25196usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(expose_tcg) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).migratable) as usize - ptr as usize }, - 25197usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(migratable) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).migrate_smi_count) as usize - ptr as usize }, - 25198usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(migrate_smi_count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).max_features) as usize - ptr as usize }, - 25199usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(max_features) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).apic_id) as usize - ptr as usize }, - 25200usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(apic_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vmware_cpuid_freq) as usize - ptr as usize }, - 25204usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(vmware_cpuid_freq) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cache_info_passthrough) as usize - ptr as usize }, - 25205usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(cache_info_passthrough) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mwait) as usize - ptr as usize }, - 25208usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(mwait) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).filtered_features) as usize - ptr as usize }, - 25224usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(filtered_features) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enable_pmu) as usize - ptr as usize }, - 25536usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(enable_pmu) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lbr_fmt) as usize - ptr as usize }, - 25544usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(lbr_fmt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enable_lmce) as usize - ptr as usize }, - 25552usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(enable_lmce) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enable_l3_cache) as usize - ptr as usize }, - 25553usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(enable_l3_cache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).legacy_cache) as usize - ptr as usize }, - 25554usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(legacy_cache) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).enable_cpuid_0xb) as usize - ptr as usize }, - 25555usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(enable_cpuid_0xb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).full_cpuid_auto_level) as usize - ptr as usize }, - 25556usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(full_cpuid_auto_level) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vendor_cpuid_only) as usize - ptr as usize }, - 25557usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(vendor_cpuid_only) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).intel_pt_auto_level) as usize - ptr as usize }, - 25558usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(intel_pt_auto_level) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fill_mtrr_mask) as usize - ptr as usize }, - 25559usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(fill_mtrr_mask) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).host_phys_bits) as usize - ptr as usize }, - 25560usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(host_phys_bits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).host_phys_bits_limit) as usize - ptr as usize }, - 25561usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(host_phys_bits_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kvm_no_smi_migration) as usize - ptr as usize }, - 25562usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(kvm_no_smi_migration) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kvm_pv_enforce_cpuid) as usize - ptr as usize }, - 25563usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(kvm_pv_enforce_cpuid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phys_bits) as usize - ptr as usize }, - 25564usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(phys_bits) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).apic_state) as usize - ptr as usize }, - 25568usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(apic_state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpu_as_root) as usize - ptr as usize }, - 25576usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(cpu_as_root) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpu_as_mem) as usize - ptr as usize }, - 25584usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(cpu_as_mem) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).smram) as usize - ptr as usize }, - 25592usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(smram) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).machine_done) as usize - ptr as usize }, - 25600usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(machine_done) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kvm_msr_buf) as usize - ptr as usize }, - 25624usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(kvm_msr_buf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).node_id) as usize - ptr as usize }, - 25632usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(node_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).socket_id) as usize - ptr as usize }, - 25636usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(socket_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).die_id) as usize - ptr as usize }, - 25640usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(die_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).core_id) as usize - ptr as usize }, - 25644usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(core_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).thread_id) as usize - ptr as usize }, - 25648usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(thread_id) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).hv_max_vps) as usize - ptr as usize }, - 25652usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(hv_max_vps) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).xen_vapic) as usize - ptr as usize }, - 25656usize, - concat!( - "Offset of field: ", - stringify!(ArchCPU), - "::", - stringify!(xen_vapic) - ) - ); -} -impl Default for ArchCPU { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for ArchCPU { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! (f , "ArchCPU {{ parent_obj: {:?}, env: {:?}, vmsentry: {:?}, hyperv_vendor: {:?}, hyperv_synic_kvm_only: {:?}, hyperv_passthrough: {:?}, hyperv_no_nonarch_cs: {:?}, hyperv_vendor_id: {:?}, hyperv_interface_id: {:?}, hyperv_limits: {:?}, hyperv_enforce_cpuid: {:?}, check_cpuid: {:?}, enforce_cpuid: {:?}, force_features: {:?}, expose_kvm: {:?}, expose_tcg: {:?}, migratable: {:?}, migrate_smi_count: {:?}, max_features: {:?}, vmware_cpuid_freq: {:?}, cache_info_passthrough: {:?}, mwait: {:?}, filtered_features: {:?}, enable_pmu: {:?}, enable_lmce: {:?}, enable_l3_cache: {:?}, legacy_cache: {:?}, enable_cpuid_0xb: {:?}, full_cpuid_auto_level: {:?}, vendor_cpuid_only: {:?}, intel_pt_auto_level: {:?}, fill_mtrr_mask: {:?}, host_phys_bits: {:?}, kvm_no_smi_migration: {:?}, kvm_pv_enforce_cpuid: {:?}, apic_state: {:?}, cpu_as_root: {:?}, cpu_as_mem: {:?}, smram: {:?}, machine_done: {:?}, kvm_msr_buf: {:?}, xen_vapic: {:?} }}" , self . parent_obj , self . env , self . vmsentry , self . hyperv_vendor , self . hyperv_synic_kvm_only , self . hyperv_passthrough , self . hyperv_no_nonarch_cs , self . hyperv_vendor_id , self . hyperv_interface_id , self . hyperv_limits , self . hyperv_enforce_cpuid , self . check_cpuid , self . enforce_cpuid , self . force_features , self . expose_kvm , self . expose_tcg , self . migratable , self . migrate_smi_count , self . max_features , self . vmware_cpuid_freq , self . cache_info_passthrough , self . mwait , self . filtered_features , self . enable_pmu , self . enable_lmce , self . enable_l3_cache , self . legacy_cache , self . enable_cpuid_0xb , self . full_cpuid_auto_level , self . vendor_cpuid_only , self . intel_pt_auto_level , self . fill_mtrr_mask , self . host_phys_bits , self . kvm_no_smi_migration , self . kvm_pv_enforce_cpuid , self . apic_state , self . cpu_as_root , self . cpu_as_mem , self . smram , self . machine_done , self . kvm_msr_buf , self . xen_vapic) - } -} -extern "C" { - pub fn cpu_memory_rw_debug( - cpu: *mut CPUState, - addr: vaddr, - ptr: *mut ::std::os::raw::c_void, - len: usize, - is_write: bool, - ) -> ::std::os::raw::c_int; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RBNode { - pub rb_parent_color: usize, - pub rb_right: *mut RBNode, - pub rb_left: *mut RBNode, -} -#[test] -fn bindgen_test_layout_RBNode() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(RBNode)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(RBNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rb_parent_color) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RBNode), - "::", - stringify!(rb_parent_color) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rb_right) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(RBNode), - "::", - stringify!(rb_right) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rb_left) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(RBNode), - "::", - stringify!(rb_left) - ) - ); -} -impl Default for RBNode { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RBRoot { - pub rb_node: *mut RBNode, -} -#[test] -fn bindgen_test_layout_RBRoot() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(RBRoot)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(RBRoot)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rb_node) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RBRoot), - "::", - stringify!(rb_node) - ) - ); -} -impl Default for RBRoot { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct RBRootLeftCached { - pub rb_root: RBRoot, - pub rb_leftmost: *mut RBNode, -} -#[test] -fn bindgen_test_layout_RBRootLeftCached() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(RBRootLeftCached)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(RBRootLeftCached)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rb_root) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(RBRootLeftCached), - "::", - stringify!(rb_root) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rb_leftmost) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(RBRootLeftCached), - "::", - stringify!(rb_leftmost) - ) - ); -} -impl Default for RBRootLeftCached { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct IntervalTreeNode { - pub rb: RBNode, - pub start: u64, - pub last: u64, - pub subtree_last: u64, -} -#[test] -fn bindgen_test_layout_IntervalTreeNode() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(IntervalTreeNode)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(IntervalTreeNode)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).rb) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(IntervalTreeNode), - "::", - stringify!(rb) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(IntervalTreeNode), - "::", - stringify!(start) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).last) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(IntervalTreeNode), - "::", - stringify!(last) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).subtree_last) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(IntervalTreeNode), - "::", - stringify!(subtree_last) - ) - ); -} -impl Default for IntervalTreeNode { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub type IntervalTreeRoot = RBRootLeftCached; -pub type abi_ulong = target_ulong; -pub type abi_long = target_long; -extern "C" { - pub static mut guest_base: usize; -} -extern "C" { - #[doc = " --- Begin LibAFL code ---"] - pub fn pageflags_get_root() -> *mut IntervalTreeRoot; -} -extern "C" { - #[doc = " page_check_range\n @start: first byte of range\n @len: length of range\n @flags: flags required for each page\n\n Return true if every page in [@start, @start+@len) has @flags set.\n Return false if any page is unmapped. Thus testing flags == 0 is\n equivalent to testing for flags == PAGE_VALID."] - pub fn page_check_range( - start: target_ulong, - last: target_ulong, - flags: ::std::os::raw::c_int, - ) -> bool; -} -pub const MemOp_MO_8: MemOp = MemOp(0); -pub const MemOp_MO_16: MemOp = MemOp(1); -pub const MemOp_MO_32: MemOp = MemOp(2); -pub const MemOp_MO_64: MemOp = MemOp(3); -pub const MemOp_MO_128: MemOp = MemOp(4); -pub const MemOp_MO_256: MemOp = MemOp(5); -pub const MemOp_MO_512: MemOp = MemOp(6); -pub const MemOp_MO_1024: MemOp = MemOp(7); -pub const MemOp_MO_SIZE: MemOp = MemOp(7); -pub const MemOp_MO_SIGN: MemOp = MemOp(8); -pub const MemOp_MO_BSWAP: MemOp = MemOp(16); -pub const MemOp_MO_LE: MemOp = MemOp(0); -pub const MemOp_MO_BE: MemOp = MemOp(16); -pub const MemOp_MO_TE: MemOp = MemOp(0); -pub const MemOp_MO_ASHIFT: MemOp = MemOp(5); -pub const MemOp_MO_AMASK: MemOp = MemOp(224); -pub const MemOp_MO_UNALN: MemOp = MemOp(0); -pub const MemOp_MO_ALIGN_2: MemOp = MemOp(32); -pub const MemOp_MO_ALIGN_4: MemOp = MemOp(64); -pub const MemOp_MO_ALIGN_8: MemOp = MemOp(96); -pub const MemOp_MO_ALIGN_16: MemOp = MemOp(128); -pub const MemOp_MO_ALIGN_32: MemOp = MemOp(160); -pub const MemOp_MO_ALIGN_64: MemOp = MemOp(192); -pub const MemOp_MO_ALIGN: MemOp = MemOp(224); -pub const MemOp_MO_ATOM_SHIFT: MemOp = MemOp(8); -pub const MemOp_MO_ATOM_IFALIGN: MemOp = MemOp(0); -pub const MemOp_MO_ATOM_IFALIGN_PAIR: MemOp = MemOp(256); -pub const MemOp_MO_ATOM_WITHIN16: MemOp = MemOp(512); -pub const MemOp_MO_ATOM_WITHIN16_PAIR: MemOp = MemOp(768); -pub const MemOp_MO_ATOM_SUBALIGN: MemOp = MemOp(1024); -pub const MemOp_MO_ATOM_NONE: MemOp = MemOp(1280); -pub const MemOp_MO_ATOM_MASK: MemOp = MemOp(1792); -pub const MemOp_MO_UB: MemOp = MemOp(0); -pub const MemOp_MO_UW: MemOp = MemOp(1); -pub const MemOp_MO_UL: MemOp = MemOp(2); -pub const MemOp_MO_UQ: MemOp = MemOp(3); -pub const MemOp_MO_UO: MemOp = MemOp(4); -pub const MemOp_MO_SB: MemOp = MemOp(8); -pub const MemOp_MO_SW: MemOp = MemOp(9); -pub const MemOp_MO_SL: MemOp = MemOp(10); -pub const MemOp_MO_SQ: MemOp = MemOp(11); -pub const MemOp_MO_SO: MemOp = MemOp(12); -pub const MemOp_MO_LEUW: MemOp = MemOp(1); -pub const MemOp_MO_LEUL: MemOp = MemOp(2); -pub const MemOp_MO_LEUQ: MemOp = MemOp(3); -pub const MemOp_MO_LESW: MemOp = MemOp(9); -pub const MemOp_MO_LESL: MemOp = MemOp(10); -pub const MemOp_MO_LESQ: MemOp = MemOp(11); -pub const MemOp_MO_BEUW: MemOp = MemOp(17); -pub const MemOp_MO_BEUL: MemOp = MemOp(18); -pub const MemOp_MO_BEUQ: MemOp = MemOp(19); -pub const MemOp_MO_BESW: MemOp = MemOp(25); -pub const MemOp_MO_BESL: MemOp = MemOp(26); -pub const MemOp_MO_BESQ: MemOp = MemOp(27); -pub const MemOp_MO_TEUW: MemOp = MemOp(1); -pub const MemOp_MO_TEUL: MemOp = MemOp(2); -pub const MemOp_MO_TEUQ: MemOp = MemOp(3); -pub const MemOp_MO_TEUO: MemOp = MemOp(4); -pub const MemOp_MO_TESW: MemOp = MemOp(9); -pub const MemOp_MO_TESL: MemOp = MemOp(10); -pub const MemOp_MO_TESQ: MemOp = MemOp(11); -pub const MemOp_MO_SSIZE: MemOp = MemOp(15); -impl ::std::ops::BitOr for MemOp { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - MemOp(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for MemOp { - #[inline] - fn bitor_assign(&mut self, rhs: MemOp) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for MemOp { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - MemOp(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for MemOp { - #[inline] - fn bitand_assign(&mut self, rhs: MemOp) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct MemOp(pub ::std::os::raw::c_uint); -pub type MemOpIdx = u32; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct image_info { - pub load_bias: abi_ulong, - pub load_addr: abi_ulong, - pub start_code: abi_ulong, - pub end_code: abi_ulong, - pub start_data: abi_ulong, - pub end_data: abi_ulong, - pub brk: abi_ulong, - pub start_stack: abi_ulong, - pub stack_limit: abi_ulong, - pub vdso: abi_ulong, - pub entry: abi_ulong, - pub code_offset: abi_ulong, - pub data_offset: abi_ulong, - pub saved_auxv: abi_ulong, - pub auxv_len: abi_ulong, - pub argc: abi_ulong, - pub argv: abi_ulong, - pub envc: abi_ulong, - pub envp: abi_ulong, - pub file_string: abi_ulong, - pub elf_flags: u32, - pub personality: ::std::os::raw::c_int, - pub alignment: abi_ulong, - pub exec_stack: bool, - pub arg_strings: abi_ulong, - pub env_strings: abi_ulong, - pub loadmap_addr: abi_ulong, - pub nsegs: u16, - pub loadsegs: *mut ::std::os::raw::c_void, - pub pt_dynamic_addr: abi_ulong, - pub interpreter_loadmap_addr: abi_ulong, - pub interpreter_pt_dynamic_addr: abi_ulong, - pub other_info: *mut image_info, - pub note_flags: u32, -} -#[test] -fn bindgen_test_layout_image_info() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 264usize, - concat!("Size of: ", stringify!(image_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(image_info)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).load_bias) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(load_bias) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).load_addr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(load_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_code) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(start_code) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end_code) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(end_code) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_data) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(start_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end_data) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(end_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).brk) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(brk) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start_stack) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(start_stack) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).stack_limit) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(stack_limit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).vdso) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(vdso) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).entry) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(entry) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).code_offset) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(code_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data_offset) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(data_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).saved_auxv) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(saved_auxv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).auxv_len) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(auxv_len) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).argc) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(argc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).argv) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(argv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).envc) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(envc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).envp) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(envp) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).file_string) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(file_string) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).elf_flags) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(elf_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).personality) as usize - ptr as usize }, - 164usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(personality) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).alignment) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(alignment) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).exec_stack) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(exec_stack) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).arg_strings) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(arg_strings) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).env_strings) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(env_strings) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).loadmap_addr) as usize - ptr as usize }, - 200usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(loadmap_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).nsegs) as usize - ptr as usize }, - 208usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(nsegs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).loadsegs) as usize - ptr as usize }, - 216usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(loadsegs) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pt_dynamic_addr) as usize - ptr as usize }, - 224usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(pt_dynamic_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).interpreter_loadmap_addr) as usize - ptr as usize }, - 232usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(interpreter_loadmap_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).interpreter_pt_dynamic_addr) as usize - ptr as usize }, - 240usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(interpreter_pt_dynamic_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).other_info) as usize - ptr as usize }, - 248usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(other_info) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).note_flags) as usize - ptr as usize }, - 256usize, - concat!( - "Offset of field: ", - stringify!(image_info), - "::", - stringify!(note_flags) - ) - ); -} -impl Default for image_info { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct tb_tc { - pub ptr: *const ::std::os::raw::c_void, - pub size: usize, -} -#[test] -fn bindgen_test_layout_tb_tc() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(tb_tc)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(tb_tc)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ptr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(tb_tc), - "::", - stringify!(ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(tb_tc), - "::", - stringify!(size) - ) - ); -} -impl Default for tb_tc { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TranslationBlock { - pub pc: vaddr, - pub cs_base: u64, - pub flags: u32, - pub cflags: u32, - pub size: u16, - pub icount: u16, - pub tc: tb_tc, - pub itree: IntervalTreeNode, - pub jmp_lock: QemuSpin, - pub jmp_reset_offset: [u16; 2usize], - pub jmp_insn_offset: [u16; 2usize], - pub jmp_target_addr: [usize; 2usize], - pub jmp_list_head: usize, - pub jmp_list_next: [usize; 2usize], - pub jmp_dest: [usize; 2usize], -} -#[test] -fn bindgen_test_layout_TranslationBlock() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 168usize, - concat!("Size of: ", stringify!(TranslationBlock)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(TranslationBlock)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pc) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(pc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cs_base) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(cs_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cflags) as usize - ptr as usize }, - 20usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(cflags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).icount) as usize - ptr as usize }, - 26usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(icount) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).tc) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(tc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).itree) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(itree) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jmp_lock) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(jmp_lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jmp_reset_offset) as usize - ptr as usize }, - 100usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(jmp_reset_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jmp_insn_offset) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(jmp_insn_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jmp_target_addr) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(jmp_target_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jmp_list_head) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(jmp_list_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jmp_list_next) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(jmp_list_next) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).jmp_dest) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(TranslationBlock), - "::", - stringify!(jmp_dest) - ) - ); -} -impl Default for TranslationBlock { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - pub static mut exec_path: *mut ::std::os::raw::c_char; -} -extern "C" { - pub static mut mmap_next_start: abi_ulong; -} -extern "C" { - pub fn target_mprotect( - start: abi_ulong, - len: abi_ulong, - prot: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn target_mmap( - start: abi_ulong, - len: abi_ulong, - prot: ::std::os::raw::c_int, - flags: ::std::os::raw::c_int, - fd: ::std::os::raw::c_int, - offset: off_t, - ) -> abi_long; -} -extern "C" { - pub fn target_munmap(start: abi_ulong, len: abi_ulong) -> ::std::os::raw::c_int; -} -extern "C" { - #[doc = " read_self_maps:\n\n Read /proc/self/maps and return a tree of MapInfo structures."] - pub fn read_self_maps() -> *mut IntervalTreeRoot; -} -extern "C" { - #[doc = " free_self_maps:\n @info: an interval tree\n\n Free a tree of MapInfo structures."] - pub fn free_self_maps(root: *mut IntervalTreeRoot); -} -extern "C" { - pub fn libafl_qemu_set_breakpoint(pc: target_ulong) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_remove_breakpoint(pc: target_ulong) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_trigger_breakpoint(cpu: *mut CPUState); -} -extern "C" { - pub fn libafl_qemu_breakpoint_run(pc_next: vaddr); -} -pub const libafl_exit_reason_kind_INTERNAL: libafl_exit_reason_kind = libafl_exit_reason_kind(0); -pub const libafl_exit_reason_kind_BREAKPOINT: libafl_exit_reason_kind = libafl_exit_reason_kind(1); -pub const libafl_exit_reason_kind_SYNC_EXIT: libafl_exit_reason_kind = libafl_exit_reason_kind(2); -pub const libafl_exit_reason_kind_TIMEOUT: libafl_exit_reason_kind = libafl_exit_reason_kind(3); -impl ::std::ops::BitOr for libafl_exit_reason_kind { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - libafl_exit_reason_kind(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for libafl_exit_reason_kind { - #[inline] - fn bitor_assign(&mut self, rhs: libafl_exit_reason_kind) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for libafl_exit_reason_kind { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - libafl_exit_reason_kind(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for libafl_exit_reason_kind { - #[inline] - fn bitand_assign(&mut self, rhs: libafl_exit_reason_kind) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct libafl_exit_reason_kind(pub ::std::os::raw::c_uint); -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libafl_exit_reason_internal { - pub cause: ShutdownCause, - pub signal: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_libafl_exit_reason_internal() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(libafl_exit_reason_internal)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(libafl_exit_reason_internal)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cause) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason_internal), - "::", - stringify!(cause) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).signal) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason_internal), - "::", - stringify!(signal) - ) - ); -} -impl Default for libafl_exit_reason_internal { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct libafl_exit_reason_breakpoint { - pub addr: target_ulong, -} -#[test] -fn bindgen_test_layout_libafl_exit_reason_breakpoint() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(libafl_exit_reason_breakpoint)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libafl_exit_reason_breakpoint)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason_breakpoint), - "::", - stringify!(addr) - ) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct libafl_exit_reason_sync_exit {} -#[test] -fn bindgen_test_layout_libafl_exit_reason_sync_exit() { - assert_eq!( - ::std::mem::size_of::(), - 0usize, - concat!("Size of: ", stringify!(libafl_exit_reason_sync_exit)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(libafl_exit_reason_sync_exit)) - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct libafl_exit_reason_timeout {} -#[test] -fn bindgen_test_layout_libafl_exit_reason_timeout() { - assert_eq!( - ::std::mem::size_of::(), - 0usize, - concat!("Size of: ", stringify!(libafl_exit_reason_timeout)) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!("Alignment of ", stringify!(libafl_exit_reason_timeout)) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct libafl_exit_reason { - pub kind: libafl_exit_reason_kind, - pub cpu: *mut CPUState, - pub next_pc: vaddr, - pub data: libafl_exit_reason__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union libafl_exit_reason__bindgen_ty_1 { - pub internal: libafl_exit_reason_internal, - pub breakpoint: libafl_exit_reason_breakpoint, - pub sync_exit: libafl_exit_reason_sync_exit, - pub timeout: libafl_exit_reason_timeout, -} -#[test] -fn bindgen_test_layout_libafl_exit_reason__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(libafl_exit_reason__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libafl_exit_reason__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).internal) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason__bindgen_ty_1), - "::", - stringify!(internal) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).breakpoint) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason__bindgen_ty_1), - "::", - stringify!(breakpoint) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sync_exit) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason__bindgen_ty_1), - "::", - stringify!(sync_exit) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).timeout) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason__bindgen_ty_1), - "::", - stringify!(timeout) - ) - ); -} -impl Default for libafl_exit_reason__bindgen_ty_1 { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for libafl_exit_reason__bindgen_ty_1 { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!(f, "libafl_exit_reason__bindgen_ty_1 {{ union }}") - } -} -#[test] -fn bindgen_test_layout_libafl_exit_reason() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(libafl_exit_reason)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libafl_exit_reason)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kind) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason), - "::", - stringify!(kind) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpu) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason), - "::", - stringify!(cpu) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next_pc) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason), - "::", - stringify!(next_pc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libafl_exit_reason), - "::", - stringify!(data) - ) - ); -} -impl Default for libafl_exit_reason { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl ::std::fmt::Debug for libafl_exit_reason { - fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write!( - f, - "libafl_exit_reason {{ kind: {:?}, cpu: {:?}, data: {:?} }}", - self.kind, self.cpu, self.data - ) - } -} -extern "C" { - pub fn libafl_last_exit_cpu() -> *mut CPUState; -} -extern "C" { - pub fn libafl_exit_signal_vm_start(); -} -extern "C" { - pub fn libafl_exit_asap() -> bool; -} -extern "C" { - pub fn libafl_sync_exit_cpu(); -} -extern "C" { - pub fn libafl_exit_request_internal( - cpu: *mut CPUState, - pc: u64, - cause: ShutdownCause, - signal: ::std::os::raw::c_int, - ); -} -extern "C" { - pub fn libafl_exit_request_breakpoint(cpu: *mut CPUState, pc: target_ulong); -} -extern "C" { - pub fn libafl_exit_request_sync_backdoor(cpu: *mut CPUState, pc: target_ulong); -} -extern "C" { - pub fn libafl_get_exit_reason() -> *mut libafl_exit_reason; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libafl_mapinfo { - pub start: target_ulong, - pub end: target_ulong, - pub offset: target_ulong, - pub path: *const ::std::os::raw::c_char, - pub flags: ::std::os::raw::c_int, - pub is_priv: ::std::os::raw::c_int, - pub is_valid: bool, -} -#[test] -fn bindgen_test_layout_libafl_mapinfo() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(libafl_mapinfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libafl_mapinfo)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).start) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libafl_mapinfo), - "::", - stringify!(start) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).end) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libafl_mapinfo), - "::", - stringify!(end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libafl_mapinfo), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).path) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libafl_mapinfo), - "::", - stringify!(path) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).flags) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(libafl_mapinfo), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).is_priv) as usize - ptr as usize }, - 36usize, - concat!( - "Offset of field: ", - stringify!(libafl_mapinfo), - "::", - stringify!(is_priv) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).is_valid) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(libafl_mapinfo), - "::", - stringify!(is_valid) - ) - ); -} -impl Default for libafl_mapinfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - pub static mut libafl_dump_core_hook: - ::std::option::Option; -} -extern "C" { - pub static mut libafl_force_dfl: ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_dump_core_exec(signal: ::std::os::raw::c_int); -} -extern "C" { - pub fn libafl_qemu_handle_crash( - host_sig: ::std::os::raw::c_int, - info: *mut siginfo_t, - puc: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn libafl_maps_first(map_info: *mut IntervalTreeRoot) -> *mut IntervalTreeNode; -} -extern "C" { - pub fn libafl_maps_next( - pageflags_maps_node: *mut IntervalTreeNode, - proc_maps_node: *mut IntervalTreeRoot, - ret: *mut libafl_mapinfo, - ) -> *mut IntervalTreeNode; -} -extern "C" { - pub fn libafl_load_addr() -> u64; -} -extern "C" { - pub fn libafl_get_image_info() -> *mut image_info; -} -extern "C" { - pub fn libafl_get_brk() -> u64; -} -extern "C" { - pub fn libafl_set_brk(new_brk: u64) -> u64; -} -extern "C" { - pub fn libafl_qemu_init(argc: ::std::os::raw::c_int, argv: *mut *mut ::std::os::raw::c_char); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct AccelCPUClass { - pub parent_class: ObjectClass, - pub cpu_class_init: ::std::option::Option, - pub cpu_instance_init: ::std::option::Option, - pub cpu_target_realize: ::std::option::Option< - unsafe extern "C" fn(cpu: *mut CPUState, errp: *mut *mut Error) -> bool, - >, -} -#[test] -fn bindgen_test_layout_AccelCPUClass() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 120usize, - concat!("Size of: ", stringify!(AccelCPUClass)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(AccelCPUClass)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).parent_class) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(AccelCPUClass), - "::", - stringify!(parent_class) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpu_class_init) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(AccelCPUClass), - "::", - stringify!(cpu_class_init) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpu_instance_init) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(AccelCPUClass), - "::", - stringify!(cpu_instance_init) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).cpu_target_realize) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(AccelCPUClass), - "::", - stringify!(cpu_target_realize) - ) - ); -} -impl Default for AccelCPUClass { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -pub const qemu_plugin_mem_rw_QEMU_PLUGIN_MEM_R: qemu_plugin_mem_rw = qemu_plugin_mem_rw(1); -pub const qemu_plugin_mem_rw_QEMU_PLUGIN_MEM_W: qemu_plugin_mem_rw = qemu_plugin_mem_rw(2); -pub const qemu_plugin_mem_rw_QEMU_PLUGIN_MEM_RW: qemu_plugin_mem_rw = qemu_plugin_mem_rw(3); -impl ::std::ops::BitOr for qemu_plugin_mem_rw { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - qemu_plugin_mem_rw(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for qemu_plugin_mem_rw { - #[inline] - fn bitor_assign(&mut self, rhs: qemu_plugin_mem_rw) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for qemu_plugin_mem_rw { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - qemu_plugin_mem_rw(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for qemu_plugin_mem_rw { - #[inline] - fn bitand_assign(&mut self, rhs: qemu_plugin_mem_rw) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct qemu_plugin_mem_rw(pub ::std::os::raw::c_uint); -#[doc = " typedef qemu_plugin_meminfo_t - opaque memory transaction handle\n\n This can be further queried using the qemu_plugin_mem_* query\n functions."] -pub type qemu_plugin_meminfo_t = u32; -extern "C" { - #[doc = " qemu_plugin_get_hwaddr() - return handle for memory operation\n @info: opaque memory info structure\n @vaddr: the virtual address of the memory operation\n\n For system emulation returns a qemu_plugin_hwaddr handle to query\n details about the actual physical address backing the virtual\n address. For linux-user guests it just returns NULL.\n\n This handle is *only* valid for the duration of the callback. Any\n information about the handle should be recovered before the\n callback returns."] - pub fn qemu_plugin_get_hwaddr( - info: qemu_plugin_meminfo_t, - vaddr: u64, - ) -> *mut qemu_plugin_hwaddr; -} -extern "C" { - #[doc = " qemu_plugin_hwaddr_phys_addr() - query physical address for memory operation\n @haddr: address handle from qemu_plugin_get_hwaddr()\n\n Returns the physical address associated with the memory operation\n\n Note that the returned physical address may not be unique if you are dealing\n with multiple address spaces."] - pub fn qemu_plugin_hwaddr_phys_addr(haddr: *const qemu_plugin_hwaddr) -> u64; -} -#[doc = " struct CPUPluginState - per-CPU state for plugins\n @event_mask: plugin event bitmap. Modified only via async work."] -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct CPUPluginState { - pub event_mask: [::std::os::raw::c_ulong; 1usize], -} -#[test] -fn bindgen_test_layout_CPUPluginState() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(CPUPluginState)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(CPUPluginState)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).event_mask) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(CPUPluginState), - "::", - stringify!(event_mask) - ) - ); -} -pub const TCGReg_TCG_REG_EAX: TCGReg = TCGReg(0); -pub const TCGReg_TCG_REG_ECX: TCGReg = TCGReg(1); -pub const TCGReg_TCG_REG_EDX: TCGReg = TCGReg(2); -pub const TCGReg_TCG_REG_EBX: TCGReg = TCGReg(3); -pub const TCGReg_TCG_REG_ESP: TCGReg = TCGReg(4); -pub const TCGReg_TCG_REG_EBP: TCGReg = TCGReg(5); -pub const TCGReg_TCG_REG_ESI: TCGReg = TCGReg(6); -pub const TCGReg_TCG_REG_EDI: TCGReg = TCGReg(7); -pub const TCGReg_TCG_REG_R8: TCGReg = TCGReg(8); -pub const TCGReg_TCG_REG_R9: TCGReg = TCGReg(9); -pub const TCGReg_TCG_REG_R10: TCGReg = TCGReg(10); -pub const TCGReg_TCG_REG_R11: TCGReg = TCGReg(11); -pub const TCGReg_TCG_REG_R12: TCGReg = TCGReg(12); -pub const TCGReg_TCG_REG_R13: TCGReg = TCGReg(13); -pub const TCGReg_TCG_REG_R14: TCGReg = TCGReg(14); -pub const TCGReg_TCG_REG_R15: TCGReg = TCGReg(15); -pub const TCGReg_TCG_REG_XMM0: TCGReg = TCGReg(16); -pub const TCGReg_TCG_REG_XMM1: TCGReg = TCGReg(17); -pub const TCGReg_TCG_REG_XMM2: TCGReg = TCGReg(18); -pub const TCGReg_TCG_REG_XMM3: TCGReg = TCGReg(19); -pub const TCGReg_TCG_REG_XMM4: TCGReg = TCGReg(20); -pub const TCGReg_TCG_REG_XMM5: TCGReg = TCGReg(21); -pub const TCGReg_TCG_REG_XMM6: TCGReg = TCGReg(22); -pub const TCGReg_TCG_REG_XMM7: TCGReg = TCGReg(23); -pub const TCGReg_TCG_REG_XMM8: TCGReg = TCGReg(24); -pub const TCGReg_TCG_REG_XMM9: TCGReg = TCGReg(25); -pub const TCGReg_TCG_REG_XMM10: TCGReg = TCGReg(26); -pub const TCGReg_TCG_REG_XMM11: TCGReg = TCGReg(27); -pub const TCGReg_TCG_REG_XMM12: TCGReg = TCGReg(28); -pub const TCGReg_TCG_REG_XMM13: TCGReg = TCGReg(29); -pub const TCGReg_TCG_REG_XMM14: TCGReg = TCGReg(30); -pub const TCGReg_TCG_REG_XMM15: TCGReg = TCGReg(31); -pub const TCGReg_TCG_REG_RAX: TCGReg = TCGReg(0); -pub const TCGReg_TCG_REG_RCX: TCGReg = TCGReg(1); -pub const TCGReg_TCG_REG_RDX: TCGReg = TCGReg(2); -pub const TCGReg_TCG_REG_RBX: TCGReg = TCGReg(3); -pub const TCGReg_TCG_REG_RSP: TCGReg = TCGReg(4); -pub const TCGReg_TCG_REG_RBP: TCGReg = TCGReg(5); -pub const TCGReg_TCG_REG_RSI: TCGReg = TCGReg(6); -pub const TCGReg_TCG_REG_RDI: TCGReg = TCGReg(7); -pub const TCGReg_TCG_AREG0: TCGReg = TCGReg(5); -pub const TCGReg_TCG_REG_CALL_STACK: TCGReg = TCGReg(4); -impl ::std::ops::BitOr for TCGReg { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - TCGReg(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for TCGReg { - #[inline] - fn bitor_assign(&mut self, rhs: TCGReg) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for TCGReg { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - TCGReg(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for TCGReg { - #[inline] - fn bitand_assign(&mut self, rhs: TCGReg) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct TCGReg(pub ::std::os::raw::c_uint); -pub const TCGType_TCG_TYPE_I32: TCGType = TCGType(0); -pub const TCGType_TCG_TYPE_I64: TCGType = TCGType(1); -pub const TCGType_TCG_TYPE_I128: TCGType = TCGType(2); -pub const TCGType_TCG_TYPE_V64: TCGType = TCGType(3); -pub const TCGType_TCG_TYPE_V128: TCGType = TCGType(4); -pub const TCGType_TCG_TYPE_V256: TCGType = TCGType(5); -pub const TCGType_TCG_TYPE_REG: TCGType = TCGType(1); -pub const TCGType_TCG_TYPE_PTR: TCGType = TCGType(1); -impl ::std::ops::BitOr for TCGType { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - TCGType(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for TCGType { - #[inline] - fn bitor_assign(&mut self, rhs: TCGType) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for TCGType { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - TCGType(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for TCGType { - #[inline] - fn bitand_assign(&mut self, rhs: TCGType) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct TCGType(pub ::std::os::raw::c_uint); -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TCGv_i64_d { - _unused: [u8; 0], -} -pub type TCGv_i64 = *mut TCGv_i64_d; -pub const TCGTempVal_TEMP_VAL_DEAD: TCGTempVal = TCGTempVal(0); -pub const TCGTempVal_TEMP_VAL_REG: TCGTempVal = TCGTempVal(1); -pub const TCGTempVal_TEMP_VAL_MEM: TCGTempVal = TCGTempVal(2); -pub const TCGTempVal_TEMP_VAL_CONST: TCGTempVal = TCGTempVal(3); -impl ::std::ops::BitOr for TCGTempVal { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - TCGTempVal(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for TCGTempVal { - #[inline] - fn bitor_assign(&mut self, rhs: TCGTempVal) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for TCGTempVal { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - TCGTempVal(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for TCGTempVal { - #[inline] - fn bitand_assign(&mut self, rhs: TCGTempVal) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct TCGTempVal(pub ::std::os::raw::c_uint); -pub const TCGTempKind_TEMP_EBB: TCGTempKind = TCGTempKind(0); -pub const TCGTempKind_TEMP_TB: TCGTempKind = TCGTempKind(1); -pub const TCGTempKind_TEMP_GLOBAL: TCGTempKind = TCGTempKind(2); -pub const TCGTempKind_TEMP_FIXED: TCGTempKind = TCGTempKind(3); -pub const TCGTempKind_TEMP_CONST: TCGTempKind = TCGTempKind(4); -impl ::std::ops::BitOr for TCGTempKind { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - TCGTempKind(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for TCGTempKind { - #[inline] - fn bitor_assign(&mut self, rhs: TCGTempKind) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for TCGTempKind { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - TCGTempKind(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for TCGTempKind { - #[inline] - fn bitand_assign(&mut self, rhs: TCGTempKind) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct TCGTempKind(pub ::std::os::raw::c_uint); -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TCGTemp { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 6usize]>, - pub val: i64, - pub mem_base: *mut TCGTemp, - pub mem_offset: isize, - pub name: *const ::std::os::raw::c_char, - pub state: usize, - pub state_ptr: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout_TCGTemp() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(TCGTemp)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(TCGTemp)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(TCGTemp), - "::", - stringify!(val) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mem_base) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(TCGTemp), - "::", - stringify!(mem_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mem_offset) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(TCGTemp), - "::", - stringify!(mem_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(TCGTemp), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).state) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(TCGTemp), - "::", - stringify!(state) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).state_ptr) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(TCGTemp), - "::", - stringify!(state_ptr) - ) - ); -} -impl Default for TCGTemp { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl TCGTemp { - #[inline] - pub fn reg(&self) -> TCGReg { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } - } - #[inline] - pub fn set_reg(&mut self, val: TCGReg) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 8u8, val as u64) - } - } - #[inline] - pub fn val_type(&self) -> TCGTempVal { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } - } - #[inline] - pub fn set_val_type(&mut self, val: TCGTempVal) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 8u8, val as u64) - } - } - #[inline] - pub fn base_type(&self) -> TCGType { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u32) } - } - #[inline] - pub fn set_base_type(&mut self, val: TCGType) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 8u8, val as u64) - } - } - #[inline] - pub fn type_(&self) -> TCGType { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 8u8) as u32) } - } - #[inline] - pub fn set_type(&mut self, val: TCGType) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(24usize, 8u8, val as u64) - } - } - #[inline] - pub fn kind(&self) -> TCGTempKind { - unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 3u8) as u32) } - } - #[inline] - pub fn set_kind(&mut self, val: TCGTempKind) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(32usize, 3u8, val as u64) - } - } - #[inline] - pub fn indirect_reg(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u32) } - } - #[inline] - pub fn set_indirect_reg(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(35usize, 1u8, val as u64) - } - } - #[inline] - pub fn indirect_base(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(36usize, 1u8) as u32) } - } - #[inline] - pub fn set_indirect_base(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(36usize, 1u8, val as u64) - } - } - #[inline] - pub fn mem_coherent(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u32) } - } - #[inline] - pub fn set_mem_coherent(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(37usize, 1u8, val as u64) - } - } - #[inline] - pub fn mem_allocated(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 1u8) as u32) } - } - #[inline] - pub fn set_mem_allocated(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(38usize, 1u8, val as u64) - } - } - #[inline] - pub fn temp_allocated(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(39usize, 1u8) as u32) } - } - #[inline] - pub fn set_temp_allocated(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(39usize, 1u8, val as u64) - } - } - #[inline] - pub fn temp_subindex(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 2u8) as u32) } - } - #[inline] - pub fn set_temp_subindex(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(40usize, 2u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - reg: TCGReg, - val_type: TCGTempVal, - base_type: TCGType, - type_: TCGType, - kind: TCGTempKind, - indirect_reg: ::std::os::raw::c_uint, - indirect_base: ::std::os::raw::c_uint, - mem_coherent: ::std::os::raw::c_uint, - mem_allocated: ::std::os::raw::c_uint, - temp_allocated: ::std::os::raw::c_uint, - temp_subindex: ::std::os::raw::c_uint, - ) -> __BindgenBitfieldUnit<[u8; 6usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 6usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 8u8, { - let reg: u32 = unsafe { ::std::mem::transmute(reg) }; - reg as u64 - }); - __bindgen_bitfield_unit.set(8usize, 8u8, { - let val_type: u32 = unsafe { ::std::mem::transmute(val_type) }; - val_type as u64 - }); - __bindgen_bitfield_unit.set(16usize, 8u8, { - let base_type: u32 = unsafe { ::std::mem::transmute(base_type) }; - base_type as u64 - }); - __bindgen_bitfield_unit.set(24usize, 8u8, { - let type_: u32 = unsafe { ::std::mem::transmute(type_) }; - type_ as u64 - }); - __bindgen_bitfield_unit.set(32usize, 3u8, { - let kind: u32 = unsafe { ::std::mem::transmute(kind) }; - kind as u64 - }); - __bindgen_bitfield_unit.set(35usize, 1u8, { - let indirect_reg: u32 = unsafe { ::std::mem::transmute(indirect_reg) }; - indirect_reg as u64 - }); - __bindgen_bitfield_unit.set(36usize, 1u8, { - let indirect_base: u32 = unsafe { ::std::mem::transmute(indirect_base) }; - indirect_base as u64 - }); - __bindgen_bitfield_unit.set(37usize, 1u8, { - let mem_coherent: u32 = unsafe { ::std::mem::transmute(mem_coherent) }; - mem_coherent as u64 - }); - __bindgen_bitfield_unit.set(38usize, 1u8, { - let mem_allocated: u32 = unsafe { ::std::mem::transmute(mem_allocated) }; - mem_allocated as u64 - }); - __bindgen_bitfield_unit.set(39usize, 1u8, { - let temp_allocated: u32 = unsafe { ::std::mem::transmute(temp_allocated) }; - temp_allocated as u64 - }); - __bindgen_bitfield_unit.set(40usize, 2u8, { - let temp_subindex: u32 = unsafe { ::std::mem::transmute(temp_subindex) }; - temp_subindex as u64 - }); - __bindgen_bitfield_unit - } -} -pub const TCGCallReturnKind_TCG_CALL_RET_NORMAL: TCGCallReturnKind = TCGCallReturnKind(0); -pub const TCGCallReturnKind_TCG_CALL_RET_BY_REF: TCGCallReturnKind = TCGCallReturnKind(1); -pub const TCGCallReturnKind_TCG_CALL_RET_BY_VEC: TCGCallReturnKind = TCGCallReturnKind(2); -impl ::std::ops::BitOr for TCGCallReturnKind { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - TCGCallReturnKind(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for TCGCallReturnKind { - #[inline] - fn bitor_assign(&mut self, rhs: TCGCallReturnKind) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for TCGCallReturnKind { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - TCGCallReturnKind(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for TCGCallReturnKind { - #[inline] - fn bitand_assign(&mut self, rhs: TCGCallReturnKind) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct TCGCallReturnKind(pub ::std::os::raw::c_uint); -pub const TCGCallArgumentKind_TCG_CALL_ARG_NORMAL: TCGCallArgumentKind = TCGCallArgumentKind(0); -pub const TCGCallArgumentKind_TCG_CALL_ARG_EVEN: TCGCallArgumentKind = TCGCallArgumentKind(1); -pub const TCGCallArgumentKind_TCG_CALL_ARG_EXTEND: TCGCallArgumentKind = TCGCallArgumentKind(2); -pub const TCGCallArgumentKind_TCG_CALL_ARG_EXTEND_U: TCGCallArgumentKind = TCGCallArgumentKind(3); -pub const TCGCallArgumentKind_TCG_CALL_ARG_EXTEND_S: TCGCallArgumentKind = TCGCallArgumentKind(4); -pub const TCGCallArgumentKind_TCG_CALL_ARG_BY_REF: TCGCallArgumentKind = TCGCallArgumentKind(5); -pub const TCGCallArgumentKind_TCG_CALL_ARG_BY_REF_N: TCGCallArgumentKind = TCGCallArgumentKind(6); -impl ::std::ops::BitOr for TCGCallArgumentKind { - type Output = Self; - #[inline] - fn bitor(self, other: Self) -> Self { - TCGCallArgumentKind(self.0 | other.0) - } -} -impl ::std::ops::BitOrAssign for TCGCallArgumentKind { - #[inline] - fn bitor_assign(&mut self, rhs: TCGCallArgumentKind) { - self.0 |= rhs.0; - } -} -impl ::std::ops::BitAnd for TCGCallArgumentKind { - type Output = Self; - #[inline] - fn bitand(self, other: Self) -> Self { - TCGCallArgumentKind(self.0 & other.0) - } -} -impl ::std::ops::BitAndAssign for TCGCallArgumentKind { - #[inline] - fn bitand_assign(&mut self, rhs: TCGCallArgumentKind) { - self.0 &= rhs.0; - } -} -#[repr(transparent)] -#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] -pub struct TCGCallArgumentKind(pub ::std::os::raw::c_uint); -#[repr(C)] -#[repr(align(4))] -#[derive(Debug, Copy, Clone)] -pub struct TCGCallArgumentLoc { - pub _bitfield_align_1: [u8; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, -} -#[test] -fn bindgen_test_layout_TCGCallArgumentLoc() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(TCGCallArgumentLoc)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(TCGCallArgumentLoc)) - ); -} -impl Default for TCGCallArgumentLoc { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl TCGCallArgumentLoc { - #[inline] - pub fn kind(&self) -> TCGCallArgumentKind { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } - } - #[inline] - pub fn set_kind(&mut self, val: TCGCallArgumentKind) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 8u8, val as u64) - } - } - #[inline] - pub fn arg_slot(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } - } - #[inline] - pub fn set_arg_slot(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 8u8, val as u64) - } - } - #[inline] - pub fn ref_slot(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 8u8) as u32) } - } - #[inline] - pub fn set_ref_slot(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(16usize, 8u8, val as u64) - } - } - #[inline] - pub fn arg_idx(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 4u8) as u32) } - } - #[inline] - pub fn set_arg_idx(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(24usize, 4u8, val as u64) - } - } - #[inline] - pub fn tmp_subindex(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 2u8) as u32) } - } - #[inline] - pub fn set_tmp_subindex(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(28usize, 2u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - kind: TCGCallArgumentKind, - arg_slot: ::std::os::raw::c_uint, - ref_slot: ::std::os::raw::c_uint, - arg_idx: ::std::os::raw::c_uint, - tmp_subindex: ::std::os::raw::c_uint, - ) -> __BindgenBitfieldUnit<[u8; 4usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 8u8, { - let kind: u32 = unsafe { ::std::mem::transmute(kind) }; - kind as u64 - }); - __bindgen_bitfield_unit.set(8usize, 8u8, { - let arg_slot: u32 = unsafe { ::std::mem::transmute(arg_slot) }; - arg_slot as u64 - }); - __bindgen_bitfield_unit.set(16usize, 8u8, { - let ref_slot: u32 = unsafe { ::std::mem::transmute(ref_slot) }; - ref_slot as u64 - }); - __bindgen_bitfield_unit.set(24usize, 4u8, { - let arg_idx: u32 = unsafe { ::std::mem::transmute(arg_idx) }; - arg_idx as u64 - }); - __bindgen_bitfield_unit.set(28usize, 2u8, { - let tmp_subindex: u32 = unsafe { ::std::mem::transmute(tmp_subindex) }; - tmp_subindex as u64 - }); - __bindgen_bitfield_unit - } -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct TCGHelperInfo { - pub func: *mut ::std::os::raw::c_void, - pub name: *const ::std::os::raw::c_char, - pub init: usize, - pub _bitfield_align_1: [u32; 0], - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, - pub in_: [TCGCallArgumentLoc; 14usize], -} -#[test] -fn bindgen_test_layout_TCGHelperInfo() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 88usize, - concat!("Size of: ", stringify!(TCGHelperInfo)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(TCGHelperInfo)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).func) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(TCGHelperInfo), - "::", - stringify!(func) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(TCGHelperInfo), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).init) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(TCGHelperInfo), - "::", - stringify!(init) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).in_) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(TCGHelperInfo), - "::", - stringify!(in_) - ) - ); -} -impl Default for TCGHelperInfo { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -impl TCGHelperInfo { - #[inline] - pub fn typemask(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 32u8) as u32) } - } - #[inline] - pub fn set_typemask(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(0usize, 32u8, val as u64) - } - } - #[inline] - pub fn flags(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 8u8) as u32) } - } - #[inline] - pub fn set_flags(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(32usize, 8u8, val as u64) - } - } - #[inline] - pub fn nr_in(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 8u8) as u32) } - } - #[inline] - pub fn set_nr_in(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(40usize, 8u8, val as u64) - } - } - #[inline] - pub fn nr_out(&self) -> ::std::os::raw::c_uint { - unsafe { ::std::mem::transmute(self._bitfield_1.get(48usize, 8u8) as u32) } - } - #[inline] - pub fn set_nr_out(&mut self, val: ::std::os::raw::c_uint) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(48usize, 8u8, val as u64) - } - } - #[inline] - pub fn out_kind(&self) -> TCGCallReturnKind { - unsafe { ::std::mem::transmute(self._bitfield_1.get(56usize, 8u8) as u32) } - } - #[inline] - pub fn set_out_kind(&mut self, val: TCGCallReturnKind) { - unsafe { - let val: u32 = ::std::mem::transmute(val); - self._bitfield_1.set(56usize, 8u8, val as u64) - } - } - #[inline] - pub fn new_bitfield_1( - typemask: ::std::os::raw::c_uint, - flags: ::std::os::raw::c_uint, - nr_in: ::std::os::raw::c_uint, - nr_out: ::std::os::raw::c_uint, - out_kind: TCGCallReturnKind, - ) -> __BindgenBitfieldUnit<[u8; 8usize]> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); - __bindgen_bitfield_unit.set(0usize, 32u8, { - let typemask: u32 = unsafe { ::std::mem::transmute(typemask) }; - typemask as u64 - }); - __bindgen_bitfield_unit.set(32usize, 8u8, { - let flags: u32 = unsafe { ::std::mem::transmute(flags) }; - flags as u64 - }); - __bindgen_bitfield_unit.set(40usize, 8u8, { - let nr_in: u32 = unsafe { ::std::mem::transmute(nr_in) }; - nr_in as u64 - }); - __bindgen_bitfield_unit.set(48usize, 8u8, { - let nr_out: u32 = unsafe { ::std::mem::transmute(nr_out) }; - nr_out as u64 - }); - __bindgen_bitfield_unit.set(56usize, 8u8, { - let out_kind: u32 = unsafe { ::std::mem::transmute(out_kind) }; - out_kind as u64 - }); - __bindgen_bitfield_unit - } -} -pub type TCGv = TCGv_i64; -#[doc = " struct qemu_plugin_hwaddr - opaque hw address handle"] -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct qemu_plugin_hwaddr { - pub is_io: bool, - pub is_store: bool, - pub phys_addr: hwaddr, - pub mr: *mut MemoryRegion, -} -#[test] -fn bindgen_test_layout_qemu_plugin_hwaddr() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(qemu_plugin_hwaddr)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(qemu_plugin_hwaddr)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).is_io) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(qemu_plugin_hwaddr), - "::", - stringify!(is_io) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).is_store) as usize - ptr as usize }, - 1usize, - concat!( - "Offset of field: ", - stringify!(qemu_plugin_hwaddr), - "::", - stringify!(is_store) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).phys_addr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(qemu_plugin_hwaddr), - "::", - stringify!(phys_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).mr) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(qemu_plugin_hwaddr), - "::", - stringify!(mr) - ) - ); -} -impl Default for qemu_plugin_hwaddr { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - #[doc = " tlb_plugin_lookup: query last TLB lookup\n @cpu: cpu environment\n\n This function can be used directly after a memory operation to\n query information about the access. It is used by the plugin\n infrastructure to expose more information about the address.\n\n It would only fail if not called from an instrumented memory access\n which would be an abuse of the API."] - pub fn tlb_plugin_lookup( - cpu: *mut CPUState, - addr: vaddr, - mmu_idx: ::std::os::raw::c_int, - is_store: bool, - data: *mut qemu_plugin_hwaddr, - ) -> bool; -} -extern "C" { - pub fn libafl_page_from_addr(addr: target_ulong) -> target_ulong; -} -extern "C" { - pub fn libafl_qemu_get_cpu(cpu_index: ::std::os::raw::c_int) -> *mut CPUState; -} -extern "C" { - pub fn libafl_qemu_num_cpus() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_current_cpu() -> *mut CPUState; -} -extern "C" { - pub fn libafl_qemu_cpu_index(arg1: *mut CPUState) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_write_reg( - cpu: *mut CPUState, - reg: ::std::os::raw::c_int, - val: *mut u8, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_read_reg( - cpu: *mut CPUState, - reg: ::std::os::raw::c_int, - val: *mut u8, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_num_regs(cpu: *mut CPUState) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_flush_jit(); -} -extern "C" { - pub fn libafl_breakpoint_invalidate(cpu: *mut CPUState, pc: target_ulong); -} -extern "C" { - pub fn libafl_qemu_main() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_run() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_set_qemu_env(env: *mut CPUArchState); -} -extern "C" { - pub fn libafl_qemu_add_gdb_cmd( - callback: ::std::option::Option< - unsafe extern "C" fn( - arg1: *mut ::std::os::raw::c_void, - arg2: *mut u8, - arg3: usize, - ) -> bool, - >, - data: *mut ::std::os::raw::c_void, - ); -} -extern "C" { - pub fn libafl_qemu_gdb_reply(buf: *const u8, len: usize); -} -extern "C" { - pub fn libafl_qemu_gdb_exec() -> bool; -} -extern "C" { - pub fn libafl_jit_trace_edge_hitcount(data: u64, id: u64) -> usize; -} -extern "C" { - pub fn libafl_jit_trace_edge_single(data: u64, id: u64) -> usize; -} -extern "C" { - pub fn libafl_jit_trace_block_hitcount(data: u64, id: u64) -> usize; -} -extern "C" { - pub fn libafl_jit_trace_block_single(data: u64, id: u64) -> usize; -} -extern "C" { - pub fn libafl_qemu_host_page_size() -> usize; -} -extern "C" { - pub fn libafl_tcg_gen_asan(addr: *mut TCGTemp, size: usize); -} -extern "C" { - pub fn libafl_gen_backdoor(pc: target_ulong); -} -extern "C" { - pub fn libafl_add_backdoor_hook( - exec: ::std::option::Option< - unsafe extern "C" fn(data: u64, cpu: *mut CPUArchState, pc: target_ulong), - >, - data: u64, - ) -> usize; -} -extern "C" { - pub fn libafl_qemu_remove_backdoor_hook( - num: usize, - invalidate: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_hook_backdoor_run(pc_next: vaddr); -} -extern "C" { - pub fn libafl_qemu_hook_block_post_gen(tb: *mut TranslationBlock, pc: vaddr); -} -extern "C" { - pub fn libafl_qemu_hook_block_run(pc: target_ulong); -} -extern "C" { - pub fn libafl_qemu_block_hook_set_jit( - num: usize, - jit: ::std::option::Option usize>, - ) -> bool; -} -extern "C" { - pub fn libafl_qemu_remove_block_hook( - num: usize, - invalidate: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_add_block_hook( - gen: ::std::option::Option u64>, - post_gen: ::std::option::Option< - unsafe extern "C" fn(data: u64, pc: target_ulong, block_length: target_ulong), - >, - exec: ::std::option::Option, - data: u64, - ) -> usize; -} -extern "C" { - pub fn libafl_gen_cmp(pc: target_ulong, op0: TCGv, op1: TCGv, ot: MemOp); -} -extern "C" { - pub fn libafl_add_cmp_hook( - gen: ::std::option::Option< - unsafe extern "C" fn(data: u64, pc: target_ulong, size: usize) -> u64, - >, - exec1: ::std::option::Option, - exec2: ::std::option::Option, - exec4: ::std::option::Option, - exec8: ::std::option::Option, - data: u64, - ) -> usize; -} -extern "C" { - pub fn libafl_qemu_remove_cmp_hook( - num: usize, - invalidate: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_gen_edge( - cpu: *mut CPUState, - src_block: target_ulong, - dst_block: target_ulong, - exit_n: ::std::os::raw::c_int, - cs_base: target_ulong, - flags: u32, - cflags: ::std::os::raw::c_int, - ) -> *mut TranslationBlock; -} -extern "C" { - pub fn libafl_add_edge_hook( - gen: ::std::option::Option< - unsafe extern "C" fn(data: u64, src: target_ulong, dst: target_ulong) -> u64, - >, - exec: ::std::option::Option, - data: u64, - ) -> usize; -} -extern "C" { - pub fn libafl_qemu_edge_hook_set_jit( - num: usize, - jit: ::std::option::Option usize>, - ) -> bool; -} -extern "C" { - pub fn libafl_qemu_remove_edge_hook( - num: usize, - invalidate: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_hook_edge_gen(src_block: target_ulong, dst_block: target_ulong) -> bool; -} -extern "C" { - pub fn libafl_qemu_hook_edge_run(); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libafl_instruction_hook { - pub data: u64, - pub num: usize, - pub addr: target_ulong, - pub helper_info: TCGHelperInfo, - pub next: *mut libafl_instruction_hook, -} -#[test] -fn bindgen_test_layout_libafl_instruction_hook() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 120usize, - concat!("Size of: ", stringify!(libafl_instruction_hook)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libafl_instruction_hook)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libafl_instruction_hook), - "::", - stringify!(data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).num) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libafl_instruction_hook), - "::", - stringify!(num) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).addr) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libafl_instruction_hook), - "::", - stringify!(addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).helper_info) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libafl_instruction_hook), - "::", - stringify!(helper_info) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).next) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(libafl_instruction_hook), - "::", - stringify!(next) - ) - ); -} -impl Default for libafl_instruction_hook { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } - } -} -extern "C" { - pub fn libafl_qemu_add_instruction_hooks( - pc: target_ulong, - callback: ::std::option::Option, - data: u64, - invalidate: ::std::os::raw::c_int, - ) -> usize; -} -extern "C" { - pub fn libafl_qemu_remove_instruction_hook( - num: usize, - invalidate: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_remove_instruction_hooks_at( - addr: target_ulong, - invalidate: ::std::os::raw::c_int, - ) -> usize; -} -extern "C" { - pub fn libafl_search_instruction_hook(addr: target_ulong) -> *mut libafl_instruction_hook; -} -extern "C" { - pub fn libafl_qemu_hook_instruction_run(pc_next: vaddr); -} -extern "C" { - pub fn libafl_gen_read(addr: *mut TCGTemp, oi: MemOpIdx); -} -extern "C" { - pub fn libafl_gen_write(addr: *mut TCGTemp, oi: MemOpIdx); -} -extern "C" { - pub fn libafl_add_read_hook( - gen: ::std::option::Option< - unsafe extern "C" fn( - data: u64, - pc: target_ulong, - addr: *mut TCGTemp, - oi: MemOpIdx, - ) -> u64, - >, - exec1: ::std::option::Option, - exec2: ::std::option::Option, - exec4: ::std::option::Option, - exec8: ::std::option::Option, - execN: ::std::option::Option< - unsafe extern "C" fn(data: u64, id: u64, addr: target_ulong, size: usize), - >, - data: u64, - ) -> usize; -} -extern "C" { - pub fn libafl_add_write_hook( - gen: ::std::option::Option< - unsafe extern "C" fn( - data: u64, - pc: target_ulong, - addr: *mut TCGTemp, - oi: MemOpIdx, - ) -> u64, - >, - exec1: ::std::option::Option, - exec2: ::std::option::Option, - exec4: ::std::option::Option, - exec8: ::std::option::Option, - execN: ::std::option::Option< - unsafe extern "C" fn(data: u64, id: u64, addr: target_ulong, size: usize), - >, - data: u64, - ) -> usize; -} -extern "C" { - pub fn libafl_qemu_remove_read_hook( - num: usize, - invalidate: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_remove_write_hook( - num: usize, - invalidate: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -pub type libafl_cpu_run_fn = - ::std::option::Option; -extern "C" { - pub fn libafl_hook_cpu_run_add( - pre_cpu_run: libafl_cpu_run_fn, - post_cpu_run: libafl_cpu_run_fn, - data: u64, - ) -> usize; -} -extern "C" { - pub fn libafl_hook_cpu_run_remove(num: usize) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_remove_cpu_run_hook(num: usize) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_hook_cpu_run_pre_exec(cpu: *mut CPUState); -} -extern "C" { - pub fn libafl_hook_cpu_run_post_exec(cpu: *mut CPUState); -} -extern "C" { - pub fn libafl_add_new_thread_hook( - callback: ::std::option::Option< - unsafe extern "C" fn(data: u64, env: *mut CPUArchState, tid: u32) -> bool, - >, - data: u64, - ) -> usize; -} -extern "C" { - pub fn libafl_qemu_remove_new_thread_hook(num: usize) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_hook_new_thread_run(env: *mut CPUArchState, tid: u32) -> bool; -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct syshook_ret { - pub retval: target_ulong, - pub skip_syscall: bool, -} -#[test] -fn bindgen_test_layout_syshook_ret() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(syshook_ret)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(syshook_ret)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).retval) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(syshook_ret), - "::", - stringify!(retval) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).skip_syscall) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(syshook_ret), - "::", - stringify!(skip_syscall) - ) - ); -} -extern "C" { - pub fn libafl_add_pre_syscall_hook( - callback: ::std::option::Option< - unsafe extern "C" fn( - data: u64, - sys_num: ::std::os::raw::c_int, - arg0: target_ulong, - arg1: target_ulong, - arg2: target_ulong, - arg3: target_ulong, - arg4: target_ulong, - arg5: target_ulong, - arg6: target_ulong, - arg7: target_ulong, - ) -> syshook_ret, - >, - data: u64, - ) -> usize; -} -extern "C" { - pub fn libafl_add_post_syscall_hook( - callback: ::std::option::Option< - unsafe extern "C" fn( - data: u64, - ret: target_ulong, - sys_num: ::std::os::raw::c_int, - arg0: target_ulong, - arg1: target_ulong, - arg2: target_ulong, - arg3: target_ulong, - arg4: target_ulong, - arg5: target_ulong, - arg6: target_ulong, - arg7: target_ulong, - ) -> target_ulong, - >, - data: u64, - ) -> usize; -} -extern "C" { - pub fn libafl_qemu_remove_pre_syscall_hook(num: usize) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_qemu_remove_post_syscall_hook(num: usize) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn libafl_hook_syscall_pre_run( - env: *mut CPUArchState, - num: ::std::os::raw::c_int, - arg1: abi_long, - arg2: abi_long, - arg3: abi_long, - arg4: abi_long, - arg5: abi_long, - arg6: abi_long, - arg7: abi_long, - arg8: abi_long, - ret: *mut abi_long, - ) -> bool; -} -extern "C" { - pub fn libafl_hook_syscall_post_run( - num: ::std::os::raw::c_int, - arg1: abi_long, - arg2: abi_long, - arg3: abi_long, - arg4: abi_long, - arg5: abi_long, - arg6: abi_long, - arg7: abi_long, - arg8: abi_long, - ret: *mut abi_long, - ); -} -#[repr(C)] -#[derive(Debug, Default, Copy, Clone)] -pub struct kvm_dirty_gfn { - pub _address: u8, -} diff --git a/libafl_qemu/runtime/libafl_qemu_stub_bindings.rs b/libafl_qemu/runtime/libafl_qemu_stub_bindings.rs index 911468761e..f6c692b783 100644 --- a/libafl_qemu/runtime/libafl_qemu_stub_bindings.rs +++ b/libafl_qemu/runtime/libafl_qemu_stub_bindings.rs @@ -1,10 +1,10 @@ /* 1.83.0-nightly */ /* qemu git hash: d6637939526f453c69f4c6bfe4635feb5dc5c0be */ -/* automatically generated by rust-bindgen 0.69.4 */ +/* automatically generated by rust-bindgen 0.70.1 */ pub const LIBAFL_SYNC_EXIT_OPCODE: u32 = 1727150607; pub const LIBAFL_BACKDOOR_OPCODE: u32 = 1156725263; -pub const LIBAFL_QEMU_TEST_VALUE: i64 = -2401053089206453570; +pub const LIBAFL_QEMU_TEST_VALUE: u32 = 3405691582; pub const LIBAFL_QEMU_HDR_VERSION_NUMBER: u32 = 73; pub const _STDIO_H: u32 = 1; pub const _FEATURES_H: u32 = 1; @@ -235,31 +235,12 @@ pub type __pid_t = ::std::os::raw::c_int; pub struct __fsid_t { pub __val: [::std::os::raw::c_int; 2usize], } -#[test] -fn bindgen_test_layout___fsid_t() { - const UNINIT: ::std::mem::MaybeUninit<__fsid_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __fsid_t"][::std::mem::size_of::<__fsid_t>() - 8usize]; + ["Alignment of __fsid_t"][::std::mem::align_of::<__fsid_t>() - 4usize]; + ["Offset of field: __fsid_t::__val"][::std::mem::offset_of!(__fsid_t, __val) - 0usize]; +}; pub type __clock_t = ::std::os::raw::c_long; pub type __rlim_t = ::std::os::raw::c_ulong; pub type __rlim64_t = ::std::os::raw::c_ulong; @@ -300,42 +281,17 @@ pub union __mbstate_t__bindgen_ty_1 { pub __wch: ::std::os::raw::c_uint, pub __wchb: [::std::os::raw::c_char; 4usize], } -#[test] -fn bindgen_test_layout___mbstate_t__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit<__mbstate_t__bindgen_ty_1> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wch) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wch) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__wchb) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wchb) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __mbstate_t__bindgen_ty_1"] + [::std::mem::size_of::<__mbstate_t__bindgen_ty_1>() - 4usize]; + ["Alignment of __mbstate_t__bindgen_ty_1"] + [::std::mem::align_of::<__mbstate_t__bindgen_ty_1>() - 4usize]; + ["Offset of field: __mbstate_t__bindgen_ty_1::__wch"] + [::std::mem::offset_of!(__mbstate_t__bindgen_ty_1, __wch) - 0usize]; + ["Offset of field: __mbstate_t__bindgen_ty_1::__wchb"] + [::std::mem::offset_of!(__mbstate_t__bindgen_ty_1, __wchb) - 0usize]; +}; impl Default for __mbstate_t__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -350,41 +306,15 @@ impl ::std::fmt::Debug for __mbstate_t__bindgen_ty_1 { write!(f, "__mbstate_t__bindgen_ty_1 {{ union }}") } } -#[test] -fn bindgen_test_layout___mbstate_t() { - const UNINIT: ::std::mem::MaybeUninit<__mbstate_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__mbstate_t>(), - 8usize, - concat!("Size of: ", stringify!(__mbstate_t)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__count) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__value) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__value) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __mbstate_t"][::std::mem::size_of::<__mbstate_t>() - 8usize]; + ["Alignment of __mbstate_t"][::std::mem::align_of::<__mbstate_t>() - 4usize]; + ["Offset of field: __mbstate_t::__count"] + [::std::mem::offset_of!(__mbstate_t, __count) - 0usize]; + ["Offset of field: __mbstate_t::__value"] + [::std::mem::offset_of!(__mbstate_t, __value) - 4usize]; +}; impl Default for __mbstate_t { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -409,41 +339,13 @@ pub struct _G_fpos_t { pub __pos: __off_t, pub __state: __mbstate_t, } -#[test] -fn bindgen_test_layout__G_fpos_t() { - const UNINIT: ::std::mem::MaybeUninit<_G_fpos_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_G_fpos_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pos) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__state) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__state) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _G_fpos_t"][::std::mem::size_of::<_G_fpos_t>() - 16usize]; + ["Alignment of _G_fpos_t"][::std::mem::align_of::<_G_fpos_t>() - 8usize]; + ["Offset of field: _G_fpos_t::__pos"][::std::mem::offset_of!(_G_fpos_t, __pos) - 0usize]; + ["Offset of field: _G_fpos_t::__state"][::std::mem::offset_of!(_G_fpos_t, __state) - 8usize]; +}; impl Default for _G_fpos_t { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -469,41 +371,14 @@ pub struct _G_fpos64_t { pub __pos: __off64_t, pub __state: __mbstate_t, } -#[test] -fn bindgen_test_layout__G_fpos64_t() { - const UNINIT: ::std::mem::MaybeUninit<_G_fpos64_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_G_fpos64_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos64_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__pos) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__state) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__state) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _G_fpos64_t"][::std::mem::size_of::<_G_fpos64_t>() - 16usize]; + ["Alignment of _G_fpos64_t"][::std::mem::align_of::<_G_fpos64_t>() - 8usize]; + ["Offset of field: _G_fpos64_t::__pos"][::std::mem::offset_of!(_G_fpos64_t, __pos) - 0usize]; + ["Offset of field: _G_fpos64_t::__state"] + [::std::mem::offset_of!(_G_fpos64_t, __state) - 8usize]; +}; impl Default for _G_fpos64_t { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -574,311 +449,59 @@ pub struct _IO_FILE { pub _mode: ::std::os::raw::c_int, pub _unused2: [::std::os::raw::c_char; 20usize], } -#[test] -fn bindgen_test_layout__IO_FILE() { - const UNINIT: ::std::mem::MaybeUninit<_IO_FILE> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_ptr) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_end) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_read_base) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_base) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_ptr) as usize - ptr as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_write_end) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_base) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_buf_end) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_base) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_backup_base) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._IO_save_end) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._markers) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._chain) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._fileno) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._flags2) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._old_offset) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._cur_column) as usize - ptr as usize }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._vtable_offset) as usize - ptr as usize }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._shortbuf) as usize - ptr as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._lock) as usize - ptr as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._offset) as usize - ptr as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._codecvt) as usize - ptr as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_codecvt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._wide_data) as usize - ptr as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_wide_data) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_list) as usize - ptr as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_list) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._freeres_buf) as usize - ptr as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_freeres_buf) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._prevchain) as usize - ptr as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_prevchain) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._mode) as usize - ptr as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr)._unused2) as usize - ptr as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _IO_FILE"][::std::mem::size_of::<_IO_FILE>() - 216usize]; + ["Alignment of _IO_FILE"][::std::mem::align_of::<_IO_FILE>() - 8usize]; + ["Offset of field: _IO_FILE::_flags"][::std::mem::offset_of!(_IO_FILE, _flags) - 0usize]; + ["Offset of field: _IO_FILE::_IO_read_ptr"] + [::std::mem::offset_of!(_IO_FILE, _IO_read_ptr) - 8usize]; + ["Offset of field: _IO_FILE::_IO_read_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_read_end) - 16usize]; + ["Offset of field: _IO_FILE::_IO_read_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_read_base) - 24usize]; + ["Offset of field: _IO_FILE::_IO_write_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_write_base) - 32usize]; + ["Offset of field: _IO_FILE::_IO_write_ptr"] + [::std::mem::offset_of!(_IO_FILE, _IO_write_ptr) - 40usize]; + ["Offset of field: _IO_FILE::_IO_write_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_write_end) - 48usize]; + ["Offset of field: _IO_FILE::_IO_buf_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_buf_base) - 56usize]; + ["Offset of field: _IO_FILE::_IO_buf_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_buf_end) - 64usize]; + ["Offset of field: _IO_FILE::_IO_save_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_save_base) - 72usize]; + ["Offset of field: _IO_FILE::_IO_backup_base"] + [::std::mem::offset_of!(_IO_FILE, _IO_backup_base) - 80usize]; + ["Offset of field: _IO_FILE::_IO_save_end"] + [::std::mem::offset_of!(_IO_FILE, _IO_save_end) - 88usize]; + ["Offset of field: _IO_FILE::_markers"][::std::mem::offset_of!(_IO_FILE, _markers) - 96usize]; + ["Offset of field: _IO_FILE::_chain"][::std::mem::offset_of!(_IO_FILE, _chain) - 104usize]; + ["Offset of field: _IO_FILE::_fileno"][::std::mem::offset_of!(_IO_FILE, _fileno) - 112usize]; + ["Offset of field: _IO_FILE::_flags2"][::std::mem::offset_of!(_IO_FILE, _flags2) - 116usize]; + ["Offset of field: _IO_FILE::_old_offset"] + [::std::mem::offset_of!(_IO_FILE, _old_offset) - 120usize]; + ["Offset of field: _IO_FILE::_cur_column"] + [::std::mem::offset_of!(_IO_FILE, _cur_column) - 128usize]; + ["Offset of field: _IO_FILE::_vtable_offset"] + [::std::mem::offset_of!(_IO_FILE, _vtable_offset) - 130usize]; + ["Offset of field: _IO_FILE::_shortbuf"] + [::std::mem::offset_of!(_IO_FILE, _shortbuf) - 131usize]; + ["Offset of field: _IO_FILE::_lock"][::std::mem::offset_of!(_IO_FILE, _lock) - 136usize]; + ["Offset of field: _IO_FILE::_offset"][::std::mem::offset_of!(_IO_FILE, _offset) - 144usize]; + ["Offset of field: _IO_FILE::_codecvt"][::std::mem::offset_of!(_IO_FILE, _codecvt) - 152usize]; + ["Offset of field: _IO_FILE::_wide_data"] + [::std::mem::offset_of!(_IO_FILE, _wide_data) - 160usize]; + ["Offset of field: _IO_FILE::_freeres_list"] + [::std::mem::offset_of!(_IO_FILE, _freeres_list) - 168usize]; + ["Offset of field: _IO_FILE::_freeres_buf"] + [::std::mem::offset_of!(_IO_FILE, _freeres_buf) - 176usize]; + ["Offset of field: _IO_FILE::_prevchain"] + [::std::mem::offset_of!(_IO_FILE, _prevchain) - 184usize]; + ["Offset of field: _IO_FILE::_mode"][::std::mem::offset_of!(_IO_FILE, _mode) - 192usize]; + ["Offset of field: _IO_FILE::_unused2"][::std::mem::offset_of!(_IO_FILE, _unused2) - 196usize]; +}; impl Default for _IO_FILE { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -920,62 +543,21 @@ pub struct _IO_cookie_io_functions_t { pub seek: cookie_seek_function_t, pub close: cookie_close_function_t, } -#[test] -fn bindgen_test_layout__IO_cookie_io_functions_t() { - const UNINIT: ::std::mem::MaybeUninit<_IO_cookie_io_functions_t> = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<_IO_cookie_io_functions_t>(), - 32usize, - concat!("Size of: ", stringify!(_IO_cookie_io_functions_t)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_cookie_io_functions_t>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_cookie_io_functions_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(read) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).write) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(write) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).seek) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(seek) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).close) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_cookie_io_functions_t), - "::", - stringify!(close) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _IO_cookie_io_functions_t"] + [::std::mem::size_of::<_IO_cookie_io_functions_t>() - 32usize]; + ["Alignment of _IO_cookie_io_functions_t"] + [::std::mem::align_of::<_IO_cookie_io_functions_t>() - 8usize]; + ["Offset of field: _IO_cookie_io_functions_t::read"] + [::std::mem::offset_of!(_IO_cookie_io_functions_t, read) - 0usize]; + ["Offset of field: _IO_cookie_io_functions_t::write"] + [::std::mem::offset_of!(_IO_cookie_io_functions_t, write) - 8usize]; + ["Offset of field: _IO_cookie_io_functions_t::seek"] + [::std::mem::offset_of!(_IO_cookie_io_functions_t, seek) - 16usize]; + ["Offset of field: _IO_cookie_io_functions_t::close"] + [::std::mem::offset_of!(_IO_cookie_io_functions_t, close) - 24usize]; +}; pub type cookie_io_functions_t = _IO_cookie_io_functions_t; pub type va_list = __gnuc_va_list; pub type off_t = __off_t; @@ -1597,61 +1179,19 @@ pub struct __va_list_tag { pub overflow_arg_area: *mut ::std::os::raw::c_void, pub reg_save_area: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout___va_list_tag() { - const UNINIT: ::std::mem::MaybeUninit<__va_list_tag> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__va_list_tag>(), - 24usize, - concat!("Size of: ", stringify!(__va_list_tag)) - ); - assert_eq!( - ::std::mem::align_of::<__va_list_tag>(), - 8usize, - concat!("Alignment of ", stringify!(__va_list_tag)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).gp_offset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(gp_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fp_offset) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(fp_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).overflow_arg_area) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(overflow_arg_area) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).reg_save_area) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(reg_save_area) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __va_list_tag"][::std::mem::size_of::<__va_list_tag>() - 24usize]; + ["Alignment of __va_list_tag"][::std::mem::align_of::<__va_list_tag>() - 8usize]; + ["Offset of field: __va_list_tag::gp_offset"] + [::std::mem::offset_of!(__va_list_tag, gp_offset) - 0usize]; + ["Offset of field: __va_list_tag::fp_offset"] + [::std::mem::offset_of!(__va_list_tag, fp_offset) - 4usize]; + ["Offset of field: __va_list_tag::overflow_arg_area"] + [::std::mem::offset_of!(__va_list_tag, overflow_arg_area) - 8usize]; + ["Offset of field: __va_list_tag::reg_save_area"] + [::std::mem::offset_of!(__va_list_tag, reg_save_area) - 16usize]; +}; impl Default for __va_list_tag { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); diff --git a/libafl_qemu/src/arch/x86_64.rs b/libafl_qemu/src/arch/x86_64.rs index 810fda8b36..7e03111aa9 100644 --- a/libafl_qemu/src/arch/x86_64.rs +++ b/libafl_qemu/src/arch/x86_64.rs @@ -84,7 +84,7 @@ impl crate::ArchExtras for crate::CPU { { let stack_ptr: GuestReg = self.read_reg(Regs::Rsp)?; let mut ret_addr = [0; size_of::()]; - unsafe { self.read_mem(stack_ptr, &mut ret_addr) }; + unsafe { self.read_mem_unchecked(stack_ptr, &mut ret_addr) }; Ok(GuestReg::from_le_bytes(ret_addr).into()) } @@ -95,7 +95,7 @@ impl crate::ArchExtras for crate::CPU { let stack_ptr: GuestReg = self.read_reg(Regs::Rsp)?; let val: GuestReg = val.into(); let ret_addr = val.to_le_bytes(); - unsafe { self.write_mem(stack_ptr, &ret_addr) }; + unsafe { self.write_mem_unchecked(stack_ptr, &ret_addr) }; Ok(()) } diff --git a/libafl_qemu/src/command/mod.rs b/libafl_qemu/src/command/mod.rs index a980b752ba..9ccdde7142 100644 --- a/libafl_qemu/src/command/mod.rs +++ b/libafl_qemu/src/command/mod.rs @@ -380,7 +380,10 @@ where ) -> Result>, EmulatorDriverError> { let qemu = emu.qemu(); - let ret_value = self.location.write(qemu, input.target_bytes().as_slice()); + let ret_value = self + .location + .write(qemu, input.target_bytes().as_slice()) + .unwrap(); if let Some(reg) = ret_reg { self.cpu.write_reg(reg, ret_value).unwrap(); @@ -443,7 +446,8 @@ where // Write input to input location let ret_value = self .input_location - .write(qemu, input.target_bytes().as_slice()); + .write(qemu, input.target_bytes().as_slice()) + .unwrap(); // Unleash hooks if locked if emu.driver_mut().unlock_hooks() { diff --git a/libafl_qemu/src/command/parser.rs b/libafl_qemu/src/command/parser.rs index d8d34c73b2..8cb7aea3e2 100644 --- a/libafl_qemu/src/command/parser.rs +++ b/libafl_qemu/src/command/parser.rs @@ -298,7 +298,7 @@ where let mem_chunk = QemuMemoryChunk::virt(buf_addr as GuestVirtAddr, total_size as GuestReg, cpu); - mem_chunk.read(qemu, str_copy.as_slice_mut()); + mem_chunk.read(qemu, str_copy.as_slice_mut())?; let c_str: &CStr = CStr::from_bytes_with_nul(str_copy.as_slice()).unwrap(); @@ -325,7 +325,7 @@ where Ok(TestCommand::new( received_value, - bindings::LIBAFL_QEMU_TEST_VALUE as GuestReg, + GuestReg::from(bindings::LIBAFL_QEMU_TEST_VALUE), )) } } diff --git a/libafl_qemu/src/emu/hooks.rs b/libafl_qemu/src/emu/hooks.rs index 55338d94ac..521f3b3ba1 100644 --- a/libafl_qemu/src/emu/hooks.rs +++ b/libafl_qemu/src/emu/hooks.rs @@ -84,7 +84,8 @@ where func(emulator_modules, target_sig); } HookRepr::Closure(ptr) => { - let func: &mut CrashHookClosure = transmute(ptr); + let func: &mut CrashHookClosure = + &mut *(ptr::from_mut::(ptr) as *mut CrashHookClosure); func(emulator_modules, target_sig); } HookRepr::Empty => (), diff --git a/libafl_qemu/src/executor.rs b/libafl_qemu/src/executor.rs index 0cb5d12b1f..ad28c00149 100644 --- a/libafl_qemu/src/executor.rs +++ b/libafl_qemu/src/executor.rs @@ -56,8 +56,11 @@ where first_exec: bool, } +/// # Safety +/// +/// This should be used as a crash handler, and nothing else. #[cfg(emulation_mode = "usermode")] -pub unsafe fn inproc_qemu_crash_handler( +unsafe fn inproc_qemu_crash_handler( signal: Signal, info: &mut siginfo_t, mut context: Option<&mut ucontext_t>, @@ -329,6 +332,7 @@ where Z: HasObjective, Z::Objective: Feedback, { + #[allow(clippy::too_many_arguments)] pub fn new( emulator: Emulator, harness_fn: &'a mut H, diff --git a/libafl_qemu/src/lib.rs b/libafl_qemu/src/lib.rs index 6d3db6d30b..bdc5b343c9 100644 --- a/libafl_qemu/src/lib.rs +++ b/libafl_qemu/src/lib.rs @@ -4,7 +4,6 @@ /*! */ #![doc = include_str!("../README.md")] #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![forbid(unexpected_cfgs)] // libafl_qemu only supports Linux currently #![cfg(target_os = "linux")] // This lint triggers too often on the current GuestAddr type when emulating 64-bit targets because @@ -13,16 +12,6 @@ any(cpu_target = "x86_64", cpu_target = "aarch64"), allow(clippy::useless_conversion) )] -#![allow(clippy::needless_pass_by_value)] -#![allow(clippy::needless_pass_by_ref_mut)] -#![allow(clippy::transmute_ptr_to_ptr)] -#![allow(clippy::ptr_cast_constness)] -#![allow(clippy::too_many_arguments)] -// Till they fix this buggy lint in clippy -#![allow(clippy::borrow_as_ptr)] -#![allow(clippy::borrow_deref_ref)] -// Allow only ATM, it will be evetually removed -#![allow(clippy::missing_safety_doc)] // libafl_qemu_sys export types with empty struct markers (e.g. struct {} start_init_save) // This causes bindgen to generate empty Rust struct that are generally not FFI-safe due to C++ having empty structs with size 1 // As the QEMU codebase is C, it is FFI-safe and we just ignore the warning diff --git a/libafl_qemu/src/modules/edges.rs b/libafl_qemu/src/modules/edges.rs index 2152570bfd..47dddf3484 100644 --- a/libafl_qemu/src/modules/edges.rs +++ b/libafl_qemu/src/modules/edges.rs @@ -646,8 +646,9 @@ where } } -// # Safety -// Calling this concurrently for the same id is racey and may lose updates. +/// # Safety +/// +/// Calling this concurrently for the same id is racey and may lose updates. pub unsafe extern "C" fn trace_edge_hitcount(_: *const (), id: u64) { unsafe { EDGES_MAP[id as usize] = EDGES_MAP[id as usize].wrapping_add(1); diff --git a/libafl_qemu/src/modules/usermode/asan.rs b/libafl_qemu/src/modules/usermode/asan.rs index 6367bc66b6..365dd6b9b9 100644 --- a/libafl_qemu/src/modules/usermode/asan.rs +++ b/libafl_qemu/src/modules/usermode/asan.rs @@ -751,14 +751,14 @@ pub struct AsanModule { impl AsanModule { #[must_use] pub fn default(rt: Pin>) -> Self { - Self::new(rt, StdAddressFilter::default(), QemuAsanOptions::Snapshot) + Self::new(rt, StdAddressFilter::default(), &QemuAsanOptions::Snapshot) } #[must_use] pub fn new( mut rt: Pin>, filter: StdAddressFilter, - options: QemuAsanOptions, + options: &QemuAsanOptions, ) -> Self { assert!(unsafe { ASAN_INITED }, "The ASan runtime is not initialized, use init_qemu_with_asan(...) instead of just Qemu::init(...)"); let (snapshot, detect_leaks) = match options { @@ -782,7 +782,7 @@ impl AsanModule { mut rt: Pin>, filter: StdAddressFilter, error_callback: AsanErrorCallback, - options: QemuAsanOptions, + options: &QemuAsanOptions, ) -> Self { assert!(unsafe { ASAN_INITED }, "The ASan runtime is not initialized, use init_qemu_with_asan(...) instead of just Qemu::init(...)"); let (snapshot, detect_leaks) = match options { @@ -808,12 +808,12 @@ impl AsanModule { pub unsafe fn with_asan_report( rt: Pin>, filter: StdAddressFilter, - options: QemuAsanOptions, + options: &QemuAsanOptions, ) -> Self { Self::with_error_callback( rt, filter, - Box::new(|rt, qemu, pc, err| unsafe { asan_report(rt, qemu, pc, err) }), + Box::new(|rt, qemu, pc, err| unsafe { asan_report(rt, qemu, pc, &err) }), options, ) } @@ -1536,7 +1536,7 @@ mod addr2line_legacy { /// Calling this function concurrently might be racey. #[allow(clippy::unnecessary_cast)] #[allow(clippy::too_many_lines)] -pub unsafe fn asan_report(rt: &AsanGiovese, qemu: Qemu, pc: GuestAddr, err: AsanError) { +pub unsafe fn asan_report(rt: &AsanGiovese, qemu: Qemu, pc: GuestAddr, err: &AsanError) { let mut regions = HashMap::new(); for region in qemu.mappings() { if let Some(path) = region.path() { @@ -1668,7 +1668,7 @@ pub unsafe fn asan_report(rt: &AsanGiovese, qemu: Qemu, pc: GuestAddr, err: Asan } let addr = match err { AsanError::Read(addr, _) | AsanError::Write(addr, _) | AsanError::BadFree(addr, _) => { - Some(addr) + Some(*addr) } AsanError::MemLeak(_) | AsanError::Signal(_) => None, }; diff --git a/libafl_qemu/src/modules/usermode/asan_guest.rs b/libafl_qemu/src/modules/usermode/asan_guest.rs index 16d231cfff..2572c204df 100644 --- a/libafl_qemu/src/modules/usermode/asan_guest.rs +++ b/libafl_qemu/src/modules/usermode/asan_guest.rs @@ -146,7 +146,7 @@ impl AsanGuestModule { impl AsanGuestModule { #[must_use] - pub fn default(qemu: Qemu, asan: String) -> Self { + pub fn default(qemu: Qemu, asan: &str) -> Self { Self::new(qemu, asan, StdAddressFilter::default()) } } @@ -156,7 +156,7 @@ where F: AddressFilter, { #[must_use] - pub fn new(qemu: Qemu, asan: String, filter: F) -> Self { + pub fn new(qemu: Qemu, asan: &str, filter: F) -> Self { for mapping in qemu.mappings() { println!("mapping: {mapping:#?}"); } diff --git a/libafl_qemu/src/modules/usermode/injections.rs b/libafl_qemu/src/modules/usermode/injections.rs index 97d275598d..43fc0fb1dc 100644 --- a/libafl_qemu/src/modules/usermode/injections.rs +++ b/libafl_qemu/src/modules/usermode/injections.rs @@ -343,6 +343,7 @@ where } } +#[allow(clippy::too_many_arguments)] fn syscall_hook( emulator_modules: &mut EmulatorModules, // our instantiated QemuHooks _state: Option<&mut S>, diff --git a/libafl_qemu/src/modules/usermode/snapshot.rs b/libafl_qemu/src/modules/usermode/snapshot.rs index f18f1dca8e..ec4fe7db41 100644 --- a/libafl_qemu/src/modules/usermode/snapshot.rs +++ b/libafl_qemu/src/modules/usermode/snapshot.rs @@ -208,7 +208,7 @@ impl SnapshotModule { // TODO not just for R pages unsafe { info.data = Some(Box::new(core::mem::zeroed())); - qemu.read_mem(addr, &mut info.data.as_mut().unwrap()[..]); + qemu.read_mem_unchecked(addr, &mut info.data.as_mut().unwrap()[..]); } } self.pages.insert(addr, info); @@ -299,7 +299,8 @@ impl SnapshotModule { qemu.read_mem( addr, current_page_content.as_mut_ptr().as_mut().unwrap(), - ); + ) + .unwrap(); } let current_page_content: &mut [u8; SNAPSHOT_PAGE_SIZE] = @@ -411,7 +412,7 @@ impl SnapshotModule { return true; // Restore later } - unsafe { qemu.write_mem(*page, &data[..]) }; + unsafe { qemu.write_mem_unchecked(*page, &data[..]) }; } else { panic!("Cannot restored a dirty but unsaved page"); } @@ -446,7 +447,7 @@ impl SnapshotModule { if let Some(info) = self.pages.get_mut(page) { // TODO avoid duplicated memcpy if let Some(data) = info.data.as_ref() { - unsafe { qemu.write_mem(*page, &data[..]) }; + unsafe { qemu.write_mem_unchecked(*page, &data[..]) }; } else { panic!("Cannot restored a dirty but unsaved page"); } diff --git a/libafl_qemu/src/qemu/hooks.rs b/libafl_qemu/src/qemu/hooks.rs index 0515ebbcc3..baae0ebb32 100644 --- a/libafl_qemu/src/qemu/hooks.rs +++ b/libafl_qemu/src/qemu/hooks.rs @@ -1,5 +1,7 @@ //! The high-level hooks -#![allow(clippy::type_complexity, clippy::missing_transmute_annotations)] +#![allow(clippy::type_complexity)] +#![allow(clippy::missing_transmute_annotations)] +#![allow(clippy::too_many_arguments)] use core::{ffi::c_void, fmt::Debug, mem::transmute, ptr}; @@ -52,6 +54,9 @@ impl TcgHookState { } } + /// # Safety + /// + /// ids should be in sync with QEMU hooks ids. pub unsafe fn set_id(&mut self, id: H) { self.id = id; } @@ -66,6 +71,9 @@ impl HookState { } } + /// # Safety + /// + /// ids should be in sync with QEMU hooks ids. pub unsafe fn set_id(&mut self, id: H) { self.id = id; } @@ -112,7 +120,7 @@ macro_rules! create_wrapper { { unsafe { let modules = EmulatorModules::::emulator_modules_mut_unchecked(); - let func: &mut Box, Option<&mut S>, $($param_type),*)> = transmute(hook); + let func: &mut Box, Option<&mut S>, $($param_type),*)> = &mut *(ptr::from_mut::(hook) as *mut Box, Option<&mut S>, $($param_type),*)>); func(modules, inprocess_get_state::(), $($param),*); } } @@ -137,7 +145,7 @@ macro_rules! create_wrapper { { unsafe { let modules = EmulatorModules::::emulator_modules_mut_unchecked(); - let func: &mut Box, Option<&mut S>, $($param_type),*) -> $ret_type> = transmute(hook); + let func: &mut Box, Option<&mut S>, $($param_type),*) -> $ret_type> = &mut *(ptr::from_mut::(hook) as *mut Box, Option<&mut S>, $($param_type),*) -> $ret_type>); func(modules, inprocess_get_state::(), $($param),*) } } @@ -164,7 +172,9 @@ macro_rules! create_pre_exec_wrapper { HookRepr::Closure(ptr) => { let func: &mut Box< dyn FnMut(&mut EmulatorModules, Option<&mut S>, $($param_type),*), - > = transmute(ptr); + > = &mut *(ptr::from_mut::(ptr) as *mut Box< + dyn FnMut(&mut EmulatorModules, Option<&mut S>, $($param_type),*), + >); func(modules, inprocess_get_state::(), $($param),*) } _ => (), @@ -194,7 +204,9 @@ macro_rules! create_post_exec_wrapper { HookRepr::Closure(ptr) => { let func: &mut Box< dyn FnMut(&mut EmulatorModules, Option<&mut S>, $($param_type),*), - > = transmute(ptr); + > = &mut *(ptr::from_mut::(ptr) as *mut Box< + dyn FnMut(&mut EmulatorModules, Option<&mut S>, $($param_type),*), + >); func(modules, inprocess_get_state::(), $($param),*); } _ => (), @@ -224,7 +236,7 @@ macro_rules! create_gen_wrapper { HookRepr::Closure(ptr) => { let func: &mut Box< dyn FnMut(&mut EmulatorModules, Option<&mut S>, $($param_type),*) -> Option<$ret_type>, - > = transmute(ptr); + > = &mut *(ptr::from_mut::(ptr) as *mut Box, Option<&mut S>, $($param_type),*) -> Option<$ret_type>>); func(modules, inprocess_get_state::(), $($param),*).map_or(SKIP_EXEC_HOOK, |id| id) } _ => 0, @@ -253,7 +265,7 @@ macro_rules! create_post_gen_wrapper { HookRepr::Closure(ptr) => { let func: &mut Box< dyn FnMut(&mut EmulatorModules, Option<&mut S>, $($param_type),*), - > = transmute(ptr); + > = &mut *(ptr::from_mut::(ptr) as *mut Box, Option<&mut S>, $($param_type),*)>); func(modules, inprocess_get_state::(), $($param),*); } _ => (), @@ -280,7 +292,7 @@ macro_rules! create_exec_wrapper { } HookRepr::Closure(ptr) => { let func: &mut Box, Option<&mut S>, $($param_type),*)> = - transmute(ptr); + &mut *(ptr::from_mut::(ptr) as *mut Box, Option<&mut S>, $($param_type),*)>); func(modules, inprocess_get_state::(), $($param),*); } _ => (), diff --git a/libafl_qemu/src/qemu/mod.rs b/libafl_qemu/src/qemu/mod.rs index 21fb8deeed..ff46ae21d1 100644 --- a/libafl_qemu/src/qemu/mod.rs +++ b/libafl_qemu/src/qemu/mod.rs @@ -18,8 +18,6 @@ use std::{ }; use libafl_bolts::os::unix_signals::Signal; -#[cfg(emulation_mode = "usermode")] -use libafl_qemu_sys::{guest_base, VerifyAccess}; use libafl_qemu_sys::{ libafl_flush_jit, libafl_get_exit_reason, libafl_page_from_addr, libafl_qemu_add_gdb_cmd, libafl_qemu_cpu_index, libafl_qemu_current_cpu, libafl_qemu_gdb_reply, libafl_qemu_get_cpu, @@ -52,6 +50,13 @@ pub use hooks::*; static mut QEMU_IS_INITIALIZED: bool = false; +#[derive(Debug)] +pub enum QemuError { + Init(QemuInitError), + Exit(QemuExitError), + RW(QemuRWError), +} + #[derive(Debug)] pub enum QemuInitError { MultipleInstances, @@ -92,6 +97,7 @@ pub enum QemuRWErrorCause { WrongArgument(i32), CurrentCpuNotFound, Reg(i32), + WrongMemoryLocation(GuestAddr, usize), // addr, size } #[derive(Debug, Clone)] @@ -108,6 +114,19 @@ impl QemuRWError { Self { kind, cause, cpu } } + pub fn wrong_mem_location( + kind: QemuRWErrorKind, + cpu: CPUStatePtr, + addr: GuestAddr, + size: usize, + ) -> Self { + Self::new( + kind, + QemuRWErrorCause::WrongMemoryLocation(addr, size), + Some(cpu), + ) + } + #[must_use] pub fn current_cpu_not_found(kind: QemuRWErrorKind) -> Self { Self::new(kind, QemuRWErrorCause::CurrentCpuNotFound, None) @@ -323,27 +342,6 @@ impl CPU { } } - #[cfg(emulation_mode = "usermode")] - #[must_use] - pub fn g2h(&self, addr: GuestAddr) -> *mut T { - unsafe { (addr as usize + guest_base) as *mut T } - } - - #[cfg(emulation_mode = "usermode")] - #[must_use] - pub fn h2g(&self, addr: *const T) -> GuestAddr { - unsafe { (addr as usize - guest_base) as GuestAddr } - } - - #[cfg(emulation_mode = "usermode")] - #[must_use] - pub fn access_ok(&self, kind: VerifyAccess, addr: GuestAddr, size: usize) -> bool { - unsafe { - // TODO add support for tagged GuestAddr - libafl_qemu_sys::page_check_range(addr, size as GuestAddr, kind.into()) - } - } - // TODO expose tlb_set_dirty and tlb_reset_dirty #[must_use] @@ -351,6 +349,31 @@ impl CPU { unsafe { libafl_qemu_num_regs(self.ptr) } } + pub fn read_reg(&self, reg: R) -> Result + where + R: Into + Clone, + T: From, + { + unsafe { + let reg_id = reg.clone().into(); + let mut val = MaybeUninit::uninit(); + let success = libafl_qemu_read_reg(self.ptr, reg_id, val.as_mut_ptr() as *mut u8); + if success == 0 { + Err(QemuRWError { + kind: QemuRWErrorKind::Write, + cause: QemuRWErrorCause::Reg(reg.into()), + cpu: Some(self.ptr), + }) + } else { + #[cfg(feature = "be")] + return Ok(GuestReg::from_be(val.assume_init()).into()); + + #[cfg(not(feature = "be"))] + return Ok(GuestReg::from_le(val.assume_init()).into()); + } + } + } + pub fn write_reg(&self, reg: R, val: T) -> Result<(), QemuRWError> where R: Into + Clone, @@ -376,28 +399,53 @@ impl CPU { } } - pub fn read_reg(&self, reg: R) -> Result - where - R: Into + Clone, - T: From, - { - unsafe { - let reg_id = reg.clone().into(); - let mut val = MaybeUninit::uninit(); - let success = libafl_qemu_read_reg(self.ptr, reg_id, val.as_mut_ptr() as *mut u8); - if success == 0 { - Err(QemuRWError { - kind: QemuRWErrorKind::Write, - cause: QemuRWErrorCause::Reg(reg.into()), - cpu: Some(self.ptr), - }) - } else { - #[cfg(feature = "be")] - return Ok(GuestReg::from_be(val.assume_init()).into()); + /// Read a value from a guest address, taking into account the potential MMU / MPU. + pub fn read_mem(&self, addr: GuestAddr, buf: &mut [u8]) -> Result<(), QemuRWError> { + // TODO use gdbstub's target_cpu_memory_rw_debug + let ret = unsafe { + libafl_qemu_sys::cpu_memory_rw_debug( + self.ptr, + addr as GuestVirtAddr, + buf.as_mut_ptr() as *mut _, + buf.len(), + false, + ) + }; - #[cfg(not(feature = "be"))] - return Ok(GuestReg::from_le(val.assume_init()).into()); - } + if ret != 0 { + Err(QemuRWError::wrong_mem_location( + QemuRWErrorKind::Read, + self.ptr, + addr, + buf.len(), + )) + } else { + Ok(()) + } + } + + /// Write a value to a guest address, taking into account the potential MMU / MPU. + pub fn write_mem(&self, addr: GuestAddr, buf: &[u8]) -> Result<(), QemuRWError> { + // TODO use gdbstub's target_cpu_memory_rw_debug + let ret = unsafe { + libafl_qemu_sys::cpu_memory_rw_debug( + self.ptr, + addr as GuestVirtAddr, + buf.as_ptr() as *mut _, + buf.len(), + true, + ) + }; + + if ret != 0 { + Err(QemuRWError::wrong_mem_location( + QemuRWErrorKind::Write, + self.ptr, + addr, + buf.len(), + )) + } else { + Ok(()) } } @@ -707,21 +755,48 @@ impl Qemu { unsafe { libafl_page_from_addr(addr) } } - //#[must_use] - /*pub fn page_size() -> GuestUsize { - unsafe { libafl_page_size } - }*/ - - pub unsafe fn write_mem(&self, addr: GuestAddr, buf: &[u8]) { + /// Read a value from a guest address, taking into account the potential indirections with the current CPU. + pub fn read_mem(&self, addr: GuestAddr, buf: &mut [u8]) -> Result<(), QemuRWError> { self.current_cpu() .unwrap_or_else(|| self.cpu_from_index(0)) - .write_mem(addr, buf); + .read_mem(addr, buf) } - pub unsafe fn read_mem(&self, addr: GuestAddr, buf: &mut [u8]) { + /// Write a value to a guest address, taking into account the potential indirections with the current CPU. + pub fn write_mem(&self, addr: GuestAddr, buf: &[u8]) -> Result<(), QemuRWError> { self.current_cpu() .unwrap_or_else(|| self.cpu_from_index(0)) - .read_mem(addr, buf); + .write_mem(addr, buf) + } + + /// Read a value from a guest address. + /// + /// # Safety + /// In usermode, this will read from a translated guest address. + /// This may only be safely used for valid guest addresses. + /// + /// In any case, no check will be performed on the correctness of the operation. + /// + /// Please refer to [`CPU::read_mem`] for more details. + pub unsafe fn read_mem_unchecked(&self, addr: GuestAddr, buf: &mut [u8]) { + self.current_cpu() + .unwrap_or_else(|| self.cpu_from_index(0)) + .read_mem_unchecked(addr, buf); + } + + /// Write a value to a guest address. + /// + /// # Safety + /// In usermode, this will write to a translated guest address. + /// + /// In any case, no check will be performed on the correctness of the operation. + /// + /// This may only be safely used for valid guest addresses. + /// Please refer to [`CPU::write_mem`] for more details. + pub unsafe fn write_mem_unchecked(&self, addr: GuestAddr, buf: &[u8]) { + self.current_cpu() + .unwrap_or_else(|| self.cpu_from_index(0)) + .write_mem_unchecked(addr, buf); } #[must_use] @@ -779,12 +854,13 @@ impl Qemu { } #[must_use] - pub fn remove_hook(&self, id: impl HookId, invalidate_block: bool) -> bool { + pub fn remove_hook(&self, id: &impl HookId, invalidate_block: bool) -> bool { id.remove(invalidate_block) } - // # Safety - // Calling this multiple times concurrently will access static variables and is unsafe. + /// # Safety + /// + /// Calling this multiple times concurrently will access static variables and is unsafe. #[allow(clippy::type_complexity)] pub unsafe fn add_gdb_cmd(&self, callback: Box bool>) { let fat: Box = Box::new(transmute::< @@ -929,7 +1005,7 @@ impl QemuMemoryChunk { /// Returns the number of bytes effectively read. /// output will get chunked at `size` bytes. - pub fn read(&self, qemu: Qemu, output: &mut [u8]) -> GuestReg { + pub fn read(&self, qemu: Qemu, output: &mut [u8]) -> Result { let max_len: usize = self.size.try_into().unwrap(); let output_sliced = if output.len() > max_len { @@ -939,32 +1015,31 @@ impl QemuMemoryChunk { }; match self.addr { - GuestAddrKind::Physical(hwaddr) => unsafe { + GuestAddrKind::Physical(hwaddr) => { #[cfg(emulation_mode = "usermode")] { // For now the default behaviour is to fall back to virtual addresses - qemu.read_mem(hwaddr.try_into().unwrap(), output_sliced); + qemu.read_mem(hwaddr.try_into().unwrap(), output_sliced)?; } #[cfg(emulation_mode = "systemmode")] - { + unsafe { qemu.read_phys_mem(hwaddr, output_sliced); } - }, + } GuestAddrKind::Virtual(vaddr) => unsafe { self.cpu .as_ref() .unwrap() - .read_mem(vaddr.try_into().unwrap(), output_sliced); + .read_mem_unchecked(vaddr.try_into().unwrap(), output_sliced); }, }; - output_sliced.len().try_into().unwrap() + Ok(output_sliced.len().try_into().unwrap()) } /// Returns the number of bytes effectively written. /// Input will get chunked at `size` bytes. - #[must_use] - pub fn write(&self, qemu: Qemu, input: &[u8]) -> GuestReg { + pub fn write(&self, qemu: Qemu, input: &[u8]) -> Result { let max_len: usize = self.size.try_into().unwrap(); let input_sliced = if input.len() > max_len { @@ -974,26 +1049,26 @@ impl QemuMemoryChunk { }; match self.addr { - GuestAddrKind::Physical(hwaddr) => unsafe { + GuestAddrKind::Physical(hwaddr) => { #[cfg(emulation_mode = "usermode")] { // For now the default behaviour is to fall back to virtual addresses - qemu.write_mem(hwaddr.try_into().unwrap(), input_sliced); + qemu.write_mem(hwaddr.try_into().unwrap(), input_sliced)?; } #[cfg(emulation_mode = "systemmode")] - { + unsafe { qemu.write_phys_mem(hwaddr, input_sliced); } - }, - GuestAddrKind::Virtual(vaddr) => unsafe { + } + GuestAddrKind::Virtual(vaddr) => { self.cpu .as_ref() .unwrap() - .write_mem(vaddr.try_into().unwrap(), input_sliced); - }, + .write_mem(vaddr.try_into().unwrap(), input_sliced)?; + } }; - input_sliced.len().try_into().unwrap() + Ok(input_sliced.len().try_into().unwrap()) } } @@ -1038,16 +1113,16 @@ pub mod pybind { } fn write_mem(&self, addr: GuestAddr, buf: &[u8]) { - unsafe { - self.qemu.write_mem(addr, buf); - } + self.qemu + .write_mem(addr, buf) + .expect("Write to memory failed."); } fn read_mem(&self, addr: GuestAddr, size: usize) -> Vec { let mut buf = vec![0; size]; - unsafe { - self.qemu.read_mem(addr, &mut buf); - } + self.qemu + .read_mem(addr, &mut buf) + .expect("Read to memory failed."); buf } diff --git a/libafl_qemu/src/qemu/systemmode.rs b/libafl_qemu/src/qemu/systemmode.rs index 4f10a598ea..c481ecd16f 100644 --- a/libafl_qemu/src/qemu/systemmode.rs +++ b/libafl_qemu/src/qemu/systemmode.rs @@ -16,8 +16,8 @@ use libc::EXIT_SUCCESS; use num_traits::Zero; use crate::{ - FastSnapshotPtr, GuestAddrKind, MemAccessInfo, Qemu, QemuMemoryChunk, QemuSnapshotCheckResult, - CPU, + FastSnapshotPtr, GuestAddrKind, MemAccessInfo, Qemu, QemuMemoryChunk, QemuRWError, + QemuRWErrorCause, QemuRWErrorKind, QemuSnapshotCheckResult, CPU, }; pub(super) extern "C" fn qemu_cleanup_atexit() { @@ -140,38 +140,40 @@ impl CPU { } } - /// Write a value to a guest address. + /// Read a value from a guest address, taking into account the potential MMU / MPU. /// /// # Safety - /// This will write to a translated guest address (using `g2h`). - /// It just adds `guest_base` and writes to that location, without checking the bounds. - /// This may only be safely used for valid guest addresses! - pub unsafe fn write_mem(&self, addr: GuestAddr, buf: &[u8]) { + /// no check is done on the correctness of the operation. + /// if a problem occurred during the operation, there will be no feedback + pub unsafe fn read_mem_unchecked(&self, addr: GuestAddr, buf: &mut [u8]) { // TODO use gdbstub's target_cpu_memory_rw_debug - libafl_qemu_sys::cpu_memory_rw_debug( - self.ptr, - addr as GuestVirtAddr, - buf.as_ptr() as *mut _, - buf.len(), - true, - ); + unsafe { + libafl_qemu_sys::cpu_memory_rw_debug( + self.ptr, + addr as GuestVirtAddr, + buf.as_mut_ptr() as *mut _, + buf.len(), + false, + ) + }; } - /// Read a value from a guest address. + /// Write a value to a guest address, taking into account the potential MMU / MPU. /// /// # Safety - /// This will read from a translated guest address (using `g2h`). - /// It just adds `guest_base` and writes to that location, without checking the bounds. - /// This may only be safely used for valid guest addresses! - pub unsafe fn read_mem(&self, addr: GuestAddr, buf: &mut [u8]) { + /// no check is done on the correctness of the operation. + /// if a problem occurred during the operation, there will be no feedback + pub fn write_mem_unchecked(&self, addr: GuestAddr, buf: &[u8]) { // TODO use gdbstub's target_cpu_memory_rw_debug - libafl_qemu_sys::cpu_memory_rw_debug( - self.ptr, - addr as GuestVirtAddr, - buf.as_mut_ptr() as *mut _, - buf.len(), - false, - ); + unsafe { + libafl_qemu_sys::cpu_memory_rw_debug( + self.ptr, + addr as GuestVirtAddr, + buf.as_ptr() as *mut _, + buf.len(), + true, + ) + }; } } @@ -182,6 +184,12 @@ impl Qemu { } /// Write a value to a physical guest address, including ROM areas. + /// + /// # Safety + /// + /// No check is done on the correctness of the operation at the moment. + /// Nothing bad will happen if the operation is incorrect, but it will be silently skipped. + // TODO: use address_space_rw and check for the result MemTxResult pub unsafe fn write_phys_mem(&self, paddr: GuestPhysAddr, buf: &[u8]) { libafl_qemu_sys::cpu_physical_memory_rw( paddr, @@ -191,7 +199,13 @@ impl Qemu { ); } - /// Read a value from a physical guest address. + /// Read a value from a physical guest address, including ROM areas. + /// + /// # Safety + /// + /// No check is done on the correctness of the operation at the moment. + /// Nothing bad will happen if the operation is incorrect, but it will be silently skipped. + // TODO: use address_space_rw and check for the result MemTxResult pub unsafe fn read_phys_mem(&self, paddr: GuestPhysAddr, buf: &mut [u8]) { libafl_qemu_sys::cpu_physical_memory_rw( paddr, diff --git a/libafl_qemu/src/qemu/usermode.rs b/libafl_qemu/src/qemu/usermode.rs index c6e5b38b3d..543b45c4c3 100644 --- a/libafl_qemu/src/qemu/usermode.rs +++ b/libafl_qemu/src/qemu/usermode.rs @@ -9,7 +9,7 @@ use libafl_qemu_sys::{ pageflags_get_root, read_self_maps, GuestAddr, GuestUsize, IntervalTreeNode, IntervalTreeRoot, MapInfo, MmapPerms, VerifyAccess, }; -use libc::{c_char, c_int, c_uchar, strlen}; +use libc::{c_int, c_uchar, strlen}; #[cfg(feature = "python")] use pyo3::{pyclass, pymethods, IntoPy, PyObject, PyRef, PyRefMut, Python}; @@ -79,27 +79,47 @@ impl Drop for GuestMaps { } impl CPU { - /// Write a value to a guest address. - /// - /// # Safety - /// This will write to a translated guest address (using `g2h`). - /// It just adds `guest_base` and writes to that location, without checking the bounds. - /// This may only be safely used for valid guest addresses! - pub unsafe fn write_mem(&self, addr: GuestAddr, buf: &[u8]) { - let host_addr = Qemu::get().unwrap().g2h(addr); - copy_nonoverlapping(buf.as_ptr(), host_addr, buf.len()); - } - /// Read a value from a guest address. + /// The input address is not checked for validity. /// /// # Safety /// This will read from a translated guest address (using `g2h`). /// It just adds `guest_base` and writes to that location, without checking the bounds. /// This may only be safely used for valid guest addresses! - pub unsafe fn read_mem(&self, addr: GuestAddr, buf: &mut [u8]) { + pub unsafe fn read_mem_unchecked(&self, addr: GuestAddr, buf: &mut [u8]) { let host_addr = Qemu::get().unwrap().g2h(addr); copy_nonoverlapping(host_addr, buf.as_mut_ptr(), buf.len()); } + + /// Write a value to a guest address. + /// The input address in not checked for validity. + /// + /// # Safety + /// This will write to a translated guest address (using `g2h`). + /// It just adds `guest_base` and writes to that location, without checking the bounds. + /// This may only be safely used for valid guest addresses! + pub unsafe fn write_mem_unchecked(&self, addr: GuestAddr, buf: &[u8]) { + let host_addr = Qemu::get().unwrap().g2h(addr); + copy_nonoverlapping(buf.as_ptr(), host_addr, buf.len()); + } + + #[must_use] + pub fn g2h(&self, addr: GuestAddr) -> *mut T { + unsafe { (addr as usize + guest_base) as *mut T } + } + + #[must_use] + pub fn h2g(&self, addr: *const T) -> GuestAddr { + unsafe { (addr as usize - guest_base) as GuestAddr } + } + + #[must_use] + pub fn access_ok(&self, kind: VerifyAccess, addr: GuestAddr, size: usize) -> bool { + unsafe { + // TODO add support for tagged GuestAddr + libafl_qemu_sys::page_check_range(addr, size as GuestAddr, kind.into()) + } + } } #[allow(clippy::unused_self)] @@ -141,7 +161,7 @@ impl Qemu { unsafe { from_utf8_unchecked_mut(from_raw_parts_mut( exec_path as *mut c_uchar, - strlen(exec_path as *const c_char), + strlen(exec_path.cast_const()), )) } } diff --git a/libafl_sugar/Cargo.toml b/libafl_sugar/Cargo.toml index 371c94ea37..8e6fc0d64b 100644 --- a/libafl_sugar/Cargo.toml +++ b/libafl_sugar/Cargo.toml @@ -73,3 +73,6 @@ libafl_qemu = { path = "../libafl_qemu", version = "0.13.2" } [lib] name = "libafl_sugar" crate-type = ["cdylib", "rlib"] + +[lints] +workspace = true diff --git a/libafl_sugar/src/lib.rs b/libafl_sugar/src/lib.rs index fbd1bbcec8..aefb6e0224 100644 --- a/libafl_sugar/src/lib.rs +++ b/libafl_sugar/src/lib.rs @@ -1,22 +1,6 @@ //! Sugar API to simplify the life of users of `LibAFL` that just want to fuzz. /*! */ #![cfg_attr(feature = "document-features", doc = document_features::document_features!())] -#![deny(rustdoc::broken_intra_doc_links)] -#![deny(clippy::all)] -#![deny(clippy::pedantic)] -#![forbid(unexpected_cfgs)] -#![allow( - clippy::unreadable_literal, - clippy::type_repetition_in_bounds, - clippy::missing_errors_doc, - clippy::cast_possible_truncation, - clippy::used_underscore_binding, - clippy::ptr_as_ptr, - clippy::missing_panics_doc, - clippy::missing_docs_in_private_items, - clippy::module_name_repetitions, - clippy::unreadable_literal -)] #![cfg_attr(not(test), warn( missing_debug_implementations, missing_docs, diff --git a/libafl_targets/Cargo.toml b/libafl_targets/Cargo.toml index f94698d00e..fc29d8aebd 100644 --- a/libafl_targets/Cargo.toml +++ b/libafl_targets/Cargo.toml @@ -86,4 +86,6 @@ serde = { workspace = true, default-features = false, features = [ ] } # serialization lib meminterval = { workspace = true, features = ["serde"], optional = true } ahash = { workspace = true, default-features = false, optional = true } -# serde-big-array = "0.3.2" + +[lints] +workspace = true diff --git a/libafl_targets/src/lib.rs b/libafl_targets/src/lib.rs index 93c94b229e..0e93351af5 100644 --- a/libafl_targets/src/lib.rs +++ b/libafl_targets/src/lib.rs @@ -1,24 +1,7 @@ //! `libafl_targets` contains runtime code, injected in the target itself during compilation. #![no_std] -#![deny(rustdoc::broken_intra_doc_links)] -#![deny(clippy::all)] -#![deny(clippy::pedantic)] -#![forbid(unexpected_cfgs)] // For `std::simd` #![cfg_attr(nightly, feature(portable_simd))] -#![allow( - clippy::unreadable_literal, - clippy::type_repetition_in_bounds, - clippy::missing_errors_doc, - clippy::cast_possible_truncation, - clippy::used_underscore_binding, - clippy::ptr_as_ptr, - clippy::missing_panics_doc, - clippy::missing_docs_in_private_items, - clippy::module_name_repetitions, - clippy::pub_underscore_fields, - clippy::into_iter_without_iter, // broken -)] #![cfg_attr(not(test), warn( missing_debug_implementations, missing_docs, @@ -101,6 +84,8 @@ pub mod sanitizer_ifaces { #![allow(missing_docs)] #![allow(missing_debug_implementations)] #![allow(unused_qualifications)] + #![allow(clippy::pub_underscore_fields)] + include!(concat!(env!("OUT_DIR"), "/sanitizer_interfaces.rs")); } diff --git a/libafl_tinyinst/Cargo.toml b/libafl_tinyinst/Cargo.toml index c22e0ab067..b3c1e48f5e 100644 --- a/libafl_tinyinst/Cargo.toml +++ b/libafl_tinyinst/Cargo.toml @@ -34,4 +34,7 @@ tinyinst = { git = "https://github.com/AFLplusplus/tinyinst-rs" } log = { workspace = true } [build-dependencies] -cmake = "0.1.51" +cmake = { workspace = true } + +[lints] +workspace = true diff --git a/libafl_tinyinst/src/lib.rs b/libafl_tinyinst/src/lib.rs index d2620db3f9..dc22e7c31a 100644 --- a/libafl_tinyinst/src/lib.rs +++ b/libafl_tinyinst/src/lib.rs @@ -2,25 +2,6 @@ The tinyinst module for `LibAFL`. */ -#![warn(clippy::cargo)] -#![deny(clippy::cargo_common_metadata)] -#![deny(rustdoc::broken_intra_doc_links)] -#![deny(clippy::all)] -#![deny(clippy::pedantic)] -#![forbid(unexpected_cfgs)] -#![allow( - clippy::unreadable_literal, - clippy::type_repetition_in_bounds, - clippy::missing_errors_doc, - clippy::cast_possible_truncation, - clippy::used_underscore_binding, - clippy::ptr_as_ptr, - clippy::missing_panics_doc, - clippy::missing_docs_in_private_items, - clippy::module_name_repetitions, - clippy::unreadable_literal, - clippy::negative_feature_names -)] #![cfg_attr(not(test), warn( missing_debug_implementations, missing_docs, @@ -60,9 +41,6 @@ The tinyinst module for `LibAFL`. while_true ) )] -// Till they fix this buggy lint in clippy -#![allow(clippy::borrow_as_ptr)] -#![allow(clippy::borrow_deref_ref)] /// Tinyinst executor pub mod executor; diff --git a/scripts/clippy.sh b/scripts/clippy.sh index 9c0d2b5fce..290239cd80 100755 --- a/scripts/clippy.sh +++ b/scripts/clippy.sh @@ -3,6 +3,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" cd "$SCRIPT_DIR/.." || exit 1 +CLIPPY_CMD="RUST_BACKTRACE=full cargo +nightly clippy --all --all-features --no-deps --tests --examples --benches -- -Z macro-backtrace" + set -e # Function to run Clippy on a single directory run_clippy() { @@ -10,20 +12,7 @@ run_clippy() { echo "Running Clippy on $dir" pushd "$dir" || return 1 - RUST_BACKTRACE=full cargo +nightly clippy --all --all-features --no-deps --tests --examples --benches -- -Z macro-backtrace \ - -D clippy::all \ - -D clippy::pedantic \ - -W clippy::similar_names \ - -A clippy::type_repetition_in_bounds \ - -A clippy::missing-errors-doc \ - -A clippy::cast-possible-truncation \ - -A clippy::used-underscore-binding \ - -A clippy::ptr-as-ptr \ - -A clippy::missing-panics-doc \ - -A clippy::missing-docs-in-private-items \ - -A clippy::unseparated-literal-suffix \ - -A clippy::module-name-repetitions \ - -A clippy::unreadable-literal + eval "$CLIPPY_CMD" popd || return 1 } @@ -52,21 +41,7 @@ else fi # First run it on all -RUST_BACKTRACE=full cargo +nightly clippy --all --all-features --no-deps --tests --examples --benches -- -Z macro-backtrace \ - -D clippy::all \ - -D clippy::pedantic \ - -W clippy::similar_names \ - -A clippy::type_repetition_in_bounds \ - -A clippy::missing-errors-doc \ - -A clippy::cast-possible-truncation \ - -A clippy::used-underscore-binding \ - -A clippy::ptr-as-ptr \ - -A clippy::missing-panics-doc \ - -A clippy::missing-docs-in-private-items \ - -A clippy::unseparated-literal-suffix \ - -A clippy::module-name-repetitions \ - -A clippy::unreadable-literal - +eval "$CLIPPY_CMD" # Loop through each project and run Clippy for project in "${PROJECTS[@]}"; do diff --git a/scripts/gen_stub_bindings.sh b/scripts/gen_stub_bindings.sh deleted file mode 100755 index 35a4404373..0000000000 --- a/scripts/gen_stub_bindings.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" -LIBAFL_DIR=$(realpath "$SCRIPT_DIR/..") - -export LIBAFL_QEMU_GEN_STUBS=1 - -cd "${LIBAFL_DIR}/libafl_qemu" || exit 1 -cargo build diff --git a/scripts/update_bindings.sh b/scripts/update_bindings.sh new file mode 100755 index 0000000000..911467e827 --- /dev/null +++ b/scripts/update_bindings.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" +cd "$SCRIPT_DIR/.." || exit 1 + +# Update LibAFL QEMU bindings +pushd libafl_qemu + LIBAFL_QEMU_GEN_STUBS=1 cargo +nightly build || exit 1 +popd \ No newline at end of file diff --git a/utils/build_and_test_fuzzers/Cargo.toml b/utils/build_and_test_fuzzers/Cargo.toml index 9256762aa9..17fa832caf 100644 --- a/utils/build_and_test_fuzzers/Cargo.toml +++ b/utils/build_and_test_fuzzers/Cargo.toml @@ -10,5 +10,8 @@ keywords = ["ci"] categories = ["development-tools::testing"] [dependencies] -cargo_toml = "0.20" -walkdir = "2" +cargo_toml = "0.20.5" +walkdir = "2.5.0" + +[lints] +workspace = true diff --git a/utils/deexit/Cargo.toml b/utils/deexit/Cargo.toml index 7249b98edd..f15b0e0cf5 100644 --- a/utils/deexit/Cargo.toml +++ b/utils/deexit/Cargo.toml @@ -23,8 +23,11 @@ categories = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -log = "0.4.20" +log = { workspace = true } [lib] name = "deexit" crate-type = ["cdylib"] + +[lints] +workspace = true diff --git a/utils/gramatron/construct_automata/Cargo.toml b/utils/gramatron/construct_automata/Cargo.toml index 418b9900eb..75d4b5e677 100644 --- a/utils/gramatron/construct_automata/Cargo.toml +++ b/utils/gramatron/construct_automata/Cargo.toml @@ -25,10 +25,12 @@ categories = [ [dependencies] libafl = { path = "../../../libafl", default-features = false } -serde_json = "1.0" -regex = "1" -postcard = { version = "1.0", features = [ +serde_json = { workspace = true, default-features = true } +regex = { workspace = true } +postcard = { workspace = true, features = [ "alloc", ], default-features = false } # no_std compatible serde serialization format -clap = { version = "4.5", features = ["derive"] } -# log = "0.4.20" +clap = { workspace = true, features = ["derive"] } + +[lints] +workspace = true diff --git a/utils/libafl_benches/Cargo.toml b/utils/libafl_benches/Cargo.toml index eb0d3af99d..debda6ac0a 100644 --- a/utils/libafl_benches/Cargo.toml +++ b/utils/libafl_benches/Cargo.toml @@ -21,15 +21,21 @@ categories = [ ] [dev-dependencies] -criterion = "0.5" # Benchmarking -ahash = { version = "0.8", default-features = false } # The hash function already used in hashbrown -rustc-hash = { version = "1.1", default-features = false } # yet another hash -xxhash-rust = { version = "0.8.5", features = ["xxh3"] } # xxh3 hashing for rust libafl_bolts = { path = "../../libafl_bolts", default-features = false, features = [ "xxh3", "alloc", ] } # libafl_bolts +criterion = "0.5.1" # Benchmarking +ahash = { workspace = true, default-features = false } # The hash function already used in hashbrown +rustc-hash = { version = "2.0.0", default-features = false } # yet another hash +xxhash-rust = { version = "0.8.12", features = [ + "xxh3", +] } # xxh3 hashing for rust + +[lints] +workspace = true + [[bench]] name = "rand_speeds" harness = false