Skip to content

Commit ae12919

Browse files
committed
more clarification on when arguments fit
1 parent 448d00e commit ae12919

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

text/0000-cmse-calling-conventions.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,16 @@ type T4 = extern "cmse-nonsecure-call" fn() -> i128;
9595
type T5 = extern "cmse-nonsecure-call" fn(_: i64, _: i64) -> WrappedI64;
9696
```
9797

98-
An error is emitted when the program contains a signature that violates the calling convention's constraints:
98+
The arguments fit if:
99+
100+
- the sum of their sizes, each rounded up to the next multiple of 4, is 16 bytes or less
101+
102+
A return value fits if either:
103+
104+
- its size is 4 bytes or less
105+
- it is an (optionally transparently wrapped) `i64`, `u64` or `f64`
106+
107+
When the arguments or return type do not fit in the available registers, an error is emitted:
99108

100109
```
101110
error[E0798]: arguments for `"cmse-nonsecure-entry"` function too large to pass via registers

0 commit comments

Comments
 (0)