diff options
| author | Necip Fazil Yildiran <necip@google.com> | 2020-08-10 14:43:38 +0000 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-08-13 13:50:25 +0200 |
| commit | f5442bde55872d703f184f8617329f706bad8149 (patch) | |
| tree | 14e121020d6aacd857b80351f01546818f19a74b /docs/syscall_descriptions_syntax.md | |
| parent | ee7cb8b69583db417b187b53f4765c3a403cd4cf (diff) | |
pkg, prog: add per-field direction attribute
Diffstat (limited to 'docs/syscall_descriptions_syntax.md')
| -rw-r--r-- | docs/syscall_descriptions_syntax.md | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/docs/syscall_descriptions_syntax.md b/docs/syscall_descriptions_syntax.md index 7f4033079..5af302de8 100644 --- a/docs/syscall_descriptions_syntax.md +++ b/docs/syscall_descriptions_syntax.md @@ -120,10 +120,14 @@ Structs are described as: ``` structname "{" "\n" - (fieldname type "\n")+ + (fieldname type ("(" fieldattribute* ")")? "\n")+ "}" ("[" attribute* "]")? ``` +Fields can have attributes specified in parentheses after the field, independent +of their type. The only attribute is direction (`in/out/inout`). For the field for +which it is specified, the direction attributes on the upper levels are overridden. + Structs can have attributes specified in square brackets after the struct. Attributes are: @@ -137,10 +141,12 @@ Unions are described as: ``` unionname "[" "\n" - (fieldname type "\n")+ + (fieldname type ("(" fieldattribute* ")")? "\n")+ "]" ("[" attribute* "]")? ``` +Field attributes are as defined for [structs](#structs). + Unions can have attributes specified in square brackets after the union. Attributes are: @@ -181,6 +187,22 @@ test_struct { } ``` +For more complex producer/consumer scenarios, field attributes can be utilized. +For example: + +``` +resource my_resource_1[int32] +resource my_resource_2[int32] + +request_produce1_consume2(..., arg ptr[inout, test_struct]) + +test_struct { + ... + field0 my_resource_1 (out) + field1 my_resource_2 (in) +} +``` + ## Type Aliases Complex types that are often repeated can be given short type aliases using the |
