wsemul_sun.c revision 1.2 1 1.2 drochner /* $NetBSD: wsemul_sun.c,v 1.2 1998/03/27 18:22:36 drochner Exp $ */
2 1.1 drochner
3 1.1 drochner /*
4 1.1 drochner * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
5 1.1 drochner *
6 1.1 drochner * Redistribution and use in source and binary forms, with or without
7 1.1 drochner * modification, are permitted provided that the following conditions
8 1.1 drochner * are met:
9 1.1 drochner * 1. Redistributions of source code must retain the above copyright
10 1.1 drochner * notice, this list of conditions and the following disclaimer.
11 1.1 drochner * 2. Redistributions in binary form must reproduce the above copyright
12 1.1 drochner * notice, this list of conditions and the following disclaimer in the
13 1.1 drochner * documentation and/or other materials provided with the distribution.
14 1.1 drochner * 3. All advertising materials mentioning features or use of this software
15 1.1 drochner * must display the following acknowledgement:
16 1.1 drochner * This product includes software developed by Christopher G. Demetriou
17 1.1 drochner * for the NetBSD Project.
18 1.1 drochner * 4. The name of the author may not be used to endorse or promote products
19 1.1 drochner * derived from this software without specific prior written permission
20 1.1 drochner *
21 1.1 drochner * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 1.1 drochner * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 1.1 drochner * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 1.1 drochner * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 1.1 drochner * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 1.1 drochner * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 1.1 drochner * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 1.1 drochner * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 1.1 drochner * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 1.1 drochner * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 1.1 drochner */
32 1.1 drochner
33 1.1 drochner static const char _copyright[] __attribute__ ((unused)) =
34 1.1 drochner "Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.";
35 1.1 drochner static const char _rcsid[] __attribute__ ((unused)) =
36 1.2 drochner "$NetBSD: wsemul_sun.c,v 1.2 1998/03/27 18:22:36 drochner Exp $";
37 1.1 drochner
38 1.1 drochner /* XXX DESCRIPTION/SOURCE OF INFORMATION */
39 1.1 drochner
40 1.1 drochner #include <sys/param.h>
41 1.1 drochner #include <sys/systm.h>
42 1.1 drochner #include <sys/time.h>
43 1.1 drochner #include <sys/malloc.h>
44 1.1 drochner #include <sys/fcntl.h>
45 1.1 drochner
46 1.1 drochner #include <dev/wscons/wsconsio.h>
47 1.1 drochner #include <dev/wscons/wsdisplayvar.h>
48 1.1 drochner #include <dev/wscons/wsemulvar.h>
49 1.1 drochner #include <dev/wscons/ascii.h>
50 1.1 drochner
51 1.1 drochner void *wsemul_sun_cnattach __P((const struct wsscreen_descr *, void *,
52 1.1 drochner int, int));
53 1.1 drochner void *wsemul_sun_attach __P((int console, const struct wsscreen_descr *,
54 1.1 drochner void *, int, int, void *));
55 1.1 drochner void wsemul_sun_output __P((void *cookie, const u_char *data, u_int count));
56 1.1 drochner void wsemul_sun_detach __P((void *cookie, u_int *crowp, u_int *ccolp));
57 1.1 drochner
58 1.1 drochner const struct wsemul_ops wsemul_sun_ops = {
59 1.1 drochner "sun",
60 1.1 drochner wsemul_sun_cnattach,
61 1.1 drochner wsemul_sun_attach,
62 1.1 drochner wsemul_sun_output,
63 1.1 drochner wsemul_sun_detach,
64 1.1 drochner };
65 1.1 drochner
66 1.1 drochner #define SUN_EMUL_STATE_NORMAL 0 /* normal processing */
67 1.1 drochner #define SUN_EMUL_STATE_HAVEESC 1 /* seen start of ctl seq */
68 1.1 drochner #define SUN_EMUL_STATE_CONTROL 2 /* processing ctl seq */
69 1.1 drochner
70 1.1 drochner #define SUN_EMUL_NARGS 2 /* max # of args to a command */
71 1.1 drochner
72 1.1 drochner struct wsemul_sun_emuldata {
73 1.1 drochner const struct wsdisplay_emulops *emulops;
74 1.1 drochner void *emulcookie;
75 1.1 drochner void *cbcookie;
76 1.1 drochner u_int nrows, ncols, crow, ccol;
77 1.1 drochner
78 1.1 drochner u_int state; /* processing state */
79 1.1 drochner u_int args[SUN_EMUL_NARGS]; /* command args, if CONTROL */
80 1.1 drochner u_int scrolldist; /* distance to scroll */
81 1.1 drochner };
82 1.1 drochner
83 1.1 drochner static u_int wsemul_sun_output_normal __P((struct wsemul_sun_emuldata *,
84 1.1 drochner u_char));
85 1.1 drochner static u_int wsemul_sun_output_haveesc __P((struct wsemul_sun_emuldata *,
86 1.1 drochner u_char));
87 1.1 drochner static u_int wsemul_sun_output_control __P((struct wsemul_sun_emuldata *,
88 1.1 drochner u_char));
89 1.1 drochner static void wsemul_sun_control __P((struct wsemul_sun_emuldata *, u_char));
90 1.1 drochner
91 1.1 drochner struct wsemul_sun_emuldata wsemul_sun_console_emuldata;
92 1.1 drochner
93 1.1 drochner /* some useful utility macros */
94 1.1 drochner #define ARG(n) (edp->args[(n)])
95 1.1 drochner #define NORMALIZE_ARG(n) (ARG(n) ? ARG(n) : 1)
96 1.1 drochner #define COLS_LEFT (edp->ncols - edp->ccol - 1)
97 1.1 drochner #define ROWS_LEFT (edp->nrows - edp->crow - 1)
98 1.1 drochner
99 1.1 drochner void *
100 1.1 drochner wsemul_sun_cnattach(type, cookie, ccol, crow)
101 1.1 drochner const struct wsscreen_descr *type;
102 1.1 drochner void *cookie;
103 1.1 drochner int ccol, crow;
104 1.1 drochner {
105 1.1 drochner struct wsemul_sun_emuldata *edp;
106 1.1 drochner
107 1.1 drochner edp = &wsemul_sun_console_emuldata;
108 1.1 drochner
109 1.1 drochner edp->emulops = type->textops;
110 1.1 drochner edp->emulcookie = cookie;
111 1.1 drochner edp->nrows = type->nrows;
112 1.1 drochner edp->ncols = type->ncols;
113 1.1 drochner edp->crow = crow;
114 1.1 drochner edp->ccol = ccol;
115 1.1 drochner edp->cbcookie = NULL;
116 1.1 drochner
117 1.1 drochner edp->state = SUN_EMUL_STATE_NORMAL;
118 1.1 drochner edp->scrolldist = 1;
119 1.1 drochner
120 1.1 drochner return (edp);
121 1.1 drochner }
122 1.1 drochner
123 1.1 drochner void *
124 1.1 drochner wsemul_sun_attach(console, type, cookie, ccol, crow, cbcookie)
125 1.1 drochner int console;
126 1.1 drochner const struct wsscreen_descr *type;
127 1.1 drochner void *cookie;
128 1.1 drochner int ccol, crow;
129 1.1 drochner void *cbcookie;
130 1.1 drochner {
131 1.1 drochner struct wsemul_sun_emuldata *edp;
132 1.1 drochner
133 1.1 drochner if (console)
134 1.1 drochner edp = &wsemul_sun_console_emuldata;
135 1.1 drochner else {
136 1.1 drochner edp = malloc(sizeof *edp, M_DEVBUF, M_WAITOK);
137 1.1 drochner
138 1.1 drochner edp->emulops = type->textops;
139 1.1 drochner edp->emulcookie = cookie;
140 1.1 drochner edp->nrows = type->nrows;
141 1.1 drochner edp->ncols = type->ncols;
142 1.1 drochner edp->crow = crow;
143 1.1 drochner edp->ccol = ccol;
144 1.1 drochner
145 1.1 drochner edp->state = SUN_EMUL_STATE_NORMAL;
146 1.1 drochner edp->scrolldist = 1;
147 1.1 drochner }
148 1.1 drochner
149 1.1 drochner edp->cbcookie = cbcookie;
150 1.1 drochner
151 1.1 drochner return (edp);
152 1.1 drochner }
153 1.1 drochner
154 1.1 drochner static inline u_int
155 1.1 drochner wsemul_sun_output_normal(edp, c)
156 1.1 drochner struct wsemul_sun_emuldata *edp;
157 1.1 drochner u_char c;
158 1.1 drochner {
159 1.1 drochner u_int newstate = SUN_EMUL_STATE_NORMAL;
160 1.1 drochner u_int n;
161 1.1 drochner
162 1.1 drochner switch (c) {
163 1.1 drochner case ASCII_BEL: /* "Bell (BEL)" */
164 1.1 drochner wsdisplay_emulbell(edp->cbcookie);
165 1.1 drochner break;
166 1.1 drochner
167 1.1 drochner case ASCII_BS: /* "Backspace (BS)" */
168 1.1 drochner if (edp->ccol > 0)
169 1.1 drochner edp->ccol--;
170 1.1 drochner break;
171 1.1 drochner
172 1.1 drochner case ASCII_CR: /* "Return (CR)" */
173 1.1 drochner edp->ccol = 0;
174 1.1 drochner break;
175 1.1 drochner
176 1.1 drochner case ASCII_HT: /* "Tab (TAB)" */
177 1.2 drochner n = min(8 - (edp->ccol & 7), COLS_LEFT);
178 1.1 drochner (*edp->emulops->erasecols)(edp->emulcookie, edp->crow,
179 1.1 drochner edp->ccol, n);
180 1.1 drochner edp->ccol += n;
181 1.1 drochner break;
182 1.1 drochner
183 1.1 drochner case ASCII_NP: /* "Form Feed (FF)" */
184 1.1 drochner (*edp->emulops->eraserows)(edp->emulcookie, 0, edp->nrows);
185 1.1 drochner edp->ccol = 0;
186 1.1 drochner edp->crow = 0;
187 1.1 drochner break;
188 1.1 drochner
189 1.1 drochner case ASCII_VT: /* "Reverse Line Feed" */
190 1.1 drochner if (edp->crow > 0)
191 1.1 drochner edp->crow--;
192 1.1 drochner break;
193 1.1 drochner
194 1.1 drochner case ASCII_ESC: /* "Escape (ESC)" */
195 1.1 drochner if (edp->state == SUN_EMUL_STATE_NORMAL) {
196 1.1 drochner newstate = SUN_EMUL_STATE_HAVEESC;
197 1.1 drochner break;
198 1.1 drochner }
199 1.1 drochner /* special case: fall through, we're printing one out */
200 1.1 drochner /* FALLTHRU */
201 1.1 drochner
202 1.1 drochner default: /* normal character */
203 1.1 drochner (*edp->emulops->putstr)(edp->emulcookie, edp->crow, edp->ccol,
204 1.1 drochner &c, 1);
205 1.1 drochner edp->ccol++;
206 1.1 drochner
207 1.1 drochner /* if cur col is still on cur line, done. */
208 1.1 drochner if (edp->ccol < edp->ncols)
209 1.1 drochner break;
210 1.1 drochner
211 1.1 drochner /* wrap the column around. */
212 1.1 drochner edp->ccol = 0;
213 1.1 drochner
214 1.1 drochner /* FALLTHRU */
215 1.1 drochner
216 1.1 drochner case ASCII_LF: /* "Line Feed (LF)" */
217 1.1 drochner /* if the cur line isn't the last, incr and leave. */
218 1.1 drochner if (edp->crow < edp->nrows - 1) {
219 1.1 drochner edp->crow++;
220 1.1 drochner break;
221 1.1 drochner }
222 1.1 drochner
223 1.1 drochner /*
224 1.1 drochner * if we're in wrap-around mode, go to the first
225 1.1 drochner * line and clear it.
226 1.1 drochner */
227 1.1 drochner if (edp->scrolldist == 0) {
228 1.1 drochner edp->crow = 0;
229 1.1 drochner (*edp->emulops->eraserows)(edp->emulcookie, 0, 1);
230 1.1 drochner break;
231 1.1 drochner }
232 1.1 drochner
233 1.1 drochner /* scroll by the scrolling distance. */
234 1.1 drochner (*edp->emulops->copyrows)(edp->emulcookie, edp->scrolldist, 0,
235 1.1 drochner edp->nrows - edp->scrolldist);
236 1.1 drochner (*edp->emulops->eraserows)(edp->emulcookie,
237 1.1 drochner edp->nrows - edp->scrolldist, edp->scrolldist);
238 1.1 drochner edp->crow -= edp->scrolldist - 1;
239 1.1 drochner break;
240 1.1 drochner }
241 1.1 drochner
242 1.1 drochner return (newstate);
243 1.1 drochner }
244 1.1 drochner
245 1.1 drochner static inline u_int
246 1.1 drochner wsemul_sun_output_haveesc(edp, c)
247 1.1 drochner struct wsemul_sun_emuldata *edp;
248 1.1 drochner u_char c;
249 1.1 drochner {
250 1.1 drochner u_int newstate;
251 1.1 drochner
252 1.1 drochner switch (c) {
253 1.1 drochner case '[': /* continuation of multi-char sequence */
254 1.1 drochner bzero(edp->args, sizeof (edp->args));
255 1.1 drochner newstate = SUN_EMUL_STATE_CONTROL;
256 1.1 drochner break;
257 1.1 drochner
258 1.1 drochner default:
259 1.1 drochner /* spit out the escape char (???), then the new character */
260 1.1 drochner wsemul_sun_output_normal(edp, ASCII_ESC); /* ??? */
261 1.1 drochner newstate = wsemul_sun_output_normal(edp, c);
262 1.1 drochner break;
263 1.1 drochner }
264 1.1 drochner
265 1.1 drochner return (newstate);
266 1.1 drochner }
267 1.1 drochner
268 1.1 drochner static inline void
269 1.1 drochner wsemul_sun_control(edp, c)
270 1.1 drochner struct wsemul_sun_emuldata *edp;
271 1.1 drochner u_char c;
272 1.1 drochner {
273 1.1 drochner u_int n, src, dst;
274 1.1 drochner
275 1.1 drochner switch (c) {
276 1.1 drochner case '@': /* "Insert Character (ICH)" */
277 1.1 drochner n = min(NORMALIZE_ARG(0), COLS_LEFT + 1);
278 1.1 drochner src = edp->ccol;
279 1.1 drochner dst = edp->ccol + n;
280 1.1 drochner if (dst < edp->ncols) {
281 1.1 drochner (*edp->emulops->copycols)(edp->emulcookie, edp->crow,
282 1.1 drochner src, dst, edp->ncols - dst);
283 1.1 drochner }
284 1.1 drochner (*edp->emulops->erasecols)(edp->emulcookie, edp->crow,
285 1.1 drochner src, dst - src);
286 1.1 drochner break;
287 1.1 drochner
288 1.1 drochner case 'E': /* "Cursor Next Line (CNL)" */
289 1.1 drochner edp->ccol = 0;
290 1.1 drochner /* FALLTHRU */
291 1.1 drochner case 'A': /* "Cursor Up (CUU)" */
292 1.1 drochner edp->crow -= min(NORMALIZE_ARG(0), edp->crow);
293 1.1 drochner break;
294 1.1 drochner
295 1.1 drochner case 'B': /* "Cursor Down (CUD)" */
296 1.1 drochner edp->crow += min(NORMALIZE_ARG(0), ROWS_LEFT);
297 1.1 drochner break;
298 1.1 drochner
299 1.1 drochner case 'C': /* "Cursor Forward (CUF)" */
300 1.1 drochner edp->ccol += min(NORMALIZE_ARG(0), COLS_LEFT);
301 1.1 drochner break;
302 1.1 drochner
303 1.1 drochner case 'D': /* "Cursor Backward (CUB)" */
304 1.1 drochner edp->ccol -= min(NORMALIZE_ARG(0), edp->ccol);
305 1.1 drochner break;
306 1.1 drochner
307 1.1 drochner case 'f': /* "Horizontal And Vertical Position (HVP)" */
308 1.1 drochner case 'H': /* "Cursor Position (CUP)" */
309 1.1 drochner edp->crow = min(NORMALIZE_ARG(1), edp->nrows) - 1;
310 1.1 drochner edp->ccol = min(NORMALIZE_ARG(0), edp->ncols) - 1;
311 1.1 drochner break;
312 1.1 drochner
313 1.1 drochner case 'J': /* "Erase in Display (ED)" */
314 1.1 drochner if (ROWS_LEFT > 0) {
315 1.1 drochner (*edp->emulops->eraserows)(edp->emulcookie,
316 1.1 drochner edp->crow + 1, ROWS_LEFT);
317 1.1 drochner }
318 1.1 drochner /* FALLTHRU */
319 1.1 drochner case 'K': /* "Erase in Line (EL)" */
320 1.1 drochner (*edp->emulops->erasecols)(edp->emulcookie, edp->crow,
321 1.1 drochner edp->ccol, COLS_LEFT + 1);
322 1.1 drochner break;
323 1.1 drochner
324 1.1 drochner case 'L': /* "Insert Line (IL)" */
325 1.1 drochner n = min(NORMALIZE_ARG(0), ROWS_LEFT + 1);
326 1.1 drochner src = edp->crow;
327 1.1 drochner dst = edp->crow + n;
328 1.1 drochner if (dst < edp->nrows) {
329 1.1 drochner (*edp->emulops->copyrows)(edp->emulcookie,
330 1.1 drochner src, dst, edp->nrows - dst);
331 1.1 drochner }
332 1.1 drochner (*edp->emulops->eraserows)(edp->emulcookie,
333 1.1 drochner src, dst - src);
334 1.1 drochner break;
335 1.1 drochner
336 1.1 drochner case 'M': /* "Delete Line (DL)" */
337 1.1 drochner n = min(NORMALIZE_ARG(0), ROWS_LEFT + 1);
338 1.1 drochner src = edp->crow + n;
339 1.1 drochner dst = edp->crow;
340 1.1 drochner if (src < edp->nrows) {
341 1.1 drochner (*edp->emulops->copyrows)(edp->emulcookie,
342 1.1 drochner src, dst, edp->nrows - src);
343 1.1 drochner }
344 1.1 drochner (*edp->emulops->eraserows)(edp->emulcookie,
345 1.1 drochner dst + edp->nrows - src, src - dst);
346 1.1 drochner break;
347 1.1 drochner
348 1.1 drochner case 'P': /* "Delete Character (DCH)" */
349 1.1 drochner n = min(NORMALIZE_ARG(0), COLS_LEFT + 1);
350 1.1 drochner src = edp->ccol + n;
351 1.1 drochner dst = edp->ccol;
352 1.1 drochner if (src < edp->ncols) {
353 1.1 drochner (*edp->emulops->copycols)(edp->emulcookie, edp->crow,
354 1.1 drochner src, dst, edp->ncols - src);
355 1.1 drochner }
356 1.1 drochner (*edp->emulops->erasecols)(edp->emulcookie, edp->crow,
357 1.1 drochner dst + edp->ncols - src, src - dst);
358 1.1 drochner break;
359 1.1 drochner
360 1.1 drochner case 'm': /* "Select Graphic Rendition (SGR)" */
361 1.1 drochner /* XXX rendition currently ignored */
362 1.1 drochner break;
363 1.1 drochner
364 1.1 drochner case 'p': /* "Black On White (SUNBOW)" */
365 1.1 drochner /* XXX rendition currently ignored */
366 1.1 drochner break;
367 1.1 drochner
368 1.1 drochner case 'q': /* "White On Black (SUNWOB)" */
369 1.1 drochner /* XXX rendition currently ignored */
370 1.1 drochner break;
371 1.1 drochner
372 1.1 drochner case 'r': /* "Set Scrolling (SUNSCRL)" */
373 1.2 drochner edp->scrolldist = min(ARG(0), edp->nrows);
374 1.1 drochner break;
375 1.1 drochner
376 1.1 drochner case 's': /* "Reset Terminal Emulator (SUNRESET)" */
377 1.1 drochner edp->scrolldist = 1;
378 1.1 drochner /* XXX rendition aspects of this currently ignored */
379 1.1 drochner break;
380 1.1 drochner }
381 1.1 drochner }
382 1.1 drochner
383 1.1 drochner static inline u_int
384 1.1 drochner wsemul_sun_output_control(edp, c)
385 1.1 drochner struct wsemul_sun_emuldata *edp;
386 1.1 drochner u_char c;
387 1.1 drochner {
388 1.1 drochner u_int newstate = SUN_EMUL_STATE_CONTROL;
389 1.1 drochner u_int i;
390 1.1 drochner
391 1.1 drochner switch (c) {
392 1.1 drochner case '0': case '1': case '2': case '3': case '4': /* argument digit */
393 1.1 drochner case '5': case '6': case '7': case '8': case '9':
394 1.1 drochner edp->args[0] = (edp->args[0] * 10) + (c - '0');
395 1.1 drochner break;
396 1.1 drochner
397 1.1 drochner case ';': /* argument terminator */
398 1.1 drochner for (i = 1; i < SUN_EMUL_NARGS; i++)
399 1.1 drochner edp->args[i] = edp->args[i - 1];
400 1.1 drochner edp->args[0] = 0;
401 1.1 drochner break;
402 1.1 drochner
403 1.1 drochner default: /* end of escape sequence */
404 1.1 drochner wsemul_sun_control(edp, c);
405 1.1 drochner newstate = SUN_EMUL_STATE_NORMAL;
406 1.1 drochner break;
407 1.1 drochner }
408 1.1 drochner return (newstate);
409 1.1 drochner }
410 1.1 drochner
411 1.1 drochner void
412 1.1 drochner wsemul_sun_output(cookie, data, count)
413 1.1 drochner void *cookie;
414 1.1 drochner const u_char *data;
415 1.1 drochner u_int count;
416 1.1 drochner {
417 1.1 drochner struct wsemul_sun_emuldata *edp = cookie;
418 1.1 drochner u_int newstate;
419 1.1 drochner
420 1.1 drochner /* XXX */
421 1.1 drochner (*edp->emulops->cursor)(edp->emulcookie, 0, edp->crow, edp->ccol);
422 1.1 drochner for (; count > 0; data++, count--) {
423 1.1 drochner switch (edp->state) {
424 1.1 drochner case SUN_EMUL_STATE_NORMAL:
425 1.1 drochner /* XXX SCAN INPUT FOR NEWLINES, DO PRESCROLLING */
426 1.1 drochner newstate = wsemul_sun_output_normal(edp, *data);
427 1.1 drochner break;
428 1.1 drochner case SUN_EMUL_STATE_HAVEESC:
429 1.1 drochner newstate = wsemul_sun_output_haveesc(edp, *data);
430 1.1 drochner break;
431 1.1 drochner case SUN_EMUL_STATE_CONTROL:
432 1.1 drochner newstate = wsemul_sun_output_control(edp, *data);
433 1.1 drochner break;
434 1.1 drochner default:
435 1.1 drochner #ifdef DIAGNOSTIC
436 1.1 drochner panic("wsemul_sun: invalid state %d\n", edp->state);
437 1.1 drochner #endif
438 1.1 drochner /* try to recover, if things get screwed up... */
439 1.1 drochner newstate = wsemul_sun_output_normal(edp, *data);
440 1.1 drochner break;
441 1.1 drochner }
442 1.1 drochner edp->state = newstate;
443 1.1 drochner }
444 1.1 drochner /* XXX */
445 1.1 drochner (*edp->emulops->cursor)(edp->emulcookie, 1, edp->crow, edp->ccol);
446 1.1 drochner }
447 1.1 drochner
448 1.1 drochner void
449 1.1 drochner wsemul_sun_detach(cookie, crowp, ccolp)
450 1.1 drochner void *cookie;
451 1.1 drochner u_int *crowp, *ccolp;
452 1.1 drochner {
453 1.1 drochner struct wsemul_sun_emuldata *edp = cookie;
454 1.1 drochner
455 1.1 drochner *crowp = edp->crow;
456 1.1 drochner *ccolp = edp->ccol;
457 1.1 drochner if (edp != &wsemul_sun_console_emuldata)
458 1.1 drochner free(edp, M_DEVBUF);
459 1.1 drochner }
460