aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/compiler
Commit message (Collapse)AuthorAgeFilesLines
* pkg/compiler: add builtin bool type aliasesDmitry Vyukov2018-01-084-10/+35
| | | | | | | | | | | | | | | | 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)
* pkg/compiler: make signalno a type aliasDmitry Vyukov2018-01-081-19/+0
| | | | | | | We don't need compiler support for such things anymore, now we simply can do: type signalno int32[0:65]
* sys: support type aliases (aka typedefs)Dmitry Vyukov2018-01-086-52/+195
| | | | | | | | | | | | | | | | | | | | | | 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.
* prog: support opt for proc typesDmitry Vyukov2018-01-062-5/+5
|
* pkg/compiler: add bitsize typeDmitry Vyukov2018-01-062-5/+9
| | | | This is need for few crypto/xfrm descriptions.
* sys/linux: fix some copy-paste errorsDmitry Vyukov2017-12-281-0/+59
|
* pkg/compiler: add check that len does not refer to array with varlen elementsDmitry Vyukov2017-11-282-0/+17
| | | | | This [almost] always means a bug in descriptions. Fix all bugs identified by the check.
* pkg/csource: support akarosDmitry Vyukov2017-10-161-7/+4
|
* all: basic freebsd supportDmitry Vyukov2017-10-021-2/+4
| | | | For now we just make Go part build for freebsd.
* sys/syz-extract: support fuchsiaDmitry Vyukov2017-09-253-6/+11
|
* all: more assorted fuchsia supportDmitry Vyukov2017-09-223-6/+15
|
* pkg/compiler: don't genererate missing syscallsDmitry Vyukov2017-09-155-27/+70
| | | | | | | | We used to generate them only because manager had no idea what arch it is testing. So syscalls numbers had to match between all arches. This is not needed anymore. Also don't generate unreferenced structs/resources.
* sys: move linux descriptions to sys/linuxDmitry Vyukov2017-09-151-2/+2
|
* prog, sys: move types to progDmitry Vyukov2017-09-054-166/+166
| | | | | | | | | | | Large overhaul moves syscalls and arg types from sys to prog. Sys package now depends on prog and contains only generated descriptions of syscalls. Introduce prog.Target type that encapsulates all targer properties, like syscall list, ptr/page size, etc. Also moves OS-dependent pieces like mmap call generation from prog to sys. Update #191
* sys: rename Call to SyscallDmitry Vyukov2017-09-052-6/+6
| | | | | In preparation for moving sys types to prog to avoid confusion between sys.Call and prog.Call.
* pkg/compiler: assign Call.ID staticallyDmitry Vyukov2017-09-041-0/+3
|
* pkg/compiler: fix alignment calculation bugDmitry Vyukov2017-09-041-3/+4
|
* sys: change BitfieldLast to BitfieldMiddleDmitry Vyukov2017-09-041-12/+12
| | | | | | | | That's the condition we always want. Currently we always check: t.BitfieldOffset() == 0 || t.BitfieldLast() now can check just: !t.BitfieldMiddle()
* sys: remove IntSignalnoDmitry Vyukov2017-09-041-4/+6
|
* sys, pkg/compiler: move padding computation to compilerDmitry Vyukov2017-09-046-88/+495
| | | | This makes types constant during execution, everything is precomputed.
* pkg/compiler: prohibit arrays of size 0Dmitry Vyukov2017-09-042-0/+9
| | | | This is pointless and the only case that can yield 0 static type size.
* pkg/compiler: prohibit bitfields of size 0Dmitry Vyukov2017-09-042-5/+14
| | | | | They don't work the way C bitfields work. So this will lead to confusion at least.
* pkg/compiler: don't allow bitfields in unions, args and anon typesDmitry Vyukov2017-09-042-11/+23
|
* pkg/compiler: move bitfield marking from sysDmitry Vyukov2017-09-041-1/+49
|
* pkg/compiler: prohibit bitfields in syscall argsDmitry Vyukov2017-09-043-2/+3
|
* pkg/compiler: reserve in/out/inout/opt namesDmitry Vyukov2017-09-043-1/+38
|
* sys: don't assume vma size is 8Dmitry Vyukov2017-09-041-0/+1
| | | | | Use explicit size for vma. This is the last use of hardcoded ptrSize in sys package.
* pkg/compiler: use correct arch ptr sizeDmitry Vyukov2017-09-042-5/+5
|
* pkg/compiler: detect resources without ctorsDmitry Vyukov2017-09-045-63/+162
| | | | Fixes #217
* pkg/compiler: verify validity of len targetsDmitry Vyukov2017-09-046-65/+167
| | | | Update #217
* pkg/compiler: move checking code to a separate fileDmitry Vyukov2017-09-042-390/+403
|
* pkg/compiler: detect recursive struct declarationsDmitry Vyukov2017-09-042-22/+126
| | | | Update #217
* sys: allow custom size for PtrTypeDmitry Vyukov2017-09-021-2/+4
| | | | This is required to support ptr64 type.
* sys: support ptr64 typeDmitry Vyukov2017-09-022-1/+9
| | | | | | 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: restore generation of unsupported syscallsDmitry Vyukov2017-09-021-1/+14
| | | | | | Unfortunately this is sitll needed, see the added comment. Update #191
* pkg/compiler: check and generate typesDmitry Vyukov2017-09-027-300/+1383
| | | | | | Move most of the logic from sysgen to pkg/compiler. Update #217
* pkg/compiler: actually tolerate unsupported constsDmitry Vyukov2017-08-281-0/+5
| | | | | The previous commit removes errors on unsupported structs/resources, but their usages still error. Fix that.
* pkg/compiler: tolerate unsupported consts everywhereDmitry Vyukov2017-08-281-8/+3
| | | | | | Currently unsupported consts in structs and resources break build. However, that can well happen for arch-specific devices (e.g. Android). Make this non-fatal as it used to be.
* pkg/compiler: more static error checkingDmitry Vyukov2017-08-277-107/+485
| | | | Update #217
* pkg/compiler: move more const-processing code to compilerDmitry Vyukov2017-08-273-70/+271
|
* pkg/compiler, sys/syz-sysgen: move const handling to pkg/compilerDmitry Vyukov2017-08-272-12/+186
| | | | Now pkg/compiler deals with consts.
* sys/syz-extract: switch to the new parserDmitry Vyukov2017-08-182-0/+124