This is an automated email from the ASF dual-hosted git repository.
yuanz pushed a commit to branch main
in repository
https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git
The following commit(s) were added to refs/heads/main by this push:
new b5143c6 no-std: optee-utee: make panic_handler optional
b5143c6 is described below
commit b5143c627de2ee128732fcf798c41516ffbc13f7
Author: ivila <[email protected]>
AuthorDate: Fri Oct 25 14:12:02 2024 +0800
no-std: optee-utee: make panic_handler optional
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]>
---
optee-utee/Cargo.toml | 3 +++
optee-utee/src/lib.rs | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/optee-utee/Cargo.toml b/optee-utee/Cargo.toml
index e33810e..2324ecf 100644
--- a/optee-utee/Cargo.toml
+++ b/optee-utee/Cargo.toml
@@ -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']
diff --git a/optee-utee/src/lib.rs b/optee-utee/src/lib.rs
index b0c205e..679339c 100644
--- a/optee-utee/src/lib.rs
+++ b/optee-utee/src/lib.rs
@@ -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); }
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]