aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-07-06 20:19:03 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-07-06 20:19:03 +0200
commit3439016dc2142d6b2d949c3c00e301b52fcb3ad9 (patch)
treeab47e34d1c0bab2693d996b78edb18687b313e46 /sys
parent0b95b8ec49528f9c878dc6c27f323ff5497ab8ee (diff)
sys/akaros: add all syscalls
Diffstat (limited to 'sys')
-rw-r--r--sys/akaros/gen/amd64.go334
-rw-r--r--sys/akaros/sys.txt195
-rw-r--r--sys/akaros/sys_amd64.const105
-rw-r--r--sys/syz-extract/akaros.go9
4 files changed, 501 insertions, 142 deletions
diff --git a/sys/akaros/gen/amd64.go b/sys/akaros/gen/amd64.go
index d2c958c2b..ee4a2bdf6 100644
--- a/sys/akaros/gen/amd64.go
+++ b/sys/akaros/gen/amd64.go
@@ -12,14 +12,35 @@ var resources_amd64 = []*ResourceDesc{
}
var structDescs_amd64 = []*KeyedStruct{
- {Key: StructKey{Name: "flock"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "flock", TypeSize: 32}, Fields: []Type{
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "flock_type", FldName: "type", TypeSize: 2}}, Vals: []uint64{0, 1, 2}, BitMask: true},
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "seek_whence", FldName: "whence", TypeSize: 2}}, Vals: []uint64{0, 1, 2}, BitMask: true},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
- &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "start", TypeSize: 8}}},
- &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "len", TypeSize: 8}}},
- &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "pid", TypeSize: 4}},
+ {Key: StructKey{Name: "childfdmap"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "childfdmap", TypeSize: 12}, Fields: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "parentfd", TypeSize: 4}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "childfd", TypeSize: 4}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "ok", TypeSize: 4}}},
+ }}},
+ {Key: StructKey{Name: "event_msg"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "event_msg", TypeSize: 24}, Fields: []Type{
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "event_type", FldName: "ev_type", TypeSize: 2}}, Vals: []uint64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 25, 50}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int16", FldName: "ev_arg1", TypeSize: 2}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "ev_arg2", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ev_arg3", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "ev_arg4", TypeSize: 8}}},
+ }}},
+ {Key: StructKey{Name: "event_queue"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "event_queue", TypeSize: 40}, Fields: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ev_mbox", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", TypeSize: 80}, Kind: 1, RangeBegin: 80, RangeEnd: 80}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "ev_flags", TypeSize: 4}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "ev_alert_pending", TypeSize: 1}}, Kind: 2, RangeEnd: 1},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 3}}, IsPad: true},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "ev_vcore", TypeSize: 4}}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "ev_handler", TypeSize: 8}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "ev_udata", TypeSize: 8}}},
+ }}},
+ {Key: StructKey{Name: "fd_tap_req"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "fd_tap_req", TypeSize: 32}, Fields: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "fdtap_commands", FldName: "cmd", TypeSize: 4}}, Vals: []uint64{1, 2, 3}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "fdtap_filters", FldName: "filter", TypeSize: 4}}, Vals: []uint64{1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024}, BitMask: true},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "ev_id", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ev_q", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "event_queue"}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "data", TypeSize: 8}}},
}}},
{Key: StructKey{Name: "timespec"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "timespec", TypeSize: 16}, Fields: []Type{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "sec", TypeSize: 8}}},
@@ -29,18 +50,53 @@ var structDescs_amd64 = []*KeyedStruct{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "sec", TypeSize: 8, ArgDir: 1}}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "nsec", TypeSize: 8, ArgDir: 1}}},
}}},
+ {Key: StructKey{Name: "vmm_gpcore_init"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "vmm_gpcore_init", TypeSize: 40}, Fields: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "posted_irq_desc", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vapic_addr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "apic_addr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "fsbase", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "gsbase", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}},
+ }}},
}
var syscalls_amd64 = []*Syscall{
+ {NR: 31, Name: "abort_sysc", CallName: "abort_sysc", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "syscall", TypeSize: 8}}},
+ }},
{NR: 33, Name: "abort_sysc_fd", CallName: "abort_sysc_fd", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
}},
+ {NR: 108, Name: "access", CallName: "access", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "path_l", TypeSize: 8}}, Buf: "path"},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 8}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}, BitMask: true},
+ }},
+ {NR: 2, Name: "block", CallName: "block", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "usec", TypeSize: 8}}},
+ }},
+ {NR: 3, Name: "cache_invalidate", CallName: "cache_invalidate"},
+ {NR: 29, Name: "change_to_m", CallName: "change_to_m"},
+ {NR: 14, Name: "change_vcore", CallName: "change_vcore", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vcoreid", TypeSize: 4}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "enable_my_notif", TypeSize: 4}}, Kind: 2, RangeEnd: 1},
+ }},
{NR: 116, Name: "chdir", CallName: "chdir", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "dir", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
}},
{NR: 103, Name: "close", CallName: "close", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
}},
+ {NR: 125, Name: "dup_fds_to", CallName: "dup_fds_to", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "pid", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "map", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}, Type: &StructType{Key: StructKey{Name: "childfdmap"}}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "nentries", TypeSize: 8}}, Buf: "map"},
+ }},
+ {NR: 16, Name: "exec", CallName: "exec", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "path_l", TypeSize: 8}}, Buf: "path"},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "argenv", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "argenv_l", TypeSize: 8}}, Buf: "argenv"},
+ }},
{NR: 124, Name: "fchdir", CallName: "fchdir", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
}},
@@ -49,11 +105,6 @@ var syscalls_amd64 = []*Syscall{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "arg", TypeSize: 4}},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
- {NR: 107, Name: "fcntl$F_DUPFD_CLOEXEC", CallName: "fcntl", Args: []Type{
- &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 1030},
- &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "arg", TypeSize: 4}},
- }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{NR: 107, Name: "fcntl$F_GETFD", CallName: "fcntl", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 1},
@@ -62,15 +113,6 @@ var syscalls_amd64 = []*Syscall{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 3},
}},
- {NR: 107, Name: "fcntl$F_GETLK", CallName: "fcntl", Args: []Type{
- &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 5},
- &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "lock", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "flock"}}},
- }},
- {NR: 107, Name: "fcntl$F_GETOWN", CallName: "fcntl", Args: []Type{
- &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 9},
- }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{NR: 107, Name: "fcntl$F_SETFD", CallName: "fcntl", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 2},
@@ -79,31 +121,38 @@ var syscalls_amd64 = []*Syscall{
{NR: 107, Name: "fcntl$F_SETFL", CallName: "fcntl", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 4},
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "fcntl_status", FldName: "flags", TypeSize: 8}}, Vals: []uint64{1024, 8192, 2048}, BitMask: true},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "fcntl_status", FldName: "flags", TypeSize: 8}}, Vals: []uint64{1024, 2048}, BitMask: true},
}},
- {NR: 107, Name: "fcntl$F_SETLK", CallName: "fcntl", Args: []Type{
+ {NR: 107, Name: "fcntl$F_SYNC", CallName: "fcntl", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 6},
- &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "lock", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "flock"}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 101},
}},
- {NR: 107, Name: "fcntl$F_SETLKW", CallName: "fcntl", Args: []Type{
+ {NR: 149, Name: "fd2path", CallName: "fd2path", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 7},
- &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "lock", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "flock"}}},
- }},
- {NR: 107, Name: "fcntl$F_SETOWN", CallName: "fcntl", Args: []Type{
- &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 8},
- &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "pid", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "u_buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "u_buf"},
}},
+ {NR: 15, Name: "fork", CallName: "fork"},
{NR: 104, Name: "fstat", CallName: "fstat", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "statbuf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}},
}},
+ {NR: 122, Name: "fwstat", CallName: "fwstat", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "stat_m", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "stat_sz", TypeSize: 8}}, BitSize: 8, Buf: "stat_m"},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}},
+ }},
{NR: 117, Name: "getcwd", CallName: "getcwd", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{ArgDir: 1, IsVarlen: true}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "buf"},
}},
+ {NR: 7, Name: "getpcoreid", CallName: "getpcoreid"},
+ {NR: 8, Name: "getvcoreid", CallName: "getvcoreid"},
+ {NR: 27, Name: "halt_core", CallName: "halt_core", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "usec", TypeSize: 8}}},
+ }},
+ {NR: 28, Name: "init_arsc", CallName: "init_arsc"},
{NR: 112, Name: "link", CallName: "link", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "old", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "new", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
@@ -127,7 +176,7 @@ var syscalls_amd64 = []*Syscall{
&VmaType{TypeCommon: TypeCommon{TypeName: "vma", FldName: "addr", TypeSize: 8}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "addr"},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "mmap_prot", FldName: "prot", TypeSize: 8}}, Vals: []uint64{4, 1, 2, 16777216, 33554432}, BitMask: true},
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "mmap_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{1, 2, 64, 32, 2048, 4096, 0, 16, 256, 262144, 8192, 65536, 16384, 32768, 131072}, BitMask: true},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "mmap_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{1, 2, 32, 2048, 4096, 16, 256, 8192, 65536, 16384, 32768, 131072}, BitMask: true},
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4, IsOptional: true}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "offset", TypeSize: 8}}},
}},
@@ -144,12 +193,69 @@ var syscalls_amd64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "req", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "timespec"}}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "rem", TypeSize: 8, IsOptional: true}, Type: &StructType{Key: StructKey{Name: "timespec", Dir: 1}}},
}},
+ {NR: 145, Name: "nbind", CallName: "nbind", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "src_path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "src_l", TypeSize: 8}}, Buf: "src_path"},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "onto_path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "onto_l", TypeSize: 8}}, Buf: "onto_path"},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bind_flags", FldName: "flag", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 4, 16}, BitMask: true},
+ }},
+ {NR: 146, Name: "nmount", CallName: "nmount", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "onto_path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "onto_l", TypeSize: 8}}, Buf: "onto_path"},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bind_flags", FldName: "lag", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 4, 16}, BitMask: true},
+ }},
+ {NR: 25, Name: "notify", CallName: "notify", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "target_pid", TypeSize: 4}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "event_type", FldName: "ev_type", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 25, 50}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "u_msg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "event_msg"}}},
+ }},
+ {NR: 147, Name: "nunmount", CallName: "nunmount", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "src_path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "src_l", TypeSize: 8}}, Buf: "src_path"},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "onto_path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "onto_l", TypeSize: 8}}, Buf: "onto_path"},
+ }},
{NR: 102, Name: "openat", CallName: "openat", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4, IsOptional: true}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
- &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 1024, 8192, 524288, 64, 65536, 128, 256, 131072, 2048, 1052672, 512, 4259840}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{1, 2, 3, 1024, 524288, 64, 65536, 128, 256, 131072, 2048, 4096, 512}},
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "open_mode", FldName: "mode", TypeSize: 8}}, Vals: []uint64{256, 128, 64, 32, 16, 8, 4, 2, 1}, BitMask: true},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
+ {NR: 30, Name: "poke_ksched", CallName: "poke_ksched", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "target_pid", TypeSize: 4}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "res_type", TypeSize: 8}}},
+ }},
+ {NR: 37, Name: "pop_ctx", CallName: "pop_ctx", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ctx", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", TypeSize: 216}, Kind: 1, RangeBegin: 216, RangeEnd: 216}},
+ }},
+ {NR: 32, Name: "populate_va", CallName: "populate_va", Args: []Type{
+ &VmaType{TypeCommon: TypeCommon{TypeName: "vma", FldName: "va", TypeSize: 8}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "nr_pgs", TypeSize: 8}}},
+ }},
+ {NR: 10, Name: "proc_create", CallName: "proc_create", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "path_l", TypeSize: 8}}, Buf: "path"},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "argenv", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string", IsVarlen: true}, Kind: 2}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "argenv_l", TypeSize: 8}}, Buf: "argenv"},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "flags", TypeSize: 8}}, Kind: 2, RangeEnd: 1},
+ }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
+ {NR: 12, Name: "proc_destroy", CallName: "proc_destroy", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "pid", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "exitcode", TypeSize: 4}}},
+ }},
+ {NR: 11, Name: "proc_run", CallName: "proc_run", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "pid", TypeSize: 4}},
+ }},
+ {NR: 13, Name: "proc_yield", CallName: "proc_yield", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "being_nice", TypeSize: 4}}, Kind: 2, RangeEnd: 1},
+ }},
+ {NR: 24, Name: "provision", CallName: "provision", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "target_pid", TypeSize: 4}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "res_type", TypeSize: 8}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "res_val", TypeSize: 8}}},
+ }},
{NR: 100, Name: "read", CallName: "read", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{ArgDir: 1, IsVarlen: true}}},
@@ -167,6 +273,17 @@ var syscalls_amd64 = []*Syscall{
{NR: 119, Name: "rmdir", CallName: "rmdir", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
}},
+ {NR: 26, Name: "self_notify", CallName: "self_notify", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vcoreid", TypeSize: 4}}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "event_type", FldName: "ev_type", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 25, 50}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "u_msg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "event_msg"}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "priv", TypeSize: 4}}, Kind: 2, RangeEnd: 1},
+ }},
+ {NR: 39, Name: "send_event", CallName: "send_event", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ev_q", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "event_queue"}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "u_msg", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "event_msg"}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vcoreid", TypeSize: 4}}},
+ }},
{NR: 105, Name: "stat", CallName: "stat", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "file", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "statbuf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}},
@@ -175,9 +292,42 @@ var syscalls_amd64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "old", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "new", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
}},
+ {NR: 126, Name: "tap_fds", CallName: "tap_fds", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "tap_reqs", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}, Type: &StructType{Key: StructKey{Name: "fd_tap_req"}}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "nr_reqs", TypeSize: 8}}, Buf: "tap_reqs"},
+ }},
+ {NR: 141, Name: "tcgetattr", CallName: "tcgetattr", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "termios_p", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", TypeSize: 60, ArgDir: 1}, Kind: 1, RangeBegin: 60, RangeEnd: 60}},
+ }},
+ {NR: 109, Name: "umask", CallName: "umask", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "mask", TypeSize: 4}}},
+ }},
{NR: 113, Name: "unlink", CallName: "unlink", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
}},
+ {NR: 35, Name: "vc_entry", CallName: "vc_entry"},
+ {NR: 34, Name: "vmm_add_gpcs", CallName: "vmm_add_gpcs", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "nr_more_gpcs", TypeSize: 8}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "gpcis", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "vmm_gpcore_init"}}},
+ }},
+ {NR: 40, Name: "vmm_ctl$VMM_CTL_GET_EXITS", CallName: "vmm_ctl", Args: []Type{
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 1},
+ }},
+ {NR: 40, Name: "vmm_ctl$VMM_CTL_GET_FLAGS", CallName: "vmm_ctl", Args: []Type{
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 3},
+ }},
+ {NR: 40, Name: "vmm_ctl$VMM_CTL_SET_EXITS", CallName: "vmm_ctl", Args: []Type{
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 2},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "vmm_exits", FldName: "arg", TypeSize: 8}}, Vals: []uint64{1}, BitMask: true},
+ }},
+ {NR: 40, Name: "vmm_ctl$VMM_CTL_SET_FLAGS", CallName: "vmm_ctl", Args: []Type{
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "cmd", TypeSize: 8}}, Val: 4},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "vmm_flags", FldName: "arg", TypeSize: 8}}, Vals: []uint64{1, 2, 4}, BitMask: true},
+ }},
+ {NR: 38, Name: "vmm_poke_guest", CallName: "vmm_poke_guest", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "guest_pcoreid", TypeSize: 4}}},
+ }},
{NR: 17, Name: "waitpid", CallName: "waitpid", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "pid", FldName: "pid", TypeSize: 4}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "status", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}},
@@ -188,34 +338,58 @@ var syscalls_amd64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buf", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{IsVarlen: true}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "count", TypeSize: 8}}, Buf: "buf"},
}},
+ {NR: 121, Name: "wstat", CallName: "wstat", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "path", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "filename", IsVarlen: true}, Kind: 3}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "path_l", TypeSize: 8}}, Buf: "path"},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "stat_m", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "stat_sz", TypeSize: 8}}, BitSize: 8, Buf: "stat_m"},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "flags", TypeSize: 8}}},
+ }},
}
var consts_amd64 = []ConstValue{
{Name: "AT_FDCWD", Value: 18446744073709551516},
- {Name: "FASYNC", Value: 8192},
+ {Name: "EVENT_MBOX_SIZE", Value: 80},
+ {Name: "EV_ALARM", Value: 7},
+ {Name: "EV_CHECK_MSGS", Value: 11},
+ {Name: "EV_EVENT", Value: 8},
+ {Name: "EV_FREE_APPLE_PIE", Value: 9},
+ {Name: "EV_GANG_PREMPT_PENDING", Value: 2},
+ {Name: "EV_GANG_RETURN", Value: 4},
+ {Name: "EV_NONE"},
+ {Name: "EV_PAGE_FAULT", Value: 6},
+ {Name: "EV_POSIX_SIGNAL", Value: 12},
+ {Name: "EV_PREEMPT_PENDING", Value: 1},
+ {Name: "EV_SYSCALL", Value: 10},
+ {Name: "EV_USER_IPI", Value: 5},
+ {Name: "EV_VCORE_PREEMPT", Value: 3},
+ {Name: "FDTAP_CMD_ADD", Value: 1},
+ {Name: "FDTAP_CMD_MOD", Value: 3},
+ {Name: "FDTAP_CMD_REM", Value: 2},
+ {Name: "FDTAP_FILT_ATTRIB", Value: 128},
+ {Name: "FDTAP_FILT_DELETED", Value: 8},
+ {Name: "FDTAP_FILT_ERROR", Value: 16},
+ {Name: "FDTAP_FILT_HANGUP", Value: 512},
+ {Name: "FDTAP_FILT_PRIORITY", Value: 256},
+ {Name: "FDTAP_FILT_RDHUP", Value: 1024},
+ {Name: "FDTAP_FILT_READABLE", Value: 1},
+ {Name: "FDTAP_FILT_RENAME", Value: 32},
+ {Name: "FDTAP_FILT_TRUNCATE", Value: 64},
+ {Name: "FDTAP_FILT_WRITABLE", Value: 2},
+ {Name: "FDTAP_FILT_WRITTEN", Value: 4},
{Name: "FD_CLOEXEC", Value: 1},
{Name: "F_DUPFD"},
- {Name: "F_DUPFD_CLOEXEC", Value: 1030},
{Name: "F_GETFD", Value: 1},
{Name: "F_GETFL", Value: 3},
- {Name: "F_GETLK", Value: 5},
- {Name: "F_GETOWN", Value: 9},
- {Name: "F_RDLCK"},
{Name: "F_SETFD", Value: 2},
{Name: "F_SETFL", Value: 4},
- {Name: "F_SETLK", Value: 6},
- {Name: "F_SETLKW", Value: 7},
- {Name: "F_SETOWN", Value: 8},
- {Name: "F_UNLCK", Value: 2},
- {Name: "F_WRLCK", Value: 1},
- {Name: "MAP_32BIT", Value: 64},
+ {Name: "F_SYNC", Value: 101},
+ {Name: "MAFTER", Value: 2},
{Name: "MAP_ANONYMOUS", Value: 32},
{Name: "MAP_DENYWRITE", Value: 2048},
{Name: "MAP_EXECUTABLE", Value: 4096},
- {Name: "MAP_FILE"},
{Name: "MAP_FIXED", Value: 16},
{Name: "MAP_GROWSDOWN", Value: 256},
- {Name: "MAP_HUGETLB", Value: 262144},
{Name: "MAP_LOCKED", Value: 8192},
{Name: "MAP_NONBLOCK", Value: 65536},
{Name: "MAP_NORESERVE", Value: 16384},
@@ -223,6 +397,12 @@ var consts_amd64 = []ConstValue{
{Name: "MAP_PRIVATE", Value: 2},
{Name: "MAP_SHARED", Value: 1},
{Name: "MAP_STACK", Value: 131072},
+ {Name: "MAX_NR_EVENT", Value: 50},
+ {Name: "MBEFORE", Value: 1},
+ {Name: "MCACHE", Value: 16},
+ {Name: "MCREATE", Value: 4},
+ {Name: "MREPL"},
+ {Name: "NR_EVENT_TYPES", Value: 25},
{Name: "O_APPEND", Value: 1024},
{Name: "O_CLOEXEC", Value: 524288},
{Name: "O_CREAT", Value: 64},
@@ -231,27 +411,42 @@ var consts_amd64 = []ConstValue{
{Name: "O_NOCTTY", Value: 256},
{Name: "O_NOFOLLOW", Value: 131072},
{Name: "O_NONBLOCK", Value: 2048},
- {Name: "O_RDONLY"},
- {Name: "O_RDWR", Value: 2},
- {Name: "O_SYNC", Value: 1052672},
+ {Name: "O_RDONLY", Value: 1},
+ {Name: "O_RDWR", Value: 3},
+ {Name: "O_SYNC", Value: 4096},
{Name: "O_TRUNC", Value: 512},
- {Name: "O_WRONLY", Value: 1},
+ {Name: "O_WRONLY", Value: 2},
{Name: "PROT_EXEC", Value: 4},
{Name: "PROT_GROWSDOWN", Value: 16777216},
{Name: "PROT_GROWSUP", Value: 33554432},
{Name: "PROT_READ", Value: 1},
{Name: "PROT_WRITE", Value: 2},
+ {Name: "RES_CORES"},
{Name: "SEEK_CUR", Value: 1},
{Name: "SEEK_END", Value: 2},
{Name: "SEEK_SET"},
+ {Name: "SYS_abort_sysc", Value: 31},
{Name: "SYS_abort_sysc_fd", Value: 33},
+ {Name: "SYS_access", Value: 108},
+ {Name: "SYS_block", Value: 2},
+ {Name: "SYS_cache_invalidate", Value: 3},
+ {Name: "SYS_change_to_m", Value: 29},
+ {Name: "SYS_change_vcore", Value: 14},
{Name: "SYS_chdir", Value: 116},
{Name: "SYS_close", Value: 103},
+ {Name: "SYS_dup_fds_to", Value: 125},
+ {Name: "SYS_exec", Value: 16},
{Name: "SYS_fchdir", Value: 124},
{Name: "SYS_fcntl", Value: 107},
+ {Name: "SYS_fd2path", Value: 149},
{Name: "SYS_fork", Value: 15},
{Name: "SYS_fstat", Value: 104},
+ {Name: "SYS_fwstat", Value: 122},
{Name: "SYS_getcwd", Value: 117},
+ {Name: "SYS_getpcoreid", Value: 7},
+ {Name: "SYS_getvcoreid", Value: 8},
+ {Name: "SYS_halt_core", Value: 27},
+ {Name: "SYS_init_arsc", Value: 28},
{Name: "SYS_link", Value: 112},
{Name: "SYS_llseek", Value: 111},
{Name: "SYS_lstat", Value: 106},
@@ -260,16 +455,38 @@ var consts_amd64 = []ConstValue{
{Name: "SYS_mprotect", Value: 20},
{Name: "SYS_munmap", Value: 19},
{Name: "SYS_nanosleep", Value: 36},
+ {Name: "SYS_nbind", Value: 145},
+ {Name: "SYS_nmount", Value: 146},
+ {Name: "SYS_notify", Value: 25},
+ {Name: "SYS_nunmount", Value: 147},
{Name: "SYS_openat", Value: 102},
+ {Name: "SYS_poke_ksched", Value: 30},
+ {Name: "SYS_pop_ctx", Value: 37},
+ {Name: "SYS_populate_va", Value: 32},
+ {Name: "SYS_proc_create", Value: 10},
+ {Name: "SYS_proc_destroy", Value: 12},
+ {Name: "SYS_proc_run", Value: 11},
+ {Name: "SYS_proc_yield", Value: 13},
+ {Name: "SYS_provision", Value: 24},
{Name: "SYS_read", Value: 100},
{Name: "SYS_readlink", Value: 115},
{Name: "SYS_rename", Value: 123},
{Name: "SYS_rmdir", Value: 119},
+ {Name: "SYS_self_notify", Value: 26},
+ {Name: "SYS_send_event", Value: 39},
{Name: "SYS_stat", Value: 105},
{Name: "SYS_symlink", Value: 114},
+ {Name: "SYS_tap_fds", Value: 126},
+ {Name: "SYS_tcgetattr", Value: 141},
+ {Name: "SYS_umask", Value: 109},
{Name: "SYS_unlink", Value: 113},
+ {Name: "SYS_vc_entry", Value: 35},
+ {Name: "SYS_vmm_add_gpcs", Value: 34},
+ {Name: "SYS_vmm_ctl", Value: 40},
+ {Name: "SYS_vmm_poke_guest", Value: 38},
{Name: "SYS_waitpid", Value: 17},
{Name: "SYS_write", Value: 101},
+ {Name: "SYS_wstat", Value: 121},
{Name: "S_IRGRP", Value: 32},
{Name: "S_IROTH", Value: 4},
{Name: "S_IRUSR", Value: 256},
@@ -279,9 +496,18 @@ var consts_amd64 = []ConstValue{
{Name: "S_IXGRP", Value: 8},
{Name: "S_IXOTH", Value: 1},
{Name: "S_IXUSR", Value: 64},
+ {Name: "TERMIOS_SIZE", Value: 60},
+ {Name: "USER_CONTEXT_SIZE", Value: 216},
+ {Name: "VMM_CTL_EXIT_HALT", Value: 1},
+ {Name: "VMM_CTL_EXIT_MWAIT", Value: 4},
+ {Name: "VMM_CTL_EXIT_PAUSE", Value: 2},
+ {Name: "VMM_CTL_FL_KERN_PRINTC", Value: 1},
+ {Name: "VMM_CTL_GET_EXITS", Value: 1},
+ {Name: "VMM_CTL_GET_FLAGS", Value: 3},
+ {Name: "VMM_CTL_SET_EXITS", Value: 2},
+ {Name: "VMM_CTL_SET_FLAGS", Value: 4},
{Name: "WNOHANG", Value: 1},
{Name: "WUNTRACED", Value: 2},
- {Name: "__O_TMPFILE", Value: 4259840},
}
-const revision_amd64 = "c9ad4b6b2170889e4578f982cada749d94dfbd59"
+const revision_amd64 = "f6dc674ef2200959a7b03f71a281c2b60ebe0820"
diff --git a/sys/akaros/sys.txt b/sys/akaros/sys.txt
index 186d4470e..77c332466 100644
--- a/sys/akaros/sys.txt
+++ b/sys/akaros/sys.txt
@@ -1,12 +1,17 @@
# 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.
-include <sys/mman.h>
-include <sys/types.h>
-include <sys/wait.h>
-include <sys/stat.h>
-include <fcntl.h>
-include <unistd.h>
+include <ros/syscall.h>
+include <ros/mman.h>
+include <ros/fs.h>
+include <ros/procinfo.h>
+include <ros/resource.h>
+include <ros/event.h>
+include <ros/vmm.h>
+include <ros/trapframe.h>
+include <ros/fdtap.h>
+include <ros/bits/posix_signum.h>
+include <termios.h>
resource fd[int32]: 0xffffffffffffffff, AT_FDCWD
resource pid[int32]: 0, 0xffffffffffffffff
@@ -32,34 +37,27 @@ mkdir(path ptr[in, filename], mode flags[open_mode])
rmdir(path ptr[in, filename])
fcntl$F_DUPFD(fd fd, cmd const[F_DUPFD], arg fd) fd
-fcntl$F_DUPFD_CLOEXEC(fd fd, cmd const[F_DUPFD_CLOEXEC], arg fd) fd
fcntl$F_GETFD(fd fd, cmd const[F_GETFD])
fcntl$F_GETFL(fd fd, cmd const[F_GETFL])
fcntl$F_SETFD(fd fd, cmd const[F_SETFD], flags flags[fcntl_flags])
fcntl$F_SETFL(fd fd, cmd const[F_SETFL], flags flags[fcntl_status])
-fcntl$F_SETLK(fd fd, cmd const[F_SETLK], lock ptr[in, flock])
-fcntl$F_SETLKW(fd fd, cmd const[F_SETLKW], lock ptr[in, flock])
-fcntl$F_GETLK(fd fd, cmd const[F_GETLK], lock ptr[in, flock])
-fcntl$F_GETOWN(fd fd, cmd const[F_GETOWN]) pid
-fcntl$F_SETOWN(fd fd, cmd const[F_SETOWN], pid pid)
+fcntl$F_SYNC(fd fd, cmd const[F_SYNC])
mmap(addr vma, len len[addr], prot flags[mmap_prot], flags flags[mmap_flags], fd fd[opt], offset intptr)
munmap(addr vma, len len[addr])
mprotect(addr vma, len len[addr], prot flags[mmap_prot])
-# TODO: disabled because crashes kernel frequently.
-# fork()
+fork()
waitpid(pid pid, status ptr[out, int32], options flags[wait_options])
nanosleep(req ptr[in, timespec], rem ptr[out, timespec, opt])
-open_flags = O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, FASYNC, O_CLOEXEC, O_CREAT, O_DIRECTORY, O_EXCL, O_NOCTTY, O_NOFOLLOW, O_NONBLOCK, O_SYNC, O_TRUNC, __O_TMPFILE
+open_flags = O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CLOEXEC, O_CREAT, O_DIRECTORY, O_EXCL, O_NOCTTY, O_NOFOLLOW, O_NONBLOCK, O_SYNC, O_TRUNC
open_mode = S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH
mmap_prot = PROT_EXEC, PROT_READ, PROT_WRITE, PROT_GROWSDOWN, PROT_GROWSUP
-mmap_flags = MAP_SHARED, MAP_PRIVATE, MAP_32BIT, MAP_ANONYMOUS, MAP_DENYWRITE, MAP_EXECUTABLE, MAP_FILE, MAP_FIXED, MAP_GROWSDOWN, MAP_HUGETLB, MAP_LOCKED, MAP_NONBLOCK, MAP_NORESERVE, MAP_POPULATE, MAP_STACK
+mmap_flags = MAP_SHARED, MAP_PRIVATE, MAP_ANONYMOUS, MAP_DENYWRITE, MAP_EXECUTABLE, MAP_FIXED, MAP_GROWSDOWN, MAP_LOCKED, MAP_NONBLOCK, MAP_NORESERVE, MAP_POPULATE, MAP_STACK
wait_options = WNOHANG, WUNTRACED
fcntl_flags = FD_CLOEXEC
-fcntl_status = O_APPEND, FASYNC, O_NONBLOCK
-flock_type = F_RDLCK, F_WRLCK, F_UNLCK
+fcntl_status = O_APPEND, O_NONBLOCK
seek_whence = SEEK_SET, SEEK_CUR, SEEK_END
timespec {
@@ -67,55 +65,116 @@ timespec {
nsec intptr
}
-flock {
- type flags[flock_type, int16]
- whence flags[seek_whence, int16]
- start intptr
- len intptr
- pid pid
+block(usec intptr)
+cache_invalidate()
+getpcoreid()
+getvcoreid()
+proc_create(path ptr[in, filename], path_l len[path], argenv ptr[in, string], argenv_l len[argenv], flags boolptr) pid
+proc_run(pid pid)
+proc_destroy(pid pid, exitcode int32)
+proc_yield(being_nice bool32)
+change_vcore(vcoreid int32, enable_my_notif bool32)
+exec(path ptr[in, filename], path_l len[path], argenv ptr[in, string], argenv_l len[argenv])
+provision(target_pid pid, res_type const[RES_CORES], res_val intptr)
+notify(target_pid pid, ev_type flags[event_type], u_msg ptr[in, event_msg])
+self_notify(vcoreid int32, ev_type flags[event_type], u_msg ptr[in, event_msg], priv bool32)
+halt_core(usec intptr)
+init_arsc()
+change_to_m()
+poke_ksched(target_pid pid, res_type const[0])
+abort_sysc(syscall intptr)
+populate_va(va vma, nr_pgs intptr)
+vmm_add_gpcs(nr_more_gpcs intptr, gpcis ptr[in, vmm_gpcore_init])
+vc_entry()
+pop_ctx(ctx ptr[in, user_context])
+vmm_poke_guest(guest_pcoreid int32)
+send_event(ev_q ptr[in, event_queue], u_msg ptr[in, event_msg], vcoreid int32)
+access(path ptr[in, filename], path_l len[path], mode flags[open_mode])
+umask(mask int32)
+wstat(path ptr[in, filename], path_l len[path], stat_m ptr[out, array[int8]], stat_sz bytesize[stat_m], flags const[0])
+fwstat(fd fd, stat_m ptr[out, array[int8]], stat_sz bytesize[stat_m], flags const[0])
+dup_fds_to(pid pid, map ptr[in, array[childfdmap]], nentries len[map])
+tap_fds(tap_reqs ptr[in, array[fd_tap_req]], nr_reqs len[tap_reqs])
+tcgetattr(fd fd, termios_p ptr[out, array[int8, TERMIOS_SIZE]])
+nbind(src_path ptr[in, filename], src_l len[src_path], onto_path ptr[in, filename], onto_l len[onto_path], flag flags[bind_flags])
+nmount(fd fd, onto_path ptr[in, filename], onto_l len[onto_path], lag flags[bind_flags])
+nunmount(src_path ptr[in, filename], src_l len[src_path], onto_path ptr[in, filename], onto_l len[onto_path])
+fd2path(fd fd, u_buf ptr[out, array[int8]], len len[u_buf])
+
+vmm_ctl$VMM_CTL_GET_EXITS(cmd const[VMM_CTL_GET_EXITS])
+vmm_ctl$VMM_CTL_SET_EXITS(cmd const[VMM_CTL_SET_EXITS], arg flags[vmm_exits])
+vmm_ctl$VMM_CTL_GET_FLAGS(cmd const[VMM_CTL_GET_FLAGS])
+vmm_ctl$VMM_CTL_SET_FLAGS(cmd const[VMM_CTL_SET_FLAGS], arg flags[vmm_flags])
+
+vmm_exits = VMM_CTL_FL_KERN_PRINTC
+vmm_flags = VMM_CTL_EXIT_HALT, VMM_CTL_EXIT_PAUSE, VMM_CTL_EXIT_MWAIT
+
+bind_flags = MREPL, MBEFORE, MAFTER, MCREATE, MCACHE
+
+event_msg {
+ ev_type flags[event_type, int16]
+ ev_arg1 int16
+ ev_arg2 int32
+ ev_arg3 ptr[in, array[int8]]
+ ev_arg4 int64
+}
+
+event_queue {
+ ev_mbox ptr[in, event_mbox]
+ ev_flags int32
+ ev_alert_pending bool8
+ ev_vcore int32
+# TODO: this is a function pointer, is it called by kernel?
+ ev_handler intptr
+ ev_udata intptr
+}
+
+# TODO: do we need more precise description?
+type event_mbox array[int8, EVENT_MBOX_SIZE]
+
+vmm_gpcore_init {
+ posted_irq_desc ptr[in, array[int8]]
+ vapic_addr ptr[in, array[int8]]
+ apic_addr ptr[in, array[int8]]
+ fsbase ptr[in, array[int8]]
+ gsbase ptr[in, array[int8]]
}
-# TODO:
-#define SYS_null 1
-#define SYS_block 2
-#define SYS_cache_invalidate 3
-#define SYS_reboot 4
-#define SYS_getpcoreid 7
-#define SYS_getvcoreid 8
-#define SYS_proc_create 10
-#define SYS_proc_run 11
-#define SYS_proc_destroy 12
-#define SYS_proc_yield 13
-#define SYS_change_vcore 14
-#define SYS_exec 16
-#define SYS_shared_page_alloc 22
-#define SYS_shared_page_free 23
-#define SYS_provision 24
-#define SYS_notify 25
-#define SYS_self_notify 26
-#define SYS_halt_core 27
-#define SYS_init_arsc 28
-#define SYS_change_to_m 29
-#define SYS_poke_ksched 30
-#define SYS_abort_sysc 31
-#define SYS_populate_va 32
-#define SYS_vmm_add_gpcs 34
-#define SYS_vc_entry 35
-#define SYS_pop_ctx 37
-#define SYS_vmm_poke_guest 38
-#define SYS_send_event 39
-#define SYS_vmm_ctl 40
-#define SYS_access 108
-#define SYS_umask 109
-#define SYS_wstat 121
-#define SYS_fwstat 122
-#define SYS_dup_fds_to 125
-#define SYS_tap_fds 126
-#define SYS_tcgetattr 141
-#define SYS_tcsetattr 142
-#define SYS_setuid 143
-#define SYS_setgid 144
-#define SYS_nbind 145
-#define SYS_nmount 146
-#define SYS_nunmount 147
-#define SYS_fd2path 149
+childfdmap {
+ parentfd fd
+ childfd const[0, int32]
+ ok const[0, int32]
+}
+
+fd_tap_req {
+ fd fd
+ cmd flags[fdtap_commands, int32]
+ filter flags[fdtap_filters, int32]
+ ev_id int32
+ ev_q ptr[in, event_queue]
+ data const[0, intptr]
+}
+
+fdtap_commands = FDTAP_CMD_ADD, FDTAP_CMD_REM, FDTAP_CMD_MOD
+fdtap_filters = FDTAP_FILT_READABLE, FDTAP_FILT_WRITABLE, FDTAP_FILT_WRITTEN, FDTAP_FILT_DELETED, FDTAP_FILT_ERROR, FDTAP_FILT_RENAME, FDTAP_FILT_TRUNCATE, FDTAP_FILT_ATTRIB, FDTAP_FILT_PRIORITY, FDTAP_FILT_HANGUP, FDTAP_FILT_RDHUP
+
+# TODO: do we need more precise description?
+type user_context array[int8, USER_CONTEXT_SIZE]
+
+define USER_CONTEXT_SIZE sizeof(struct user_context)
+define TERMIOS_SIZE sizeof(struct termios)
+define EVENT_MBOX_SIZE sizeof(struct event_mbox)
+
+event_type = EV_NONE, EV_PREEMPT_PENDING, EV_GANG_PREMPT_PENDING, EV_VCORE_PREEMPT, EV_GANG_RETURN, EV_USER_IPI, EV_PAGE_FAULT, EV_ALARM, EV_EVENT, EV_FREE_APPLE_PIE, EV_SYSCALL, EV_CHECK_MSGS, EV_POSIX_SIGNAL, NR_EVENT_TYPES, MAX_NR_EVENT
+
+# Akaros does not bother to define these in headers.
+define SEEK_SET 0
+define SEEK_CUR 1
+define SEEK_END 2
+
+# Can't include <ns.h> because it conflicts with other header files (how it is supposed to be used?).
+define MREPL 0x0000
+define MBEFORE 0x0001
+define MAFTER 0x0002
+define MCREATE 0x0004
+define MCACHE 0x0010
diff --git a/sys/akaros/sys_amd64.const b/sys/akaros/sys_amd64.const
index 3154e8339..4e928a7d6 100644
--- a/sys/akaros/sys_amd64.const
+++ b/sys/akaros/sys_amd64.const
@@ -1,29 +1,46 @@
# AUTOGENERATED FILE
AT_FDCWD = 18446744073709551516
-FASYNC = 8192
+EVENT_MBOX_SIZE = 80
+EV_ALARM = 7
+EV_CHECK_MSGS = 11
+EV_EVENT = 8
+EV_FREE_APPLE_PIE = 9
+EV_GANG_PREMPT_PENDING = 2
+EV_GANG_RETURN = 4
+EV_NONE = 0
+EV_PAGE_FAULT = 6
+EV_POSIX_SIGNAL = 12
+EV_PREEMPT_PENDING = 1
+EV_SYSCALL = 10
+EV_USER_IPI = 5
+EV_VCORE_PREEMPT = 3
+FDTAP_CMD_ADD = 1
+FDTAP_CMD_MOD = 3
+FDTAP_CMD_REM = 2
+FDTAP_FILT_ATTRIB = 128
+FDTAP_FILT_DELETED = 8
+FDTAP_FILT_ERROR = 16
+FDTAP_FILT_HANGUP = 512
+FDTAP_FILT_PRIORITY = 256
+FDTAP_FILT_RDHUP = 1024
+FDTAP_FILT_READABLE = 1
+FDTAP_FILT_RENAME = 32
+FDTAP_FILT_TRUNCATE = 64
+FDTAP_FILT_WRITABLE = 2
+FDTAP_FILT_WRITTEN = 4
FD_CLOEXEC = 1
F_DUPFD = 0
-F_DUPFD_CLOEXEC = 1030
F_GETFD = 1
F_GETFL = 3
-F_GETLK = 5
-F_GETOWN = 9
-F_RDLCK = 0
F_SETFD = 2
F_SETFL = 4
-F_SETLK = 6
-F_SETLKW = 7
-F_SETOWN = 8
-F_UNLCK = 2
-F_WRLCK = 1
-MAP_32BIT = 64
+F_SYNC = 101
+MAFTER = 2
MAP_ANONYMOUS = 32
MAP_DENYWRITE = 2048
MAP_EXECUTABLE = 4096
-MAP_FILE = 0
MAP_FIXED = 16
MAP_GROWSDOWN = 256
-MAP_HUGETLB = 262144
MAP_LOCKED = 8192
MAP_NONBLOCK = 65536
MAP_NORESERVE = 16384
@@ -31,6 +48,12 @@ MAP_POPULATE = 32768
MAP_PRIVATE = 2
MAP_SHARED = 1
MAP_STACK = 131072
+MAX_NR_EVENT = 50
+MBEFORE = 1
+MCACHE = 16
+MCREATE = 4
+MREPL = 0
+NR_EVENT_TYPES = 25
O_APPEND = 1024
O_CLOEXEC = 524288
O_CREAT = 64
@@ -39,27 +62,42 @@ O_EXCL = 128
O_NOCTTY = 256
O_NOFOLLOW = 131072
O_NONBLOCK = 2048
-O_RDONLY = 0
-O_RDWR = 2
-O_SYNC = 1052672
+O_RDONLY = 1
+O_RDWR = 3
+O_SYNC = 4096
O_TRUNC = 512
-O_WRONLY = 1
+O_WRONLY = 2
PROT_EXEC = 4
PROT_GROWSDOWN = 16777216
PROT_GROWSUP = 33554432
PROT_READ = 1
PROT_WRITE = 2
+RES_CORES = 0
SEEK_CUR = 1
SEEK_END = 2
SEEK_SET = 0
+SYS_abort_sysc = 31
SYS_abort_sysc_fd = 33
+SYS_access = 108
+SYS_block = 2
+SYS_cache_invalidate = 3
+SYS_change_to_m = 29
+SYS_change_vcore = 14
SYS_chdir = 116
SYS_close = 103
+SYS_dup_fds_to = 125
+SYS_exec = 16
SYS_fchdir = 124
SYS_fcntl = 107
+SYS_fd2path = 149
SYS_fork = 15
SYS_fstat = 104
+SYS_fwstat = 122
SYS_getcwd = 117
+SYS_getpcoreid = 7
+SYS_getvcoreid = 8
+SYS_halt_core = 27
+SYS_init_arsc = 28
SYS_link = 112
SYS_llseek = 111
SYS_lstat = 106
@@ -68,16 +106,38 @@ SYS_mmap = 18
SYS_mprotect = 20
SYS_munmap = 19
SYS_nanosleep = 36
+SYS_nbind = 145
+SYS_nmount = 146
+SYS_notify = 25
+SYS_nunmount = 147
SYS_openat = 102
+SYS_poke_ksched = 30
+SYS_pop_ctx = 37
+SYS_populate_va = 32
+SYS_proc_create = 10
+SYS_proc_destroy = 12
+SYS_proc_run = 11
+SYS_proc_yield = 13
+SYS_provision = 24
SYS_read = 100
SYS_readlink = 115
SYS_rename = 123
SYS_rmdir = 119
+SYS_self_notify = 26
+SYS_send_event = 39
SYS_stat = 105
SYS_symlink = 114
+SYS_tap_fds = 126
+SYS_tcgetattr = 141
+SYS_umask = 109
SYS_unlink = 113
+SYS_vc_entry = 35
+SYS_vmm_add_gpcs = 34
+SYS_vmm_ctl = 40
+SYS_vmm_poke_guest = 38
SYS_waitpid = 17
SYS_write = 101
+SYS_wstat = 121
S_IRGRP = 32
S_IROTH = 4
S_IRUSR = 256
@@ -87,6 +147,15 @@ S_IWUSR = 128
S_IXGRP = 8
S_IXOTH = 1
S_IXUSR = 64
+TERMIOS_SIZE = 60
+USER_CONTEXT_SIZE = 216
+VMM_CTL_EXIT_HALT = 1
+VMM_CTL_EXIT_MWAIT = 4
+VMM_CTL_EXIT_PAUSE = 2
+VMM_CTL_FL_KERN_PRINTC = 1
+VMM_CTL_GET_EXITS = 1
+VMM_CTL_GET_FLAGS = 3
+VMM_CTL_SET_EXITS = 2
+VMM_CTL_SET_FLAGS = 4
WNOHANG = 1
WUNTRACED = 2
-__O_TMPFILE = 4259840
diff --git a/sys/syz-extract/akaros.go b/sys/syz-extract/akaros.go
index ee7d1a3bd..e9a2dd3af 100644
--- a/sys/syz-extract/akaros.go
+++ b/sys/syz-extract/akaros.go
@@ -25,8 +25,13 @@ func (*akaros) prepareArch(arch *Arch) error {
func (*akaros) processFile(arch *Arch, info *compiler.ConstInfo) (map[string]uint64, map[string]bool, error) {
dir := arch.sourceDir
- syscallH := filepath.Join(dir, "kern", "include", "ros", "bits", "syscall.h")
- args := []string{"-fmessage-length=0", "--include", syscallH}
+ args := []string{
+ "-fmessage-length=0",
+ "-D__KERNEL__",
+ "-DROS_KERNEL",
+ "-I", filepath.Join(dir, "kern", "include"),
+ "-I", filepath.Join(dir, "user", "parlib", "include"),
+ }
for _, incdir := range info.Incdirs {
args = append(args, "-I"+filepath.Join(dir, incdir))
}