summaryrefslogtreecommitdiffstats
path: root/third_party/rust/minidump-writer/src/minidump_cpu.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/minidump-writer/src/minidump_cpu.rs')
-rw-r--r--third_party/rust/minidump-writer/src/minidump_cpu.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/third_party/rust/minidump-writer/src/minidump_cpu.rs b/third_party/rust/minidump-writer/src/minidump_cpu.rs
new file mode 100644
index 0000000000..6afc94029e
--- /dev/null
+++ b/third_party/rust/minidump-writer/src/minidump_cpu.rs
@@ -0,0 +1,26 @@
+cfg_if::cfg_if! {
+ if #[cfg(target_arch = "x86_64")] {
+ pub type RawContextCPU = minidump_common::format::CONTEXT_AMD64;
+ pub type FloatStateCPU = minidump_common::format::XMM_SAVE_AREA32;
+ } else if #[cfg(target_arch = "x86")] {
+ pub type RawContextCPU = minidump_common::format::CONTEXT_X86;
+ pub type FloatStateCPU = minidump_common::format::FLOATING_SAVE_AREA_X86;
+ } else if #[cfg(target_arch = "arm")] {
+ pub type RawContextCPU = minidump_common::format::CONTEXT_ARM;
+ pub type FloatStateCPU = minidump_common::format::FLOATING_SAVE_AREA_ARM;
+ } else if #[cfg(target_arch = "aarch64")] {
+ /// This is the number of general purpose registers _not_ counting
+ /// the stack pointer
+ #[cfg(any(target_os = "linux", target_os = "android"))]
+ pub(crate) const GP_REG_COUNT: usize = 31;
+ /// The number of floating point registers in the floating point save area
+ #[cfg(any(target_os = "linux", target_os = "android"))]
+ pub(crate) const FP_REG_COUNT: usize = 32;
+
+ pub type RawContextCPU = minidump_common::format::CONTEXT_ARM64_OLD;
+ } else if #[cfg(target_arch = "mips")] {
+ compile_error!("flesh me out");
+ } else {
+ compile_error!("unsupported target architecture");
+ }
+}