diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-09-20 21:18:36 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-09-20 21:19:29 +0200 |
| commit | 8cb7d3dcfcbe11a6d5682743816409d1c8e8f6a0 (patch) | |
| tree | 75e6dd62ae61ce7986cf4e0e04e9954586033635 /sys/fuchsia | |
| parent | d606e60dfe3d50499812f7d740dae6e727fa9f76 (diff) | |
all: initial support for fuchsia
Nothing works, but builds.
Update #191
Diffstat (limited to 'sys/fuchsia')
| -rw-r--r-- | sys/fuchsia/amd64.go | 27 | ||||
| -rw-r--r-- | sys/fuchsia/arm64.go | 27 | ||||
| -rw-r--r-- | sys/fuchsia/init.go | 35 | ||||
| -rw-r--r-- | sys/fuchsia/sys.txt | 6 | ||||
| -rw-r--r-- | sys/fuchsia/sys_amd64.const | 5 | ||||
| -rw-r--r-- | sys/fuchsia/sys_arm64.const | 5 |
6 files changed, 105 insertions, 0 deletions
diff --git a/sys/fuchsia/amd64.go b/sys/fuchsia/amd64.go new file mode 100644 index 000000000..eb51d797d --- /dev/null +++ b/sys/fuchsia/amd64.go @@ -0,0 +1,27 @@ +// AUTOGENERATED FILE +package fuchsia + +import . "github.com/google/syzkaller/prog" + +func init() { + RegisterTarget(&Target{OS: "fuchsia", Arch: "amd64", Revision: revision_amd64, PtrSize: 8, Syscalls: syscalls_amd64, Resources: resources_amd64, Structs: structDescs_amd64, Consts: consts_amd64}, initTarget) +} + +var resources_amd64 = []*ResourceDesc(nil) + +var structDescs_amd64 = []*KeyedStruct(nil) + +var syscalls_amd64 = []*Syscall{ + {Name: "mx_time_get", CallName: "mx_time_get", Args: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_id", FldName: "clock_id", TypeSize: 8}}, Vals: []uint64{0, 1, 2}}, + }}, +} + +var consts_amd64 = []ConstValue{ + {Name: "MX_CLOCK_MONOTONIC"}, + {Name: "MX_CLOCK_THREAD", Value: 2}, + {Name: "MX_CLOCK_UTC", Value: 1}, + {Name: "__NR_mx_time_get"}, +} + +const revision_amd64 = "d65b9adb4853817be6f471df44fc8347ebf6dfc6" diff --git a/sys/fuchsia/arm64.go b/sys/fuchsia/arm64.go new file mode 100644 index 000000000..b39870ffa --- /dev/null +++ b/sys/fuchsia/arm64.go @@ -0,0 +1,27 @@ +// AUTOGENERATED FILE +package fuchsia + +import . "github.com/google/syzkaller/prog" + +func init() { + RegisterTarget(&Target{OS: "fuchsia", Arch: "arm64", Revision: revision_arm64, PtrSize: 8, Syscalls: syscalls_arm64, Resources: resources_arm64, Structs: structDescs_arm64, Consts: consts_arm64}, initTarget) +} + +var resources_arm64 = []*ResourceDesc(nil) + +var structDescs_arm64 = []*KeyedStruct(nil) + +var syscalls_arm64 = []*Syscall{ + {Name: "mx_time_get", CallName: "mx_time_get", Args: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_id", FldName: "clock_id", TypeSize: 8}}, Vals: []uint64{0, 1, 2}}, + }}, +} + +var consts_arm64 = []ConstValue{ + {Name: "MX_CLOCK_MONOTONIC"}, + {Name: "MX_CLOCK_THREAD", Value: 2}, + {Name: "MX_CLOCK_UTC", Value: 1}, + {Name: "__NR_mx_time_get"}, +} + +const revision_arm64 = "bd2655e6d85f1fecceb1648649e1ad5adda81dc8" diff --git a/sys/fuchsia/init.go b/sys/fuchsia/init.go new file mode 100644 index 000000000..0dfe874cc --- /dev/null +++ b/sys/fuchsia/init.go @@ -0,0 +1,35 @@ +// Copyright 2017 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. + +package fuchsia + +import ( + "github.com/google/syzkaller/prog" +) + +func initTarget(target *prog.Target) { + arch := &arch{} + + target.PageSize = pageSize + target.DataOffset = dataOffset + target.MmapSyscall = arch.mmapSyscall + target.MakeMmap = arch.makeMmap + target.AnalyzeMmap = arch.analyzeMmap +} + +const ( + pageSize = 4 << 10 + dataOffset = 512 << 20 +) + +type arch struct { +} + +// createMmapCall creates a "normal" mmap call that maps [start, start+npages) page range. +func (arch *arch) makeMmap(start, npages uint64) *prog.Call { + return nil +} + +func (arch *arch) analyzeMmap(c *prog.Call) (start, npages uint64, mapped bool) { + return +} diff --git a/sys/fuchsia/sys.txt b/sys/fuchsia/sys.txt new file mode 100644 index 000000000..543d5da01 --- /dev/null +++ b/sys/fuchsia/sys.txt @@ -0,0 +1,6 @@ +# Copyright 2017 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. + +mx_time_get(clock_id flags[clock_id]) + +clock_id = MX_CLOCK_MONOTONIC, MX_CLOCK_UTC, MX_CLOCK_THREAD diff --git a/sys/fuchsia/sys_amd64.const b/sys/fuchsia/sys_amd64.const new file mode 100644 index 000000000..c6aa53ea0 --- /dev/null +++ b/sys/fuchsia/sys_amd64.const @@ -0,0 +1,5 @@ +__NR_mx_time_get = 0 + +MX_CLOCK_MONOTONIC = 0 +MX_CLOCK_UTC = 1 +MX_CLOCK_THREAD = 2 diff --git a/sys/fuchsia/sys_arm64.const b/sys/fuchsia/sys_arm64.const new file mode 100644 index 000000000..c6aa53ea0 --- /dev/null +++ b/sys/fuchsia/sys_arm64.const @@ -0,0 +1,5 @@ +__NR_mx_time_get = 0 + +MX_CLOCK_MONOTONIC = 0 +MX_CLOCK_UTC = 1 +MX_CLOCK_THREAD = 2 |
