aboutsummaryrefslogtreecommitdiffstats
path: root/docs/syscall_descriptions_syntax.md
Commit message (Collapse)AuthorAgeFilesLines
...
* pkg/compiler: support negative integersDmitry Vyukov2018-07-091-2/+3
| | | | | | Currently we have to use 0xffffffffffffffff to represent -1, and we can't express e.g. -20:20 int range. Support negative consts to fix both problems.
* prog, pkg/compiler: support fmt typeDmitry Vyukov2018-07-081-0/+3
| | | | | fmt type allows to convert intergers and resources to string representation.
* Update syscall_descriptions_syntax.mdDmitry Vyukov2018-06-041-4/+3
| | | extend resource description
* Update syscall_descriptions_syntax.mdDmitry Vyukov2018-06-041-2/+2
| | | clarify size of intptr
* pkg/compiler: add optional builtin templateDmitry Vyukov2018-05-171-4/+8
| | | | | | | type optional[T] [ val T void void ] [varlen]
* pkg/ast: support char constantsDmitry Vyukov2018-04-291-0/+15
| | | | | | | Frequently it's useful to do something like: int8['a':'z'] punctuation = ',', '-', ':'
* pkg/compiler: support non-zero terminated filenamesDmitry Vyukov2018-04-021-4/+3
| | | | | | | | | | | | | | | Now file names become: string[filename] with a possibility of using other string features: stringnoz[filename] string[filename, CONST_SIZE] and filename is left as type alias as it is commonly used: type filename string[filename]
* pkg/compiler: allow specifying static size for filename'sDmitry Vyukov2018-03-051-1/+3
| | | | Sometimes filenames are embed into structs and need to take fixed space.
* pkg/compiler: add size attribute for structsDmitry Vyukov2018-03-051-2/+11
| | | | The size attribute allows to pad a struct up to the specified size.
* pkg/compiler: support non-zero-terminated stringsDmitry Vyukov2018-01-181-0/+3
| | | | Add stringnoz type.
* pkg/compiler: support void typeDmitry Vyukov2018-01-131-0/+2
| | | | | | "void": type with static size 0 mostly useful inside of templates and varlen unions can't be syscall argument
* pkg/compiler: support type templatesDmitry Vyukov2018-01-131-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Netlink descriptions contain tons of code duplication, and need much more for proper descriptions. Introduce type templates to simplify writing such descriptions and remove code duplication. Note: type templates are experimental, have poor error handling and are subject to change. Type templates can be declared as follows: ``` type buffer[DIR] ptr[DIR, array[int8]] type fileoff[BASE] BASE type nlattr[TYPE, PAYLOAD] { nla_len len[parent, int16] nla_type const[TYPE, int16] payload PAYLOAD } [align_4] ``` and later used as follows: ``` syscall(a buffer[in], b fileoff[int64], c ptr[in, nlattr[FOO, int32]]) ```
* pkg/compiler: add builtin bool type aliasesDmitry Vyukov2018-01-081-0/+9
| | | | | | | | | | | | | | | | This adds builtin: type bool8 int8[0:1] type bool16 int16[0:1] type bool32 int32[0:1] type bool64 int64[0:1] type boolptr intptr[0:1] We used to use just int's for bools. But bool types provide several advantages: - make true/false probability equal - improve description expressiveness - reduce search space (we will take advantage of this later)
* sys: support type aliases (aka typedefs)Dmitry Vyukov2018-01-081-0/+22
| | | | | | | | | | | | | | | | | | | | | | Complex types that are often repeated can be given short type aliases using the following syntax: ``` type identifier underlying_type ``` For example: ``` type signalno int32[0:65] type net_port proc[20000, 4, int16be] ``` Then, type alias can be used instead of the underlying type in any contexts. Underlying type needs to be described as if it's a struct field, that is, with the base type if it's required. However, type alias can be used as syscall arguments as well. Underlying types are currently restricted to integer types, `ptr`, `ptr64`, `const`, `flags` and `proc` types.
* pkg/compiler: add bitsize typeDmitry Vyukov2018-01-061-2/+4
| | | | This is need for few crypto/xfrm descriptions.
* Update syscall_descriptions_syntax.mdDmitry Vyukov2017-09-131-1/+1
|
* sys: support ptr64 typeDmitry Vyukov2017-09-021-1/+2
| | | | | | ptr64 is like ptr, but always takes 8 bytes of space. Needed for some APIs. Unfortunately, most of these APIs use buffer type, so we can't use ptr64 immidiately.
* pkg/compiler: check and generate typesDmitry Vyukov2017-09-021-1/+2
| | | | | | Move most of the logic from sysgen to pkg/compiler. Update #217
* sys: change proc arguments to the format used by const/flags/lenDmitry Vyukov2017-08-311-2/+3
| | | | | | | | All other types have optional underlying type as the last argument. Proc have it as first. This creates very irregular syntax and complicates parsing. Make type the last argument. Note: this is a breaking change if you have descriptions on the side.
* docs: small fixesAndrey Konovalov2017-07-241-49/+67
|
* Parse incdir "incdir" in syscall description file to add custom include ↵Yuzhe Han2017-06-261-1/+1
| | | | | | | | | | | | directories. (#180) * Parse #incdir "incdir" in syscall description file to add custom include directories. * add flagLinux * remove '#' in incdir flag * Update sys/README.md AUTHORS CONTRIBUTORS.
* docs: various improvementsAndrey Konovalov2017-06-141-0/+163