• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright 2015 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 <asm/ioctls.h>
5include <uapi/linux/kd.h>
6include <uapi/linux/vt.h>
7include <uapi/linux/fcntl.h>
8
9resource fd_tty[fd]
10
11openat$ptmx(fd const[AT_FDCWD], file ptr[in, string["/dev/ptmx"]], flags flags[open_flags], mode const[0]) fd_tty
12syz_open_pts(fd fd_tty, flags flags[open_flags]) fd_tty
13ioctl$TCGETS(fd fd_tty, cmd const[TCGETS], arg ptr[out, termios])
14ioctl$TCSETS(fd fd_tty, cmd const[TCSETS], arg ptr[in, termios])
15ioctl$TCSETSW(fd fd_tty, cmd const[TCSETSW], arg ptr[in, termios])
16ioctl$TCSETSF(fd fd_tty, cmd const[TCSETSF], arg ptr[in, termios])
17ioctl$TCGETA(fd fd_tty, cmd const[TCGETA], arg ptr[out, termio])
18ioctl$TCSETA(fd fd_tty, cmd const[TCSETA], arg ptr[in, termio])
19ioctl$TCSETAW(fd fd_tty, cmd const[TCSETAW], arg ptr[in, termio])
20ioctl$TCSETAF(fd fd_tty, cmd const[TCSETAF], arg ptr[in, termio])
21ioctl$TIOCGLCKTRMIOS(fd fd_tty, cmd const[TIOCGLCKTRMIOS], arg ptr[in, termios])
22ioctl$TIOCSLCKTRMIOS(fd fd_tty, cmd const[TIOCSLCKTRMIOS], arg ptr[out, termios])
23ioctl$TIOCGWINSZ(fd fd_tty, cmd const[TIOCGWINSZ], arg ptr[out, winsize])
24ioctl$TIOCSWINSZ(fd fd_tty, cmd const[TIOCSWINSZ], arg ptr[in, winsize])
25ioctl$TCSBRK(fd fd_tty, cmd const[TCSBRK], arg intptr)
26ioctl$TCSBRKP(fd fd_tty, cmd const[TCSBRKP], arg intptr)
27ioctl$TIOCSBRK(fd fd_tty, cmd const[TIOCSBRK])
28ioctl$TIOCCBRK(fd fd_tty, cmd const[TIOCCBRK])
29ioctl$TCXONC(fd fd_tty, cmd const[TCXONC], arg intptr)
30ioctl$FIONREAD(fd fd_tty, cmd const[FIONREAD], arg ptr[out, int32])
31ioctl$TIOCOUTQ(fd fd_tty, cmd const[TIOCOUTQ], arg ptr[out, int32])
32ioctl$TCFLSH(fd fd_tty, cmd const[TCFLSH], arg intptr)
33ioctl$TIOCGPTPEER(fd fd_tty, cmd const[TIOCGPTPEER], arg intptr)
34ioctl$TIOCSTI(fd fd_tty, cmd const[TIOCSTI], arg intptr)
35ioctl$TIOCCONS(fd fd_tty, cmd const[TIOCCONS])
36ioctl$TIOCSCTTY(fd fd_tty, cmd const[TIOCSCTTY], arg intptr)
37ioctl$TIOCNOTTY(fd fd_tty, cmd const[TIOCNOTTY])
38ioctl$TIOCGPGRP(fd fd_tty, cmd const[TIOCGPGRP], arg ptr[out, pid])
39ioctl$TIOCSPGRP(fd fd_tty, cmd const[TIOCSPGRP], arg ptr[in, pid])
40ioctl$TIOCGSID(fd fd_tty, cmd const[TIOCGSID], arg ptr[out, pid])
41ioctl$TIOCEXCL(fd fd_tty, cmd const[TIOCEXCL])
42ioctl$TIOCNXCL(fd fd_tty, cmd const[TIOCNXCL])
43ioctl$TIOCGETD(fd fd_tty, cmd const[TIOCGETD], arg ptr[out, int32])
44ioctl$TIOCSETD(fd fd_tty, cmd const[TIOCSETD], arg ptr[in, int32])
45ioctl$TIOCPKT(fd fd_tty, cmd const[TIOCPKT], arg ptr[in, int32])
46ioctl$TIOCMGET(fd fd_tty, cmd const[TIOCMGET], arg ptr[out, int32])
47ioctl$TIOCMSET(fd fd_tty, cmd const[TIOCMSET], arg ptr[in, int32])
48ioctl$TIOCMBIC(fd fd_tty, cmd const[TIOCMBIC], arg ptr[in, int32])
49ioctl$TIOCMBIS(fd fd_tty, cmd const[TIOCMBIS], arg ptr[in, int32])
50ioctl$TIOCGSOFTCAR(fd fd_tty, cmd const[TIOCGSOFTCAR], arg ptr[out, int32])
51ioctl$TIOCSSOFTCAR(fd fd_tty, cmd const[TIOCSSOFTCAR], arg ptr[in, int32])
52
53# For the TIOCLINUX ioctl, see console_ioctl(4).
54
55ioctl$KDGETLED(fd fd_tty, cmd const[KDGETLED], arg ptr[out, int8])
56ioctl$KDSETLED(fd fd_tty, cmd const[KDSETLED], arg intptr)
57ioctl$KDGKBLED(fd fd_tty, cmd const[KDGKBLED], arg ptr[out, int8])
58ioctl$KDSKBLED(fd fd_tty, cmd const[KDSKBLED], arg intptr)
59ioctl$KDGKBTYPE(fd fd_tty, cmd const[KDGKBTYPE], arg ptr[out, int8])
60ioctl$KDADDIO(fd fd_tty, cmd const[KDADDIO], arg intptr)
61ioctl$KDDELIO(fd fd_tty, cmd const[KDDELIO], arg intptr)
62ioctl$KDENABIO(fd fd_tty, cmd const[KDENABIO])
63ioctl$KDDISABIO(fd fd_tty, cmd const[KDDISABIO])
64ioctl$KDSETMODE(fd fd_tty, cmd const[KDSETMODE], arg intptr)
65ioctl$KDGETMODE(fd fd_tty, cmd const[KDGETMODE], arg ptr[out, intptr])
66ioctl$KDMKTONE(fd fd_tty, cmd const[KDMKTONE], arg intptr)
67ioctl$KIOCSOUND(fd fd_tty, cmd const[KIOCSOUND], arg intptr)
68ioctl$GIO_CMAP(fd fd_tty, cmd const[GIO_CMAP], arg ptr[out, io_cmap])
69ioctl$PIO_CMAP(fd fd_tty, cmd const[PIO_CMAP], arg ptr[in, io_cmap])
70ioctl$GIO_FONT(fd fd_tty, cmd const[GIO_FONT], arg buffer[out])
71ioctl$GIO_FONTX(fd fd_tty, cmd const[GIO_FONTX], arg buffer[out])
72ioctl$PIO_FONT(fd fd_tty, cmd const[PIO_FONT], arg buffer[in])
73ioctl$PIO_FONTX(fd fd_tty, cmd const[PIO_FONTX], arg buffer[in])
74ioctl$PIO_FONTRESET(fd fd_tty, cmd const[PIO_FONTRESET], arg const[0])
75ioctl$GIO_SCRNMAP(fd fd_tty, cmd const[GIO_SCRNMAP], arg buffer[out])
76ioctl$GIO_UNISCRNMAP(fd fd_tty, cmd const[GIO_UNISCRNMAP], arg buffer[out])
77ioctl$PIO_SCRNMAP(fd fd_tty, cmd const[PIO_SCRNMAP], arg buffer[in])
78ioctl$PIO_UNISCRNMAP(fd fd_tty, cmd const[PIO_UNISCRNMAP], arg buffer[in])
79ioctl$GIO_UNIMAP(fd fd_tty, cmd const[GIO_UNIMAP], arg ptr[in, unimapdesc_out])
80ioctl$PIO_UNIMAP(fd fd_tty, cmd const[PIO_UNIMAP], arg ptr[in, unimapdesc_in])
81ioctl$PIO_UNIMAPCLR(fd fd_tty, cmd const[PIO_UNIMAPCLR], arg ptr[in, unimapinit])
82ioctl$KDGKBMODE(fd fd_tty, cmd const[KDGKBMODE], arg ptr[out, intptr])
83ioctl$KDSKBMODE(fd fd_tty, cmd const[KDSKBMODE], arg ptr[in, intptr])
84ioctl$KDGKBMETA(fd fd_tty, cmd const[KDGKBMETA], arg ptr[out, intptr])
85ioctl$KDSKBMETA(fd fd_tty, cmd const[KDSKBMETA], arg ptr[in, intptr])
86ioctl$KDGKBENT(fd fd_tty, cmd const[KDGKBENT], arg ptr[in, kbentry])
87ioctl$KDGKBSENT(fd fd_tty, cmd const[KDGKBSENT], arg ptr[in, kbentry])
88ioctl$KDSKBSENT(fd fd_tty, cmd const[KDSKBSENT], arg buffer[in])
89ioctl$KDGKBDIACR(fd fd_tty, cmd const[KDGKBDIACR], arg buffer[out])
90ioctl$KDGETKEYCODE(fd fd_tty, cmd const[KDGETKEYCODE], arg ptr[in, kbkeycode])
91ioctl$KDSETKEYCODE(fd fd_tty, cmd const[KDSETKEYCODE], arg ptr[in, kbkeycode])
92ioctl$KDSIGACCEPT(fd fd_tty, cmd const[KDSIGACCEPT], arg signalno)
93ioctl$VT_OPENQRY(fd fd_tty, cmd const[VT_OPENQRY], arg ptr[out, int32])
94ioctl$VT_GETMODE(fd fd_tty, cmd const[VT_GETMODE], arg ptr[out, vt_mode])
95ioctl$VT_SETMODE(fd fd_tty, cmd const[VT_SETMODE], arg ptr[in, vt_mode])
96ioctl$VT_GETSTATE(fd fd_tty, cmd const[VT_GETSTATE], arg ptr[in, vt_stat])
97ioctl$VT_RELDISP(fd fd_tty, cmd const[VT_RELDISP])
98ioctl$VT_ACTIVATE(fd fd_tty, cmd const[VT_ACTIVATE], arg intptr)
99ioctl$VT_WAITACTIVE(fd fd_tty, cmd const[VT_WAITACTIVE])
100ioctl$VT_DISALLOCATE(fd fd_tty, cmd const[VT_DISALLOCATE])
101ioctl$VT_RESIZE(fd fd_tty, cmd const[VT_RESIZE], arg ptr[in, vt_sizes])
102ioctl$VT_RESIZEX(fd fd_tty, cmd const[VT_RESIZEX], arg ptr[in, vt_consize])
103ioctl$TIOCLINUX2(fd fd_tty, cmd const[TIOCLINUX], arg ptr[in, tiocl_selection])
104ioctl$TIOCLINUX3(fd fd_tty, cmd const[TIOCLINUX], arg ptr[in, const[3, int8]])
105ioctl$TIOCLINUX4(fd fd_tty, cmd const[TIOCLINUX], arg ptr[in, const[4, int8]])
106ioctl$TIOCLINUX5(fd fd_tty, cmd const[TIOCLINUX], arg ptr[in, loadlut])
107ioctl$TIOCLINUX6(fd fd_tty, cmd const[TIOCLINUX], arg ptr[in, tiocl_shift_state])
108ioctl$TIOCLINUX7(fd fd_tty, cmd const[TIOCLINUX], arg ptr[in, tiocl_report_mouse])
109
110termios {
111	iflag	int32
112	oflag	int32
113	cflag	int32
114	lflag	int32
115	line	int8
116	cc0	int8
117	cc1	int8
118	cc2	int8
119	cc3_6	int32
120	cc7_10	int32
121	cc11_14	int32
122	cc15_18	int32
123}
124
125termio {
126	iflag	int16
127	oflag	int16
128	cflag	int16
129	lflag	int16
130	line	int8
131	cc0	int8
132	cc1	int8
133	cc2	int8
134	cc3_6	int32
135	cc7	int8
136}
137
138winsize {
139	row	int16
140	col	int16
141	xpix	int16
142	upix	int16
143}
144
145io_cmap {
146	map0	int64
147	map1	int64
148	map2	int64
149	map3	int64
150	map4	int64
151	map5	int64
152}
153
154unimapdesc_in {
155	cnt	len[entries, int16]
156	entries	ptr[in, array[unipair]]
157}
158
159unimapdesc_out {
160	cnt	len[entries, int16]
161	entries	ptr[out, array[unipair]]
162}
163
164unipair {
165	unicode	int16
166	fontpos	int16
167}
168
169unimapinit {
170	size	int16
171	step	int16
172	level	int16
173}
174
175kbentry {
176	table	int8
177	index	int8
178	value	int16
179}
180
181kbkeycode {
182	scan	int32
183	key	int32
184}
185
186vt_mode {
187	mode	int8
188	waitv	int8
189	relsig	int16
190	acqsig	int16
191	frsig	int16
192}
193
194vt_stat {
195	active	int16
196	signal	int16
197	state	int16
198}
199
200vt_sizes {
201	rows	int16
202	cols	int16
203	scroll	int16
204}
205
206vt_consize {
207	rows	int16
208	cols	int16
209	vlin	int16
210	clin	int16
211	vcol	int16
212	ccol	int16
213}
214
215tiocl_selection {
216	subcode	const[2, int8]
217	xs	int16
218	ys	int16
219	xe	int16
220	ye	int16
221	mode	int16
222}
223
224loadlut {
225	submode	const[5, int8]
226	tab0	int64
227	tab1	int64
228	tab2	int64
229	tab3	int64
230}
231
232tiocl_shift_state {
233	subcode	const[6, int8]
234	shift	int8
235}
236
237tiocl_report_mouse {
238	subcode	const[7, int8]
239	shift	int8
240}
241