From 0d0fbbe73f5b02bfeac0aedd0b6b9e8417ab0b0f Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 26 Aug 2016 07:09:25 +0200 Subject: overhaul syscall description generation process This splits generation process into two phases: 1. Extract values of constants from linux kernel sources. 2. Generate Go code. Constant values are checked in. The advantage is that the second phase is now completely independent from linux source files, kernel version, presence of headers for particular drivers, etc. This allows to change what Go code we generate any time without access to all kernel headers (which in future won't be limited to only upstream headers). Constant extraction process does require proper kernel sources, but this can be done only once by the person who added the driver and has access to the required sources. Then the constant values are checked in for others to use. Consant extraction process is per-file/per-arch. That is, if I am adding a driver that is not present upstream and that works only on a single arch, I will check in constants only for that driver and for that arch. --- sys/sys.txt | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) (limited to 'sys/sys.txt') diff --git a/sys/sys.txt b/sys/sys.txt index eca616d0e..a13ceb5a2 100644 --- a/sys/sys.txt +++ b/sys/sys.txt @@ -1,45 +1,7 @@ # Copyright 2015 syzkaller project authors. All rights reserved. # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. -# Description of syscall arguments. - -# A syscall is described as: -# syscallname "(" [arg ["," arg]*] ")" [type] -# arg = argname type -# argname = identifier -# type = typename [ "[" type-options "]" ] -# typename = "fd" | "fileoff" | "buffer" | "vma" , "len" | "flags" | "filename" | "ptr" | "array" | "intN" | "intptr" -# type-options = [type-opt ["," type-opt]] -# common type-options include: -# "opt" - the argument is optional (like mmap fd argument, or accept peer argument) -# rest of the type-options are type-specific: -# "fd": file descriptor, type-options: kind of fd (file/sock/pipe/rand) (optional) -# "fileoff": offset within a file, type-options: argname of the file -# "buffer": a pointer to a memory buffer (like read/write buffer argument), type-options: direction (in/out/inout) -# "string": a pointer to a memory buffer, similar to buffer[in] -# "vma": a pointer to a set of pages (used as input for mmap/munmap/mremap/madvise) -# "len": length of buffer/vma/arrayptr (for array it is number of elements), type-options: argname of the object -# "flags": a set of flags, type-options: reference to flags description -# "filename": a file/link/dir name -# "ptr": a pointer to an object, type-options: type of the object; direction (in/out/inout) -# "array": a variable/fixed-length array, type-options: type of elements, optional size for fixed-length arrays -# "intN"/"intptr": an integer without a particular meaning, type-options: range of values (e.g. "5:10", or "-100:200", optional) -# flags/len/flags also have trailing underlying type type-option when used in structs/unions/pointers. -# -# Flags are described as: -# flagname = const ["," const] -# -# Structs are described as: -# structname "{" "\n" (fieldname type "\n")+ "}" -# Structs can have trailing attributes "packed" and "align_N", -# they are specified in square brackets after the struct. -# -# Unions are described as: -# unionname "[" "\n" (fieldname type "\n")+ "]" -# Unions can have a trailing "varlen" attribute (specified in square brackets after the union), -# which means that union length is not maximum of all option lengths, -# but rather length of a particular chosen option (such unions can't be part of a struct, -# because their size is not statically known). +# Description of syscall arguments. See README.md for details. include include -- cgit mrf-deployment