Add a new ABI to support cmse_nonsecure_call
This commit adds a new ABI to be selected via `extern "C-cmse-nonsecure-call"` on function pointers in order for the compiler to apply the corresponding cmse_nonsecure_call callsite attribute. For Armv8-M targets supporting TrustZone-M, this will perform a non-secure function call by saving, clearing and calling a non-secure function pointer using the BLXNS instruction. See the page on the unstable book for details. Signed-off-by: Hugues de Valon <hugues.devalon@arm.com>
This commit is contained in:
12
compiler/rustc_error_codes/src/error_codes/E0781.md
Normal file
12
compiler/rustc_error_codes/src/error_codes/E0781.md
Normal file
@@ -0,0 +1,12 @@
|
||||
The `C-cmse-nonsecure-call` ABI can only be used with function pointers.
|
||||
|
||||
Erroneous code example:
|
||||
|
||||
```compile_fail,E0781
|
||||
#![feature(abi_c_cmse_nonsecure_call)]
|
||||
|
||||
pub extern "C-cmse-nonsecure-call" fn test() {}
|
||||
```
|
||||
|
||||
The `C-cmse-nonsecure-call` ABI should be used by casting function pointers to
|
||||
specific addresses.
|
||||
Reference in New Issue
Block a user