bolts/minibsod add openbsd arm64 support (#1724)

* bolts/minibsod adding openbsd arm64 part.

* disable core ids test on freebsd
This commit is contained in:
David CARLIER 2023-12-21 13:25:25 +00:00 committed by GitHub
parent a98805b4ca
commit ea61b79012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 2 deletions

View File

@ -936,7 +936,7 @@ mod tests {
use super::*;
#[test]
#[cfg_attr(miri, ignore)]
#[cfg_attr(any(miri, target_os = "freebsd"), ignore)]
fn test_get_core_ids() {
let set = get_core_ids().unwrap();
assert_eq!(set.len(), usize::from(available_parallelism().unwrap()));

View File

@ -380,6 +380,26 @@ pub fn dump_registers<W: Write>(
write!(writer, "cs : {:#016x}, ", ucontext.sc_cs)?;
Ok(())
}
///
/// Write the content of all important registers
#[cfg(all(target_os = "openbsd", target_arch = "aarch64"))]
#[allow(clippy::similar_names)]
pub fn dump_registers<W: Write>(
writer: &mut BufWriter<W>,
ucontext: &ucontext_t,
) -> Result<(), std::io::Error> {
for reg in 0..29_usize {
write!(writer, "x{:02}: 0x{:016x} ", reg, ucontext.sc_x[reg])?;
if reg % 4 == 3 {
writeln!(writer)?;
}
}
write!(writer, "lr : {:#016x}, ", ucontext.sc_lr)?;
write!(writer, "elr : {:#016x}, ", ucontext.sc_elr)?;
write!(writer, "sp : {:#016x}, ", ucontext.sc_sp)?;
write!(writer, "spsr : {:#016x}, ", ucontext.sc_spsr)?;
}
///
/// Write the content of all important registers
#[cfg(all(
@ -630,7 +650,7 @@ fn write_crash<W: Write>(
Ok(())
}
#[cfg(target_os = "openbsd")]
#[cfg(all(target_os = "openbsd", target_arch = "x86_64"))]
#[allow(clippy::similar_names)]
fn write_crash<W: Write>(
writer: &mut BufWriter<W>,
@ -646,6 +666,22 @@ fn write_crash<W: Write>(
Ok(())
}
#[cfg(all(target_os = "openbsd", target_arch = "aarch64"))]
#[allow(clippy::similar_names)]
fn write_crash<W: Write>(
writer: &mut BufWriter<W>,
signal: Signal,
ucontext: &ucontext_t,
) -> Result<(), std::io::Error> {
writeln!(
writer,
"Received signal {} at{:016x}",
signal, ucontext.sc_elr
)?;
Ok(())
}
#[cfg(all(target_os = "netbsd", target_arch = "x86_64"))]
fn write_crash<W: Write>(
writer: &mut BufWriter<W>,