github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/openbsd/wscons.txt (about) 1 # Copyright 2019 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 <sys/types.h> 5 include <time.h> 6 include <sys/tty.h> 7 include <fcntl.h> 8 9 include <dev/wscons/wsconsio.h> 10 include <dev/wscons/wsdisplay_usl_io.h> 11 12 resource fd_wsdisplay[fd] 13 14 openat$wsdisplay(fd const[AT_FDCWD], file ptr[in, string["/dev/ttyCcfg"]], flags flags[open_flags], mode const[0]) fd_wsdisplay 15 16 ioctl$KDDISABIO(fd fd_wsdisplay, cmd const[KDDISABIO]) 17 ioctl$KDENABIO(fd fd_wsdisplay, cmd const[KDENABIO]) 18 ioctl$KDGETLED(fd fd_wsdisplay, cmd const[KDGETLED], arg ptr[in, kd_getled]) 19 ioctl$KDGKBMODE(fd fd_wsdisplay, cmd const[KDGKBMODE]) 20 ioctl$KDMKTONE(fd fd_wsdisplay, cmd const[KDMKTONE], arg ptr[in, int32]) 21 ioctl$KDSETLED(fd fd_wsdisplay, cmd const[KDSETLED], arg ptr[in, kd_setled]) 22 ioctl$KDSETMODE(fd fd_wsdisplay, cmd const[KDSETMODE], arg ptr[in, kd_mode]) 23 ioctl$KDSETRAD(fd fd_wsdisplay, cmd const[KDSETRAD]) 24 ioctl$VT_ACTIVATE(fd fd_wsdisplay, cmd const[VT_ACTIVATE], arg ptr[in, int32]) 25 ioctl$VT_GETACTIVE(fd fd_wsdisplay, cmd const[VT_GETACTIVE], arg ptr[out, int32]) 26 ioctl$VT_GETMODE(fd fd_wsdisplay, cmd const[VT_GETMODE], arg ptr[out, vt_mode]) 27 ioctl$VT_GETSTATE(fd fd_wsdisplay, cmd const[VT_GETSTATE], arg ptr[out, vt_stat]) 28 ioctl$VT_OPENQRY(fd fd_wsdisplay, cmd const[VT_OPENQRY], arg ptr[out, int32]) 29 ioctl$VT_RELDISP(fd fd_wsdisplay, cmd const[VT_RELDISP], arg ptr[in, vt_reldisp]) 30 ioctl$VT_SETMODE(fd fd_wsdisplay, cmd const[VT_SETMODE], arg ptr[in, vt_mode]) 31 ioctl$VT_WAITACTIVE(fd fd_wsdisplay, cmd const[VT_WAITACTIVE], arg ptr[in, int32]) 32 ioctl$WSDISPLAYIO_ADDSCREEN(fd fd_wsdisplay, cmd const[WSDISPLAYIO_ADDSCREEN], arg ptr[in, wsdisplay_addscreendata]) 33 ioctl$WSDISPLAYIO_DELFONT(fd fd_wsdisplay, cmd const[WSDISPLAYIO_DELFONT], arg ptr[in, wsdisplay_font]) 34 ioctl$WSDISPLAYIO_DELSCREEN(fd fd_wsdisplay, cmd const[WSDISPLAYIO_DELSCREEN], arg ptr[in, wsdisplay_delscreendata]) 35 ioctl$WSDISPLAYIO_GBURNER(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GBURNER], arg ptr[out, wsdisplay_burner]) 36 ioctl$WSDISPLAYIO_GETEMULTYPE(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GETEMULTYPE], arg ptr[in, wsdisplay_emultype]) 37 ioctl$WSDISPLAYIO_GETSCREEN(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GETSCREEN], arg ptr[in, wsdisplay_addscreendata]) 38 ioctl$WSDISPLAYIO_GETSCREENTYPE(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GETSCREENTYPE], arg ptr[in, wsdisplay_screentype]) 39 ioctl$WSDISPLAYIO_GMODE(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GMODE], arg ptr[out, int32]) 40 ioctl$WSDISPLAYIO_GVIDEO(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GVIDEO], arg ptr[out, int32]) 41 ioctl$WSDISPLAYIO_LDFONT(fd fd_wsdisplay, cmd const[WSDISPLAYIO_LDFONT], arg ptr[in, wsdisplay_font]) 42 ioctl$WSDISPLAYIO_LSFONT(fd fd_wsdisplay, cmd const[WSDISPLAYIO_LSFONT], arg ptr[out, wsdisplay_font]) 43 ioctl$WSDISPLAYIO_SBURNER(fd fd_wsdisplay, cmd const[WSDISPLAYIO_SBURNER], arg ptr[in, wsdisplay_burner]) 44 ioctl$WSDISPLAYIO_SETSCREEN(fd fd_wsdisplay, cmd const[WSDISPLAYIO_SETSCREEN], arg ptr[in, int32]) 45 ioctl$WSDISPLAYIO_SMODE(fd fd_wsdisplay, cmd const[WSDISPLAYIO_SMODE], arg ptr[in, wsdisplay_mode]) 46 ioctl$WSDISPLAYIO_SVIDEO(fd fd_wsdisplay, cmd const[WSDISPLAYIO_SVIDEO], arg ptr[in, wsdisplay_svideo]) 47 ioctl$WSDISPLAYIO_USEFONT(fd fd_wsdisplay, cmd const[WSDISPLAYIO_USEFONT], arg ptr[in, wsdisplay_font]) 48 ioctl$WSDISPLAYIO_WSMOUSED(fd fd_wsdisplay, cmd const[WSDISPLAYIO_WSMOUSED], arg ptr[in, wscons_event]) 49 ioctl$WSKBDIO_GETMODE(fd fd_wsdisplay, cmd const[WSKBDIO_GETMODE], arg ptr[out, int32]) 50 ioctl$WSKBDIO_SETMODE(fd fd_wsdisplay, cmd const[WSKBDIO_SETMODE], arg ptr[in, wskbd_mode]) 51 ioctl$WSMUXIO_ADD_DEVICE(fd fd_wsdisplay, cmd const[WSMUXIO_ADD_DEVICE], arg ptr[in, wsmux_device]) 52 ioctl$WSMUXIO_INJECTEVENT(fd fd_wsdisplay, cmd const[WSMUXIO_INJECTEVENT], arg ptr[in, wscons_event]) 53 ioctl$WSMUXIO_LIST_DEVICES(fd fd_wsdisplay, cmd const[WSMUXIO_LIST_DEVICES], arg ptr[in, wsmux_device_list]) 54 ioctl$WSMUXIO_REMOVE_DEVICE(fd fd_wsdisplay, cmd const[WSMUXIO_REMOVE_DEVICE], arg ptr[in, wsmux_device]) 55 56 resource fd_wskbd[fd] 57 58 openat$wskbd(fd const[AT_FDCWD], file ptr[in, string["/dev/wskbd0"]], flags flags[open_flags], mode const[0]) fd_wskbd 59 60 ioctl$WSKBDIO_BELL(fd fd_wskbd, cmd const[WSKBDIO_BELL]) 61 ioctl$WSKBDIO_COMPLEXBELL(fd fd_wskbd, cmd const[WSKBDIO_COMPLEXBELL], arg ptr[in, wskbd_bell_data]) 62 ioctl$WSKBDIO_SETBELL(fd fd_wskbd, cmd const[WSKBDIO_SETBELL], arg ptr[in, wskbd_bell_data]) 63 ioctl$WSKBDIO_GETBELL(fd fd_wskbd, cmd const[WSKBDIO_GETBELL], arg ptr[out, wskbd_bell_data]) 64 ioctl$WSKBDIO_SETDEFAULTBELL(fd fd_wskbd, cmd const[WSKBDIO_SETDEFAULTBELL], arg ptr[in, wskbd_bell_data]) 65 ioctl$WSKBDIO_GETDEFAULTBELL(fd fd_wskbd, cmd const[WSKBDIO_GETDEFAULTBELL], arg ptr[out, wskbd_bell_data]) 66 ioctl$WSKBDIO_SETKEYREPEAT(fd fd_wskbd, cmd const[WSKBDIO_SETKEYREPEAT], arg ptr[in, wskbd_keyrepeat_data]) 67 ioctl$WSKBDIO_GETKEYREPEAT(fd fd_wskbd, cmd const[WSKBDIO_GETKEYREPEAT], arg ptr[out, wskbd_keyrepeat_data]) 68 ioctl$WSKBDIO_SETDEFAULTKEYREPEAT(fd fd_wskbd, cmd const[WSKBDIO_SETDEFAULTKEYREPEAT], arg ptr[in, wskbd_keyrepeat_data]) 69 ioctl$WSKBDIO_GETDEFAULTKEYREPEAT(fd fd_wskbd, cmd const[WSKBDIO_GETDEFAULTKEYREPEAT], arg ptr[out, wskbd_keyrepeat_data]) 70 ioctl$WSKBDIO_SETMAP(fd fd_wskbd, cmd const[WSKBDIO_SETMAP], arg ptr[in, wskbd_map_data]) 71 ioctl$WSKBDIO_GETMAP(fd fd_wskbd, cmd const[WSKBDIO_GETMAP], arg ptr[out, wskbd_map_data]) 72 ioctl$WSKBDIO_GETENCODING(fd fd_wskbd, cmd const[WSKBDIO_GETENCODING], arg ptr[out, int32]) 73 ioctl$WSKBDIO_SETENCODING(fd fd_wskbd, cmd const[WSKBDIO_SETENCODING], arg ptr[in, int32]) 74 ioctl$WSKBDIO_GETENCODINGS(fd fd_wskbd, cmd const[WSKBDIO_GETENCODINGS], arg ptr[out, wskbd_encoding_data]) 75 ioctl$WSKBDIO_GETBACKLIGHT(fd fd_wskbd, cmd const[WSKBDIO_GETBACKLIGHT], arg ptr[out, wskbd_backlight]) 76 ioctl$WSKBDIO_SETBACKLIGHT(fd fd_wskbd, cmd const[WSKBDIO_SETBACKLIGHT], arg ptr[in, wskbd_backlight]) 77 78 resource fd_wsmouse[fd] 79 80 openat$wsmouse(fd const[AT_FDCWD], file ptr[in, string["/dev/wsmouse0"]], flags flags[open_flags], mode const[0]) fd_wsmouse 81 82 ioctl$WSMOUSEIO_GCALIBCOORDS(fd fd_wsmouse, cmd const[WSMOUSEIO_GCALIBCOORDS], arg ptr[out, wsmouse_calibcoords]) 83 ioctl$WSMOUSEIO_GETPARAMS(fd fd_wsmouse, cmd const[WSMOUSEIO_GETPARAMS], arg ptr[out, wsmouse_parameters]) 84 ioctl$WSMOUSEIO_GTYPE(fd fd_wsmouse, cmd const[WSMOUSEIO_GTYPE], arg ptr[out, int32]) 85 ioctl$WSMOUSEIO_SCALIBCOORDS(fd fd_wsmouse, cmd const[WSMOUSEIO_SCALIBCOORDS], arg ptr[in, wsmouse_calibcoords]) 86 ioctl$WSMOUSEIO_SETMODE(fd fd_wsmouse, cmd const[WSMOUSEIO_SETMODE], arg ptr[in, wsmouse_mode]) 87 ioctl$WSMOUSEIO_SETPARAMS(fd fd_wsmouse, cmd const[WSMOUSEIO_SETPARAMS], arg ptr[in, wsmouse_parameters]) 88 ioctl$WSMOUSEIO_SRES(fd fd_wsmouse, cmd const[WSMOUSEIO_SRES], arg ptr[in, int32]) 89 90 openat$wsmuxkbd(fd const[AT_FDCWD], file ptr[in, string["/dev/wskbd"]], flags flags[open_flags], mode const[0]) fd 91 openat$wsmuxmouse(fd const[AT_FDCWD], file ptr[in, string["/dev/wsmouse"]], flags flags[open_flags], mode const[0]) fd 92 93 wsmux_device { 94 type flags[wsmux_device_flags, int32] 95 idx int32 96 } 97 98 wsmux_device_list { 99 ndevices int32 100 devices array[wsmux_device, WSMUX_MAXDEV] 101 } 102 103 wscons_event { 104 type int32 105 value int32 106 time timespec 107 } 108 109 wsdisplay_addscreendata { 110 idx int32 111 # NEED: random string of given max size 112 screentype string[filename, WSSCREEN_NAME_SIZE] 113 # NEED: random string of given max size 114 emul string[filename, WSEMUL_NAME_SIZE] 115 } 116 117 wsdisplay_burner { 118 off int32 119 on int32 120 flags flags[wsdisplay_burner_flags, int32] 121 } 122 123 wsdisplay_delscreendata { 124 idx int32 125 flags flags[wsdisplay_delscreendata_flags, int32] 126 } 127 128 wsdisplay_emultype { 129 idx int32 130 name string[filename, WSSCREEN_NAME_SIZE] 131 } 132 133 wsdisplay_font { 134 # NEED: random string of given max size 135 name string[filename, WSFONT_NAME_SIZE] 136 index int32 137 firstchar int32 138 numchars int32 139 encoding flags[wsdisplay_font_encoding_flags, int32] 140 fontwidth int32 141 fontheight int32 142 stride int32 143 bitorder flags[wsdisplay_font_order_flags, int32] 144 byteorder flags[wsdisplay_font_order_flags, int32] 145 cookie intptr 146 data intptr 147 } 148 149 wsdisplay_screentype { 150 idx int32 151 nidx int32 152 # NEED: random string of given max size 153 name string[filename, WSSCREEN_NAME_SIZE] 154 ncols int32 155 nrows int32 156 fontwidth int32 157 fontheight int32 158 } 159 160 wsmouse_calibcoord { 161 rawx int32 162 rawy int32 163 x int32 164 y int32 165 } 166 167 wsmouse_calibcoords { 168 minx int32 169 miny int32 170 maxx int32 171 maxy int32 172 swapxy int32 173 resx int32 174 resy int32 175 samplelen len[samples, int32] 176 samples array[wsmouse_calibcoord, WSMOUSE_CALIBCOORDS_MAX] 177 } 178 179 wsmouse_mode { 180 mode flags[wsmouse_mode_flags, int32] 181 } 182 183 wsmouse_param { 184 key flags[wsmousecfg_flags, int32] 185 value int32 186 } 187 188 wsmouse_parameters { 189 params ptr[in, array[wsmouse_param]] 190 nparams len[params, int32] 191 } 192 193 vt_stat { 194 v_active int16 195 v_signal int16 196 v_state int16 197 } 198 199 vt_mode { 200 mode flags[vt_mode_flags, int8] 201 waitv int8 202 relsig int16 203 acqsig int16 204 frsig int16 205 } 206 207 wskbd_bell_data { 208 which int32 209 pitch int32 210 period int32 211 volume int32 212 } 213 214 wskbd_keyrepeat_data { 215 which int32 216 del1 int32 217 delN int32 218 } 219 220 wskbd_map_data { 221 maplen len[map, int32] 222 map ptr[in, array[wscons_keymap]] 223 } 224 225 wscons_keymap { 226 command int16 227 group1_0 int16 228 group1_1 int16 229 group2_0 int16 230 group2_1 int16 231 } 232 233 wskbd_encoding_data { 234 nencodings len[encodings, int32] 235 encodings array[int32] 236 } 237 238 wskbd_backlight { 239 min int32 240 max int32 241 curval int32 242 } 243 244 type vt_reldisp flags[vt_reldisp_flags, int32] 245 246 type kd_mode flags[kd_mode_flags, int32] 247 248 type kd_setled flags[kd_setled_flags, int32] 249 250 type kd_getled flags[kd_getled_flags, int32] 251 252 type wskbd_mode flags[wskbd_mode_flags, int32] 253 254 type wsdisplay_mode flags[wsdisplay_mode_flags, int32] 255 256 type wsdisplay_svideo flags[wsdisplay_svideo_flags, int32] 257 258 vt_mode_flags = VT_AUTO, VT_PROCESS 259 260 vt_reldisp_flags = VT_FALSE, VT_TRUE, VT_ACKACQ 261 262 kd_mode_flags = KD_GRAPHICS, KD_TEXT 263 264 kd_setled_flags = LED_CAP, LED_NUM, LED_SCR 265 266 kd_getled_flags = K_RAW, K_XLATE 267 268 wskbd_mode_flags = WSKBD_RAW 269 270 wsdisplay_delscreendata_flags = WSDISPLAY_DELSCR_FORCE, WSDISPLAY_DELSCR_QUIET 271 272 wsdisplay_mode_flags = WSDISPLAYIO_MODE_EMUL, WSDISPLAYIO_MODE_MAPPED, WSDISPLAYIO_MODE_DUMBFB 273 274 wsdisplay_font_encoding_flags = WSDISPLAY_FONTENC_ISO, WSDISPLAY_FONTENC_IBM 275 276 wsdisplay_font_order_flags = WSDISPLAY_FONTORDER_KNOWN, WSDISPLAY_FONTORDER_L2R, WSDISPLAY_FONTORDER_R2L 277 278 wsdisplay_svideo_flags = WSDISPLAYIO_VIDEO_OFF, WSDISPLAYIO_VIDEO_ON 279 280 wsdisplay_burner_flags = WSDISPLAY_BURN_VBLANK, WSDISPLAY_BURN_KBD, WSDISPLAY_BURN_MOUSE, WSDISPLAY_BURN_OUTPUT 281 282 wsmouse_mode_flags = WSMOUSE_COMPAT, WSMOUSE_NATIVE 283 284 wsmousecfg_flags = WSMOUSECFG_DX_SCALE, WSMOUSECFG_DY_SCALE, WSMOUSECFG_PRESSURE_LO, WSMOUSECFG_PRESSURE_HI, WSMOUSECFG_TRKMAXDIST, WSMOUSECFG_SWAPXY, WSMOUSECFG_X_INV, WSMOUSECFG_Y_INV, WSMOUSECFG_REVERSE_SCROLLING, WSMOUSECFG_DX_MAX, WSMOUSECFG_DY_MAX, WSMOUSECFG_X_HYSTERESIS, WSMOUSECFG_Y_HYSTERESIS, WSMOUSECFG_DECELERATION, WSMOUSECFG_STRONG_HYSTERESIS, WSMOUSECFG_SMOOTHING, WSMOUSECFG_SOFTBUTTONS, WSMOUSECFG_SOFTMBTN, WSMOUSECFG_TOPBUTTONS, WSMOUSECFG_TWOFINGERSCROLL, WSMOUSECFG_EDGESCROLL, WSMOUSECFG_HORIZSCROLL, WSMOUSECFG_SWAPSIDES, WSMOUSECFG_DISABLE, WSMOUSECFG_LEFT_EDGE, WSMOUSECFG_RIGHT_EDGE, WSMOUSECFG_TOP_EDGE, WSMOUSECFG_BOTTOM_EDGE, WSMOUSECFG_CENTERWIDTH, WSMOUSECFG_HORIZSCROLLDIST, WSMOUSECFG_VERTSCROLLDIST, WSMOUSECFG_F2WIDTH, WSMOUSECFG_F2PRESSURE, WSMOUSECFG_TAP_MAXTIME, WSMOUSECFG_TAP_CLICKTIME, WSMOUSECFG_TAP_LOCKTIME, WSMOUSECFG_TAP_ONE_BTNMAP, WSMOUSECFG_TAP_TWO_BTNMAP, WSMOUSECFG_TAP_THREE_BTNMAP, WSMOUSECFG_LOG_INPUT, WSMOUSECFG_LOG_EVENTS 285 286 wsmux_device_flags = WSMUX_MOUSE, WSMUX_KBD, WSMUX_MUX