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 struct device;
35
36
37
38
39
40 #define WSDISPLAY_MAXSCREEN 12
41 #define WSDISPLAY_MAXFONT 8
42
43
44
45
46
47
48
49
50
51
52
53
54
55 struct wsdisplay_emulops {
56 void (*cursor)(void *c, int on, int row, int col);
57 int (*mapchar)(void *, int, unsigned int *);
58 void (*putchar)(void *c, int row, int col, u_int uc, long attr);
59 void (*copycols)(void *c, int row, int srccol, int dstcol,
60 int ncols);
61 void (*erasecols)(void *c, int row, int startcol, int ncols, long);
62 void (*copyrows)(void *c, int srcrow, int dstrow, int nrows);
63 void (*eraserows)(void *c, int row, int nrows, long attr);
64 int (*alloc_attr)(void *c, int fg, int bg, int flags, long *attrp);
65 void (*unpack_attr)(void *c, long attr, int *fg, int *bg, int *ul);
66
67 #define WSCOL_BLACK 0
68 #define WSCOL_RED 1
69 #define WSCOL_GREEN 2
70 #define WSCOL_BROWN 3
71 #define WSCOL_BLUE 4
72 #define WSCOL_MAGENTA 5
73 #define WSCOL_CYAN 6
74 #define WSCOL_WHITE 7
75
76 #define WSATTR_REVERSE 1
77 #define WSATTR_HILIT 2
78 #define WSATTR_BLINK 4
79 #define WSATTR_UNDERLINE 8
80 #define WSATTR_WSCOLORS 16
81
82 };
83
84 #define WSSCREEN_NAME_SIZE 16
85
86 struct wsscreen_descr {
87 char name[WSSCREEN_NAME_SIZE];
88 int ncols, nrows;
89 const struct wsdisplay_emulops *textops;
90 int fontwidth, fontheight;
91 int capabilities;
92 #define WSSCREEN_WSCOLORS 1
93 #define WSSCREEN_REVERSE 2
94 #define WSSCREEN_HILIT 4
95 #define WSSCREEN_BLINK 8
96 #define WSSCREEN_UNDERLINE 16
97 };
98
99
100
101
102 struct wsdisplay_charcell {
103 u_int uc;
104 long attr;
105 };
106
107 struct wsdisplay_font;
108
109
110
111
112
113
114
115 struct wsdisplay_accessops {
116 int (*ioctl)(void *v, u_long cmd, caddr_t data, int flag,
117 struct proc *p);
118 paddr_t (*mmap)(void *v, off_t off, int prot);
119 int (*alloc_screen)(void *, const struct wsscreen_descr *,
120 void **, int *, int *, long *);
121 void (*free_screen)(void *, void *);
122 int (*show_screen)(void *, void *, int,
123 void (*) (void *, int, int), void *);
124 int (*load_font)(void *, void *, struct wsdisplay_font *);
125 void (*scrollback)(void *, void *, int);
126 int (*getchar)(void *, int, int, struct wsdisplay_charcell *);
127 void (*burn_screen)(void *, u_int, u_int);
128 void (*pollc)(void *, int);
129 };
130
131
132 struct wsscreen_list {
133 int nscreens;
134 const struct wsscreen_descr **screens;
135 };
136
137
138
139
140
141 struct wsemuldisplaydev_attach_args {
142 int console;
143 const struct wsscreen_list *scrdata;
144 const struct wsdisplay_accessops *accessops;
145 void *accesscookie;
146 u_int defaultscreens;
147 };
148
149 #define WSEMULDISPLAYDEVCF_CONSOLE 0
150 #define wsemuldisplaydevcf_console cf_loc[WSEMULDISPLAYDEVCF_CONSOLE]
151 #define WSEMULDISPLAYDEVCF_CONSOLE_UNK -1
152 #define WSDISPLAYDEVCF_MUX 0
153 #define wsdisplaydevcf_mux cf_loc[WSDISPLAYDEVCF_MUX]
154 #define WSEMULDISPLAYDEVCF_MUX 1
155 #define wsemuldisplaydevcf_mux cf_loc[WSEMULDISPLAYDEVCF_MUX]
156
157 struct wscons_syncops {
158 int (*detach)(void *, int, void (*)(void *, int, int), void *);
159 int (*attach)(void *, int, void (*)(void *, int, int), void *);
160 int (*check)(void *);
161 void (*destroy)(void *);
162 };
163
164
165
166
167 void wsdisplay_cnattach(const struct wsscreen_descr *, void *,
168 int, int, long);
169 int wsemuldisplaydevprint(void *, const char *);
170
171
172
173
174 void wsdisplay_cnputc(dev_t dev, int i);
175
176
177
178
179 struct wsdisplay_softc;
180 struct wsscreen;
181 int wsscreen_attach_sync(struct wsscreen *,
182 const struct wscons_syncops *, void *);
183 int wsscreen_detach_sync(struct wsscreen *);
184 int wsscreen_lookup_sync(struct wsscreen *,
185 const struct wscons_syncops *, void **);
186
187 int wsdisplay_maxscreenidx(struct wsdisplay_softc *);
188 int wsdisplay_screenstate(struct wsdisplay_softc *, int);
189 int wsdisplay_getactivescreen(struct wsdisplay_softc *);
190 int wsscreen_switchwait(struct wsdisplay_softc *, int);
191
192 int wsdisplay_internal_ioctl(struct wsdisplay_softc *sc,
193 struct wsscreen *,
194 u_long cmd, caddr_t data,
195 int flag, struct proc *p);
196
197 int wsdisplay_usl_ioctl1(struct wsdisplay_softc *,
198 u_long, caddr_t, int, struct proc *);
199
200 int wsdisplay_usl_ioctl2(struct wsdisplay_softc *, struct wsscreen *,
201 u_long, caddr_t, int, struct proc *);
202
203 int wsdisplay_cfg_ioctl(struct wsdisplay_softc *sc,
204 u_long cmd, caddr_t data,
205 int flag, struct proc *p);
206
207
208
209
210 #define WSDISPLAY_NULLSCREEN -1
211 void wsdisplay_switchtoconsole(void);
212 const struct wsscreen_descr *
213 wsdisplay_screentype_pick(const struct wsscreen_list *, const char *);
214
215
216
217
218 void wsdisplay_burn(void *v, u_int flags);
219 void wsscrollback(void *v, int op);
220
221 #define WSDISPLAY_SCROLL_BACKWARD 0
222 #define WSDISPLAY_SCROLL_FORWARD 1
223 #define WSDISPLAY_SCROLL_RESET 2
224
225
226
227
228 #define WSDISPLAY_DEFBURNOUT 600000
229 #define WSDISPLAY_DEFBURNIN 250
230