aboutsummaryrefslogtreecommitdiffstats
path: root/sys/openbsd/wscons.txt
blob: 9219b70e5761a14e684f24154287d013376d3b62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# 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_SBURNER(fd fd_wsdisplay, cmd const[WSDISPLAYIO_SBURNER], arg ptr[in, wsdisplay_burner])
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

ioctl$WSKBDIO_BELL(fd fd_wskbd, cmd const[WSKBDIO_BELL])
ioctl$WSKBDIO_COMPLEXBELL(fd fd_wskbd, cmd const[WSKBDIO_COMPLEXBELL], arg ptr[in, wskbd_bell_data])
ioctl$WSKBDIO_SETBELL(fd fd_wskbd, cmd const[WSKBDIO_SETBELL], arg ptr[in, wskbd_bell_data])
ioctl$WSKBDIO_GETBELL(fd fd_wskbd, cmd const[WSKBDIO_GETBELL], arg ptr[out, wskbd_bell_data])
ioctl$WSKBDIO_SETDEFAULTBELL(fd fd_wskbd, cmd const[WSKBDIO_SETDEFAULTBELL], arg ptr[in, wskbd_bell_data])
ioctl$WSKBDIO_GETDEFAULTBELL(fd fd_wskbd, cmd const[WSKBDIO_GETDEFAULTBELL], arg ptr[out, wskbd_bell_data])
ioctl$WSKBDIO_SETKEYREPEAT(fd fd_wskbd, cmd const[WSKBDIO_SETKEYREPEAT], arg ptr[in, wskbd_keyrepeat_data])
ioctl$WSKBDIO_GETKEYREPEAT(fd fd_wskbd, cmd const[WSKBDIO_GETKEYREPEAT], arg ptr[out, wskbd_keyrepeat_data])
ioctl$WSKBDIO_SETDEFAULTKEYREPEAT(fd fd_wskbd, cmd const[WSKBDIO_SETDEFAULTKEYREPEAT], arg ptr[in, wskbd_keyrepeat_data])
ioctl$WSKBDIO_GETDEFAULTKEYREPEAT(fd fd_wskbd, cmd const[WSKBDIO_GETDEFAULTKEYREPEAT], arg ptr[out, wskbd_keyrepeat_data])
ioctl$WSKBDIO_SETMAP(fd fd_wskbd, cmd const[WSKBDIO_SETMAP], arg ptr[in, wskbd_map_data])
ioctl$WSKBDIO_GETMAP(fd fd_wskbd, cmd const[WSKBDIO_GETMAP], arg ptr[out, wskbd_map_data])
ioctl$WSKBDIO_GETENCODING(fd fd_wskbd, cmd const[WSKBDIO_GETENCODING], arg ptr[out, int32])
ioctl$WSKBDIO_SETENCODING(fd fd_wskbd, cmd const[WSKBDIO_SETENCODING], arg ptr[in, int32])
ioctl$WSKBDIO_GETENCODINGS(fd fd_wskbd, cmd const[WSKBDIO_GETENCODINGS], arg ptr[out, wskbd_encoding_data])
ioctl$WSKBDIO_GETBACKLIGHT(fd fd_wskbd, cmd const[WSKBDIO_GETBACKLIGHT], arg ptr[out, wskbd_backlight])
ioctl$WSKBDIO_SETBACKLIGHT(fd fd_wskbd, cmd const[WSKBDIO_SETBACKLIGHT], arg ptr[in, wskbd_backlight])

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_GCALIBCOORDS(fd fd_wsmouse, cmd const[WSMOUSEIO_GCALIBCOORDS], arg ptr[out, wsmouse_calibcoords])
ioctl$WSMOUSEIO_GETPARAMS(fd fd_wsmouse, cmd const[WSMOUSEIO_GETPARAMS], arg ptr[out, wsmouse_parameters])
ioctl$WSMOUSEIO_GTYPE(fd fd_wsmouse, cmd const[WSMOUSEIO_GTYPE], arg ptr[out, int32])
ioctl$WSMOUSEIO_SCALIBCOORDS(fd fd_wsmouse, cmd const[WSMOUSEIO_SCALIBCOORDS], arg ptr[in, wsmouse_calibcoords])
ioctl$WSMOUSEIO_SETMODE(fd fd_wsmouse, cmd const[WSMOUSEIO_SETMODE], arg ptr[in, wsmouse_mode])
ioctl$WSMOUSEIO_SETPARAMS(fd fd_wsmouse, cmd const[WSMOUSEIO_SETPARAMS], arg ptr[in, wsmouse_parameters])
ioctl$WSMOUSEIO_SRES(fd fd_wsmouse, cmd const[WSMOUSEIO_SRES], arg ptr[in, int32])

openat$wsmuxkbd(fd const[AT_FDCWD], file ptr[in, string["/dev/wskbd"]], flags flags[open_flags], mode const[0]) fd
openat$wsmuxmouse(fd const[AT_FDCWD], file ptr[in, string["/dev/wsmouse"]], flags flags[open_flags], mode const[0]) fd

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_calibcoord {
	rawx	int32
	rawy	int32
	x	int32
	y	int32
}

wsmouse_calibcoords {
	minx		int32
	miny		int32
	maxx		int32
	maxy		int32
	swapxy		int32
	resx		int32
	resy		int32
	samplelen	len[samples, int32]
	samples		array[wsmouse_calibcoord, WSMOUSE_CALIBCOORDS_MAX]
}

wsmouse_mode {
	mode	flags[wsmouse_mode_flags, 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
}

wskbd_bell_data {
	which	int32
	pitch	int32
	period	int32
	volume	int32
}

wskbd_keyrepeat_data {
	which	int32
	del1	int32
	delN	int32
}

wskbd_map_data {
	maplen	len[map, int32]
	map	ptr[in, array[wscons_keymap]]
}

wscons_keymap {
	command		int16
	group1_0	int16
	group1_1	int16
	group2_0	int16
	group2_1	int16
}

wskbd_encoding_data {
	nencodings	len[encodings, int32]
	encodings	array[int32]
}

wskbd_backlight {
	min	int32
	max	int32
	curval	int32
}

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

wsmouse_mode_flags = WSMOUSE_COMPAT, WSMOUSE_NATIVE

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

wsmux_device_flags = WSMUX_MOUSE, WSMUX_KBD, WSMUX_MUX