Skip to content

Commit

Permalink
Try to be more helpful (#2044)
Browse files Browse the repository at this point in the history
  • Loading branch information
bugadani authored Aug 30, 2024
1 parent aacc001 commit 897c92e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion xtensa-lx-rt/src/exception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub use context::Context;
/// general exceptions, which vector to the user, kernel, or double-exception
/// vectors).
#[allow(unused)]
#[derive(Debug)]
#[derive(Debug, PartialEq)]
#[repr(C)]
pub enum ExceptionCause {
/// Illegal Instruction
Expand Down
8 changes: 8 additions & 0 deletions xtensa-lx-rt/src/exception/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ unsafe extern "C" fn __default_exception(cause: ExceptionCause, save_frame: &mut
#[no_mangle]
#[link_section = ".rwtext"]
extern "C" fn __default_user_exception(cause: ExceptionCause, save_frame: &Context) {
#[cfg(any(feature = "esp32", feature = "esp32s3"))]
if cause == ExceptionCause::Cp0Disabled {
panic!(
"Access to the floating point coprocessor is not allowed. You may want to enable the `float-save-restore` feature of the `xtensa-lx-rt` crate. {:08x?}",
save_frame
)
}

panic!("Exception: {:?}, {:08x?}", cause, save_frame)
}

Expand Down

0 comments on commit 897c92e

Please sign in to comment.