• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2017 syzkaller project authors. All rights reserved.
2# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
3
4include <zircon/syscalls.h>
5include <zircon/syscalls/object.h>
6include <zircon/syscalls/exception.h>
7
8resource koid[int64]: 0
9
10# TODO: temporary disabled as it crashes kernel left and right.
11# zx_object_get_child(handle zx_handle, koid koid, rights flags[zx_rights], out ptr[out, zx_handle])
12zx_object_get_cookie(handle zx_handle, scope zx_handle, cookie ptr[out, int64])
13zx_object_set_cookie(handle zx_handle, scope zx_handle, cookie int64)
14zx_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])
15zx_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])
16zx_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])
17zx_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])
18zx_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])
19zx_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])
20zx_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])
21zx_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])
22zx_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])
23zx_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])
24zx_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])
25zx_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])
26zx_object_get_info$ZX_INFO_CPU_STATS(root_resource zx_root_resource, topic const[ZX_INFO_CPU_STATS], buffer ptr[out, array[zx_info_cpu_stats]], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
27zx_object_get_info$ZX_INFO_KMEM_STATS(root_resource zx_root_resource, topic const[ZX_INFO_KMEM_STATS], buffer ptr[out, zx_info_kmem_stats], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
28# TODO: what is handle type here?
29zx_object_get_info$ZX_INFO_RESOURCE(resource_handle zx_handle, topic const[ZX_INFO_RESOURCE], buffer ptr[out, zx_info_resource], buffer_size bytesize[buffer], actual ptr[out, intptr], avail ptr[out, intptr])
30# TODO: detail properties
31zx_object_get_property(handle zx_handle, property int32, value ptr[out, array[int8]], size len[value])
32zx_object_set_property(handle zx_handle, property int32, value ptr[in, array[int8]], size len[value])
33zx_object_signal(handle zx_handle, clear_mask int32, set_mask int32)
34zx_object_signal_peer(handle zx_handle, clear_mask int32, set_mask int32)
35zx_object_wait_one(handle zx_handle, signals int32, deadline zx_time, observed ptr[out, int32])
36zx_object_wait_async(handle zx_handle, port zx_port, key proc[1000, 4], signals int32, options flags[wait_async_options])
37zx_object_wait_many(items ptr[in, array[zx_wait_item]], count len[items], deadline zx_time)
38zx_object_set_profile(handle zx_handle, profile zx_handle, options int32)
39
40wait_async_options = ZX_WAIT_ASYNC_ONCE, ZX_WAIT_ASYNC_REPEATING
41
42zx_info_handle_basic {
43	koid		koid
44	rights		int32
45	type		int32
46	related_koid	koid
47	props		int32
48}
49
50zx_info_process {
51	return_code		int32
52	started			int8
53	exited			int8
54	debugger_attached	int8
55}
56
57zx_info_vmar {
58	base	intptr
59	len	intptr
60}
61
62zx_info_thread {
63	state				int32
64	wait_exception_port_type	int32
65}
66
67zx_info_thread_stats {
68	total_runtime	int64
69}
70
71zx_info_task_stats {
72	mem_mapped_bytes	intptr
73	mem_private_bytes	intptr
74	mem_shared_bytes	intptr
75	mem_scaled_shared_bytes	intptr
76}
77
78zx_info_maps {
79	name	array[int8, ZX_MAX_NAME_LEN]
80	base	intptr
81	size	intptr
82	depth	intptr
83	type	int32
84	mapping	zx_info_maps_mapping
85}
86
87zx_info_maps_mapping {
88	mmu_flags	int32
89	vmo_koid	koid
90	committed_pages	intptr
91}
92
93zx_info_vmo {
94	koid		koid
95	name		array[int8, ZX_MAX_NAME_LEN]
96	size_bytes	int64
97	parent_koid	koid
98	num_children	intptr
99	num_mappings	intptr
100	share_count	intptr
101	flags		int32
102	committed_bytes	int64
103	handle_rights	int32
104}
105
106zx_info_cpu_stats {
107	cpu_number		int32
108	flags			int32
109	idle_time		int64
110	reschedules		int64
111	context_switches	int64
112	irq_preempts		int64
113	preempts		int64
114	yields			int64
115	ints			int64
116	timer_ints		int64
117	timers			int64
118	page_faults		int64
119	exceptions		int64
120	syscalls		int64
121	reschedule_ipis		int64
122	generic_ipis		int64
123}
124
125zx_info_kmem_stats {
126	total_bytes		int64
127	free_bytes		int64
128	wired_bytes		int64
129
130	total_heap_bytes	int64
131	free_heap_bytes		int64
132	vmo_bytes		int64
133	mmu_overhead_bytes	int64
134	other_bytes		int64
135}
136
137zx_info_resource {
138	kind	int32
139	low	int64
140	high	int64
141}
142
143zx_exception_report {
144	header	zx_exception_header
145	context	zx_exception_context
146}
147
148zx_exception_header {
149	size	int32
150	type	int32
151}
152
153zx_exception_context [
154	x86_64	x86_64_exc_data
155	arm_64	arm64_exc_data
156]
157
158x86_64_exc_data {
159	vector		int64
160	err_code	int64
161	cr2		int64
162}
163
164arm64_exc_data {
165	esr	int32
166	far	int64
167}
168
169zx_wait_item {
170	handle	zx_handle
171	waitfor	int32
172	pending	int32
173}
174