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