aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorJulia Hansbrough <flowerhack@google.com>2018-07-03 19:53:42 -0700
committerDmitry Vyukov <dvyukov@google.com>2018-07-07 13:56:36 +0200
commitab89aea98e577670c444de85f1c347d347e49d9f (patch)
treed6ce6f52b8c774a52323644f484b9b412f6ca145 /sys
parent6c0c0099a0b807a5fcab6578b3b687b004ca1690 (diff)
sys/fuchsia: Update Fuchsia syscalls.
Updates cover * zx_vmo_create * zx_clock_get_monotonic * hypervisor- and vCPU-related syscalls * system_get_features * some DDK syscalls
Diffstat (limited to 'sys')
-rw-r--r--sys/fuchsia/ddk.txt13
-rw-r--r--sys/fuchsia/ddk_amd64.const5
-rw-r--r--sys/fuchsia/ddk_arm64.const5
-rw-r--r--sys/fuchsia/gen/amd64.go104
-rw-r--r--sys/fuchsia/gen/arm64.go104
-rw-r--r--sys/fuchsia/hypervisor_guests.txt15
-rw-r--r--sys/fuchsia/hypervisor_guests_amd64.const2
-rw-r--r--sys/fuchsia/hypervisor_guests_arm64.const2
-rw-r--r--sys/fuchsia/log.txt6
-rw-r--r--sys/fuchsia/objects.txt8
-rw-r--r--sys/fuchsia/posix_amd64.const4
-rw-r--r--sys/fuchsia/posix_arm64.const4
-rw-r--r--sys/fuchsia/sys.txt10
-rw-r--r--sys/fuchsia/time.txt2
-rw-r--r--sys/fuchsia/vmos.txt4
-rw-r--r--sys/fuchsia/vmos_amd64.const1
-rw-r--r--sys/fuchsia/vmos_arm64.const1
17 files changed, 258 insertions, 32 deletions
diff --git a/sys/fuchsia/ddk.txt b/sys/fuchsia/ddk.txt
new file mode 100644
index 000000000..0ad5bee76
--- /dev/null
+++ b/sys/fuchsia/ddk.txt
@@ -0,0 +1,13 @@
+include <zircon/syscalls.h>
+include <zircon/types.h>
+
+resource zx_interrupt[intptr]
+
+cache_flush_flags = ZX_CACHE_FLUSH_DATA, ZX_CACHE_FLUSH_INVALIDATE, ZX_CACHE_FLUSH_INSN
+
+zx_cache_flush(addr ptr[out, intptr], size int64, flags flags[cache_flush_flags])
+# TODO: enable modes other than ZX_INTERRUPT_VIRTUAL
+zx_interrupt_create(src_obj const[0], src_num const[0], options const[ZX_INTERRUPT_VIRTUAL], interrupt ptr[out, zx_interrupt])
+zx_interrupt_ack(interrupt zx_interrupt)
+zx_interrupt_destroy(interrupt zx_interrupt)
+# TODO fill out remaining interrupt syscalls
diff --git a/sys/fuchsia/ddk_amd64.const b/sys/fuchsia/ddk_amd64.const
new file mode 100644
index 000000000..d004f8574
--- /dev/null
+++ b/sys/fuchsia/ddk_amd64.const
@@ -0,0 +1,5 @@
+# AUTOGENERATED FILE
+ZX_CACHE_FLUSH_DATA = 2
+ZX_CACHE_FLUSH_INSN = 1
+ZX_CACHE_FLUSH_INVALIDATE = 4
+ZX_INTERRUPT_VIRTUAL = 16
diff --git a/sys/fuchsia/ddk_arm64.const b/sys/fuchsia/ddk_arm64.const
new file mode 100644
index 000000000..d004f8574
--- /dev/null
+++ b/sys/fuchsia/ddk_arm64.const
@@ -0,0 +1,5 @@
+# AUTOGENERATED FILE
+ZX_CACHE_FLUSH_DATA = 2
+ZX_CACHE_FLUSH_INSN = 1
+ZX_CACHE_FLUSH_INVALIDATE = 4
+ZX_INTERRUPT_VIRTUAL = 16
diff --git a/sys/fuchsia/gen/amd64.go b/sys/fuchsia/gen/amd64.go
index 1eb94fc6e..63d7a8ff2 100644
--- a/sys/fuchsia/gen/amd64.go
+++ b/sys/fuchsia/gen/amd64.go
@@ -13,18 +13,23 @@ var resources_amd64 = []*ResourceDesc{
{Name: "pid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"pid"}, Values: []uint64{0, 18446744073709551615}},
{Name: "uid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"uid"}, Values: []uint64{0, 18446744073709551615}},
{Name: "zx_chan", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_chan"}, Values: []uint64{0}},
+ {Name: "zx_debug_log", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_debug_log"}, Values: []uint64{0}},
{Name: "zx_event", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_event"}, Values: []uint64{0}},
{Name: "zx_fifo", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_fifo"}, Values: []uint64{0}},
+ {Name: "zx_guest", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8}}}, Kind: []string{"zx_guest"}, Values: []uint64{0}},
{Name: "zx_handle", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle"}, Values: []uint64{0}},
+ {Name: "zx_interrupt", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8}}}, Kind: []string{"zx_interrupt"}, Values: []uint64{0}},
{Name: "zx_job", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_task", "zx_job"}, Values: []uint64{0}},
{Name: "zx_log", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_log"}, Values: []uint64{0}},
{Name: "zx_port", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_port"}, Values: []uint64{0}},
{Name: "zx_process", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_task", "zx_process"}, Values: []uint64{0}},
+ {Name: "zx_root_resource", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_root_resource"}, Values: []uint64{0}},
{Name: "zx_socket", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_socket"}, Values: []uint64{0}},
{Name: "zx_task", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_task"}, Values: []uint64{0}},
{Name: "zx_thread", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_task", "zx_thread"}, Values: []uint64{0}},
{Name: "zx_time", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, Kind: []string{"zx_time"}, Values: []uint64{0, 18446744073709551615}},
{Name: "zx_timer", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_timer"}, Values: []uint64{0}},
+ {Name: "zx_vcpu", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_vcpu"}, Values: []uint64{0}},
{Name: "zx_vmar", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_vmar"}, Values: []uint64{0}},
{Name: "zx_vmo", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_vmo"}, Values: []uint64{0}},
}
@@ -303,6 +308,7 @@ var syscalls_amd64 = []*Syscall{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "len", TypeSize: 8}}},
}},
+ {Name: "get_root_resource", CallName: "get_root_resource", Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_root_resource", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{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"},
@@ -484,6 +490,11 @@ var syscalls_amd64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vec", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}, Type: &StructType{Key: StructKey{Name: "iovec_in"}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "vlen", TypeSize: 8}}, Buf: "vec"},
}},
+ {Name: "zx_cache_flush", CallName: "zx_cache_flush", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "addr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "size", TypeSize: 8}}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "cache_flush_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{2, 4, 1}, BitMask: true},
+ }},
{Name: "zx_channel_call", CallName: "zx_channel_call", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_chan", FldName: "handle", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
@@ -529,6 +540,11 @@ var syscalls_amd64 = []*Syscall{
{Name: "zx_clock_get", CallName: "zx_clock_get", Args: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_id", FldName: "clock_id", TypeSize: 8}}, Vals: []uint64{0, 1, 2}, BitMask: true},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "ret", TypeSize: 8, ArgDir: 1}}},
+ {Name: "zx_clock_get_monotonic", CallName: "zx_clock_get_monotonic"},
+ {Name: "zx_clock_get_new", CallName: "zx_clock_get_new", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "clock_id", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "zx_time", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}},
+ }},
{Name: "zx_cprng_add_entropy", CallName: "zx_cprng_add_entropy", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buffer"},
@@ -538,6 +554,23 @@ var syscalls_amd64 = []*Syscall{
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buffer"},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}},
}},
+ {Name: "zx_debuglog_create", CallName: "zx_debuglog_create", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_root_resource", FldName: "root_resource", TypeSize: 4}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "log_create_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1073741824}, BitMask: true},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_debug_log", TypeSize: 4, ArgDir: 1}}},
+ }},
+ {Name: "zx_debuglog_read", CallName: "zx_debuglog_read", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_debug_log", FldName: "handle", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "options", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ptr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "ptr"},
+ }},
+ {Name: "zx_debuglog_write", CallName: "zx_debuglog_write", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_debug_log", FldName: "handle", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "options", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ptr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "ptr"},
+ }},
{Name: "zx_event_create", CallName: "zx_event_create", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_event", TypeSize: 4, ArgDir: 1}}},
@@ -588,6 +621,20 @@ var syscalls_amd64 = []*Syscall{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "new_value", TypeSize: 4}}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "close_handle", TypeSize: 4}},
}},
+ {Name: "zx_guest_create", CallName: "zx_guest_create", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_root_resource", FldName: "root_resource", TypeSize: 4}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmo", FldName: "physmem_vmo", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "guest", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_guest", TypeSize: 8, ArgDir: 1}}},
+ }},
+ {Name: "zx_guest_set_trap", CallName: "zx_guest_set_trap", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_guest", FldName: "guest", TypeSize: 8}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "vaddr", TypeSize: 8}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "len", TypeSize: 8}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "port", TypeSize: 8}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "key", TypeSize: 8}}},
+ }},
{Name: "zx_handle_close", CallName: "zx_handle_close", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}},
}},
@@ -605,6 +652,18 @@ var syscalls_amd64 = []*Syscall{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "zx_rights", FldName: "rights", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 2147483648}, BitMask: true},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}},
}},
+ {Name: "zx_interrupt_ack", CallName: "zx_interrupt_ack", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_interrupt", FldName: "interrupt", TypeSize: 8}},
+ }},
+ {Name: "zx_interrupt_create", CallName: "zx_interrupt_create", Args: []Type{
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "src_obj", TypeSize: 8}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "src_num", TypeSize: 8}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}, Val: 16},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "interrupt", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_interrupt", TypeSize: 8, ArgDir: 1}}},
+ }},
+ {Name: "zx_interrupt_destroy", CallName: "zx_interrupt_destroy", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_interrupt", FldName: "interrupt", TypeSize: 8}},
+ }},
{Name: "zx_job_create", CallName: "zx_job_create", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "job", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
@@ -642,7 +701,7 @@ var syscalls_amd64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "cookie", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
}},
{Name: "zx_object_get_info$ZX_INFO_CPU_STATS", CallName: "zx_object_get_info", Args: []Type{
- &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_root_resource", FldName: "root_resource", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 16},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}, Type: &StructType{Key: StructKey{Name: "zx_info_cpu_stats", Dir: 1}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, BitSize: 8, Buf: "buffer"},
@@ -682,7 +741,7 @@ var syscalls_amd64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}},
}},
{Name: "zx_object_get_info$ZX_INFO_KMEM_STATS", CallName: "zx_object_get_info", Args: []Type{
- &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_root_resource", FldName: "root_resource", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 17},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_kmem_stats", Dir: 1}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, BitSize: 8, Buf: "buffer"},
@@ -722,7 +781,7 @@ var syscalls_amd64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}},
}},
{Name: "zx_object_get_info$ZX_INFO_RESOURCE", CallName: "zx_object_get_info", Args: []Type{
- &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "resource_handle", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 18},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_resource", Dir: 1}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, BitSize: 8, Buf: "buffer"},
@@ -956,6 +1015,32 @@ var syscalls_amd64 = []*Syscall{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "slack", TypeSize: 8}}},
}},
+ {Name: "zx_vcpu_create", CallName: "zx_vcpu_create", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_guest", FldName: "guest", TypeSize: 8}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "options", TypeSize: 4}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "vaddr", TypeSize: 8}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vcpu", TypeSize: 4, ArgDir: 1}}},
+ }},
+ {Name: "zx_vcpu_interrupt", CallName: "zx_vcpu_interrupt", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vcpu", FldName: "vcpu", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vector", TypeSize: 4}}},
+ }},
+ {Name: "zx_vcpu_read_state", CallName: "zx_vcpu_read_state", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vcpu", FldName: "vcpu", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "buflen", TypeSize: 8}}, Buf: "buffer"},
+ }},
+ {Name: "zx_vcpu_resume", CallName: "zx_vcpu_resume", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vcpu", FldName: "vcpu", TypeSize: 4}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
+ }},
+ {Name: "zx_vcpu_write_state", CallName: "zx_vcpu_write_state", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vcpu", FldName: "vcpu", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "buflen", TypeSize: 8}}, Buf: "buffer"},
+ }},
{Name: "zx_vmar_allocate", CallName: "zx_vmar_allocate", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmar", FldName: "parent_handle", TypeSize: 4}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "offset", TypeSize: 8}}},
@@ -1002,7 +1087,7 @@ var syscalls_amd64 = []*Syscall{
}},
{Name: "zx_vmo_create", CallName: "zx_vmo_create", Args: []Type{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "size", TypeSize: 8}}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "vmo_create_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{0, 1}, BitMask: true},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmo", TypeSize: 4, ArgDir: 1}}},
}},
{Name: "zx_vmo_get_size", CallName: "zx_vmo_get_size", Args: []Type{
@@ -1089,10 +1174,6 @@ var consts_amd64 = []ConstValue{
{Name: "AT_SYMLINK_FOLLOW", Value: 1024},
{Name: "AT_SYMLINK_NOFOLLOW", Value: 256},
{Name: "FASYNC", Value: 1024},
- {Name: "LOCK_EX", Value: 2},
- {Name: "LOCK_NB", Value: 4},
- {Name: "LOCK_SH", Value: 1},
- {Name: "LOCK_UN", Value: 8},
{Name: "O_APPEND", Value: 1048576},
{Name: "O_CLOEXEC", Value: 256},
{Name: "O_CREAT", Value: 65536},
@@ -1134,6 +1215,9 @@ var consts_amd64 = []ConstValue{
{Name: "S_IXGRP", Value: 8},
{Name: "S_IXOTH", Value: 1},
{Name: "S_IXUSR", Value: 64},
+ {Name: "ZX_CACHE_FLUSH_DATA", Value: 2},
+ {Name: "ZX_CACHE_FLUSH_INSN", Value: 1},
+ {Name: "ZX_CACHE_FLUSH_INVALIDATE", Value: 4},
{Name: "ZX_CACHE_POLICY_CACHED"},
{Name: "ZX_CACHE_POLICY_UNCACHED", Value: 1},
{Name: "ZX_CACHE_POLICY_UNCACHED_DEVICE", Value: 2},
@@ -1160,6 +1244,7 @@ var consts_amd64 = []ConstValue{
{Name: "ZX_INFO_THREAD_EXCEPTION_REPORT", Value: 11},
{Name: "ZX_INFO_THREAD_STATS", Value: 15},
{Name: "ZX_INFO_VMAR", Value: 7},
+ {Name: "ZX_INTERRUPT_VIRTUAL", Value: 16},
{Name: "ZX_JOB_POL_ABSOLUTE", Value: 1},
{Name: "ZX_JOB_POL_BASIC"},
{Name: "ZX_JOB_POL_RELATIVE"},
@@ -1210,6 +1295,7 @@ var consts_amd64 = []ConstValue{
{Name: "ZX_TIMER_SLACK_LATE", Value: 2},
{Name: "ZX_TIME_INFINITE", Value: 18446744073709551615},
{Name: "ZX_VMO_CLONE_COPY_ON_WRITE", Value: 1},
+ {Name: "ZX_VMO_NON_RESIZABLE", Value: 1},
{Name: "ZX_VMO_OP_CACHE_CLEAN", Value: 8},
{Name: "ZX_VMO_OP_CACHE_CLEAN_INVALIDATE", Value: 9},
{Name: "ZX_VMO_OP_CACHE_INVALIDATE", Value: 7},
@@ -1231,4 +1317,4 @@ var consts_amd64 = []ConstValue{
{Name: "ZX_WAIT_ASYNC_REPEATING", Value: 1},
}
-const revision_amd64 = "5ce842ebcec58232491c33abad5d2f25f4b4bea0"
+const revision_amd64 = "9540132f74bbe9bfb7e8f215844bdb3a88b9a665"
diff --git a/sys/fuchsia/gen/arm64.go b/sys/fuchsia/gen/arm64.go
index 7f079788c..326d53079 100644
--- a/sys/fuchsia/gen/arm64.go
+++ b/sys/fuchsia/gen/arm64.go
@@ -13,18 +13,23 @@ var resources_arm64 = []*ResourceDesc{
{Name: "pid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"pid"}, Values: []uint64{0, 18446744073709551615}},
{Name: "uid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"uid"}, Values: []uint64{0, 18446744073709551615}},
{Name: "zx_chan", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_chan"}, Values: []uint64{0}},
+ {Name: "zx_debug_log", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_debug_log"}, Values: []uint64{0}},
{Name: "zx_event", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_event"}, Values: []uint64{0}},
{Name: "zx_fifo", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_fifo"}, Values: []uint64{0}},
+ {Name: "zx_guest", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8}}}, Kind: []string{"zx_guest"}, Values: []uint64{0}},
{Name: "zx_handle", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle"}, Values: []uint64{0}},
+ {Name: "zx_interrupt", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8}}}, Kind: []string{"zx_interrupt"}, Values: []uint64{0}},
{Name: "zx_job", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_task", "zx_job"}, Values: []uint64{0}},
{Name: "zx_log", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_log"}, Values: []uint64{0}},
{Name: "zx_port", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_port"}, Values: []uint64{0}},
{Name: "zx_process", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_task", "zx_process"}, Values: []uint64{0}},
+ {Name: "zx_root_resource", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_root_resource"}, Values: []uint64{0}},
{Name: "zx_socket", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_socket"}, Values: []uint64{0}},
{Name: "zx_task", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_task"}, Values: []uint64{0}},
{Name: "zx_thread", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_task", "zx_thread"}, Values: []uint64{0}},
{Name: "zx_time", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, Kind: []string{"zx_time"}, Values: []uint64{0, 18446744073709551615}},
{Name: "zx_timer", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_timer"}, Values: []uint64{0}},
+ {Name: "zx_vcpu", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_vcpu"}, Values: []uint64{0}},
{Name: "zx_vmar", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_vmar"}, Values: []uint64{0}},
{Name: "zx_vmo", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_vmo"}, Values: []uint64{0}},
}
@@ -303,6 +308,7 @@ var syscalls_arm64 = []*Syscall{
&ResourceType{TypeCommon: TypeCommon{TypeName: "fd", FldName: "fd", TypeSize: 4}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "len", TypeSize: 8}}},
}},
+ {Name: "get_root_resource", CallName: "get_root_resource", Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_root_resource", FldName: "ret", TypeSize: 4, ArgDir: 1}}},
{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"},
@@ -484,6 +490,11 @@ var syscalls_arm64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vec", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}, Type: &StructType{Key: StructKey{Name: "iovec_in"}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "vlen", TypeSize: 8}}, Buf: "vec"},
}},
+ {Name: "zx_cache_flush", CallName: "zx_cache_flush", Args: []Type{
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "addr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "size", TypeSize: 8}}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "cache_flush_flags", FldName: "flags", TypeSize: 8}}, Vals: []uint64{2, 4, 1}, BitMask: true},
+ }},
{Name: "zx_channel_call", CallName: "zx_channel_call", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_chan", FldName: "handle", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
@@ -529,6 +540,11 @@ var syscalls_arm64 = []*Syscall{
{Name: "zx_clock_get", CallName: "zx_clock_get", Args: []Type{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_id", FldName: "clock_id", TypeSize: 8}}, Vals: []uint64{0, 1, 2}, BitMask: true},
}, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "ret", TypeSize: 8, ArgDir: 1}}},
+ {Name: "zx_clock_get_monotonic", CallName: "zx_clock_get_monotonic"},
+ {Name: "zx_clock_get_new", CallName: "zx_clock_get_new", Args: []Type{
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "clock_id", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "zx_time", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}},
+ }},
{Name: "zx_cprng_add_entropy", CallName: "zx_cprng_add_entropy", Args: []Type{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buffer"},
@@ -538,6 +554,23 @@ var syscalls_arm64 = []*Syscall{
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buffer"},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}},
}},
+ {Name: "zx_debuglog_create", CallName: "zx_debuglog_create", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_root_resource", FldName: "root_resource", TypeSize: 4}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "log_create_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1073741824}, BitMask: true},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_debug_log", TypeSize: 4, ArgDir: 1}}},
+ }},
+ {Name: "zx_debuglog_read", CallName: "zx_debuglog_read", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_debug_log", FldName: "handle", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "options", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ptr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "ptr"},
+ }},
+ {Name: "zx_debuglog_write", CallName: "zx_debuglog_write", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_debug_log", FldName: "handle", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "options", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ptr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "ptr"},
+ }},
{Name: "zx_event_create", CallName: "zx_event_create", Args: []Type{
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_event", TypeSize: 4, ArgDir: 1}}},
@@ -588,6 +621,20 @@ var syscalls_arm64 = []*Syscall{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "new_value", TypeSize: 4}}},
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "close_handle", TypeSize: 4}},
}},
+ {Name: "zx_guest_create", CallName: "zx_guest_create", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_root_resource", FldName: "root_resource", TypeSize: 4}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmo", FldName: "physmem_vmo", TypeSize: 4}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "guest", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_guest", TypeSize: 8, ArgDir: 1}}},
+ }},
+ {Name: "zx_guest_set_trap", CallName: "zx_guest_set_trap", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_guest", FldName: "guest", TypeSize: 8}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "vaddr", TypeSize: 8}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "len", TypeSize: 8}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "port", TypeSize: 8}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "key", TypeSize: 8}}},
+ }},
{Name: "zx_handle_close", CallName: "zx_handle_close", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}},
}},
@@ -605,6 +652,18 @@ var syscalls_arm64 = []*Syscall{
&FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "zx_rights", FldName: "rights", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 2147483648}, BitMask: true},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}},
}},
+ {Name: "zx_interrupt_ack", CallName: "zx_interrupt_ack", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_interrupt", FldName: "interrupt", TypeSize: 8}},
+ }},
+ {Name: "zx_interrupt_create", CallName: "zx_interrupt_create", Args: []Type{
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "src_obj", TypeSize: 8}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "src_num", TypeSize: 8}}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}, Val: 16},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "interrupt", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_interrupt", TypeSize: 8, ArgDir: 1}}},
+ }},
+ {Name: "zx_interrupt_destroy", CallName: "zx_interrupt_destroy", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_interrupt", FldName: "interrupt", TypeSize: 8}},
+ }},
{Name: "zx_job_create", CallName: "zx_job_create", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "job", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
@@ -642,7 +701,7 @@ var syscalls_arm64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "cookie", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}},
}},
{Name: "zx_object_get_info$ZX_INFO_CPU_STATS", CallName: "zx_object_get_info", Args: []Type{
- &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_root_resource", FldName: "root_resource", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 16},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1, IsVarlen: true}, Type: &StructType{Key: StructKey{Name: "zx_info_cpu_stats", Dir: 1}}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, BitSize: 8, Buf: "buffer"},
@@ -682,7 +741,7 @@ var syscalls_arm64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}},
}},
{Name: "zx_object_get_info$ZX_INFO_KMEM_STATS", CallName: "zx_object_get_info", Args: []Type{
- &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_root_resource", FldName: "root_resource", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 17},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_kmem_stats", Dir: 1}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, BitSize: 8, Buf: "buffer"},
@@ -722,7 +781,7 @@ var syscalls_arm64 = []*Syscall{
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}},
}},
{Name: "zx_object_get_info$ZX_INFO_RESOURCE", CallName: "zx_object_get_info", Args: []Type{
- &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}},
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "resource_handle", TypeSize: 4}},
&ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 18},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_resource", Dir: 1}}},
&LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, BitSize: 8, Buf: "buffer"},
@@ -956,6 +1015,32 @@ var syscalls_arm64 = []*Syscall{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "slack", TypeSize: 8}}},
}},
+ {Name: "zx_vcpu_create", CallName: "zx_vcpu_create", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_guest", FldName: "guest", TypeSize: 8}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "options", TypeSize: 4}}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "vaddr", TypeSize: 8}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vcpu", TypeSize: 4, ArgDir: 1}}},
+ }},
+ {Name: "zx_vcpu_interrupt", CallName: "zx_vcpu_interrupt", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vcpu", FldName: "vcpu", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "vector", TypeSize: 4}}},
+ }},
+ {Name: "zx_vcpu_read_state", CallName: "zx_vcpu_read_state", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vcpu", FldName: "vcpu", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "buflen", TypeSize: 8}}, Buf: "buffer"},
+ }},
+ {Name: "zx_vcpu_resume", CallName: "zx_vcpu_resume", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vcpu", FldName: "vcpu", TypeSize: 4}},
+ &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
+ }},
+ {Name: "zx_vcpu_write_state", CallName: "zx_vcpu_write_state", Args: []Type{
+ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vcpu", FldName: "vcpu", TypeSize: 4}},
+ &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4}}},
+ &PtrType{TypeCommon: TypeCommon{TypeName: "buffer", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{ArgDir: 1, IsVarlen: true}}},
+ &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "buflen", TypeSize: 8}}, Buf: "buffer"},
+ }},
{Name: "zx_vmar_allocate", CallName: "zx_vmar_allocate", Args: []Type{
&ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmar", FldName: "parent_handle", TypeSize: 4}},
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "offset", TypeSize: 8}}},
@@ -1002,7 +1087,7 @@ var syscalls_arm64 = []*Syscall{
}},
{Name: "zx_vmo_create", CallName: "zx_vmo_create", Args: []Type{
&IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "size", TypeSize: 8}}},
- &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}},
+ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "vmo_create_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{0, 1}, BitMask: true},
&PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmo", TypeSize: 4, ArgDir: 1}}},
}},
{Name: "zx_vmo_get_size", CallName: "zx_vmo_get_size", Args: []Type{
@@ -1089,10 +1174,6 @@ var consts_arm64 = []ConstValue{
{Name: "AT_SYMLINK_FOLLOW", Value: 1024},
{Name: "AT_SYMLINK_NOFOLLOW", Value: 256},
{Name: "FASYNC", Value: 1024},
- {Name: "LOCK_EX", Value: 2},
- {Name: "LOCK_NB", Value: 4},
- {Name: "LOCK_SH", Value: 1},
- {Name: "LOCK_UN", Value: 8},
{Name: "O_APPEND", Value: 1048576},
{Name: "O_CLOEXEC", Value: 256},
{Name: "O_CREAT", Value: 65536},
@@ -1134,6 +1215,9 @@ var consts_arm64 = []ConstValue{
{Name: "S_IXGRP", Value: 8},
{Name: "S_IXOTH", Value: 1},
{Name: "S_IXUSR", Value: 64},
+ {Name: "ZX_CACHE_FLUSH_DATA", Value: 2},
+ {Name: "ZX_CACHE_FLUSH_INSN", Value: 1},
+ {Name: "ZX_CACHE_FLUSH_INVALIDATE", Value: 4},
{Name: "ZX_CACHE_POLICY_CACHED"},
{Name: "ZX_CACHE_POLICY_UNCACHED", Value: 1},
{Name: "ZX_CACHE_POLICY_UNCACHED_DEVICE", Value: 2},
@@ -1160,6 +1244,7 @@ var consts_arm64 = []ConstValue{
{Name: "ZX_INFO_THREAD_EXCEPTION_REPORT", Value: 11},
{Name: "ZX_INFO_THREAD_STATS", Value: 15},
{Name: "ZX_INFO_VMAR", Value: 7},
+ {Name: "ZX_INTERRUPT_VIRTUAL", Value: 16},
{Name: "ZX_JOB_POL_ABSOLUTE", Value: 1},
{Name: "ZX_JOB_POL_BASIC"},
{Name: "ZX_JOB_POL_RELATIVE"},
@@ -1210,6 +1295,7 @@ var consts_arm64 = []ConstValue{
{Name: "ZX_TIMER_SLACK_LATE", Value: 2},
{Name: "ZX_TIME_INFINITE", Value: 18446744073709551615},
{Name: "ZX_VMO_CLONE_COPY_ON_WRITE", Value: 1},
+ {Name: "ZX_VMO_NON_RESIZABLE", Value: 1},
{Name: "ZX_VMO_OP_CACHE_CLEAN", Value: 8},
{Name: "ZX_VMO_OP_CACHE_CLEAN_INVALIDATE", Value: 9},
{Name: "ZX_VMO_OP_CACHE_INVALIDATE", Value: 7},
@@ -1231,4 +1317,4 @@ var consts_arm64 = []ConstValue{
{Name: "ZX_WAIT_ASYNC_REPEATING", Value: 1},
}
-const revision_arm64 = "f385e79d53b401a933dd01ccc6f89a0936affaf6"
+const revision_arm64 = "ebb425942f2bbfd2db293e4a2a0a417f6aaafb1c"
diff --git a/sys/fuchsia/hypervisor_guests.txt b/sys/fuchsia/hypervisor_guests.txt
new file mode 100644
index 000000000..1106d1a5d
--- /dev/null
+++ b/sys/fuchsia/hypervisor_guests.txt
@@ -0,0 +1,15 @@
+include <zircon/syscalls.h>
+
+resource zx_guest[intptr]
+resource zx_vcpu[zx_handle]
+
+zx_guest_create(root_resource zx_root_resource, options const[0], physmem_vmo zx_vmo, guest ptr[out, zx_guest])
+# TODO: teach this how to use ports & keys
+zx_guest_set_trap(guest zx_guest, kind int32, vaddr intptr, len int64, port const[ZX_HANDLE_INVALID], key int64)
+
+zx_vcpu_create(guest zx_guest, options int32, vaddr intptr, out ptr[out, zx_vcpu])
+# TODO: teach this about the port_packet_t struct
+zx_vcpu_resume(vcpu zx_vcpu, options const[0])
+zx_vcpu_interrupt(vcpu zx_vcpu, vector int32)
+zx_vcpu_read_state(vcpu zx_vcpu, kind int32, buffer buffer[in], buflen len[buffer])
+zx_vcpu_write_state(vcpu zx_vcpu, kind int32, buffer buffer[out], buflen len[buffer])
diff --git a/sys/fuchsia/hypervisor_guests_amd64.const b/sys/fuchsia/hypervisor_guests_amd64.const
new file mode 100644
index 000000000..a6ff852b2
--- /dev/null
+++ b/sys/fuchsia/hypervisor_guests_amd64.const
@@ -0,0 +1,2 @@
+# AUTOGENERATED FILE
+ZX_HANDLE_INVALID = 0
diff --git a/sys/fuchsia/hypervisor_guests_arm64.const b/sys/fuchsia/hypervisor_guests_arm64.const
new file mode 100644
index 000000000..a6ff852b2
--- /dev/null
+++ b/sys/fuchsia/hypervisor_guests_arm64.const
@@ -0,0 +1,2 @@
+# AUTOGENERATED FILE
+ZX_HANDLE_INVALID = 0
diff --git a/sys/fuchsia/log.txt b/sys/fuchsia/log.txt
index 2511bcb6b..b5e22de90 100644
--- a/sys/fuchsia/log.txt
+++ b/sys/fuchsia/log.txt
@@ -5,10 +5,16 @@ include <zircon/syscalls.h>
include <zircon/syscalls/log.h>
resource zx_log[zx_handle]
+resource zx_debug_log[zx_handle]
# TODO: do we need root resource for this? kernel actually has debuglog_create syscall that accepts resource...
zx_log_create(options flags[log_create_options], out ptr[out, zx_log])
zx_log_write(handle zx_log, len len[ptr], ptr ptr[in, array[int8]], options int32)
zx_log_read(handle zx_log, len len[ptr], ptr ptr[out, array[int8]], options int32)
+# Undocumented syscall
+zx_debuglog_create(root_resource zx_root_resource, options flags[log_create_options], out ptr[out, zx_debug_log])
+zx_debuglog_read(handle zx_debug_log, options int32, ptr ptr[out, array[int8]], size len[ptr])
+zx_debuglog_write(handle zx_debug_log, options int32, ptr ptr[in, array[int8]], size len[ptr])
+
log_create_options = ZX_LOG_FLAG_READABLE
diff --git a/sys/fuchsia/objects.txt b/sys/fuchsia/objects.txt
index e111c1160..01a8293b7 100644
--- a/sys/fuchsia/objects.txt
+++ b/sys/fuchsia/objects.txt
@@ -23,12 +23,10 @@ zx_object_get_info$ZX_INFO_TASK_STATS(handle zx_process, topic const[ZX_INFO_TAS
zx_object_get_info$ZX_INFO_PROCESS_MAPS(handle zx_process, topic const[ZX_INFO_PROCESS_MAPS], buffer ptr[out, array[zx_info_maps]], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
zx_object_get_info$ZX_INFO_PROCESS_VMOS(handle zx_process, topic const[ZX_INFO_PROCESS_VMOS], buffer ptr[out, array[zx_info_vmo]], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
zx_object_get_info$ZX_INFO_THREAD_STATS(handle zx_thread, topic const[ZX_INFO_THREAD_STATS], buffer ptr[out, zx_info_thread_stats], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
+zx_object_get_info$ZX_INFO_CPU_STATS(root_resource zx_root_resource, topic const[ZX_INFO_CPU_STATS], buffer ptr[out, array[zx_info_cpu_stats]], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
+zx_object_get_info$ZX_INFO_KMEM_STATS(root_resource zx_root_resource, topic const[ZX_INFO_KMEM_STATS], buffer ptr[out, zx_info_kmem_stats], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
# TODO: what is handle type here?
-zx_object_get_info$ZX_INFO_CPU_STATS(handle zx_handle, topic const[ZX_INFO_CPU_STATS], buffer ptr[out, array[zx_info_cpu_stats]], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
-# TODO: handle is "root resource", where does one get one?
-zx_object_get_info$ZX_INFO_KMEM_STATS(handle zx_handle, topic const[ZX_INFO_KMEM_STATS], buffer ptr[out, zx_info_kmem_stats], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
-# TODO: what is handle type here?
-zx_object_get_info$ZX_INFO_RESOURCE(handle zx_handle, topic const[ZX_INFO_RESOURCE], buffer ptr[out, zx_info_resource], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
+zx_object_get_info$ZX_INFO_RESOURCE(resource_handle zx_handle, topic const[ZX_INFO_RESOURCE], buffer ptr[out, zx_info_resource], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
# TODO: detail properties
zx_object_get_property(handle zx_handle, property int32, value ptr[out, array[int8]], size len[value])
zx_object_set_property(handle zx_handle, property int32, value ptr[in, array[int8]], size len[value])
diff --git a/sys/fuchsia/posix_amd64.const b/sys/fuchsia/posix_amd64.const
index e3afc41c6..bae219db3 100644
--- a/sys/fuchsia/posix_amd64.const
+++ b/sys/fuchsia/posix_amd64.const
@@ -6,10 +6,6 @@ AT_REMOVEDIR = 512
AT_SYMLINK_FOLLOW = 1024
AT_SYMLINK_NOFOLLOW = 256
FASYNC = 1024
-LOCK_EX = 2
-LOCK_NB = 4
-LOCK_SH = 1
-LOCK_UN = 8
O_APPEND = 1048576
O_CLOEXEC = 256
O_CREAT = 65536
diff --git a/sys/fuchsia/posix_arm64.const b/sys/fuchsia/posix_arm64.const
index e3afc41c6..bae219db3 100644
--- a/sys/fuchsia/posix_arm64.const
+++ b/sys/fuchsia/posix_arm64.const
@@ -6,10 +6,6 @@ AT_REMOVEDIR = 512
AT_SYMLINK_FOLLOW = 1024
AT_SYMLINK_NOFOLLOW = 256
FASYNC = 1024
-LOCK_EX = 2
-LOCK_NB = 4
-LOCK_SH = 1
-LOCK_UN = 8
O_APPEND = 1048576
O_CLOEXEC = 256
O_CREAT = 65536
diff --git a/sys/fuchsia/sys.txt b/sys/fuchsia/sys.txt
index 3b34ca504..3ed323799 100644
--- a/sys/fuchsia/sys.txt
+++ b/sys/fuchsia/sys.txt
@@ -4,6 +4,11 @@
# See https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls.md
include <zircon/syscalls.h>
+include <ddk/driver.h>
+
+# Provided by sysroot (include/ddk/driver.h)
+resource zx_root_resource[zx_handle]
+get_root_resource() zx_root_resource
# Used by syzkaller to allocate memory for syscall arguments.
syz_mmap(addr vma, len len[addr])
@@ -14,6 +19,9 @@ syz_thread_self() zx_thread
syz_vmar_root_self() zx_vmar
syz_job_default() zx_job
+# TODO: the get_system_features_options flags are only valid on ARM;
+# find a way to make syzkaller generate ARM-specific code
+# zx_system_features(kind int32, features flags[get_system_features_options])
zx_system_get_num_cpus()
zx_system_get_physmem()
zx_system_get_version(version ptr[out, array[int8]], version_len len[version])
@@ -23,3 +31,5 @@ zx_cprng_add_entropy(buffer ptr[in, array[int8]], len len[buffer])
zx_vmar_unmap_handle_close_thread_exit(vmar_handle zx_vmar, addr vma, len len[addr], close_handle zx_handle)
zx_futex_wake_handle_close_thread_exit(value_ptr ptr[in, int32], wake_count int32, new_value int32, close_handle zx_handle)
+
+# get_system_features_options = ZX_ARM_64_ISA_FP, ZX_ARM64_FEATURE_ASIMD, ZX_ARM64_FEATURE_ISA_AES, ZX_ARM64_FEATURE_ISA_PMULL, ZX_ARM64_FEATURE_ISA_SHA1, ZX_ARM64_FEATURE_ISA_SHA2, ZX_ARM64_FEATURE_ISA_CRC32, ZX_ARM64_FEATURE_ISA_ATOMICS, ZX_ARM64_FEATURE_ISA_RDM, ZX_ARM64_FEATURE_ISA_SHA3, ZX_ARM64_FEATURE_ISA_SM3, ZX_ARM64_FEATURE_ISA_SM4, ZX_ARM64_FEATURE_ISA_DP, ZX_ARM64_FEATURE_ISA_DPB
diff --git a/sys/fuchsia/time.txt b/sys/fuchsia/time.txt
index 7cd8c1ea7..5901de036 100644
--- a/sys/fuchsia/time.txt
+++ b/sys/fuchsia/time.txt
@@ -7,6 +7,8 @@ resource zx_time[int64]: 0, ZX_TIME_INFINITE
zx_nanosleep(deadline zx_time)
zx_clock_get(clock_id flags[clock_id]) zx_time
+zx_clock_get_new(clock_id int32, zx_time ptr[out, intptr])
+zx_clock_get_monotonic()
zx_ticks_get()
zx_ticks_per_second()
diff --git a/sys/fuchsia/vmos.txt b/sys/fuchsia/vmos.txt
index ca27739a6..d2125db4e 100644
--- a/sys/fuchsia/vmos.txt
+++ b/sys/fuchsia/vmos.txt
@@ -2,10 +2,11 @@
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
include <zircon/syscalls.h>
+include <zircon/types.h>
resource zx_vmo[zx_handle]
-zx_vmo_create(size int64, options const[0], out ptr[out, zx_vmo])
+zx_vmo_create(size int64, options flags[vmo_create_options], out ptr[out, zx_vmo])
zx_vmo_read(handle zx_vmo, data ptr[out, array[int8]], offset int64, len intptr, actual ptr[out, intptr])
zx_vmo_write(handle zx_vmo, data ptr[in, array[int8]], offset int64, len intptr, actual ptr[out, intptr])
zx_vmo_clone(handle zx_vmo, options flags[vmo_clone_options], offset int64, size int64, out ptr[out, zx_vmo])
@@ -21,5 +22,6 @@ zx_vmo_op_range$ZX_VMO_OP_CACHE_CLEAN_INVALIDATE(handle zx_vmo, op const[ZX_VMO_
# Not public:
zx_vmo_set_cache_policy(handle zx_vmo, cache_policy flags[vmo_cache_policy])
+vmo_create_options = 0, ZX_VMO_NON_RESIZABLE
vmo_clone_options = ZX_VMO_CLONE_COPY_ON_WRITE
vmo_cache_policy = ZX_CACHE_POLICY_CACHED, ZX_CACHE_POLICY_UNCACHED, ZX_CACHE_POLICY_UNCACHED_DEVICE, ZX_CACHE_POLICY_WRITE_COMBINING
diff --git a/sys/fuchsia/vmos_amd64.const b/sys/fuchsia/vmos_amd64.const
index baac96cdb..9ceea2823 100644
--- a/sys/fuchsia/vmos_amd64.const
+++ b/sys/fuchsia/vmos_amd64.const
@@ -4,6 +4,7 @@ ZX_CACHE_POLICY_UNCACHED = 1
ZX_CACHE_POLICY_UNCACHED_DEVICE = 2
ZX_CACHE_POLICY_WRITE_COMBINING = 3
ZX_VMO_CLONE_COPY_ON_WRITE = 1
+ZX_VMO_NON_RESIZABLE = 1
ZX_VMO_OP_CACHE_CLEAN = 8
ZX_VMO_OP_CACHE_CLEAN_INVALIDATE = 9
ZX_VMO_OP_CACHE_INVALIDATE = 7
diff --git a/sys/fuchsia/vmos_arm64.const b/sys/fuchsia/vmos_arm64.const
index baac96cdb..9ceea2823 100644
--- a/sys/fuchsia/vmos_arm64.const
+++ b/sys/fuchsia/vmos_arm64.const
@@ -4,6 +4,7 @@ ZX_CACHE_POLICY_UNCACHED = 1
ZX_CACHE_POLICY_UNCACHED_DEVICE = 2
ZX_CACHE_POLICY_WRITE_COMBINING = 3
ZX_VMO_CLONE_COPY_ON_WRITE = 1
+ZX_VMO_NON_RESIZABLE = 1
ZX_VMO_OP_CACHE_CLEAN = 8
ZX_VMO_OP_CACHE_CLEAN_INVALIDATE = 9
ZX_VMO_OP_CACHE_INVALIDATE = 7