Skip to content

Commit

Permalink
no-std: optee-utee: make panic_handler optional
Browse files Browse the repository at this point in the history
Make panic_handler optional for no-std TAs by adding "no_panic_handler"
feature flag. It allows no-std TAs to have a custom panic handler.

Signed-off-by: ivila <[email protected]>
Reviewed-by: Sumit Garg <[email protected]>
Reviewed-by: Yuan Zhuang <[email protected]>
  • Loading branch information
ivila committed Oct 25, 2024
1 parent 7f9c0c2 commit 83b725a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions optee-utee/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ uuid = { version = "0.8", default-features = false }
hex = { version = "0.4", default-features = false, features = ["alloc"] }
libc_alloc = "=1.0.5"

[features]
no_panic_handler = []

[workspace]
members = ['systest']
2 changes: 1 addition & 1 deletion optee-utee/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use core::panic::PanicInfo;
#[cfg(not(target_os = "optee"))]
use optee_utee_sys as raw;

#[cfg(not(target_os = "optee"))]
#[cfg(all(not(target_os = "optee"), not(feature = "no_panic_handler")))]
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
unsafe { raw::TEE_Panic(0); }
Expand Down

0 comments on commit 83b725a

Please sign in to comment.