This is an automated email from the ASF dual-hosted git repository.

yuanz pushed a commit to branch no-std
in repository 
https://gitbox.apache.org/repos/asf/incubator-teaclave-trustzone-sdk.git

commit 6b0c8fc5a074ddce109e3bdee19d26ef4c840cee
Author: Sumit Garg <[email protected]>
AuthorDate: Fri Nov 24 19:23:56 2023 +0530

    optee-utee: no_std: Add support for panic handler
    
    Signed-off-by: Sumit Garg <[email protected]>
---
 optee-utee/src/lib.rs | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/optee-utee/src/lib.rs b/optee-utee/src/lib.rs
index 953d604..ebbaaba 100644
--- a/optee-utee/src/lib.rs
+++ b/optee-utee/src/lib.rs
@@ -27,6 +27,18 @@ use libc_alloc::LibcAlloc;
 #[global_allocator]
 static ALLOCATOR: LibcAlloc = LibcAlloc;
 
+#[cfg(not(feature = "std"))]
+use core::panic::PanicInfo;
+#[cfg(not(feature = "std"))]
+use optee_utee_sys as raw;
+
+#[cfg(not(feature = "std"))]
+#[panic_handler]
+fn panic(_info: &PanicInfo) -> ! {
+    unsafe { raw::TEE_Panic(0); }
+    loop {}
+}
+
 pub use self::error::{Error, ErrorKind, Result};
 pub use self::object::*;
 pub use self::crypto_op::*;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to