| # Copyright 2019 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 <sys/types.h> |
| include <time.h> |
| include <sys/tty.h> |
| include <fcntl.h> |
| |
| include <dev/wscons/wsconsio.h> |
| include <dev/wscons/wsdisplay_usl_io.h> |
| |
| resource fd_wsdisplay[fd] |
| |
| openat$wsdisplay(fd const[AT_FDCWD], file ptr[in, string["/dev/ttyCcfg"]], flags flags[open_flags], mode const[0]) fd_wsdisplay |
| |
| ioctl$KDDISABIO(fd fd_wsdisplay, cmd const[KDDISABIO]) |
| ioctl$KDENABIO(fd fd_wsdisplay, cmd const[KDENABIO]) |
| ioctl$KDGETLED(fd fd_wsdisplay, cmd const[KDGETLED], arg ptr[in, kd_getled]) |
| ioctl$KDGKBMODE(fd fd_wsdisplay, cmd const[KDGKBMODE]) |
| ioctl$KDMKTONE(fd fd_wsdisplay, cmd const[KDMKTONE], arg ptr[in, int32]) |
| ioctl$KDSETLED(fd fd_wsdisplay, cmd const[KDSETLED], arg ptr[in, kd_setled]) |
| ioctl$KDSETMODE(fd fd_wsdisplay, cmd const[KDSETMODE], arg ptr[in, kd_mode]) |
| ioctl$KDSETRAD(fd fd_wsdisplay, cmd const[KDSETRAD]) |
| ioctl$VT_ACTIVATE(fd fd_wsdisplay, cmd const[VT_ACTIVATE], arg ptr[in, int32]) |
| ioctl$VT_GETACTIVE(fd fd_wsdisplay, cmd const[VT_GETACTIVE], arg ptr[out, int32]) |
| ioctl$VT_GETMODE(fd fd_wsdisplay, cmd const[VT_GETMODE], arg ptr[out, vt_mode]) |
| ioctl$VT_GETSTATE(fd fd_wsdisplay, cmd const[VT_GETSTATE], arg ptr[out, vt_stat]) |
| ioctl$VT_OPENQRY(fd fd_wsdisplay, cmd const[VT_OPENQRY], arg ptr[out, int32]) |
| ioctl$VT_RELDISP(fd fd_wsdisplay, cmd const[VT_RELDISP], arg ptr[in, vt_reldisp]) |
| ioctl$VT_SETMODE(fd fd_wsdisplay, cmd const[VT_SETMODE], arg ptr[in, vt_mode]) |
| ioctl$VT_WAITACTIVE(fd fd_wsdisplay, cmd const[VT_WAITACTIVE], arg ptr[in, int32]) |
| ioctl$WSDISPLAYIO_ADDSCREEN(fd fd_wsdisplay, cmd const[WSDISPLAYIO_ADDSCREEN], arg ptr[in, wsdisplay_addscreendata]) |
| ioctl$WSDISPLAYIO_DELFONT(fd fd_wsdisplay, cmd const[WSDISPLAYIO_DELFONT], arg ptr[in, wsdisplay_font]) |
| ioctl$WSDISPLAYIO_DELSCREEN(fd fd_wsdisplay, cmd const[WSDISPLAYIO_DELSCREEN], arg ptr[in, wsdisplay_delscreendata]) |
| ioctl$WSDISPLAYIO_GBURNER(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GBURNER], arg ptr[out, wsdisplay_burner]) |
| ioctl$WSDISPLAYIO_GETEMULTYPE(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GETEMULTYPE], arg ptr[in, wsdisplay_emultype]) |
| ioctl$WSDISPLAYIO_GETSCREEN(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GETSCREEN], arg ptr[in, wsdisplay_addscreendata]) |
| ioctl$WSDISPLAYIO_GETSCREENTYPE(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GETSCREENTYPE], arg ptr[in, wsdisplay_screentype]) |
| ioctl$WSDISPLAYIO_GMODE(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GMODE], arg ptr[out, int32]) |
| ioctl$WSDISPLAYIO_GVIDEO(fd fd_wsdisplay, cmd const[WSDISPLAYIO_GVIDEO], arg ptr[out, int32]) |
| ioctl$WSDISPLAYIO_LDFONT(fd fd_wsdisplay, cmd const[WSDISPLAYIO_LDFONT], arg ptr[in, wsdisplay_font]) |
| ioctl$WSDISPLAYIO_LSFONT(fd fd_wsdisplay, cmd const[WSDISPLAYIO_LSFONT], arg ptr[out, wsdisplay_font]) |
| ioctl$WSDISPLAYIO_SETSCREEN(fd fd_wsdisplay, cmd const[WSDISPLAYIO_SETSCREEN], arg ptr[in, int32]) |
| ioctl$WSDISPLAYIO_SMODE(fd fd_wsdisplay, cmd const[WSDISPLAYIO_SMODE], arg ptr[in, wsdisplay_mode]) |
| ioctl$WSDISPLAYIO_SVIDEO(fd fd_wsdisplay, cmd const[WSDISPLAYIO_SVIDEO], arg ptr[in, wsdisplay_svideo]) |
| ioctl$WSDISPLAYIO_USEFONT(fd fd_wsdisplay, cmd const[WSDISPLAYIO_USEFONT], arg ptr[in, wsdisplay_font]) |
| ioctl$WSDISPLAYIO_WSMOUSED(fd fd_wsdisplay, cmd const[WSDISPLAYIO_WSMOUSED], arg ptr[in, wscons_event]) |
| ioctl$WSKBDIO_GETMODE(fd fd_wsdisplay, cmd const[WSKBDIO_GETMODE], arg ptr[out, int32]) |
| ioctl$WSKBDIO_SETMODE(fd fd_wsdisplay, cmd const[WSKBDIO_SETMODE], arg ptr[in, wskbd_mode]) |
| ioctl$WSMUXIO_ADD_DEVICE(fd fd_wsdisplay, cmd const[WSMUXIO_ADD_DEVICE], arg ptr[in, wsmux_device]) |
| ioctl$WSMUXIO_INJECTEVENT(fd fd_wsdisplay, cmd const[WSMUXIO_INJECTEVENT], arg ptr[in, wscons_event]) |
| ioctl$WSMUXIO_LIST_DEVICES(fd fd_wsdisplay, cmd const[WSMUXIO_LIST_DEVICES], arg ptr[in, wsmux_device_list]) |
| ioctl$WSMUXIO_REMOVE_DEVICE(fd fd_wsdisplay, cmd const[WSMUXIO_REMOVE_DEVICE], arg ptr[in, wsmux_device]) |
| |
| resource fd_wskbd[fd] |
| |
| openat$wskbd(fd const[AT_FDCWD], file ptr[in, string["/dev/wskbd0"]], flags flags[open_flags], mode const[0]) fd_wskbd |
| |
| resource fd_wsmouse[fd] |
| |
| openat$wsmouse(fd const[AT_FDCWD], file ptr[in, string["/dev/wsmouse0"]], flags flags[open_flags], mode const[0]) fd_wsmouse |
| |
| ioctl$WSMOUSEIO_GETPARAMS(fd fd_wsmouse, cmd const[WSMOUSEIO_GETPARAMS], arg ptr[out, wsmouse_parameters]) |
| ioctl$WSMOUSEIO_SETPARAMS(fd fd_wsmouse, cmd const[WSMOUSEIO_SETPARAMS], arg ptr[in, wsmouse_parameters]) |
| |
| resource fd_wsmux[fd] |
| |
| openat$wsmuxkbd(fd const[AT_FDCWD], file ptr[in, string["/dev/wskbd"]], flags flags[open_flags], mode const[0]) fd_wsmux |
| openat$wsmuxmouse(fd const[AT_FDCWD], file ptr[in, string["/dev/wsmouse"]], flags flags[open_flags], mode const[0]) fd_wsmux |
| |
| wsmux_device { |
| type flags[wsmux_device_flags, int32] |
| idx int32 |
| } |
| |
| wsmux_device_list { |
| ndevices int32 |
| devices array[wsmux_device, WSMUX_MAXDEV] |
| } |
| |
| wscons_event { |
| type int32 |
| value int32 |
| time timespec |
| } |
| |
| wsdisplay_addscreendata { |
| idx int32 |
| # NEED: random string of given max size |
| screentype string[filename, WSSCREEN_NAME_SIZE] |
| # NEED: random string of given max size |
| emul string[filename, WSEMUL_NAME_SIZE] |
| } |
| |
| wsdisplay_burner { |
| off int32 |
| on int32 |
| flags flags[wsdisplay_burner_flags, int32] |
| } |
| |
| wsdisplay_delscreendata { |
| idx int32 |
| flags flags[wsdisplay_delscreendata_flags, int32] |
| } |
| |
| wsdisplay_emultype { |
| idx int32 |
| name string[filename, WSSCREEN_NAME_SIZE] |
| } |
| |
| wsdisplay_font { |
| # NEED: random string of given max size |
| name string[filename, WSFONT_NAME_SIZE] |
| index int32 |
| firstchar int32 |
| numchars int32 |
| encoding flags[wsdisplay_font_encoding_flags, int32] |
| fontwidth int32 |
| fontheight int32 |
| stride int32 |
| bitorder flags[wsdisplay_font_order_flags, int32] |
| byteorder flags[wsdisplay_font_order_flags, int32] |
| cookie intptr |
| data intptr |
| } |
| |
| wsdisplay_screentype { |
| idx int32 |
| nidx int32 |
| # NEED: random string of given max size |
| name string[filename, WSSCREEN_NAME_SIZE] |
| ncols int32 |
| nrows int32 |
| fontwidth int32 |
| fontheight int32 |
| } |
| |
| wsmouse_param { |
| key flags[wsmousecfg_flags, int32] |
| value int32 |
| } |
| |
| wsmouse_parameters { |
| params ptr[in, array[wsmouse_param]] |
| nparams len[params, int32] |
| } |
| |
| vt_stat { |
| v_active int16 |
| v_signal int16 |
| v_state int16 |
| } |
| |
| vt_mode { |
| mode flags[vt_mode_flags, int8] |
| waitv int8 |
| relsig int16 |
| acqsig int16 |
| frsig int16 |
| } |
| |
| type vt_reldisp flags[vt_reldisp_flags, int32] |
| |
| type kd_mode flags[kd_mode_flags, int32] |
| |
| type kd_setled flags[kd_setled_flags, int32] |
| |
| type kd_getled flags[kd_getled_flags, int32] |
| |
| type wskbd_mode flags[wskbd_mode_flags, int32] |
| |
| type wsdisplay_mode flags[wsdisplay_mode_flags, int32] |
| |
| type wsdisplay_svideo flags[wsdisplay_svideo_flags, int32] |
| |
| vt_mode_flags = VT_AUTO, VT_PROCESS |
| |
| vt_reldisp_flags = VT_FALSE, VT_TRUE, VT_ACKACQ |
| |
| kd_mode_flags = KD_GRAPHICS, KD_TEXT |
| |
| kd_setled_flags = LED_CAP, LED_NUM, LED_SCR |
| |
| kd_getled_flags = K_RAW, K_XLATE |
| |
| wskbd_mode_flags = WSKBD_RAW |
| |
| wsdisplay_delscreendata_flags = WSDISPLAY_DELSCR_FORCE, WSDISPLAY_DELSCR_QUIET |
| |
| wsdisplay_mode_flags = WSDISPLAYIO_MODE_EMUL, WSDISPLAYIO_MODE_MAPPED, WSDISPLAYIO_MODE_DUMBFB |
| |
| wsdisplay_font_encoding_flags = WSDISPLAY_FONTENC_ISO, WSDISPLAY_FONTENC_IBM |
| |
| wsdisplay_font_order_flags = WSDISPLAY_FONTORDER_KNOWN, WSDISPLAY_FONTORDER_L2R, WSDISPLAY_FONTORDER_R2L |
| |
| wsdisplay_svideo_flags = WSDISPLAYIO_VIDEO_OFF, WSDISPLAYIO_VIDEO_ON |
| |
| wsdisplay_burner_flags = WSDISPLAY_BURN_VBLANK, WSDISPLAY_BURN_KBD, WSDISPLAY_BURN_MOUSE, WSDISPLAY_BURN_OUTPUT |
| |
| 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_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_TAPPING, 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_LOG_INPUT, WSMOUSECFG_LOG_EVENTS |
| |
| wsmux_device_flags = WSMUX_MOUSE, WSMUX_KBD, WSMUX_MUX |