aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/csource
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-05 13:31:14 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-05 15:52:42 +0200
commitffe7e17368d7ae6c2b40da2ce0703d8ad8a116ac (patch)
tree195b7c32977fdaab05acb1282a727fb480593431 /pkg/csource
parent4fc47026945ebec3fc81d0c897547670034cfb58 (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 'pkg/csource')
-rw-r--r--pkg/csource/csource.go4
-rw-r--r--pkg/csource/csource_test.go1
2 files changed, 3 insertions, 2 deletions
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go
index b46fda351..e1b32e752 100644
--- a/pkg/csource/csource.go
+++ b/pkg/csource/csource.go
@@ -20,7 +20,7 @@ import (
"unsafe"
"github.com/google/syzkaller/prog"
- "github.com/google/syzkaller/sys"
+ _ "github.com/google/syzkaller/sys"
)
type Options struct {
@@ -367,7 +367,7 @@ loop:
fmt.Fprintf(w, "\twrite_file(\"/sys/kernel/debug/fail_futex/ignore-private\", \"N\");\n")
fmt.Fprintf(w, "\tinject_fault(%v);\n", opts.FaultNth)
}
- meta := sys.Syscalls[instr]
+ meta := prog.Syscalls[instr]
emitCall := true
if meta.CallName == "syz_test" {
emitCall = false
diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go
index e4e9e1f7f..fbe984b3c 100644
--- a/pkg/csource/csource_test.go
+++ b/pkg/csource/csource_test.go
@@ -13,6 +13,7 @@ import (
"github.com/google/syzkaller/pkg/osutil"
"github.com/google/syzkaller/prog"
+ _ "github.com/google/syzkaller/sys"
)
func initTest(t *testing.T) (rand.Source, int) {