diff options
| author | Hugues de Valon <hugues.devalon@arm.com> | 2021-01-24 17:15:05 +0000 |
|---|---|---|
| committer | Hugues de Valon <hugues.devalon@arm.com> | 2021-02-02 13:04:31 +0000 |
| commit | ce9818f2b7beaed0039f42605e2f547e9e461430 (patch) | |
| tree | b6b6b3e156b4d3d38e12124ce5129b00d19fb9c8 /compiler/rustc_error_codes | |
| parent | d60b29d1ae8147538b8d542f7ffcc03b48e2cbda (diff) | |
| download | rust-ce9818f2b7beaed0039f42605e2f547e9e461430.tar.gz rust-ce9818f2b7beaed0039f42605e2f547e9e461430.zip | |
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>
Diffstat (limited to 'compiler/rustc_error_codes')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0781.md | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes.rs b/compiler/rustc_error_codes/src/error_codes.rs index c669f7fed27..4cf674afcfa 100644 --- a/compiler/rustc_error_codes/src/error_codes.rs +++ b/compiler/rustc_error_codes/src/error_codes.rs @@ -465,6 +465,7 @@ E0777: include_str!("./error_codes/E0777.md"), E0778: include_str!("./error_codes/E0778.md"), E0779: include_str!("./error_codes/E0779.md"), E0780: include_str!("./error_codes/E0780.md"), +E0781: include_str!("./error_codes/E0781.md"), ; // E0006, // merged with E0005 // E0008, // cannot bind by-move into a pattern guard diff --git a/compiler/rustc_error_codes/src/error_codes/E0781.md b/compiler/rustc_error_codes/src/error_codes/E0781.md new file mode 100644 index 00000000000..7641acfb524 --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0781.md @@ -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. |
