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.
  • Loading branch information
ivila committed Oct 25, 2024
1 parent 7f9c0c2 commit 1808b90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
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']
1 change: 1 addition & 0 deletions optee-utee/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ use core::panic::PanicInfo;
use optee_utee_sys as raw;

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

0 comments on commit 1808b90

Please sign in to comment.