diff --git a/Makefile b/Makefile index 7727f155..d6a498cd 100644 --- a/Makefile +++ b/Makefile @@ -171,6 +171,7 @@ format: bin/syz-fmt go fmt ./... clang-format --style=file -i executor/*.cc executor/*.h tools/kcovtrace/*.c bin/syz-fmt sys/linux + bin/syz-fmt sys/fuchsia bin/syz-fmt: go build $(GOFLAGS) -o $@ ./tools/syz-fmt diff --git a/executor/common_fuchsia.h b/executor/common_fuchsia.h index 189e7bc3..e6ccddff 100644 --- a/executor/common_fuchsia.h +++ b/executor/common_fuchsia.h @@ -49,3 +49,31 @@ long syz_mmap(size_t addr, size_t size) return status; } #endif + +#if defined(SYZ_EXECUTOR) || defined(__NR_syz_process_self) +long syz_process_self() +{ + return zx_process_self(); +} +#endif + +#if defined(SYZ_EXECUTOR) || defined(__NR_syz_thread_self) +long syz_thread_self() +{ + return zx_thread_self(); +} +#endif + +#if defined(SYZ_EXECUTOR) || defined(__NR_syz_vmar_root_self) +long syz_vmar_root_self() +{ + return zx_vmar_root_self(); +} +#endif + +#if defined(SYZ_EXECUTOR) || defined(__NR_syz_job_default) +long syz_job_default() +{ + return zx_job_default(); +} +#endif diff --git a/executor/syscalls_fuchsia.h b/executor/syscalls_fuchsia.h index 7d4eb574..b169f74d 100644 --- a/executor/syscalls_fuchsia.h +++ b/executor/syscalls_fuchsia.h @@ -2,32 +2,184 @@ #if defined(__x86_64__) || 0 #define GOARCH "amd64" -#define SYZ_REVISION "9b1c1a07ba105b616c1fb926256ea6a00b57b664" -#define __NR_syz_mmap 1000000 +#define SYZ_REVISION "3b490e61c63ea05eb2c4569ba31e8335f65af325" +#define __NR_syz_job_default 1000000 +#define __NR_syz_mmap 1000001 +#define __NR_syz_process_self 1000002 +#define __NR_syz_thread_self 1000003 +#define __NR_syz_vmar_root_self 1000004 -unsigned syscall_count = 5; +unsigned syscall_count = 77; call_t syscalls[] = { - {"syz_mmap", 1000000, (syscall_t)syz_mmap}, + {"syz_job_default", 1000000, (syscall_t)syz_job_default}, + {"syz_mmap", 1000001, (syscall_t)syz_mmap}, + {"syz_process_self", 1000002, (syscall_t)syz_process_self}, + {"syz_thread_self", 1000003, (syscall_t)syz_thread_self}, + {"syz_vmar_root_self", 1000004, (syscall_t)syz_vmar_root_self}, + {"zx_channel_call", 0, (syscall_t)zx_channel_call}, + {"zx_channel_create", 0, (syscall_t)zx_channel_create}, + {"zx_channel_read", 0, (syscall_t)zx_channel_read}, + {"zx_channel_write", 0, (syscall_t)zx_channel_write}, + {"zx_cprng_add_entropy", 0, (syscall_t)zx_cprng_add_entropy}, + {"zx_cprng_draw", 0, (syscall_t)zx_cprng_draw}, + {"zx_event_create", 0, (syscall_t)zx_event_create}, + {"zx_eventpair_create", 0, (syscall_t)zx_eventpair_create}, + {"zx_fifo_create", 0, (syscall_t)zx_fifo_create}, + {"zx_fifo_read", 0, (syscall_t)zx_fifo_read}, + {"zx_fifo_write", 0, (syscall_t)zx_fifo_write}, + {"zx_futex_requeue", 0, (syscall_t)zx_futex_requeue}, + {"zx_futex_wait", 0, (syscall_t)zx_futex_wait}, + {"zx_futex_wake", 0, (syscall_t)zx_futex_wake}, + {"zx_futex_wake_handle_close_thread_exit", 0, (syscall_t)zx_futex_wake_handle_close_thread_exit}, {"zx_handle_close", 0, (syscall_t)zx_handle_close}, {"zx_handle_duplicate", 0, (syscall_t)zx_handle_duplicate}, {"zx_handle_replace", 0, (syscall_t)zx_handle_replace}, + {"zx_job_create", 0, (syscall_t)zx_job_create}, + {"zx_job_set_policy", 0, (syscall_t)zx_job_set_policy}, + {"zx_job_set_relative_importance", 0, (syscall_t)zx_job_set_relative_importance}, + {"zx_log_create", 0, (syscall_t)zx_log_create}, + {"zx_log_read", 0, (syscall_t)zx_log_read}, + {"zx_log_write", 0, (syscall_t)zx_log_write}, + {"zx_nanosleep", 0, (syscall_t)zx_nanosleep}, + {"zx_object_get_child", 0, (syscall_t)zx_object_get_child}, + {"zx_object_get_cookie", 0, (syscall_t)zx_object_get_cookie}, + {"zx_object_get_info$ZX_INFO_CPU_STATS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_HANDLE_BASIC", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_HANDLE_VALID", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_JOB_CHILDREN", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_JOB_PROCESSES", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_KMEM_STATS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_PROCESS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_PROCESS_MAPS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_PROCESS_THREADS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_PROCESS_VMOS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_RESOURCE", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_TASK_STATS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_THREAD_EXCEPTION_REPORT", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_THREAD_STATS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_VMAR", 0, (syscall_t)zx_object_get_info}, + {"zx_port_cancel", 0, (syscall_t)zx_port_cancel}, + {"zx_port_create", 0, (syscall_t)zx_port_create}, + {"zx_port_queue", 0, (syscall_t)zx_port_queue}, + {"zx_port_wait", 0, (syscall_t)zx_port_wait}, + {"zx_process_create", 0, (syscall_t)zx_process_create}, + {"zx_process_exit", 0, (syscall_t)zx_process_exit}, + {"zx_process_read_memory", 0, (syscall_t)zx_process_read_memory}, + {"zx_process_start", 0, (syscall_t)zx_process_start}, + {"zx_process_write_memory", 0, (syscall_t)zx_process_write_memory}, + {"zx_socket_create", 0, (syscall_t)zx_socket_create}, + {"zx_socket_read", 0, (syscall_t)zx_socket_read}, + {"zx_socket_write", 0, (syscall_t)zx_socket_write}, + {"zx_system_get_num_cpus", 0, (syscall_t)zx_system_get_num_cpus}, + {"zx_system_get_physmem", 0, (syscall_t)zx_system_get_physmem}, + {"zx_system_get_version", 0, (syscall_t)zx_system_get_version}, + {"zx_task_bind_exception_port", 0, (syscall_t)zx_task_bind_exception_port}, + {"zx_task_kill", 0, (syscall_t)zx_task_kill}, + {"zx_task_resume", 0, (syscall_t)zx_task_resume}, + {"zx_thread_create", 0, (syscall_t)zx_thread_create}, + {"zx_thread_exit", 0, (syscall_t)zx_thread_exit}, + {"zx_thread_read_state", 0, (syscall_t)zx_thread_read_state}, + {"zx_thread_start", 0, (syscall_t)zx_thread_start}, + {"zx_thread_write_state", 0, (syscall_t)zx_thread_write_state}, + {"zx_ticks_get", 0, (syscall_t)zx_ticks_get}, + {"zx_ticks_per_second", 0, (syscall_t)zx_ticks_per_second}, {"zx_time_get", 0, (syscall_t)zx_time_get}, + {"zx_timer_cancel", 0, (syscall_t)zx_timer_cancel}, + {"zx_timer_create", 0, (syscall_t)zx_timer_create}, + {"zx_timer_set", 0, (syscall_t)zx_timer_set}, + {"zx_vmar_unmap_handle_close_thread_exit", 0, (syscall_t)zx_vmar_unmap_handle_close_thread_exit}, }; #endif #if defined(__aarch64__) || 0 #define GOARCH "arm64" -#define SYZ_REVISION "9e985d79861e2754a6fead2a7c97ca4854e3df44" -#define __NR_syz_mmap 1000000 +#define SYZ_REVISION "7aa3efd28c51db95f99f7b3c8feb4f66ad25f0d8" +#define __NR_syz_job_default 1000000 +#define __NR_syz_mmap 1000001 +#define __NR_syz_process_self 1000002 +#define __NR_syz_thread_self 1000003 +#define __NR_syz_vmar_root_self 1000004 -unsigned syscall_count = 5; +unsigned syscall_count = 77; call_t syscalls[] = { - {"syz_mmap", 1000000, (syscall_t)syz_mmap}, + {"syz_job_default", 1000000, (syscall_t)syz_job_default}, + {"syz_mmap", 1000001, (syscall_t)syz_mmap}, + {"syz_process_self", 1000002, (syscall_t)syz_process_self}, + {"syz_thread_self", 1000003, (syscall_t)syz_thread_self}, + {"syz_vmar_root_self", 1000004, (syscall_t)syz_vmar_root_self}, + {"zx_channel_call", 0, (syscall_t)zx_channel_call}, + {"zx_channel_create", 0, (syscall_t)zx_channel_create}, + {"zx_channel_read", 0, (syscall_t)zx_channel_read}, + {"zx_channel_write", 0, (syscall_t)zx_channel_write}, + {"zx_cprng_add_entropy", 0, (syscall_t)zx_cprng_add_entropy}, + {"zx_cprng_draw", 0, (syscall_t)zx_cprng_draw}, + {"zx_event_create", 0, (syscall_t)zx_event_create}, + {"zx_eventpair_create", 0, (syscall_t)zx_eventpair_create}, + {"zx_fifo_create", 0, (syscall_t)zx_fifo_create}, + {"zx_fifo_read", 0, (syscall_t)zx_fifo_read}, + {"zx_fifo_write", 0, (syscall_t)zx_fifo_write}, + {"zx_futex_requeue", 0, (syscall_t)zx_futex_requeue}, + {"zx_futex_wait", 0, (syscall_t)zx_futex_wait}, + {"zx_futex_wake", 0, (syscall_t)zx_futex_wake}, + {"zx_futex_wake_handle_close_thread_exit", 0, (syscall_t)zx_futex_wake_handle_close_thread_exit}, {"zx_handle_close", 0, (syscall_t)zx_handle_close}, {"zx_handle_duplicate", 0, (syscall_t)zx_handle_duplicate}, {"zx_handle_replace", 0, (syscall_t)zx_handle_replace}, + {"zx_job_create", 0, (syscall_t)zx_job_create}, + {"zx_job_set_policy", 0, (syscall_t)zx_job_set_policy}, + {"zx_job_set_relative_importance", 0, (syscall_t)zx_job_set_relative_importance}, + {"zx_log_create", 0, (syscall_t)zx_log_create}, + {"zx_log_read", 0, (syscall_t)zx_log_read}, + {"zx_log_write", 0, (syscall_t)zx_log_write}, + {"zx_nanosleep", 0, (syscall_t)zx_nanosleep}, + {"zx_object_get_child", 0, (syscall_t)zx_object_get_child}, + {"zx_object_get_cookie", 0, (syscall_t)zx_object_get_cookie}, + {"zx_object_get_info$ZX_INFO_CPU_STATS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_HANDLE_BASIC", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_HANDLE_VALID", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_JOB_CHILDREN", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_JOB_PROCESSES", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_KMEM_STATS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_PROCESS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_PROCESS_MAPS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_PROCESS_THREADS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_PROCESS_VMOS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_RESOURCE", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_TASK_STATS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_THREAD_EXCEPTION_REPORT", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_THREAD_STATS", 0, (syscall_t)zx_object_get_info}, + {"zx_object_get_info$ZX_INFO_VMAR", 0, (syscall_t)zx_object_get_info}, + {"zx_port_cancel", 0, (syscall_t)zx_port_cancel}, + {"zx_port_create", 0, (syscall_t)zx_port_create}, + {"zx_port_queue", 0, (syscall_t)zx_port_queue}, + {"zx_port_wait", 0, (syscall_t)zx_port_wait}, + {"zx_process_create", 0, (syscall_t)zx_process_create}, + {"zx_process_exit", 0, (syscall_t)zx_process_exit}, + {"zx_process_read_memory", 0, (syscall_t)zx_process_read_memory}, + {"zx_process_start", 0, (syscall_t)zx_process_start}, + {"zx_process_write_memory", 0, (syscall_t)zx_process_write_memory}, + {"zx_socket_create", 0, (syscall_t)zx_socket_create}, + {"zx_socket_read", 0, (syscall_t)zx_socket_read}, + {"zx_socket_write", 0, (syscall_t)zx_socket_write}, + {"zx_system_get_num_cpus", 0, (syscall_t)zx_system_get_num_cpus}, + {"zx_system_get_physmem", 0, (syscall_t)zx_system_get_physmem}, + {"zx_system_get_version", 0, (syscall_t)zx_system_get_version}, + {"zx_task_bind_exception_port", 0, (syscall_t)zx_task_bind_exception_port}, + {"zx_task_kill", 0, (syscall_t)zx_task_kill}, + {"zx_task_resume", 0, (syscall_t)zx_task_resume}, + {"zx_thread_create", 0, (syscall_t)zx_thread_create}, + {"zx_thread_exit", 0, (syscall_t)zx_thread_exit}, + {"zx_thread_read_state", 0, (syscall_t)zx_thread_read_state}, + {"zx_thread_start", 0, (syscall_t)zx_thread_start}, + {"zx_thread_write_state", 0, (syscall_t)zx_thread_write_state}, + {"zx_ticks_get", 0, (syscall_t)zx_ticks_get}, + {"zx_ticks_per_second", 0, (syscall_t)zx_ticks_per_second}, {"zx_time_get", 0, (syscall_t)zx_time_get}, + {"zx_timer_cancel", 0, (syscall_t)zx_timer_cancel}, + {"zx_timer_create", 0, (syscall_t)zx_timer_create}, + {"zx_timer_set", 0, (syscall_t)zx_timer_set}, + {"zx_vmar_unmap_handle_close_thread_exit", 0, (syscall_t)zx_vmar_unmap_handle_close_thread_exit}, }; #endif diff --git a/sys/fuchsia/amd64.go b/sys/fuchsia/amd64.go index 738bcc71..7c159b96 100644 --- a/sys/fuchsia/amd64.go +++ b/sys/fuchsia/amd64.go @@ -8,38 +8,640 @@ func init() { } var resources_amd64 = []*ResourceDesc{ + {Name: "koid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, Kind: []string{"koid"}, Values: []uint64{0}}, + {Name: "zx_chan", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_chan"}, 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_handle", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle"}, 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_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_vmar", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_vmar"}, Values: []uint64{0}}, } -var structDescs_amd64 = []*KeyedStruct(nil) +var structDescs_amd64 = []*KeyedStruct{ + {Key: StructKey{Name: "arm64_exc_data", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "arm64_exc_data", TypeSize: 16, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "esr", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "far", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "x86_64_exc_data", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "x86_64_exc_data", TypeSize: 24, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vector", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "err_code", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "cr2", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_channel_call_args"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_channel_call_args", TypeSize: 48}, Fields: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "wr_bytes", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "wr_handles", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array"}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "rd_bytes", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "rd_handles", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "wr_num_bytes", TypeSize: 4}}, Buf: "wr_bytes"}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "wr_num_handles", TypeSize: 4}}, Buf: "wr_handles"}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "rd_num_bytes", TypeSize: 4}}, Buf: "rd_bytes"}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "rd_num_handles", TypeSize: 4}}, Buf: "rd_handles"}, + }}}, + {Key: StructKey{Name: "zx_exception_context", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_exception_context", TypeSize: 24, ArgDir: 1}, Fields: []Type{ + &StructType{Key: StructKey{Name: "x86_64_exc_data", Dir: 1}, FldName: "x86_64"}, + &StructType{Key: StructKey{Name: "arm64_exc_data", Dir: 1}, FldName: "arm_64"}, + }}}, + {Key: StructKey{Name: "zx_exception_header", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_exception_header", TypeSize: 8, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "size", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "type", TypeSize: 4, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_exception_report", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_exception_report", TypeSize: 32, ArgDir: 1}, Fields: []Type{ + &StructType{Key: StructKey{Name: "zx_exception_header", Dir: 1}, FldName: "header"}, + &UnionType{Key: StructKey{Name: "zx_exception_context", Dir: 1}, FldName: "context"}, + }}}, + {Key: StructKey{Name: "zx_info_cpu_stats", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_cpu_stats", TypeSize: 120, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "cpu_number", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "flags", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "idle_time", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "reschedules", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "context_switches", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "irq_preempts", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "preempts", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "yields", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "ints", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "timer_ints", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "timers", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "page_faults", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "exceptions", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "syscalls", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "reschedule_ipis", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "generic_ipis", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_handle_basic", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_handle_basic", TypeSize: 32, ArgDir: 1}, Fields: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "koid", TypeSize: 8, ArgDir: 1}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "rights", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "type", TypeSize: 4, ArgDir: 1}}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "related_koid", TypeSize: 8, ArgDir: 1}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "props", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + }}}, + {Key: StructKey{Name: "zx_info_kmem_stats", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_kmem_stats", TypeSize: 64, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "total_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "free_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "wired_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "total_heap_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "free_heap_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vmo_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "mmu_overhead_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "other_bytes", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_maps", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_maps", TypeSize: 88, ArgDir: 1}, Fields: []Type{ + &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "name", TypeSize: 32, ArgDir: 1}, Kind: 1, RangeBegin: 32, RangeEnd: 32}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "base", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "size", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "depth", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "type", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &StructType{Key: StructKey{Name: "zx_info_maps_mapping", Dir: 1}, FldName: "mapping"}, + }}}, + {Key: StructKey{Name: "zx_info_maps_mapping", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_maps_mapping", TypeSize: 24, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "mmu_flags", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "vmo_koid", TypeSize: 8, ArgDir: 1}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "committed_pages", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_process", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_process", TypeSize: 7, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "return_code", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "started", TypeSize: 1, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "exited", TypeSize: 1, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "debugger_attached", TypeSize: 1, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_resource", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_resource", TypeSize: 24, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "low", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "high", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_task_stats", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_task_stats", TypeSize: 32, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "mem_mapped_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "mem_private_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "mem_shared_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "mem_scaled_shared_bytes", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_thread", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_thread", TypeSize: 8, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "state", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "wait_exception_port_type", TypeSize: 4, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_thread_stats", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_thread_stats", TypeSize: 8, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "total_runtime", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_vmar", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_vmar", TypeSize: 16, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "base", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "len", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_vmo", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_vmo", TypeSize: 104, ArgDir: 1}, Fields: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "koid", TypeSize: 8, ArgDir: 1}}, + &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "name", TypeSize: 32, ArgDir: 1}, Kind: 1, RangeBegin: 32, RangeEnd: 32}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "size_bytes", TypeSize: 8, ArgDir: 1}}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "parent_koid", TypeSize: 8, ArgDir: 1}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "num_children", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "num_mappings", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "share_count", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "flags", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "committed_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "handle_rights", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + }}}, + {Key: StructKey{Name: "zx_policy_basic"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_policy_basic", TypeSize: 8}, Fields: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "zx_policy_condition", FldName: "condition", TypeSize: 4}}, Vals: []uint64{0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 3}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "zx_policy_policy", FldName: "policy", TypeSize: 4}}, Vals: []uint64{0, 1, 2, 5}}, + }}}, + {Key: StructKey{Name: "zx_port_packet"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_port_packet", TypeSize: 48}, Fields: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "key", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "type", TypeSize: 4}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "status", TypeSize: 4}}}, + &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "u64", TypeSize: 32}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, Kind: 1, RangeBegin: 4, RangeEnd: 4}, + }}}, + {Key: StructKey{Name: "zx_port_packet", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_port_packet", TypeSize: 48, ArgDir: 1}, Fields: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "key", TypeSize: 8, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "type", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "status", TypeSize: 4, ArgDir: 1}}}, + &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "u64", TypeSize: 32, ArgDir: 1}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}, Kind: 1, RangeBegin: 4, RangeEnd: 4}, + }}}, +} var syscalls_amd64 = []*Syscall{ - {NR: 1000000, Name: "syz_mmap", CallName: "syz_mmap", Args: []Type{ + {NR: 1000000, Name: "syz_job_default", CallName: "syz_job_default", Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, + {ID: 1, NR: 1000001, Name: "syz_mmap", CallName: "syz_mmap", Args: []Type{ &VmaType{TypeCommon: TypeCommon{TypeName: "vma", FldName: "addr", TypeSize: 8}}, &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "addr"}, }}, - {ID: 1, Name: "zx_handle_close", CallName: "zx_handle_close", Args: []Type{ + {ID: 2, NR: 1000002, Name: "syz_process_self", CallName: "syz_process_self", Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, + {ID: 3, NR: 1000003, Name: "syz_thread_self", CallName: "syz_thread_self", Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, + {ID: 4, NR: 1000004, Name: "syz_vmar_root_self", CallName: "syz_vmar_root_self", Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmar", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, + {ID: 5, 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}}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "args", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_channel_call_args"}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual_bytes", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual_handles", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "read_status", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + }}, + {ID: 6, Name: "zx_channel_create", CallName: "zx_channel_create", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out0", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_chan", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out1", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_chan", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 7, Name: "zx_channel_read", CallName: "zx_channel_read", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_chan", FldName: "handle", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "chan_read_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "bytes", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "handles", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "num_bytes", TypeSize: 8}}, Buf: "bytes"}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "num_handles", TypeSize: 8}}, Buf: "handles"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual_bytes", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual_handles", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + }}, + {ID: 8, Name: "zx_channel_write", CallName: "zx_channel_write", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_chan", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "bytes", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "num_bytes", TypeSize: 8}}, Buf: "bytes"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "handles", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array"}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "num_handles", TypeSize: 8}}, Buf: "handles"}, + }}, + {ID: 9, 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"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buffer"}, + }}, + {ID: 10, Name: "zx_cprng_draw", CallName: "zx_cprng_draw", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &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}}}}, + }}, + {ID: 11, 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}}}, + }}, + {ID: 12, Name: "zx_eventpair_create", CallName: "zx_eventpair_create", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out0", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_event", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out1", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_event", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 13, Name: "zx_fifo_create", CallName: "zx_fifo_create", Args: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "fifo_elem_count", FldName: "elem_count", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "elem_size", TypeSize: 4}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out0", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_fifo", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out1", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_fifo", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 14, Name: "zx_fifo_read", CallName: "zx_fifo_read", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_fifo", FldName: "handle", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "num_entries_read", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + }}, + {ID: 15, Name: "zx_fifo_write", CallName: "zx_fifo_write", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_fifo", FldName: "handle", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "num_entries_written", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + }}, + {ID: 16, Name: "zx_futex_requeue", CallName: "zx_futex_requeue", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "value_ptr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "wake_count", TypeSize: 8}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "current_value", TypeSize: 4}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "requeue_ptr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "requeue_count", TypeSize: 8}}}, + }}, + {ID: 17, Name: "zx_futex_wait", CallName: "zx_futex_wait", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "value_ptr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "current_value", TypeSize: 4}}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}}, + }}, + {ID: 18, Name: "zx_futex_wake", CallName: "zx_futex_wake", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "value_ptr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "wake_count", TypeSize: 8}}}, + }}, + {ID: 19, Name: "zx_futex_wake_handle_close_thread_exit", CallName: "zx_futex_wake_handle_close_thread_exit", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "value_ptr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "wake_count", TypeSize: 4}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "new_value", TypeSize: 4}}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "close_handle", TypeSize: 4}}, + }}, + {ID: 20, Name: "zx_handle_close", CallName: "zx_handle_close", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, }}, - {ID: 2, Name: "zx_handle_duplicate", CallName: "zx_handle_duplicate", Args: []Type{ + {ID: 21, Name: "zx_handle_duplicate", CallName: "zx_handle_duplicate", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, &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}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}}, }}, - {ID: 3, Name: "zx_handle_replace", CallName: "zx_handle_replace", Args: []Type{ + {ID: 22, Name: "zx_handle_replace", CallName: "zx_handle_replace", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, &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}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}}, }}, - {ID: 4, Name: "zx_time_get", CallName: "zx_time_get", Args: []Type{ + {ID: 23, 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}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 24, Name: "zx_job_set_policy", CallName: "zx_job_set_policy", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "job_handle", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "job_policy_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{0, 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "policy", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array"}, Type: &StructType{Key: StructKey{Name: "zx_policy_basic"}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "count", TypeSize: 8}}, Buf: "policy"}, + }}, + {ID: 25, Name: "zx_job_set_relative_importance", CallName: "zx_job_set_relative_importance", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "res", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "job", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "less_important_job", TypeSize: 4}}, + }}, + {ID: 26, Name: "zx_log_create", CallName: "zx_log_create", Args: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "log_create_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1073741824}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_log", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 27, Name: "zx_log_read", CallName: "zx_log_read", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_log", FldName: "handle", TypeSize: 4}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "ptr"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ptr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "options", TypeSize: 4}}}, + }}, + {ID: 28, Name: "zx_log_write", CallName: "zx_log_write", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_log", FldName: "handle", TypeSize: 4}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "ptr"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ptr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "options", TypeSize: 4}}}, + }}, + {ID: 29, Name: "zx_nanosleep", CallName: "zx_nanosleep", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}}, + }}, + {ID: 30, Name: "zx_object_get_child", CallName: "zx_object_get_child", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "koid", TypeSize: 8}}, + &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}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 31, Name: "zx_object_get_cookie", CallName: "zx_object_get_cookie", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "scope", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "cookie", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 32, 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}}, + &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}, Type: &StructType{Key: StructKey{Name: "zx_info_cpu_stats", Dir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 33, Name: "zx_object_get_info$ZX_INFO_HANDLE_BASIC", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 2}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_handle_basic", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 34, Name: "zx_object_get_info$ZX_INFO_HANDLE_VALID", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 1}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "buffer", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "buffer_size", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 35, Name: "zx_object_get_info$ZX_INFO_JOB_CHILDREN", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 8}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", TypeSize: 8, ArgDir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 36, Name: "zx_object_get_info$ZX_INFO_JOB_PROCESSES", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 9}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_thread", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 37, 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}}, + &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}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 38, Name: "zx_object_get_info$ZX_INFO_PROCESS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 3}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_process", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 39, Name: "zx_object_get_info$ZX_INFO_PROCESS_MAPS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 13}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}, Type: &StructType{Key: StructKey{Name: "zx_info_maps", Dir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 40, Name: "zx_object_get_info$ZX_INFO_PROCESS_THREADS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 4}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", TypeSize: 8, ArgDir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 41, Name: "zx_object_get_info$ZX_INFO_PROCESS_VMOS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 14}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}, Type: &StructType{Key: StructKey{Name: "zx_info_vmo", Dir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 42, 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}}, + &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}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 43, Name: "zx_object_get_info$ZX_INFO_TASK_STATS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 12}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_task_stats", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 44, Name: "zx_object_get_info$ZX_INFO_THREAD_EXCEPTION_REPORT", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 11}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_exception_report", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 45, Name: "zx_object_get_info$ZX_INFO_THREAD_STATS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 15}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_thread_stats", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 46, Name: "zx_object_get_info$ZX_INFO_VMAR", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmar", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 7}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_vmar", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 47, Name: "zx_port_cancel", CallName: "zx_port_cancel", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_port", FldName: "port", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "source", TypeSize: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "key", TypeSize: 8}}}, + }}, + {ID: 48, Name: "zx_port_create", CallName: "zx_port_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_port", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 49, Name: "zx_port_queue", CallName: "zx_port_queue", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_port", FldName: "handle", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "packet", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_port_packet"}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "size", TypeSize: 8}}}, + }}, + {ID: 50, Name: "zx_port_wait", CallName: "zx_port_wait", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_port", FldName: "handle", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "packet", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_port_packet", Dir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "size", TypeSize: 8}}}, + }}, + {ID: 51, Name: "zx_process_create", CallName: "zx_process_create", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "job", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "name", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string"}, Kind: 2}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "name_len", TypeSize: 8}}, Buf: "name"}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "proc_handle", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vmar_handle", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmar", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 52, Name: "zx_process_exit", CallName: "zx_process_exit", Args: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "ret_code", TypeSize: 4}}}, + }}, + {ID: 53, Name: "zx_process_read_memory", CallName: "zx_process_read_memory", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "process", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vaddr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", TypeSize: 1, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &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}}}}, + }}, + {ID: 54, Name: "zx_process_start", CallName: "zx_process_start", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "process", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "thread", TypeSize: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "entry", TypeSize: 8}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "stack", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "arg1", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "arg2", TypeSize: 8}}}, + }}, + {ID: 55, Name: "zx_process_write_memory", CallName: "zx_process_write_memory", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "process", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vaddr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", TypeSize: 1, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &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}}}}, + }}, + {ID: 56, Name: "zx_socket_create", CallName: "zx_socket_create", Args: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "socket_create_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{0, 1, 2}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out0", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_socket", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out1", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_socket", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 57, Name: "zx_socket_read", CallName: "zx_socket_read", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_socket", FldName: "handle", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "socket_read_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", 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}}}}, + }}, + {ID: 58, Name: "zx_socket_write", CallName: "zx_socket_write", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_socket", FldName: "handle", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "socket_write_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{4, 2, 1}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", 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}}}}, + }}, + {ID: 59, Name: "zx_system_get_num_cpus", CallName: "zx_system_get_num_cpus"}, + {ID: 60, Name: "zx_system_get_physmem", CallName: "zx_system_get_physmem"}, + {ID: 61, Name: "zx_system_get_version", CallName: "zx_system_get_version", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "version", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "version_len", TypeSize: 8}}, Buf: "version"}, + }}, + {ID: 62, Name: "zx_task_bind_exception_port", CallName: "zx_task_bind_exception_port", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_task", FldName: "task", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_port", FldName: "eport", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "key", TypeSize: 8}}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "exception_port_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{2, 1}}, + }}, + {ID: 63, Name: "zx_task_kill", CallName: "zx_task_kill", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_task", FldName: "handle", TypeSize: 4}}, + }}, + {ID: 64, Name: "zx_task_resume", CallName: "zx_task_resume", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_task", FldName: "task", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "task_resume_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1, 2}}, + }}, + {ID: 65, Name: "zx_thread_create", CallName: "zx_thread_create", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "process", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "name", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string"}, Kind: 2}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "name_len", TypeSize: 8}}, Buf: "name"}, + &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_thread", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 66, Name: "zx_thread_exit", CallName: "zx_thread_exit"}, + {ID: 67, Name: "zx_thread_read_state", CallName: "zx_thread_read_state", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &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: "int32", TypeSize: 4, ArgDir: 1}}}}, + }}, + {ID: 68, Name: "zx_thread_start", CallName: "zx_thread_start", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "entry", TypeSize: 8}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "stack", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "arg1", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "arg2", TypeSize: 8}}}, + }}, + {ID: 69, Name: "zx_thread_write_state", CallName: "zx_thread_write_state", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buffer"}, + }}, + {ID: 70, Name: "zx_ticks_get", CallName: "zx_ticks_get"}, + {ID: 71, Name: "zx_ticks_per_second", CallName: "zx_ticks_per_second"}, + {ID: 72, Name: "zx_time_get", CallName: "zx_time_get", Args: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_id", FldName: "clock_id", TypeSize: 8}}, Vals: []uint64{0, 1, 2}}, + }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "ret", TypeSize: 8, ArgDir: 1}}}, + {ID: 73, Name: "zx_timer_cancel", CallName: "zx_timer_cancel", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_timer", FldName: "handle", TypeSize: 4}}, + }}, + {ID: 74, Name: "zx_timer_create", CallName: "zx_timer_create", Args: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "timer_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{0, 1, 2}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "clock_id", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_timer", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 75, Name: "zx_timer_set", CallName: "zx_timer_set", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_timer", FldName: "handle", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "slack", TypeSize: 8}}}, + }}, + {ID: 76, Name: "zx_vmar_unmap_handle_close_thread_exit", CallName: "zx_vmar_unmap_handle_close_thread_exit", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmar", FldName: "vmar_handle", TypeSize: 4}}, + &VmaType{TypeCommon: TypeCommon{TypeName: "vma", FldName: "addr", TypeSize: 8}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "addr"}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "close_handle", TypeSize: 4}}, }}, } var consts_amd64 = []ConstValue{ + {Name: "ZX_CHANNEL_READ_MAY_DISCARD", Value: 1}, {Name: "ZX_CLOCK_MONOTONIC"}, {Name: "ZX_CLOCK_THREAD", Value: 2}, {Name: "ZX_CLOCK_UTC", Value: 1}, + {Name: "ZX_EXCEPTION_PORT_DEBUGGER", Value: 1}, + {Name: "ZX_EXCEPTION_PORT_UNBIND_QUIETLY", Value: 2}, + {Name: "ZX_HANDLE_INVALID"}, + {Name: "ZX_INFO_CPU_STATS", Value: 16}, + {Name: "ZX_INFO_HANDLE_BASIC", Value: 2}, + {Name: "ZX_INFO_HANDLE_VALID", Value: 1}, + {Name: "ZX_INFO_JOB_CHILDREN", Value: 8}, + {Name: "ZX_INFO_JOB_PROCESSES", Value: 9}, + {Name: "ZX_INFO_KMEM_STATS", Value: 17}, + {Name: "ZX_INFO_PROCESS", Value: 3}, + {Name: "ZX_INFO_PROCESS_MAPS", Value: 13}, + {Name: "ZX_INFO_PROCESS_THREADS", Value: 4}, + {Name: "ZX_INFO_PROCESS_VMOS", Value: 14}, + {Name: "ZX_INFO_RESOURCE", Value: 18}, + {Name: "ZX_INFO_TASK_STATS", Value: 12}, + {Name: "ZX_INFO_THREAD_EXCEPTION_REPORT", Value: 11}, + {Name: "ZX_INFO_THREAD_STATS", Value: 15}, + {Name: "ZX_INFO_VMAR", Value: 7}, + {Name: "ZX_JOB_POL_ABSOLUTE", Value: 1}, + {Name: "ZX_JOB_POL_BASIC"}, + {Name: "ZX_JOB_POL_RELATIVE"}, + {Name: "ZX_LOG_FLAG_READABLE", Value: 1073741824}, + {Name: "ZX_MAX_NAME_LEN", Value: 32}, + {Name: "ZX_PKT_TYPE_USER"}, + {Name: "ZX_POL_ACTION_ALLOW"}, + {Name: "ZX_POL_ACTION_DENY", Value: 1}, + {Name: "ZX_POL_ACTION_EXCEPTION", Value: 2}, + {Name: "ZX_POL_ACTION_KILL", Value: 5}, + {Name: "ZX_POL_BAD_HANDLE"}, + {Name: "ZX_POL_NEW_ANY", Value: 3}, + {Name: "ZX_POL_NEW_CHANNEL", Value: 5}, + {Name: "ZX_POL_NEW_EVENT", Value: 6}, + {Name: "ZX_POL_NEW_EVPAIR", Value: 7}, + {Name: "ZX_POL_NEW_FIFO", Value: 10}, + {Name: "ZX_POL_NEW_PORT", Value: 8}, + {Name: "ZX_POL_NEW_SOCKET", Value: 9}, + {Name: "ZX_POL_NEW_TIMER", Value: 11}, + {Name: "ZX_POL_NEW_VMO", Value: 4}, + {Name: "ZX_POL_VMAR_WX", Value: 2}, + {Name: "ZX_POL_WRONG_OBJECT", Value: 1}, + {Name: "ZX_RESUME_EXCEPTION", Value: 1}, + {Name: "ZX_RESUME_TRY_NEXT", Value: 2}, {Name: "ZX_RIGHT_DESTROY", Value: 512}, {Name: "ZX_RIGHT_DUPLICATE", Value: 1}, {Name: "ZX_RIGHT_ENUMERATE", Value: 256}, @@ -56,6 +658,16 @@ var consts_amd64 = []ConstValue{ {Name: "ZX_RIGHT_SIGNAL_PEER", Value: 8192}, {Name: "ZX_RIGHT_TRANSFER", Value: 2}, {Name: "ZX_RIGHT_WRITE", Value: 8}, + {Name: "ZX_SOCKET_CONTROL", Value: 4}, + {Name: "ZX_SOCKET_DATAGRAM", Value: 1}, + {Name: "ZX_SOCKET_HAS_CONTROL", Value: 2}, + {Name: "ZX_SOCKET_SHUTDOWN_READ", Value: 2}, + {Name: "ZX_SOCKET_SHUTDOWN_WRITE", Value: 1}, + {Name: "ZX_SOCKET_STREAM"}, + {Name: "ZX_TIMER_SLACK_CENTER"}, + {Name: "ZX_TIMER_SLACK_EARLY", Value: 1}, + {Name: "ZX_TIMER_SLACK_LATE", Value: 2}, + {Name: "ZX_TIME_INFINITE", Value: 18446744073709551615}, } -const revision_amd64 = "9b1c1a07ba105b616c1fb926256ea6a00b57b664" +const revision_amd64 = "3b490e61c63ea05eb2c4569ba31e8335f65af325" diff --git a/sys/fuchsia/arm64.go b/sys/fuchsia/arm64.go index 28bdb5b5..e9eee2ea 100644 --- a/sys/fuchsia/arm64.go +++ b/sys/fuchsia/arm64.go @@ -8,38 +8,640 @@ func init() { } var resources_arm64 = []*ResourceDesc{ + {Name: "koid", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, Kind: []string{"koid"}, Values: []uint64{0}}, + {Name: "zx_chan", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_chan"}, 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_handle", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle"}, 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_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_vmar", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"zx_handle", "zx_vmar"}, Values: []uint64{0}}, } -var structDescs_arm64 = []*KeyedStruct(nil) +var structDescs_arm64 = []*KeyedStruct{ + {Key: StructKey{Name: "arm64_exc_data", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "arm64_exc_data", TypeSize: 16, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "esr", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "far", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "x86_64_exc_data", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "x86_64_exc_data", TypeSize: 24, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vector", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "err_code", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "cr2", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_channel_call_args"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_channel_call_args", TypeSize: 48}, Fields: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "wr_bytes", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "wr_handles", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array"}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "rd_bytes", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "rd_handles", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "wr_num_bytes", TypeSize: 4}}, Buf: "wr_bytes"}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "wr_num_handles", TypeSize: 4}}, Buf: "wr_handles"}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "rd_num_bytes", TypeSize: 4}}, Buf: "rd_bytes"}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "rd_num_handles", TypeSize: 4}}, Buf: "rd_handles"}, + }}}, + {Key: StructKey{Name: "zx_exception_context", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_exception_context", TypeSize: 24, ArgDir: 1}, Fields: []Type{ + &StructType{Key: StructKey{Name: "x86_64_exc_data", Dir: 1}, FldName: "x86_64"}, + &StructType{Key: StructKey{Name: "arm64_exc_data", Dir: 1}, FldName: "arm_64"}, + }}}, + {Key: StructKey{Name: "zx_exception_header", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_exception_header", TypeSize: 8, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "size", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "type", TypeSize: 4, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_exception_report", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_exception_report", TypeSize: 32, ArgDir: 1}, Fields: []Type{ + &StructType{Key: StructKey{Name: "zx_exception_header", Dir: 1}, FldName: "header"}, + &UnionType{Key: StructKey{Name: "zx_exception_context", Dir: 1}, FldName: "context"}, + }}}, + {Key: StructKey{Name: "zx_info_cpu_stats", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_cpu_stats", TypeSize: 120, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "cpu_number", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "flags", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "idle_time", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "reschedules", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "context_switches", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "irq_preempts", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "preempts", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "yields", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "ints", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "timer_ints", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "timers", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "page_faults", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "exceptions", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "syscalls", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "reschedule_ipis", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "generic_ipis", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_handle_basic", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_handle_basic", TypeSize: 32, ArgDir: 1}, Fields: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "koid", TypeSize: 8, ArgDir: 1}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "rights", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "type", TypeSize: 4, ArgDir: 1}}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "related_koid", TypeSize: 8, ArgDir: 1}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "props", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + }}}, + {Key: StructKey{Name: "zx_info_kmem_stats", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_kmem_stats", TypeSize: 64, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "total_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "free_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "wired_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "total_heap_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "free_heap_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "vmo_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "mmu_overhead_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "other_bytes", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_maps", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_maps", TypeSize: 88, ArgDir: 1}, Fields: []Type{ + &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "name", TypeSize: 32, ArgDir: 1}, Kind: 1, RangeBegin: 32, RangeEnd: 32}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "base", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "size", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "depth", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "type", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &StructType{Key: StructKey{Name: "zx_info_maps_mapping", Dir: 1}, FldName: "mapping"}, + }}}, + {Key: StructKey{Name: "zx_info_maps_mapping", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_maps_mapping", TypeSize: 24, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "mmu_flags", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "vmo_koid", TypeSize: 8, ArgDir: 1}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "committed_pages", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_process", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_process", TypeSize: 7, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "return_code", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "started", TypeSize: 1, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "exited", TypeSize: 1, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", FldName: "debugger_attached", TypeSize: 1, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_resource", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_resource", TypeSize: 24, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "low", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "high", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_task_stats", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_task_stats", TypeSize: 32, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "mem_mapped_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "mem_private_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "mem_shared_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "mem_scaled_shared_bytes", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_thread", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_thread", TypeSize: 8, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "state", TypeSize: 4, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "wait_exception_port_type", TypeSize: 4, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_thread_stats", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_thread_stats", TypeSize: 8, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "total_runtime", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_vmar", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_vmar", TypeSize: 16, ArgDir: 1}, Fields: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "base", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "len", TypeSize: 8, ArgDir: 1}}}, + }}}, + {Key: StructKey{Name: "zx_info_vmo", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_info_vmo", TypeSize: 104, ArgDir: 1}, Fields: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "koid", TypeSize: 8, ArgDir: 1}}, + &BufferType{TypeCommon: TypeCommon{TypeName: "array", FldName: "name", TypeSize: 32, ArgDir: 1}, Kind: 1, RangeBegin: 32, RangeEnd: 32}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "size_bytes", TypeSize: 8, ArgDir: 1}}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "parent_koid", TypeSize: 8, ArgDir: 1}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "num_children", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "num_mappings", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "share_count", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "flags", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "committed_bytes", TypeSize: 8, ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "handle_rights", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "pad", TypeSize: 4}}, IsPad: true}, + }}}, + {Key: StructKey{Name: "zx_policy_basic"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_policy_basic", TypeSize: 8}, Fields: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "zx_policy_condition", FldName: "condition", TypeSize: 4}}, Vals: []uint64{0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 3}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "zx_policy_policy", FldName: "policy", TypeSize: 4}}, Vals: []uint64{0, 1, 2, 5}}, + }}}, + {Key: StructKey{Name: "zx_port_packet"}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_port_packet", TypeSize: 48}, Fields: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "key", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "type", TypeSize: 4}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "status", TypeSize: 4}}}, + &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "u64", TypeSize: 32}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8}}}, Kind: 1, RangeBegin: 4, RangeEnd: 4}, + }}}, + {Key: StructKey{Name: "zx_port_packet", Dir: 1}, Desc: &StructDesc{TypeCommon: TypeCommon{TypeName: "zx_port_packet", TypeSize: 48, ArgDir: 1}, Fields: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "key", TypeSize: 8, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "type", TypeSize: 4, ArgDir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "status", TypeSize: 4, ArgDir: 1}}}, + &ArrayType{TypeCommon: TypeCommon{TypeName: "array", FldName: "u64", TypeSize: 32, ArgDir: 1}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}, Kind: 1, RangeBegin: 4, RangeEnd: 4}, + }}}, +} var syscalls_arm64 = []*Syscall{ - {NR: 1000000, Name: "syz_mmap", CallName: "syz_mmap", Args: []Type{ + {NR: 1000000, Name: "syz_job_default", CallName: "syz_job_default", Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, + {ID: 1, NR: 1000001, Name: "syz_mmap", CallName: "syz_mmap", Args: []Type{ &VmaType{TypeCommon: TypeCommon{TypeName: "vma", FldName: "addr", TypeSize: 8}}, &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "addr"}, }}, - {ID: 1, Name: "zx_handle_close", CallName: "zx_handle_close", Args: []Type{ + {ID: 2, NR: 1000002, Name: "syz_process_self", CallName: "syz_process_self", Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, + {ID: 3, NR: 1000003, Name: "syz_thread_self", CallName: "syz_thread_self", Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, + {ID: 4, NR: 1000004, Name: "syz_vmar_root_self", CallName: "syz_vmar_root_self", Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmar", FldName: "ret", TypeSize: 4, ArgDir: 1}}}, + {ID: 5, 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}}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "args", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_channel_call_args"}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual_bytes", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual_handles", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "read_status", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + }}, + {ID: 6, Name: "zx_channel_create", CallName: "zx_channel_create", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out0", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_chan", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out1", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_chan", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 7, Name: "zx_channel_read", CallName: "zx_channel_read", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_chan", FldName: "handle", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "chan_read_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "bytes", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "handles", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "num_bytes", TypeSize: 8}}, Buf: "bytes"}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "num_handles", TypeSize: 8}}, Buf: "handles"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual_bytes", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual_handles", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + }}, + {ID: 8, Name: "zx_channel_write", CallName: "zx_channel_write", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_chan", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "bytes", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "num_bytes", TypeSize: 8}}, Buf: "bytes"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "handles", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array"}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "num_handles", TypeSize: 8}}, Buf: "handles"}, + }}, + {ID: 9, 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"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buffer"}, + }}, + {ID: 10, Name: "zx_cprng_draw", CallName: "zx_cprng_draw", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &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}}}}, + }}, + {ID: 11, 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}}}, + }}, + {ID: 12, Name: "zx_eventpair_create", CallName: "zx_eventpair_create", Args: []Type{ + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out0", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_event", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out1", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_event", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 13, Name: "zx_fifo_create", CallName: "zx_fifo_create", Args: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "fifo_elem_count", FldName: "elem_count", TypeSize: 8}}, Vals: []uint64{0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "elem_size", TypeSize: 4}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out0", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_fifo", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out1", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_fifo", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 14, Name: "zx_fifo_read", CallName: "zx_fifo_read", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_fifo", FldName: "handle", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "num_entries_read", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + }}, + {ID: 15, Name: "zx_fifo_write", CallName: "zx_fifo_write", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_fifo", FldName: "handle", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", TypeSize: 8}}, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "num_entries_written", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + }}, + {ID: 16, Name: "zx_futex_requeue", CallName: "zx_futex_requeue", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "value_ptr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "wake_count", TypeSize: 8}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "current_value", TypeSize: 4}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "requeue_ptr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "requeue_count", TypeSize: 8}}}, + }}, + {ID: 17, Name: "zx_futex_wait", CallName: "zx_futex_wait", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "value_ptr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "current_value", TypeSize: 4}}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}}, + }}, + {ID: 18, Name: "zx_futex_wake", CallName: "zx_futex_wake", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "value_ptr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "wake_count", TypeSize: 8}}}, + }}, + {ID: 19, Name: "zx_futex_wake_handle_close_thread_exit", CallName: "zx_futex_wake_handle_close_thread_exit", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "value_ptr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4, ArgDir: 1}}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "wake_count", TypeSize: 4}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "new_value", TypeSize: 4}}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "close_handle", TypeSize: 4}}, + }}, + {ID: 20, Name: "zx_handle_close", CallName: "zx_handle_close", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, }}, - {ID: 2, Name: "zx_handle_duplicate", CallName: "zx_handle_duplicate", Args: []Type{ + {ID: 21, Name: "zx_handle_duplicate", CallName: "zx_handle_duplicate", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, &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}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}}, }}, - {ID: 3, Name: "zx_handle_replace", CallName: "zx_handle_replace", Args: []Type{ + {ID: 22, Name: "zx_handle_replace", CallName: "zx_handle_replace", Args: []Type{ &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, &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}}, &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}}, }}, - {ID: 4, Name: "zx_time_get", CallName: "zx_time_get", Args: []Type{ + {ID: 23, 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}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 24, Name: "zx_job_set_policy", CallName: "zx_job_set_policy", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "job_handle", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "job_policy_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{0, 1}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "policy", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array"}, Type: &StructType{Key: StructKey{Name: "zx_policy_basic"}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "count", TypeSize: 8}}, Buf: "policy"}, + }}, + {ID: 25, Name: "zx_job_set_relative_importance", CallName: "zx_job_set_relative_importance", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "res", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "job", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "less_important_job", TypeSize: 4}}, + }}, + {ID: 26, Name: "zx_log_create", CallName: "zx_log_create", Args: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "log_create_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1073741824}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_log", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 27, Name: "zx_log_read", CallName: "zx_log_read", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_log", FldName: "handle", TypeSize: 4}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "ptr"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ptr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "options", TypeSize: 4}}}, + }}, + {ID: 28, Name: "zx_log_write", CallName: "zx_log_write", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_log", FldName: "handle", TypeSize: 4}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "ptr"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "ptr", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "options", TypeSize: 4}}}, + }}, + {ID: 29, Name: "zx_nanosleep", CallName: "zx_nanosleep", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}}, + }}, + {ID: 30, Name: "zx_object_get_child", CallName: "zx_object_get_child", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", FldName: "koid", TypeSize: 8}}, + &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}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 31, Name: "zx_object_get_cookie", CallName: "zx_object_get_cookie", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "scope", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "cookie", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 32, 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}}, + &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}, Type: &StructType{Key: StructKey{Name: "zx_info_cpu_stats", Dir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 33, Name: "zx_object_get_info$ZX_INFO_HANDLE_BASIC", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 2}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_handle_basic", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 34, Name: "zx_object_get_info$ZX_INFO_HANDLE_VALID", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 1}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "buffer", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "buffer_size", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 35, Name: "zx_object_get_info$ZX_INFO_JOB_CHILDREN", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 8}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", TypeSize: 8, ArgDir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 36, Name: "zx_object_get_info$ZX_INFO_JOB_PROCESSES", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 9}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_thread", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 37, 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}}, + &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}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 38, Name: "zx_object_get_info$ZX_INFO_PROCESS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 3}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_process", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 39, Name: "zx_object_get_info$ZX_INFO_PROCESS_MAPS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 13}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}, Type: &StructType{Key: StructKey{Name: "zx_info_maps", Dir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 40, Name: "zx_object_get_info$ZX_INFO_PROCESS_THREADS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 4}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "koid", TypeSize: 8, ArgDir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 41, Name: "zx_object_get_info$ZX_INFO_PROCESS_VMOS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 14}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &ArrayType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}, Type: &StructType{Key: StructKey{Name: "zx_info_vmo", Dir: 1}}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 42, 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}}, + &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}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 43, Name: "zx_object_get_info$ZX_INFO_TASK_STATS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 12}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_task_stats", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 44, Name: "zx_object_get_info$ZX_INFO_THREAD_EXCEPTION_REPORT", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 11}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_exception_report", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 45, Name: "zx_object_get_info$ZX_INFO_THREAD_STATS", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 15}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_thread_stats", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 46, Name: "zx_object_get_info$ZX_INFO_VMAR", CallName: "zx_object_get_info", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmar", FldName: "handle", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "topic", TypeSize: 8}}, Val: 7}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_info_vmar", Dir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "bytesize", FldName: "buffer_size", TypeSize: 8}}, ByteSize: 1, Buf: "buffer"}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "actual", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "avail", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8, ArgDir: 1}}}}, + }}, + {ID: 47, Name: "zx_port_cancel", CallName: "zx_port_cancel", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_port", FldName: "port", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "source", TypeSize: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int64", FldName: "key", TypeSize: 8}}}, + }}, + {ID: 48, Name: "zx_port_create", CallName: "zx_port_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_port", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 49, Name: "zx_port_queue", CallName: "zx_port_queue", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_port", FldName: "handle", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "packet", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_port_packet"}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "size", TypeSize: 8}}}, + }}, + {ID: 50, Name: "zx_port_wait", CallName: "zx_port_wait", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_port", FldName: "handle", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "packet", TypeSize: 8}, Type: &StructType{Key: StructKey{Name: "zx_port_packet", Dir: 1}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "size", TypeSize: 8}}}, + }}, + {ID: 51, Name: "zx_process_create", CallName: "zx_process_create", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_job", FldName: "job", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "name", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string"}, Kind: 2}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "name_len", TypeSize: 8}}, Buf: "name"}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "options", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "proc_handle", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vmar_handle", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmar", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 52, Name: "zx_process_exit", CallName: "zx_process_exit", Args: []Type{ + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "ret_code", TypeSize: 4}}}, + }}, + {ID: 53, Name: "zx_process_read_memory", CallName: "zx_process_read_memory", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "process", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vaddr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", TypeSize: 1, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &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}}}}, + }}, + {ID: 54, Name: "zx_process_start", CallName: "zx_process_start", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "process", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "thread", TypeSize: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "entry", TypeSize: 8}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "stack", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "arg1", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "arg2", TypeSize: 8}}}, + }}, + {ID: 55, Name: "zx_process_write_memory", CallName: "zx_process_write_memory", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "process", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "vaddr", TypeSize: 8}, Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int8", TypeSize: 1, ArgDir: 1}}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &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}}}}, + }}, + {ID: 56, Name: "zx_socket_create", CallName: "zx_socket_create", Args: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "socket_create_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{0, 1, 2}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out0", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_socket", TypeSize: 4, ArgDir: 1}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out1", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_socket", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 57, Name: "zx_socket_read", CallName: "zx_socket_read", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_socket", FldName: "handle", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "socket_read_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", 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}}}}, + }}, + {ID: 58, Name: "zx_socket_write", CallName: "zx_socket_write", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_socket", FldName: "handle", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "socket_write_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{4, 2, 1}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "size", 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}}}}, + }}, + {ID: 59, Name: "zx_system_get_num_cpus", CallName: "zx_system_get_num_cpus"}, + {ID: 60, Name: "zx_system_get_physmem", CallName: "zx_system_get_physmem"}, + {ID: 61, Name: "zx_system_get_version", CallName: "zx_system_get_version", Args: []Type{ + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "version", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "version_len", TypeSize: 8}}, Buf: "version"}, + }}, + {ID: 62, Name: "zx_task_bind_exception_port", CallName: "zx_task_bind_exception_port", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_task", FldName: "task", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_port", FldName: "eport", TypeSize: 4}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "key", TypeSize: 8}}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "exception_port_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{2, 1}}, + }}, + {ID: 63, Name: "zx_task_kill", CallName: "zx_task_kill", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_task", FldName: "handle", TypeSize: 4}}, + }}, + {ID: 64, Name: "zx_task_resume", CallName: "zx_task_resume", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_task", FldName: "task", TypeSize: 4}}, + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "task_resume_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{1, 2}}, + }}, + {ID: 65, Name: "zx_thread_create", CallName: "zx_thread_create", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_process", FldName: "process", TypeSize: 4}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "name", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "string"}, Kind: 2}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "name_len", TypeSize: 8}}, Buf: "name"}, + &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_thread", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 66, Name: "zx_thread_exit", CallName: "zx_thread_exit"}, + {ID: 67, Name: "zx_thread_read_state", CallName: "zx_thread_read_state", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array", ArgDir: 1}}}, + &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: "int32", TypeSize: 4, ArgDir: 1}}}}, + }}, + {ID: 68, Name: "zx_thread_start", CallName: "zx_thread_start", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "entry", TypeSize: 8}}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "stack", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "arg1", TypeSize: 8}}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "arg2", TypeSize: 8}}}, + }}, + {ID: 69, Name: "zx_thread_write_state", CallName: "zx_thread_write_state", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_thread", FldName: "handle", TypeSize: 4}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", FldName: "kind", TypeSize: 4}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "buffer", TypeSize: 8}, Type: &BufferType{TypeCommon: TypeCommon{TypeName: "array"}}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "buffer"}, + }}, + {ID: 70, Name: "zx_ticks_get", CallName: "zx_ticks_get"}, + {ID: 71, Name: "zx_ticks_per_second", CallName: "zx_ticks_per_second"}, + {ID: 72, Name: "zx_time_get", CallName: "zx_time_get", Args: []Type{ &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "clock_id", FldName: "clock_id", TypeSize: 8}}, Vals: []uint64{0, 1, 2}}, + }, Ret: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "ret", TypeSize: 8, ArgDir: 1}}}, + {ID: 73, Name: "zx_timer_cancel", CallName: "zx_timer_cancel", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_timer", FldName: "handle", TypeSize: 4}}, + }}, + {ID: 74, Name: "zx_timer_create", CallName: "zx_timer_create", Args: []Type{ + &FlagsType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "timer_options", FldName: "options", TypeSize: 8}}, Vals: []uint64{0, 1, 2}}, + &ConstType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "const", FldName: "clock_id", TypeSize: 8}}}, + &PtrType{TypeCommon: TypeCommon{TypeName: "ptr", FldName: "out", TypeSize: 8}, Type: &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_timer", TypeSize: 4, ArgDir: 1}}}, + }}, + {ID: 75, Name: "zx_timer_set", CallName: "zx_timer_set", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_timer", FldName: "handle", TypeSize: 4}}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_time", FldName: "deadline", TypeSize: 8}}, + &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", FldName: "slack", TypeSize: 8}}}, + }}, + {ID: 76, Name: "zx_vmar_unmap_handle_close_thread_exit", CallName: "zx_vmar_unmap_handle_close_thread_exit", Args: []Type{ + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_vmar", FldName: "vmar_handle", TypeSize: 4}}, + &VmaType{TypeCommon: TypeCommon{TypeName: "vma", FldName: "addr", TypeSize: 8}}, + &LenType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "len", FldName: "len", TypeSize: 8}}, Buf: "addr"}, + &ResourceType{TypeCommon: TypeCommon{TypeName: "zx_handle", FldName: "close_handle", TypeSize: 4}}, }}, } var consts_arm64 = []ConstValue{ + {Name: "ZX_CHANNEL_READ_MAY_DISCARD", Value: 1}, {Name: "ZX_CLOCK_MONOTONIC"}, {Name: "ZX_CLOCK_THREAD", Value: 2}, {Name: "ZX_CLOCK_UTC", Value: 1}, + {Name: "ZX_EXCEPTION_PORT_DEBUGGER", Value: 1}, + {Name: "ZX_EXCEPTION_PORT_UNBIND_QUIETLY", Value: 2}, + {Name: "ZX_HANDLE_INVALID"}, + {Name: "ZX_INFO_CPU_STATS", Value: 16}, + {Name: "ZX_INFO_HANDLE_BASIC", Value: 2}, + {Name: "ZX_INFO_HANDLE_VALID", Value: 1}, + {Name: "ZX_INFO_JOB_CHILDREN", Value: 8}, + {Name: "ZX_INFO_JOB_PROCESSES", Value: 9}, + {Name: "ZX_INFO_KMEM_STATS", Value: 17}, + {Name: "ZX_INFO_PROCESS", Value: 3}, + {Name: "ZX_INFO_PROCESS_MAPS", Value: 13}, + {Name: "ZX_INFO_PROCESS_THREADS", Value: 4}, + {Name: "ZX_INFO_PROCESS_VMOS", Value: 14}, + {Name: "ZX_INFO_RESOURCE", Value: 18}, + {Name: "ZX_INFO_TASK_STATS", Value: 12}, + {Name: "ZX_INFO_THREAD_EXCEPTION_REPORT", Value: 11}, + {Name: "ZX_INFO_THREAD_STATS", Value: 15}, + {Name: "ZX_INFO_VMAR", Value: 7}, + {Name: "ZX_JOB_POL_ABSOLUTE", Value: 1}, + {Name: "ZX_JOB_POL_BASIC"}, + {Name: "ZX_JOB_POL_RELATIVE"}, + {Name: "ZX_LOG_FLAG_READABLE", Value: 1073741824}, + {Name: "ZX_MAX_NAME_LEN", Value: 32}, + {Name: "ZX_PKT_TYPE_USER"}, + {Name: "ZX_POL_ACTION_ALLOW"}, + {Name: "ZX_POL_ACTION_DENY", Value: 1}, + {Name: "ZX_POL_ACTION_EXCEPTION", Value: 2}, + {Name: "ZX_POL_ACTION_KILL", Value: 5}, + {Name: "ZX_POL_BAD_HANDLE"}, + {Name: "ZX_POL_NEW_ANY", Value: 3}, + {Name: "ZX_POL_NEW_CHANNEL", Value: 5}, + {Name: "ZX_POL_NEW_EVENT", Value: 6}, + {Name: "ZX_POL_NEW_EVPAIR", Value: 7}, + {Name: "ZX_POL_NEW_FIFO", Value: 10}, + {Name: "ZX_POL_NEW_PORT", Value: 8}, + {Name: "ZX_POL_NEW_SOCKET", Value: 9}, + {Name: "ZX_POL_NEW_TIMER", Value: 11}, + {Name: "ZX_POL_NEW_VMO", Value: 4}, + {Name: "ZX_POL_VMAR_WX", Value: 2}, + {Name: "ZX_POL_WRONG_OBJECT", Value: 1}, + {Name: "ZX_RESUME_EXCEPTION", Value: 1}, + {Name: "ZX_RESUME_TRY_NEXT", Value: 2}, {Name: "ZX_RIGHT_DESTROY", Value: 512}, {Name: "ZX_RIGHT_DUPLICATE", Value: 1}, {Name: "ZX_RIGHT_ENUMERATE", Value: 256}, @@ -56,6 +658,16 @@ var consts_arm64 = []ConstValue{ {Name: "ZX_RIGHT_SIGNAL_PEER", Value: 8192}, {Name: "ZX_RIGHT_TRANSFER", Value: 2}, {Name: "ZX_RIGHT_WRITE", Value: 8}, + {Name: "ZX_SOCKET_CONTROL", Value: 4}, + {Name: "ZX_SOCKET_DATAGRAM", Value: 1}, + {Name: "ZX_SOCKET_HAS_CONTROL", Value: 2}, + {Name: "ZX_SOCKET_SHUTDOWN_READ", Value: 2}, + {Name: "ZX_SOCKET_SHUTDOWN_WRITE", Value: 1}, + {Name: "ZX_SOCKET_STREAM"}, + {Name: "ZX_TIMER_SLACK_CENTER"}, + {Name: "ZX_TIMER_SLACK_EARLY", Value: 1}, + {Name: "ZX_TIMER_SLACK_LATE", Value: 2}, + {Name: "ZX_TIME_INFINITE", Value: 18446744073709551615}, } -const revision_arm64 = "9e985d79861e2754a6fead2a7c97ca4854e3df44" +const revision_arm64 = "7aa3efd28c51db95f99f7b3c8feb4f66ad25f0d8" diff --git a/sys/fuchsia/channels.txt b/sys/fuchsia/channels.txt new file mode 100644 index 00000000..15448bf4 --- /dev/null +++ b/sys/fuchsia/channels.txt @@ -0,0 +1,24 @@ +# 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 + +resource zx_chan[zx_handle] + +zx_channel_create(options const[0], out0 ptr[out, zx_chan], out1 ptr[out, zx_chan]) +zx_channel_call(handle zx_chan, options const[0], deadline zx_time, args ptr[in, zx_channel_call_args], actual_bytes ptr[out, int32], actual_handles ptr[out, int32], read_status ptr[out, int32]) +zx_channel_read(handle zx_chan, options flags[chan_read_options], bytes ptr[out, array[int8]], handles ptr[out, zx_handle], num_bytes len[bytes], num_handles len[handles], actual_bytes ptr[out, int32], actual_handles ptr[out, int32]) +zx_channel_write(handle zx_chan, options const[0], bytes ptr[in, array[int8]], num_bytes len[bytes], handles ptr[in, array[zx_handle]], num_handles len[handles]) + +zx_channel_call_args { + wr_bytes ptr[in, array[int8]] + wr_handles ptr[in, array[zx_handle]] + rd_bytes ptr[out, array[int8]] + rd_handles ptr[out, array[zx_handle]] + wr_num_bytes len[wr_bytes, int32] + wr_num_handles len[wr_handles, int32] + rd_num_bytes len[rd_bytes, int32] + rd_num_handles len[rd_handles, int32] +} + +chan_read_options = ZX_CHANNEL_READ_MAY_DISCARD diff --git a/sys/fuchsia/channels_amd64.const b/sys/fuchsia/channels_amd64.const new file mode 100644 index 00000000..18356a18 --- /dev/null +++ b/sys/fuchsia/channels_amd64.const @@ -0,0 +1,2 @@ +# AUTOGENERATED FILE +ZX_CHANNEL_READ_MAY_DISCARD = 1 diff --git a/sys/fuchsia/channels_arm64.const b/sys/fuchsia/channels_arm64.const new file mode 100644 index 00000000..18356a18 --- /dev/null +++ b/sys/fuchsia/channels_arm64.const @@ -0,0 +1,2 @@ +# AUTOGENERATED FILE +ZX_CHANNEL_READ_MAY_DISCARD = 1 diff --git a/sys/fuchsia/events.txt b/sys/fuchsia/events.txt new file mode 100644 index 00000000..de9d26d7 --- /dev/null +++ b/sys/fuchsia/events.txt @@ -0,0 +1,9 @@ +# 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 + +resource zx_event[zx_handle] + +zx_event_create(options const[0], out ptr[out, zx_event]) +zx_eventpair_create(options const[0], out0 ptr[out, zx_event], out1 ptr[out, zx_event]) diff --git a/sys/fuchsia/fifos.txt b/sys/fuchsia/fifos.txt new file mode 100644 index 00000000..98a34822 --- /dev/null +++ b/sys/fuchsia/fifos.txt @@ -0,0 +1,12 @@ +# 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 + +resource zx_fifo[zx_handle] + +zx_fifo_create(elem_count flags[fifo_elem_count], elem_size int32, options const[0], out0 ptr[out, zx_fifo], out1 ptr[out, zx_fifo]) +zx_fifo_read(handle zx_fifo, buffer ptr[out, array[int8]], size len[buffer], num_entries_read ptr[out, int32]) +zx_fifo_write(handle zx_fifo, buffer ptr[in, array[int8]], size len[buffer], num_entries_written ptr[out, int32]) + +fifo_elem_count = 0, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096 diff --git a/sys/fuchsia/futexes.txt b/sys/fuchsia/futexes.txt new file mode 100644 index 00000000..3177472c --- /dev/null +++ b/sys/fuchsia/futexes.txt @@ -0,0 +1,9 @@ +# 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 + +# TODO: limit value_ptr space somehow to make matches more frequent. +zx_futex_wait(value_ptr ptr[in, int32], current_value int32, deadline zx_time) +zx_futex_wake(value_ptr ptr[in, int32], wake_count intptr) +zx_futex_requeue(value_ptr ptr[in, int32], wake_count intptr, current_value int32, requeue_ptr ptr[in, int32], requeue_count intptr) diff --git a/sys/fuchsia/handles.txt b/sys/fuchsia/handles.txt new file mode 100644 index 00000000..e3a64745 --- /dev/null +++ b/sys/fuchsia/handles.txt @@ -0,0 +1,12 @@ +# 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 + +resource zx_handle[int32]: ZX_HANDLE_INVALID + +zx_handle_close(handle zx_handle) +zx_handle_duplicate(handle zx_handle, rights flags[zx_rights], out ptr[out, zx_handle]) +zx_handle_replace(handle zx_handle, rights flags[zx_rights], out ptr[out, zx_handle]) + +zx_rights = ZX_RIGHT_NONE, ZX_RIGHT_DUPLICATE, ZX_RIGHT_TRANSFER, ZX_RIGHT_READ, ZX_RIGHT_WRITE, ZX_RIGHT_EXECUTE, ZX_RIGHT_MAP, ZX_RIGHT_GET_PROPERTY, ZX_RIGHT_SET_PROPERTY, ZX_RIGHT_ENUMERATE, ZX_RIGHT_DESTROY, ZX_RIGHT_SET_POLICY, ZX_RIGHT_GET_POLICY, ZX_RIGHT_SIGNAL, ZX_RIGHT_SIGNAL_PEER, ZX_RIGHT_SAME_RIGHTS diff --git a/sys/fuchsia/handles_amd64.const b/sys/fuchsia/handles_amd64.const new file mode 100644 index 00000000..bd5e30e5 --- /dev/null +++ b/sys/fuchsia/handles_amd64.const @@ -0,0 +1,18 @@ +# AUTOGENERATED FILE +ZX_HANDLE_INVALID = 0 +ZX_RIGHT_DESTROY = 512 +ZX_RIGHT_DUPLICATE = 1 +ZX_RIGHT_ENUMERATE = 256 +ZX_RIGHT_EXECUTE = 16 +ZX_RIGHT_GET_POLICY = 2048 +ZX_RIGHT_GET_PROPERTY = 64 +ZX_RIGHT_MAP = 32 +ZX_RIGHT_NONE = 0 +ZX_RIGHT_READ = 4 +ZX_RIGHT_SAME_RIGHTS = 2147483648 +ZX_RIGHT_SET_POLICY = 1024 +ZX_RIGHT_SET_PROPERTY = 128 +ZX_RIGHT_SIGNAL = 4096 +ZX_RIGHT_SIGNAL_PEER = 8192 +ZX_RIGHT_TRANSFER = 2 +ZX_RIGHT_WRITE = 8 diff --git a/sys/fuchsia/handles_arm64.const b/sys/fuchsia/handles_arm64.const new file mode 100644 index 00000000..bd5e30e5 --- /dev/null +++ b/sys/fuchsia/handles_arm64.const @@ -0,0 +1,18 @@ +# AUTOGENERATED FILE +ZX_HANDLE_INVALID = 0 +ZX_RIGHT_DESTROY = 512 +ZX_RIGHT_DUPLICATE = 1 +ZX_RIGHT_ENUMERATE = 256 +ZX_RIGHT_EXECUTE = 16 +ZX_RIGHT_GET_POLICY = 2048 +ZX_RIGHT_GET_PROPERTY = 64 +ZX_RIGHT_MAP = 32 +ZX_RIGHT_NONE = 0 +ZX_RIGHT_READ = 4 +ZX_RIGHT_SAME_RIGHTS = 2147483648 +ZX_RIGHT_SET_POLICY = 1024 +ZX_RIGHT_SET_PROPERTY = 128 +ZX_RIGHT_SIGNAL = 4096 +ZX_RIGHT_SIGNAL_PEER = 8192 +ZX_RIGHT_TRANSFER = 2 +ZX_RIGHT_WRITE = 8 diff --git a/sys/fuchsia/jobs.txt b/sys/fuchsia/jobs.txt new file mode 100644 index 00000000..89a8dfbe --- /dev/null +++ b/sys/fuchsia/jobs.txt @@ -0,0 +1,21 @@ +# 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 +include + +resource zx_job[zx_task] + +zx_job_create(job zx_job, options const[0], out ptr[out, zx_job]) +zx_job_set_policy(job_handle zx_job, options flags[job_policy_options], topic const[ZX_JOB_POL_BASIC], policy ptr[in, array[zx_policy_basic]], count len[policy]) +# TODO: res must be some "root resource", where does one get one? +zx_job_set_relative_importance(res zx_handle, job zx_job, less_important_job zx_job) + +zx_policy_basic { + condition flags[zx_policy_condition, int32] + policy flags[zx_policy_policy, int32] +} + +job_policy_options = ZX_JOB_POL_RELATIVE, ZX_JOB_POL_ABSOLUTE +zx_policy_condition = ZX_POL_BAD_HANDLE, ZX_POL_WRONG_OBJECT, ZX_POL_VMAR_WX, ZX_POL_NEW_VMO, ZX_POL_NEW_CHANNEL, ZX_POL_NEW_EVENT, ZX_POL_NEW_EVPAIR, ZX_POL_NEW_PORT, ZX_POL_NEW_SOCKET, ZX_POL_NEW_FIFO, ZX_POL_NEW_TIMER, ZX_POL_NEW_ANY +zx_policy_policy = ZX_POL_ACTION_ALLOW, ZX_POL_ACTION_DENY, ZX_POL_ACTION_EXCEPTION, ZX_POL_ACTION_KILL diff --git a/sys/fuchsia/jobs_amd64.const b/sys/fuchsia/jobs_amd64.const new file mode 100644 index 00000000..eb4c408c --- /dev/null +++ b/sys/fuchsia/jobs_amd64.const @@ -0,0 +1,20 @@ +# AUTOGENERATED FILE +ZX_JOB_POL_ABSOLUTE = 1 +ZX_JOB_POL_BASIC = 0 +ZX_JOB_POL_RELATIVE = 0 +ZX_POL_ACTION_ALLOW = 0 +ZX_POL_ACTION_DENY = 1 +ZX_POL_ACTION_EXCEPTION = 2 +ZX_POL_ACTION_KILL = 5 +ZX_POL_BAD_HANDLE = 0 +ZX_POL_NEW_ANY = 3 +ZX_POL_NEW_CHANNEL = 5 +ZX_POL_NEW_EVENT = 6 +ZX_POL_NEW_EVPAIR = 7 +ZX_POL_NEW_FIFO = 10 +ZX_POL_NEW_PORT = 8 +ZX_POL_NEW_SOCKET = 9 +ZX_POL_NEW_TIMER = 11 +ZX_POL_NEW_VMO = 4 +ZX_POL_VMAR_WX = 2 +ZX_POL_WRONG_OBJECT = 1 diff --git a/sys/fuchsia/jobs_arm64.const b/sys/fuchsia/jobs_arm64.const new file mode 100644 index 00000000..eb4c408c --- /dev/null +++ b/sys/fuchsia/jobs_arm64.const @@ -0,0 +1,20 @@ +# AUTOGENERATED FILE +ZX_JOB_POL_ABSOLUTE = 1 +ZX_JOB_POL_BASIC = 0 +ZX_JOB_POL_RELATIVE = 0 +ZX_POL_ACTION_ALLOW = 0 +ZX_POL_ACTION_DENY = 1 +ZX_POL_ACTION_EXCEPTION = 2 +ZX_POL_ACTION_KILL = 5 +ZX_POL_BAD_HANDLE = 0 +ZX_POL_NEW_ANY = 3 +ZX_POL_NEW_CHANNEL = 5 +ZX_POL_NEW_EVENT = 6 +ZX_POL_NEW_EVPAIR = 7 +ZX_POL_NEW_FIFO = 10 +ZX_POL_NEW_PORT = 8 +ZX_POL_NEW_SOCKET = 9 +ZX_POL_NEW_TIMER = 11 +ZX_POL_NEW_VMO = 4 +ZX_POL_VMAR_WX = 2 +ZX_POL_WRONG_OBJECT = 1 diff --git a/sys/fuchsia/log.txt b/sys/fuchsia/log.txt new file mode 100644 index 00000000..2511bcb6 --- /dev/null +++ b/sys/fuchsia/log.txt @@ -0,0 +1,14 @@ +# 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 +include + +resource zx_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) + +log_create_options = ZX_LOG_FLAG_READABLE diff --git a/sys/fuchsia/log_amd64.const b/sys/fuchsia/log_amd64.const new file mode 100644 index 00000000..d16fe84e --- /dev/null +++ b/sys/fuchsia/log_amd64.const @@ -0,0 +1,2 @@ +# AUTOGENERATED FILE +ZX_LOG_FLAG_READABLE = 1073741824 diff --git a/sys/fuchsia/log_arm64.const b/sys/fuchsia/log_arm64.const new file mode 100644 index 00000000..d16fe84e --- /dev/null +++ b/sys/fuchsia/log_arm64.const @@ -0,0 +1,2 @@ +# AUTOGENERATED FILE +ZX_LOG_FLAG_READABLE = 1073741824 diff --git a/sys/fuchsia/objects.txt b/sys/fuchsia/objects.txt new file mode 100644 index 00000000..fedbf4b9 --- /dev/null +++ b/sys/fuchsia/objects.txt @@ -0,0 +1,167 @@ +# 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 +include + +# TODO: special values? +resource koid[int64]: 0 + +# TODO: +#object_get_property - read an object property +#object_set_cookie - write an object cookie +#object_set_property - modify an object property +#object_signal - set or clear the user signals on an object +#object_signal_peer - set or clear the user signals in the opposite end +#object_wait_many - wait for signals on multiple objects +#object_wait_one - wait for signals on one object +#object_wait_async - asynchronous notifications on signal change + +zx_object_get_child(handle zx_handle, koid koid, rights flags[zx_rights], out ptr[out, zx_handle]) +zx_object_get_cookie(handle zx_handle, scope zx_handle, cookie ptr[out, int64]) + +zx_object_get_info$ZX_INFO_HANDLE_VALID(handle zx_handle, topic const[ZX_INFO_HANDLE_VALID], buffer const[0], buffer_size const[0], actual ptr[out, intptr], avail ptr[out, intptr]) +zx_object_get_info$ZX_INFO_HANDLE_BASIC(handle zx_handle, topic const[ZX_INFO_HANDLE_BASIC], buffer ptr[out, zx_info_handle_basic], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr]) +zx_object_get_info$ZX_INFO_PROCESS(handle zx_process, topic const[ZX_INFO_PROCESS], buffer ptr[out, zx_info_process], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr]) +zx_object_get_info$ZX_INFO_PROCESS_THREADS(handle zx_process, topic const[ZX_INFO_PROCESS_THREADS], buffer ptr[out, array[koid]], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr]) +zx_object_get_info$ZX_INFO_VMAR(handle zx_vmar, topic const[ZX_INFO_VMAR], buffer ptr[out, zx_info_vmar], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr]) +zx_object_get_info$ZX_INFO_JOB_CHILDREN(handle zx_job, topic const[ZX_INFO_JOB_CHILDREN], buffer ptr[out, array[koid]], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr]) +zx_object_get_info$ZX_INFO_JOB_PROCESSES(handle zx_job, topic const[ZX_INFO_JOB_PROCESSES], buffer ptr[out, zx_info_thread], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr]) +zx_object_get_info$ZX_INFO_THREAD_EXCEPTION_REPORT(handle zx_thread, topic const[ZX_INFO_THREAD_EXCEPTION_REPORT], buffer ptr[out, zx_exception_report], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr]) +zx_object_get_info$ZX_INFO_TASK_STATS(handle zx_process, topic const[ZX_INFO_TASK_STATS], buffer ptr[out, zx_info_task_stats], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr]) +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]) +# 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_info_handle_basic { + koid koid + rights int32 + type int32 + related_koid koid + props int32 +} + +zx_info_process { + return_code int32 + started int8 + exited int8 + debugger_attached int8 +} + +zx_info_vmar { + base intptr + len intptr +} + +zx_info_thread { + state int32 + wait_exception_port_type int32 +} + +zx_info_thread_stats { + total_runtime int64 +} + +zx_info_task_stats { + mem_mapped_bytes intptr + mem_private_bytes intptr + mem_shared_bytes intptr + mem_scaled_shared_bytes intptr +} + +zx_info_maps { + name array[int8, ZX_MAX_NAME_LEN] + base intptr + size intptr + depth intptr + type int32 + mapping zx_info_maps_mapping +} + +zx_info_maps_mapping { + mmu_flags int32 + vmo_koid koid + committed_pages intptr +} + +zx_info_vmo { + koid koid + name array[int8, ZX_MAX_NAME_LEN] + size_bytes int64 + parent_koid koid + num_children intptr + num_mappings intptr + share_count intptr + flags int32 + committed_bytes int64 + handle_rights int32 +} + +zx_info_cpu_stats { + cpu_number int32 + flags int32 + idle_time int64 + reschedules int64 + context_switches int64 + irq_preempts int64 + preempts int64 + yields int64 + ints int64 + timer_ints int64 + timers int64 + page_faults int64 + exceptions int64 + syscalls int64 + reschedule_ipis int64 + generic_ipis int64 +} + +zx_info_kmem_stats { + total_bytes int64 + free_bytes int64 + wired_bytes int64 + + total_heap_bytes int64 + free_heap_bytes int64 + vmo_bytes int64 + mmu_overhead_bytes int64 + other_bytes int64 +} + +zx_info_resource { + kind int32 + low int64 + high int64 +} + +zx_exception_report { + header zx_exception_header + context zx_exception_context +} + +zx_exception_header { + size int32 + type int32 +} + +zx_exception_context [ + x86_64 x86_64_exc_data + arm_64 arm64_exc_data +] + +x86_64_exc_data { + vector int64 + err_code int64 + cr2 int64 +} + +arm64_exc_data { + esr int32 + far int64 +} diff --git a/sys/fuchsia/objects_amd64.const b/sys/fuchsia/objects_amd64.const new file mode 100644 index 00000000..2c19aac9 --- /dev/null +++ b/sys/fuchsia/objects_amd64.const @@ -0,0 +1,17 @@ +# AUTOGENERATED FILE +ZX_INFO_CPU_STATS = 16 +ZX_INFO_HANDLE_BASIC = 2 +ZX_INFO_HANDLE_VALID = 1 +ZX_INFO_JOB_CHILDREN = 8 +ZX_INFO_JOB_PROCESSES = 9 +ZX_INFO_KMEM_STATS = 17 +ZX_INFO_PROCESS = 3 +ZX_INFO_PROCESS_MAPS = 13 +ZX_INFO_PROCESS_THREADS = 4 +ZX_INFO_PROCESS_VMOS = 14 +ZX_INFO_RESOURCE = 18 +ZX_INFO_TASK_STATS = 12 +ZX_INFO_THREAD_EXCEPTION_REPORT = 11 +ZX_INFO_THREAD_STATS = 15 +ZX_INFO_VMAR = 7 +ZX_MAX_NAME_LEN = 32 diff --git a/sys/fuchsia/objects_arm64.const b/sys/fuchsia/objects_arm64.const new file mode 100644 index 00000000..2c19aac9 --- /dev/null +++ b/sys/fuchsia/objects_arm64.const @@ -0,0 +1,17 @@ +# AUTOGENERATED FILE +ZX_INFO_CPU_STATS = 16 +ZX_INFO_HANDLE_BASIC = 2 +ZX_INFO_HANDLE_VALID = 1 +ZX_INFO_JOB_CHILDREN = 8 +ZX_INFO_JOB_PROCESSES = 9 +ZX_INFO_KMEM_STATS = 17 +ZX_INFO_PROCESS = 3 +ZX_INFO_PROCESS_MAPS = 13 +ZX_INFO_PROCESS_THREADS = 4 +ZX_INFO_PROCESS_VMOS = 14 +ZX_INFO_RESOURCE = 18 +ZX_INFO_TASK_STATS = 12 +ZX_INFO_THREAD_EXCEPTION_REPORT = 11 +ZX_INFO_THREAD_STATS = 15 +ZX_INFO_VMAR = 7 +ZX_MAX_NAME_LEN = 32 diff --git a/sys/fuchsia/ports.txt b/sys/fuchsia/ports.txt new file mode 100644 index 00000000..e914078c --- /dev/null +++ b/sys/fuchsia/ports.txt @@ -0,0 +1,21 @@ +# 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 +include + +resource zx_port[zx_handle] + +zx_port_create(options const[0], out ptr[out, zx_port]) +# TODO: does size really always 0? +zx_port_queue(handle zx_port, packet ptr[in, zx_port_packet], size const[0]) +zx_port_wait(handle zx_port, deadline zx_time, packet ptr[out, zx_port_packet], size const[0]) +# TODO: we probably want to limit key space to get more matches between different calls. +zx_port_cancel(port zx_port, source zx_handle, key int64) + +zx_port_packet { + key const[0, int64] + type const[ZX_PKT_TYPE_USER, int32] + status const[0, int32] + u64 array[int64, 4] +} diff --git a/sys/fuchsia/ports_amd64.const b/sys/fuchsia/ports_amd64.const new file mode 100644 index 00000000..726f4053 --- /dev/null +++ b/sys/fuchsia/ports_amd64.const @@ -0,0 +1,2 @@ +# AUTOGENERATED FILE +ZX_PKT_TYPE_USER = 0 diff --git a/sys/fuchsia/ports_arm64.const b/sys/fuchsia/ports_arm64.const new file mode 100644 index 00000000..726f4053 --- /dev/null +++ b/sys/fuchsia/ports_arm64.const @@ -0,0 +1,2 @@ +# AUTOGENERATED FILE +ZX_PKT_TYPE_USER = 0 diff --git a/sys/fuchsia/processes.txt b/sys/fuchsia/processes.txt new file mode 100644 index 00000000..11f28b73 --- /dev/null +++ b/sys/fuchsia/processes.txt @@ -0,0 +1,12 @@ +# 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 + +resource zx_process[zx_task] + +zx_process_create(job zx_job, name ptr[in, string], name_len len[name], options const[0], proc_handle ptr[out, zx_process], vmar_handle ptr[out, zx_vmar]) +zx_process_start(process zx_process, thread zx_thread, entry intptr, stack intptr, arg1 const[0], arg2 const[0]) +zx_process_read_memory(process zx_process, vaddr ptr[out, int8], buffer ptr[out, array[int8]], len len[buffer], actual ptr[out, intptr]) +zx_process_write_memory(process zx_process, vaddr ptr[out, int8], buffer ptr[in, array[int8]], len len[buffer], actual ptr[out, intptr]) +zx_process_exit(ret_code int32) diff --git a/sys/fuchsia/sockets.txt b/sys/fuchsia/sockets.txt new file mode 100644 index 00000000..70724213 --- /dev/null +++ b/sys/fuchsia/sockets.txt @@ -0,0 +1,14 @@ +# 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 + +resource zx_socket[zx_handle] + +zx_socket_create(options flags[socket_create_options], out0 ptr[out, zx_socket], out1 ptr[out, zx_socket]) +zx_socket_read(handle zx_socket, options flags[socket_read_options], buffer ptr[out, array[int8]], size len[buffer], actual ptr[out, intptr]) +zx_socket_write(handle zx_socket, options flags[socket_write_options], buffer ptr[in, array[int8]], size len[buffer], actual ptr[out, intptr]) + +socket_create_options = ZX_SOCKET_STREAM, ZX_SOCKET_DATAGRAM, ZX_SOCKET_HAS_CONTROL +socket_read_options = ZX_SOCKET_CONTROL +socket_write_options = ZX_SOCKET_CONTROL, ZX_SOCKET_SHUTDOWN_READ, ZX_SOCKET_SHUTDOWN_WRITE diff --git a/sys/fuchsia/sockets_amd64.const b/sys/fuchsia/sockets_amd64.const new file mode 100644 index 00000000..a933bc01 --- /dev/null +++ b/sys/fuchsia/sockets_amd64.const @@ -0,0 +1,7 @@ +# AUTOGENERATED FILE +ZX_SOCKET_CONTROL = 4 +ZX_SOCKET_DATAGRAM = 1 +ZX_SOCKET_HAS_CONTROL = 2 +ZX_SOCKET_SHUTDOWN_READ = 2 +ZX_SOCKET_SHUTDOWN_WRITE = 1 +ZX_SOCKET_STREAM = 0 diff --git a/sys/fuchsia/sockets_arm64.const b/sys/fuchsia/sockets_arm64.const new file mode 100644 index 00000000..a933bc01 --- /dev/null +++ b/sys/fuchsia/sockets_arm64.const @@ -0,0 +1,7 @@ +# AUTOGENERATED FILE +ZX_SOCKET_CONTROL = 4 +ZX_SOCKET_DATAGRAM = 1 +ZX_SOCKET_HAS_CONTROL = 2 +ZX_SOCKET_SHUTDOWN_READ = 2 +ZX_SOCKET_SHUTDOWN_WRITE = 1 +ZX_SOCKET_STREAM = 0 diff --git a/sys/fuchsia/sys.txt b/sys/fuchsia/sys.txt index 38324632..815351a0 100644 --- a/sys/fuchsia/sys.txt +++ b/sys/fuchsia/sys.txt @@ -1,18 +1,25 @@ # 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. +# See https://fuchsia.googlesource.com/zircon/+/master/docs/syscalls.md + include +# Used by syzkaller to allocate memory for syscall arguments. syz_mmap(addr vma, len len[addr]) -resource zx_handle[int32]: 0 +# Provided by process runtime (zircon/process.h). +syz_process_self() zx_process +syz_thread_self() zx_thread +syz_vmar_root_self() zx_vmar +syz_job_default() zx_job -zx_handle_close(handle zx_handle) -zx_handle_duplicate(handle zx_handle, rights flags[zx_rights], out ptr[out, zx_handle]) -zx_handle_replace(handle zx_handle, rights flags[zx_rights], out ptr[out, zx_handle]) +zx_system_get_num_cpus() +zx_system_get_physmem() +zx_system_get_version(version ptr[out, array[int8]], version_len len[version]) -zx_time_get(clock_id flags[clock_id]) +zx_cprng_draw(buffer ptr[out, array[int8]], len len[buffer], actual ptr[out, intptr]) +zx_cprng_add_entropy(buffer ptr[in, array[int8]], len len[buffer]) -clock_id = ZX_CLOCK_MONOTONIC, ZX_CLOCK_UTC, ZX_CLOCK_THREAD - -zx_rights = ZX_RIGHT_NONE, ZX_RIGHT_DUPLICATE, ZX_RIGHT_TRANSFER, ZX_RIGHT_READ, ZX_RIGHT_WRITE, ZX_RIGHT_EXECUTE, ZX_RIGHT_MAP, ZX_RIGHT_GET_PROPERTY, ZX_RIGHT_SET_PROPERTY, ZX_RIGHT_ENUMERATE, ZX_RIGHT_DESTROY, ZX_RIGHT_SET_POLICY, ZX_RIGHT_GET_POLICY, ZX_RIGHT_SIGNAL, ZX_RIGHT_SIGNAL_PEER, ZX_RIGHT_SAME_RIGHTS +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[out, int32], wake_count int32, new_value int32, close_handle zx_handle) diff --git a/sys/fuchsia/sys_amd64.const b/sys/fuchsia/sys_amd64.const index e0496bf8..bfb0651e 100644 --- a/sys/fuchsia/sys_amd64.const +++ b/sys/fuchsia/sys_amd64.const @@ -2,19 +2,3 @@ ZX_CLOCK_MONOTONIC = 0 ZX_CLOCK_THREAD = 2 ZX_CLOCK_UTC = 1 -ZX_RIGHT_DESTROY = 512 -ZX_RIGHT_DUPLICATE = 1 -ZX_RIGHT_ENUMERATE = 256 -ZX_RIGHT_EXECUTE = 16 -ZX_RIGHT_GET_POLICY = 2048 -ZX_RIGHT_GET_PROPERTY = 64 -ZX_RIGHT_MAP = 32 -ZX_RIGHT_NONE = 0 -ZX_RIGHT_READ = 4 -ZX_RIGHT_SAME_RIGHTS = 2147483648 -ZX_RIGHT_SET_POLICY = 1024 -ZX_RIGHT_SET_PROPERTY = 128 -ZX_RIGHT_SIGNAL = 4096 -ZX_RIGHT_SIGNAL_PEER = 8192 -ZX_RIGHT_TRANSFER = 2 -ZX_RIGHT_WRITE = 8 diff --git a/sys/fuchsia/sys_arm64.const b/sys/fuchsia/sys_arm64.const index e0496bf8..bfb0651e 100644 --- a/sys/fuchsia/sys_arm64.const +++ b/sys/fuchsia/sys_arm64.const @@ -2,19 +2,3 @@ ZX_CLOCK_MONOTONIC = 0 ZX_CLOCK_THREAD = 2 ZX_CLOCK_UTC = 1 -ZX_RIGHT_DESTROY = 512 -ZX_RIGHT_DUPLICATE = 1 -ZX_RIGHT_ENUMERATE = 256 -ZX_RIGHT_EXECUTE = 16 -ZX_RIGHT_GET_POLICY = 2048 -ZX_RIGHT_GET_PROPERTY = 64 -ZX_RIGHT_MAP = 32 -ZX_RIGHT_NONE = 0 -ZX_RIGHT_READ = 4 -ZX_RIGHT_SAME_RIGHTS = 2147483648 -ZX_RIGHT_SET_POLICY = 1024 -ZX_RIGHT_SET_PROPERTY = 128 -ZX_RIGHT_SIGNAL = 4096 -ZX_RIGHT_SIGNAL_PEER = 8192 -ZX_RIGHT_TRANSFER = 2 -ZX_RIGHT_WRITE = 8 diff --git a/sys/fuchsia/tasks.txt b/sys/fuchsia/tasks.txt new file mode 100644 index 00000000..1eb52c9a --- /dev/null +++ b/sys/fuchsia/tasks.txt @@ -0,0 +1,14 @@ +# 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 +include + +resource zx_task[zx_handle] + +zx_task_resume(task zx_task, options flags[task_resume_options]) +zx_task_bind_exception_port(task zx_task, eport zx_port, key const[0], options flags[exception_port_options]) +zx_task_kill(handle zx_task) + +task_resume_options = ZX_RESUME_EXCEPTION, ZX_RESUME_TRY_NEXT +exception_port_options = ZX_EXCEPTION_PORT_UNBIND_QUIETLY, ZX_EXCEPTION_PORT_DEBUGGER diff --git a/sys/fuchsia/tasks_amd64.const b/sys/fuchsia/tasks_amd64.const new file mode 100644 index 00000000..a7be9682 --- /dev/null +++ b/sys/fuchsia/tasks_amd64.const @@ -0,0 +1,5 @@ +# AUTOGENERATED FILE +ZX_EXCEPTION_PORT_DEBUGGER = 1 +ZX_EXCEPTION_PORT_UNBIND_QUIETLY = 2 +ZX_RESUME_EXCEPTION = 1 +ZX_RESUME_TRY_NEXT = 2 diff --git a/sys/fuchsia/tasks_arm64.const b/sys/fuchsia/tasks_arm64.const new file mode 100644 index 00000000..a7be9682 --- /dev/null +++ b/sys/fuchsia/tasks_arm64.const @@ -0,0 +1,5 @@ +# AUTOGENERATED FILE +ZX_EXCEPTION_PORT_DEBUGGER = 1 +ZX_EXCEPTION_PORT_UNBIND_QUIETLY = 2 +ZX_RESUME_EXCEPTION = 1 +ZX_RESUME_TRY_NEXT = 2 diff --git a/sys/fuchsia/threads.txt b/sys/fuchsia/threads.txt new file mode 100644 index 00000000..ae0ff0dd --- /dev/null +++ b/sys/fuchsia/threads.txt @@ -0,0 +1,14 @@ +# 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 +include + +resource zx_thread[zx_task] + +zx_thread_create(process zx_process, name ptr[in, string], name_len len[name], options const[0], out ptr[out, zx_thread]) +zx_thread_start(handle zx_thread, entry intptr, stack intptr, arg1 const[0], arg2 const[0]) +zx_thread_exit() +# TODO: what is kind? +zx_thread_read_state(handle zx_thread, kind int32, buffer ptr[out, array[int8]], len len[buffer], actual ptr[out, int32]) +zx_thread_write_state(handle zx_thread, kind int32, buffer ptr[in, array[int8]], len len[buffer]) diff --git a/sys/fuchsia/time.txt b/sys/fuchsia/time.txt new file mode 100644 index 00000000..b62791a5 --- /dev/null +++ b/sys/fuchsia/time.txt @@ -0,0 +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 + +# TODO: generate time a bit in future +resource zx_time[int64]: 0, ZX_TIME_INFINITE + +zx_nanosleep(deadline zx_time) +zx_time_get(clock_id flags[clock_id]) zx_time +zx_ticks_get() +zx_ticks_per_second() + +# TODO: undocumented +# zx_clock_adjust? + +clock_id = ZX_CLOCK_MONOTONIC, ZX_CLOCK_UTC, ZX_CLOCK_THREAD diff --git a/sys/fuchsia/time_amd64.const b/sys/fuchsia/time_amd64.const new file mode 100644 index 00000000..8b4044a9 --- /dev/null +++ b/sys/fuchsia/time_amd64.const @@ -0,0 +1,5 @@ +# AUTOGENERATED FILE +ZX_CLOCK_MONOTONIC = 0 +ZX_CLOCK_THREAD = 2 +ZX_CLOCK_UTC = 1 +ZX_TIME_INFINITE = 18446744073709551615 diff --git a/sys/fuchsia/time_arm64.const b/sys/fuchsia/time_arm64.const new file mode 100644 index 00000000..8b4044a9 --- /dev/null +++ b/sys/fuchsia/time_arm64.const @@ -0,0 +1,5 @@ +# AUTOGENERATED FILE +ZX_CLOCK_MONOTONIC = 0 +ZX_CLOCK_THREAD = 2 +ZX_CLOCK_UTC = 1 +ZX_TIME_INFINITE = 18446744073709551615 diff --git a/sys/fuchsia/timers.txt b/sys/fuchsia/timers.txt new file mode 100644 index 00000000..39c47bcd --- /dev/null +++ b/sys/fuchsia/timers.txt @@ -0,0 +1,12 @@ +# 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 + +resource zx_timer[zx_handle] + +zx_timer_create(options flags[timer_options], clock_id const[ZX_CLOCK_MONOTONIC], out ptr[out, zx_timer]) +zx_timer_set(handle zx_timer, deadline zx_time, slack intptr) +zx_timer_cancel(handle zx_timer) + +timer_options = ZX_TIMER_SLACK_CENTER, ZX_TIMER_SLACK_EARLY, ZX_TIMER_SLACK_LATE diff --git a/sys/fuchsia/timers_amd64.const b/sys/fuchsia/timers_amd64.const new file mode 100644 index 00000000..fef6535a --- /dev/null +++ b/sys/fuchsia/timers_amd64.const @@ -0,0 +1,5 @@ +# AUTOGENERATED FILE +ZX_CLOCK_MONOTONIC = 0 +ZX_TIMER_SLACK_CENTER = 0 +ZX_TIMER_SLACK_EARLY = 1 +ZX_TIMER_SLACK_LATE = 2 diff --git a/sys/fuchsia/timers_arm64.const b/sys/fuchsia/timers_arm64.const new file mode 100644 index 00000000..fef6535a --- /dev/null +++ b/sys/fuchsia/timers_arm64.const @@ -0,0 +1,5 @@ +# AUTOGENERATED FILE +ZX_CLOCK_MONOTONIC = 0 +ZX_TIMER_SLACK_CENTER = 0 +ZX_TIMER_SLACK_EARLY = 1 +ZX_TIMER_SLACK_LATE = 2 diff --git a/sys/fuchsia/vmars.txt b/sys/fuchsia/vmars.txt new file mode 100644 index 00000000..7b4dac2b --- /dev/null +++ b/sys/fuchsia/vmars.txt @@ -0,0 +1,13 @@ +# 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 + +resource zx_vmar[zx_handle] + +# TODO: +#vmar_allocate - create a new child VMAR +#vmar_map - map a VMO into a process +#vmar_unmap - unmap a memory region from a process +#vmar_protect - adjust memory access permissions +#vmar_destroy - destroy a VMAR and all of its children diff --git a/sys/fuchsia/vmos.txt b/sys/fuchsia/vmos.txt new file mode 100644 index 00000000..72ec9d90 --- /dev/null +++ b/sys/fuchsia/vmos.txt @@ -0,0 +1,15 @@ +# 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 + +resource zx_vmo[zx_handle] + +# TODO: +#vmo_create - create a new vmo +#vmo_read - read from a vmo +#vmo_write - write to a vmo +#vmo_clone - clone a vmo +#vmo_get_size - obtain the size of a vmo +#vmo_set_size - adjust the size of a vmo +#vmo_op_range - perform an operation on a range of a vmo