diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-09-05 13:31:14 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-09-05 15:52:42 +0200 |
| commit | ffe7e17368d7ae6c2b40da2ce0703d8ad8a116ac (patch) | |
| tree | 195b7c32977fdaab05acb1282a727fb480593431 /sys/syz-sysgen | |
| parent | 4fc47026945ebec3fc81d0c897547670034cfb58 (diff) | |
prog, sys: move types to prog
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
Diffstat (limited to 'sys/syz-sysgen')
| -rw-r--r-- | sys/syz-sysgen/syscallnr.go | 4 | ||||
| -rw-r--r-- | sys/syz-sysgen/sysgen.go | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/syz-sysgen/syscallnr.go b/sys/syz-sysgen/syscallnr.go index 02c676cf0..da427a553 100644 --- a/sys/syz-sysgen/syscallnr.go +++ b/sys/syz-sysgen/syscallnr.go @@ -9,7 +9,7 @@ import ( "strings" "text/template" - "github.com/google/syzkaller/sys" + "github.com/google/syzkaller/prog" ) type Arch struct { @@ -26,7 +26,7 @@ var archs = []*Arch{ {"ppc64le", 8, []string{"__ppc64__", "__PPC64__", "__powerpc64__"}}, } -func generateExecutorSyscalls(arch *Arch, syscalls []*sys.Syscall) []byte { +func generateExecutorSyscalls(arch *Arch, syscalls []*prog.Syscall) []byte { data := ArchData{ CARCH: arch.CARCH, } diff --git a/sys/syz-sysgen/sysgen.go b/sys/syz-sysgen/sysgen.go index 7381f1edb..f09835aef 100644 --- a/sys/syz-sysgen/sysgen.go +++ b/sys/syz-sysgen/sysgen.go @@ -116,8 +116,9 @@ func main() { func generate(arch string, prog *compiler.Prog, consts map[string]uint64, out io.Writer) { fmt.Fprintf(out, "// AUTOGENERATED FILE\n") fmt.Fprintf(out, "package sys\n\n") + fmt.Fprintf(out, "import . \"github.com/google/syzkaller/prog\"\n\n") - fmt.Fprintf(out, "var resourceArray = ") + fmt.Fprintf(out, "var resources = ") serializer.Write(out, prog.Resources) fmt.Fprintf(out, "\n\n") @@ -133,7 +134,7 @@ func generate(arch string, prog *compiler.Prog, consts map[string]uint64, out io serializer.Write(out, prog.StructDescs) fmt.Fprintf(out, "\n\n") - fmt.Fprintf(out, "var Syscalls = ") + fmt.Fprintf(out, "var syscalls = ") serializer.Write(out, prog.Syscalls) fmt.Fprintf(out, "\n\n") |
