Print this page
12315 errors in section 7i of the manual
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man7i/visual_io.7i
+++ new/usr/src/man/man7i/visual_io.7i
1 1 .\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved
2 2 .\" Copyright 2018, Joyent, Inc.
3 +.\" Copyright 2020 Peter Tribble.
3 4 .\" The contents of this file are subject to the terms of the
4 5 .\" Common Development and Distribution License (the "License").
5 6 .\" You may not use this file except in compliance with the License.
6 7 .\"
7 8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8 9 .\" or http://www.opensolaris.org/os/licensing.
9 10 .\" See the License for the specific language governing permissions
10 11 .\" and limitations under the License.
11 12 .\"
12 13 .\" When distributing Covered Code, include this CDDL HEADER in each
13 14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14 15 .\" If applicable, add the following below this CDDL HEADER, with the
15 16 .\" fields enclosed by brackets "[]" replaced with your own identifying
16 17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
17 -.Dd August 31, 2018
18 +.Dd February 17, 2020
18 19 .Dt VISUAL_IO 7I
19 20 .Os
20 21 .Sh NAME
21 22 .Nm visual_io
22 23 .Nd illumos VISUAL I/O control operations
23 24 .Sh SYNOPSIS
24 25 .In sys/visual_io.h
25 26 .Sh DESCRIPTION
26 27 The illumos VISUAL environment defines a small set of ioctls for controlling
27 28 graphics and imaging devices.
28 29 .Pp
29 30 The
30 31 .Dv VIS_GETIDENTIFIER
31 32 ioctl is mandatory and must be implemented in
32 33 device drivers for graphics devices using the illumos VISUAL environment.
33 34 The
34 35 .Dv VIS_GETIDENTIFIER
35 36 ioctl is defined to return a device identifier from the device driver.
36 37 This identifier must be a uniquely-defined string.
37 38 .Pp
38 39 There are two additional sets of ioctls.
39 40 One supports mouse tracking via hardware cursor operations.
40 41 Use of this set is optional, however, if a graphics
41 42 device has hardware cursor support and implements these ioctls, the mouse
42 43 tracking performance is improved.
43 44 The remaining set supports the device acting
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
44 45 as the system console device.
45 46 Use of this set is optional, but if a graphics device is to be used as the
46 47 system console device, it must implement these ioctls.
47 48 .Pp
48 49 The VISUAL environment also defines interfaces for non-ioctl entry points into
49 50 the driver that the illumos operating environment calls when it is running in
50 51 standalone mode (for example, when using a stand-alone debugger, entering
51 52 the PROM monitor, or when the system panicking).
52 53 These are also known as
53 54 .Dq Polled I/O
54 -entry points, which operate under an an explicit set of restrictions, described below.
55 +entry points, which operate under an explicit set of restrictions, described below.
55 56 .Sh IOCTLS
56 57 .Bl -tag -width VIS_GETIDENTIFIER -compact
57 58 .It Dv VIS_GETIDENTIFIER
58 59 This
59 60 .Xr ioctl 2
60 61 returns an identifier string to uniquely identify a device
61 62 used in the illumos VISUAL environment.
62 63 This is a mandatory ioctl and must return a unique string.
63 64 We suggest that the name be formed as
64 65 .Ao companysymbol Ac Ns Ao devicetype Ac .
65 -For example, the
66 -.Xr cgsix 7D
67 -driver
68 -returns
69 -.Sy SUNWcg6 .
70 66 .Pp
71 67 .Dv VIS_GETIDENTIFIER
72 68 takes a
73 69 .Vt vis_identifier
74 70 structure as its parameter.
75 71 This structure has the form:
76 72 .Bd -literal -offset 2n
77 73 #define VIS_MAXNAMELEN 128
78 74 struct vis_identifier {
79 75 char name[VIS_MAXNAMELEN];
80 76 };
81 77 .Ed
82 78 .Pp
83 79 .It Dv VIS_GETCURSOR
84 80 .It Dv VIS_SETCURSOR
85 81 These ioctls fetch and set various cursor attributes, using the
86 82 .Vt vis_cursor
87 83 structure.
88 84 .Bd -literal -offset 2n
89 85 struct vis_cursorpos {
90 86 short x; /* cursor x coordinate */
91 87 short y; /* cursor y coordinate */
92 88 };
93 89
94 90 struct vis_cursorcmap {
95 91 int version; /* version */
96 92 int reserved;
97 93 /* red color map elements */
98 94 unsigned char *red;
99 95 /* green color map elements */
100 96 unsigned char *green;
101 97 /* blue color map elements */
102 98 unsigned char *blue;
103 99 };
104 100
105 101 #define VIS_CURSOR_SETCURSOR 0x01 /* set cursor */
106 102 /* set cursor position */
107 103 #define VIS_CURSOR_SETPOSITION 0x02
108 104 /* set cursur hot spot */
109 105 #define VIS_CURSOR_SETHOTSPOT 0x04
110 106 /* set cursor colormap */
111 107 #define VIS_CURSOR_SETCOLORMAP 0x08
112 108 /* set cursor shape */
113 109 #define VIS_CURSOR_SETSHAPE 0x10
114 110 #define VIS_CURSOR_SETALL \e
115 111 (VIS_CURSOR_SETCURSOR | VIS_CURSOR_SETPOSITION | \e
116 112 VIS_CURSOR_SETHOTSPOT | VIS_CURSOR_SETCOLORMAP | \e
117 113 VIS_CURSOR_SETSHAPE)
118 114
119 115 struct vis_cursor {
120 116 short set; /* what to set */
121 117 short enable; /* cursor on/off */
122 118 struct vis_cursorpos pos; /* cursor position */
123 119 struct vis_cursorpos hot; /* cursor hot spot */
124 120 struct vis_cursorcmap cmap; /* color map info */
125 121 /* cursor bitmap size */
126 122 struct vis_cursorpos size;
127 123 char *image; /* cursor image bits */
128 124 char *mask; /* cursor mask bits */
129 125 };
130 126 .Ed
131 127 .Pp
132 128 The
133 129 .Vt vis_cursorcmap
134 130 structure should contain pointers to two elements,
135 131 specifying the red, green, and blue values for foreground and background.
136 132 .Pp
137 133 .It Dv VIS_SETCURSORPOS
138 134 .It Dv VIS_MOVECURSOR
139 135 These ioctls fetch and move the current cursor position, using the
140 136 .Vt vis_cursorpos
141 137 structure.
142 138 .El
143 139 .Ss "Console Optional Ioctls"
144 140 The following ioctl sets are used by graphics drivers that are part of the
145 141 system console device.
146 142 All of the ioctls must be implemented to be a console device.
147 143 In addition, if the system does not have a prom or the prom goes away
148 144 during boot, the special standalone ioctls (listed below) must also be
149 145 implemented.
150 146 .Pp
151 147 The coordinate system for the console device places 0,0 at the upper left
152 148 corner of the device, with rows increasing toward the bottom of the device and
153 149 columns increasing from left to right.
154 150 .Pp
155 151 .Bl -tag -width VIS_CONSDISPLAY -compact -offset 2n
156 152 .It Dv VIS_PUTCMAP
157 153 .It Dv VIS_GETCMAP
158 154 Set or get color map entries.
159 155 .Pp
160 156 The argument is a pointer to a
161 157 .Vt vis_cmap
162 158 structure, which contains the
163 159 following fields:
164 160 .Bd -literal -offset 2n
165 161 struct vis_cmap {
166 162 int index;
167 163 int count;
168 164 uchar_t *red;
169 165 uchar_t *green;
170 166 uchar_t *blue;
171 167 }
172 168 .Ed
173 169 .Pp
174 170 .Fa index
175 171 is the starting index in the color map where you want to start
176 172 setting or getting color map entries.
177 173 .Pp
178 174 .Fa count
179 175 is the number of color map entries to set or get.
180 176 It also is the
181 177 size of the
182 178 .Fa red ,
183 179 .Fa green ,
184 180 and
185 181 .Fa blue
186 182 color arrays.
187 183 .Pp
188 184 .Fa *red ,
189 185 .Fa *green ,
190 186 and
191 187 .Fa *blue
192 188 are pointers to unsigned character arrays which contain the color map info to
193 189 set or where the color map info is placed on a get.
194 190 .Pp
195 191 .It Dv VIS_DEVINIT
196 192 Initializes the graphics driver as a console device.
197 193 .Pp
198 194 The argument is a pointer to a
199 195 .Vt vis_devinit
200 196 structure.
201 197 The graphics driver
202 198 is expected to allocate any local state information needed to be a console
203 199 device and fill in this structure.
204 200 .Bd -literal -offset 2n
205 201 struct vis_devinit {
206 202 int version;
207 203 screen_size_t width;
208 204 screen_size_t height;
209 205 screen_size_t linebytes;
210 206 unit_t size;
211 207 int depth;
212 208 short mode;
213 209 struct vis_polledio *polledio;
214 210 vis_modechg_cb_t modechg_cb;
215 211 struct vis_modechg_arg *modechg_arg;
216 212 };
217 213 .Ed
218 214 .Pp
219 215 .Fa version
220 216 is the version of this structure and should be set to
221 217 .Dv VIS_CONS_REV .
222 218 .Pp
223 219 .Fa width
224 220 and
225 221 .Fa height
226 222 are the width and height of the device.
227 223 If
228 224 .Fa mode
229 225 (see below) is
230 226 .Dv VIS_TEXT
231 227 then
232 228 .Fa width
233 229 and
234 230 .Fa height
235 231 are the number of characters wide and high of the device.
236 232 If
237 233 .Fa mode
238 234 is
239 235 .Dv VIS_PIXEL
240 236 then
241 237 .Fa width
242 238 and
243 239 .Fa height
244 240 are the number of pixels wide and high of the device.
245 241 .Pp
246 242 .Fa linebytes
247 243 is the number of bytes per line of the device.
248 244 .Pp
249 245 .Fa size
250 246 is the total size of the device in pixels.
251 247 .Pp
252 248 .Fa depth
253 249 is the pixel depth in device bits.
254 250 Currently supported depths are:
255 251 .Sy 1 ,
256 252 .Sy 4 ,
257 253 .Sy 8
258 254 and
259 255 .Sy 24 .
260 256 .Pp
261 257 .Fa mode
262 258 is the mode of the device.
263 259 Either
264 260 .Dv VIS_PIXEL
265 261 (data to be displayed is in bitmap format) or
266 262 .Dv VIS_TEXT
267 263 (data to be displayed is in ascii format).
268 264 .Pp
269 265 .Fa polledio
270 266 is used to pass the address of the structure containing the
271 267 standalone mode polled I/O entry points to the device driver back to the
272 268 terminal emulator.
273 269 The
274 270 .Vt vis_polledio
275 271 interfaces are described in the
276 272 Console Standalone Entry Points section of this manpage.
277 273 These entry points are where the operating system enters the driver when the
278 274 system is running in standalone mode.
279 275 These functions perform identically to the
280 276 .Dv VIS_CONSDISPLAY ,
281 277 .Dv VIS_CONSCURSOR ,
282 278 and
283 279 .Dv VIS_CONSCOPY
284 280 ioctls, but are called directly by the illumos
285 281 operating environment and must operate under a very strict set of assumptions.
286 282 .Pp
287 283 .Fa modechg_cb
288 284 is a callback function passed from the terminal emulator to
289 285 the framebuffer driver which the frame-buffer driver must call whenever a video
290 286 mode change event occurs that changes the screen height, width or depth.
291 287 The callback takes two arguments, an opaque handle,
292 288 .Fa modechg_arg ,
293 289 and the address of a
294 290 .Vt vis_devinit
295 291 struct containing the new video mode information.
296 292 .Pp
297 293 .Fa modechg_arg
298 294 is an opaque handle passed from the terminal emulator to the
299 295 driver, which the driver must pass back to the terminal emulator as an argument
300 296 to the
301 297 .Fa modechg_cb
302 298 function when the driver notifies the terminal emulator of a video mode change.
303 299 .Pp
304 300 .It Dv VIS_DEVFINI
305 301 Tells the graphics driver that it is no longer the system console device.
306 302 There is no argument to this ioctl.
307 303 The driver is expected to free any locally kept
308 304 state information related to the console.
309 305 .Pp
310 306 .It Dv VIS_CONSCURSOR
311 307 Describes the size and placement of the cursor on the screen.
312 308 The graphics
313 309 driver is expected to display or hide the cursor at the indicated position.
314 310 .Pp
315 311 The argument is a pointer to a
316 312 .Vt vis_conscursor
317 313 structure which contains
318 314 the following fields:
319 315 .Bd -literal -offset 2n
320 316 struct vis_conscursor {
321 317 screen_pos_t row;
322 318 screen_pos_t col;
323 319 screen_size_t width;
324 320 screen_size_t height
325 321 color_t fg_color;
326 322 color_t bg_color;
327 323 short action;
328 324 };
329 325 .Ed
330 326 .Pp
331 327 .Fa row
332 328 and
333 329 .Fa col
334 330 are the first row and column (upper left corner of the cursor).
335 331 .Pp
336 332 .Fa width
337 333 and
338 334 .Fa height
339 335 are the width and height of the cursor.
340 336 .Pp
341 337 If
342 338 .Fa mode
343 339 in the
344 340 .Dv VIS_DEVINIT
345 341 ioctl is set to
346 342 .Dv VIS_PIXEL ,
347 343 then
348 344 .Fa col ,
349 345 .Fa row ,
350 346 .Fa width
351 347 and
352 348 .Fa height
353 349 are in pixels.
354 350 If
355 351 .Fa mode
356 352 in the
357 353 .Dv VIS_DEVINIT
358 354 ioctl was set to
359 355 .Dv VIS_TEXT ,
360 356 then
361 357 .Fa col ,
362 358 .Fa row ,
363 359 .Fa width
364 360 and
365 361 .Fa height
366 362 are in characters.
367 363 .Pp
368 364 .Fa fg_color
369 365 and
370 366 .Fa bg_color
371 367 are the foreground and background color map
372 368 indexes to use when the
373 369 .Fa action
374 370 (see below) is set to
375 371 .Dv VIS_DISPLAY_CURSOR .
376 372 .Pp
377 373 .Fa action
378 374 indicates whether to display or hide the cursor.
379 375 It is set to either
380 376 .Dv VIS_HIDE_CURSOR
381 377 or
382 378 .Dv VIS_DISPLAY_CURSOR .
383 379 .Pp
384 380 .It Dv VIS_CONSDISPLAY
385 381 Display data on the graphics device.
386 382 The graphics driver is expected to display the data contained in the
387 383 .Vt vis_display
388 384 structure at the specified position on the console.
389 385 .Pp
390 386 The
391 387 .Vt vis_display
392 388 structure contains the following fields:
393 389 .Bd -literal -offset 2n
394 390 struct vis_display {
395 391 screen_pos_t row;
396 392 screen_pos_t col;
397 393 screen_size_t width;
398 394 screen_size_t height;
399 395 uchar_t *data;
400 396 color_t fg_color;
401 397 color_t bg_color;
402 398 };
403 399 .Ed
404 400 .Pp
405 401 .Fa row
406 402 and
407 403 .Fa col
408 404 specify at which starting row and column the date is to be displayed.
409 405 If
410 406 .Fa mode
411 407 in the
412 408 .Dv VIS_DEVINIT
413 409 ioctl was set to
414 410 .Dv VIS_TEXT ,
415 411 .Fa row
416 412 and
417 413 .Fa col
418 414 are defined to be a character offset
419 415 from the starting position of the console device.
420 416 If
421 417 .Fa mode
422 418 in the
423 419 .Dv VIS_DEVINIT
424 420 ioctl was set to
425 421 .Dv VIS_PIXEL ,
426 422 .Fa row
427 423 and
428 424 .Fa col
429 425 are defined to be a pixel offset from the starting position of the console
430 426 device.
431 427 .Pp
432 428 .Fa width
433 429 and
434 430 .Fa height
435 431 specify the size of the
436 432 .Fa data
437 433 to be displayed.
438 434 If
439 435 .Fa mode
440 436 in the
441 437 .Dv VIS_DEVINIT
442 438 ioctl was set to
443 439 .Dv VIS_TEXT ,
444 440 .Fa width
445 441 and
446 442 .Fa height
447 443 define the size of
448 444 .Fa data
449 445 as rectangle that is
450 446 .Fa width
451 447 characters wide and
452 448 .Fa height
453 449 characters high.
454 450 If
455 451 .Fa mode
456 452 in the
457 453 .Dv VIS_DEVINIT
458 454 ioctl was set to
459 455 .Dv VIS_PIXEL ,
460 456 .Fa width
461 457 and
462 458 .Fa height
463 459 define the size of
464 460 .Fa data
465 461 as a rectangle that is
466 462 .Fa width
467 463 pixels wide and
468 464 .Fa height
469 465 pixels high.
470 466 .Pp
471 467 .Fa *data
472 468 is a pointer to the data to be displayed on the console device.
473 469 If
474 470 .Fa mode
475 471 in the
476 472 .Dv VIS_DEVINIT
477 473 ioctl was set to
478 474 .Dv VIS_TEXT ,
479 475 .Fa data
480 476 is an array of
481 477 .Sy ASCII
482 478 characters to be displayed on the console device.
483 479 The driver must break these characters up appropriately and display it in the
484 480 rectangle defined by
485 481 .Fa row ,
486 482 .Fa col ,
487 483 .Fa width ,
488 484 and
489 485 .Fa height .
490 486 If
491 487 .Fa mode
492 488 in the
493 489 .Dv VIS_DEVINIT
494 490 ioctl was set to
495 491 .Dv VIS_PIXEL ,
496 492 .Fa data
497 493 is an array of bitmap data to be displayed on the console device.
498 494 The driver must break this data up appropriately and display it in the retangle
499 495 defined by
500 496 .Fa row ,
501 497 .Fa col ,
502 498 .Fa width ,
503 499 and
504 500 .Fa height .
505 501 .Pp
506 502 The
507 503 .Fa fg_color
508 504 and
509 505 .Fa bg_color
510 506 fields define the foreground and
511 507 background color map indexes to use when displaying the data.
512 508 .Fa fb_color
513 509 is used for
514 510 .Dq on
515 511 pixels and
516 512 .Fa bg_color
517 513 is used for
518 514 .Dq off
519 515 pixels.
520 516 .Pp
521 517 .It Dv VIS_CONSCOPY
522 518 Copy data from one location on the device to another.
523 519 The driver is expected to copy the specified data.
524 520 The source data should not be modified.
525 521 Any modifications to the source data should be as a side effect of the copy
526 522 destination overlapping the copy source.
527 523 .Pp
528 524 The argument is a pointer to a
529 525 .Vt vis_copy
530 526 structure which contains the following fields:
531 527 .Bd -literal -offset 2n
532 528 struct vis_copy {
533 529 screen_pos_t s_row;
534 530 screen_pos_t s_col;
535 531 screen_pos_t e_row;
536 532 screen_pos_t e_col;
537 533 screen_pos_t t_row;
538 534 screen_pos_t t_col;
539 535 short direction;
540 536 };
541 537 .Ed
542 538 .Pp
543 539 .Fa s_row ,
544 540 .Fa s_col ,
545 541 .Fa e_row ,
546 542 and
547 543 .Fa e_col
548 544 define the source rectangle of the copy.
549 545 .Fa s_row
550 546 and
551 547 .Fa s_col
552 548 are the upper left corner of the source rectangle.
553 549 .Fa e_row
554 550 and
555 551 .Fa e_col
556 552 are the lower right corner of the source rectangle.
557 553 If
558 554 .Fa mode
559 555 in the
560 556 .Dv VIS_DEVINIT
561 557 .Fn ioctl
562 558 was set to
563 559 .Dv VIS_TEXT ,
564 560 .Fa s_row ,
565 561 .Fa s_col ,
566 562 .Fa e_row ,
567 563 and
568 564 .Fa e_col
569 565 are defined to be character offsets from the starting position of the console
570 566 device.
571 567 If
572 568 .Fa mode
573 569 in the
574 570 .Dv VIS_DEVINIT
575 571 .Fn ioctl
576 572 was set to
577 573 .Dv VIS_PIXEL ,
578 574 .Fa s_row ,
579 575 .Fa s_col ,
580 576 .Fa e_row ,
581 577 and
582 578 .Fa e_col
583 579 are
584 580 defined to be pixel offsets from the starting position of the console device.
585 581 .Pp
586 582 .Fa t_row
587 583 and
588 584 .Fa t_col
589 585 define the upper left corner of the destination rectangle of the copy.
590 586 The entire rectangle is copied to this location.
591 587 If
592 588 .Fa mode
593 589 in the
594 590 .Dv VIS_DEVINIT
595 591 ioctl was set to
596 592 .Dv VIS_TEXT ,
597 593 .Fa t_row ,
598 594 and
599 595 .Fa t_col
600 596 are defined to be character offsets from the
601 597 starting position of the console device.
↓ open down ↓ |
522 lines elided |
↑ open up ↑ |
602 598 If
603 599 .Fa mode
604 600 in the
605 601 .Dv VIS_DEVINIT
606 602 ioctl was set to
607 603 .Dv VIS_PIXEL ,
608 604 .Fa t_row ,
609 605 and
610 606 .Fa t_col
611 607 are defined to be pixel offsets from the starting position of the
612 -onssole device.
608 +console device.
613 609 .Pp
614 610 .Fa direction
615 611 specifies which way to do the copy.
616 612 If direction is
617 613 .Dv VIS_COPY_FORWARD
618 614 the graphics driver should copy data from position
619 615 .Po
620 616 .Fa s_row ,
621 617 .Fa s_col
622 618 .Pc
623 619 in the source rectangle to position
624 620 .Po
625 621 .Fa t_row ,
626 622 .Fa t_col
627 623 .Pc
628 624 in the destination rectangle.
629 625 If direction is
630 626 .Dv VIS_COPY_BACKWARDS
631 627 the graphics driver should copy data from position
632 628 .Po
633 629 .Fa e_row ,
634 630 .Fa e_col
635 631 .Pc
636 632 in the source rectangle to position
637 633 .Po
638 634 .Fa t_row Ns + Ns
639 635 .Po
640 636 .Fa e_row Ns \- Ns
641 637 .Fa s_row
642 638 .Pc ,
643 639 .Fa t_col Ns + Ns
644 640 .Po
645 641 .Fa e_col Ns \- Ns
646 642 .Fa s_col
647 643 .Pc
648 644 .Pc
649 645 in the destination rectangle.
650 646 .El
651 647 .Ss "Console Standalone Entry Points (Polled I/O Interfaces)"
652 648 Console standalone entry points are necessary only if the driver is
653 649 implementing console-compatible extensions.
654 650 All console vectored standalone
655 651 entry points must be implemented along with all console-related ioctls if the
656 652 console extension is implemented.
657 653 .Bd -literal -offset 2n
658 654 struct vis_polledio {
659 655 struct vis_polledio_arg *arg;
660 656 void (*display)(vis_polledio_arg *, struct vis_consdisplay *);
661 657 void (*copy)(vis_polledio_arg *, struct vis_conscopy *);
662 658 void (*cursor)(vis_polledio_arg *, struct vis_conscursor *);
663 659 };
664 660 .Ed
665 661 .Pp
666 662 The
667 663 .Vt vis_polledio
668 664 structure is passed from the driver to the illumos
669 665 operating environment, conveying the entry point addresses of three functions
670 666 which perform the same operations of their similarly named ioctl counterparts.
671 667 The rendering parameters for each entry point are derived from the same
672 668 structure passed as the respective ioctl.
673 669 See the
674 670 .Sx "Console Optional Ioctls"
675 671 section of this manpage for an explanation of the specific function each of the
676 672 entry points,
↓ open down ↓ |
54 lines elided |
↑ open up ↑ |
677 673 .Fn display ,
678 674 .Fn copy ,
679 675 and
680 676 .Fn cursor
681 677 are required to implement.
682 678 In
683 679 addition to performing the prescribed function of their ioctl counterparts, the
684 680 standalone vectors operate in a special context and must adhere to a strict set
685 681 of rules.
686 682 The polled I/O vectors are called directly whenever the system is
687 -quisced (running in a limited context) and must send output to the display.
683 +quiesced (running in a limited context) and must send output to the display.
688 684 Standalone mode describes the state in which the system is running in
689 685 single-threaded mode and only one processor is active.
690 686 illumos operating
691 687 environment services are stopped, along with all other threads on the system,
692 688 prior to entering any of the polled I/O interfaces.
693 689 The polled I/O vectors are
694 690 called when the system is running in a standalone debugger, when executing the
695 691 PROM monitor (OBP) or when panicking.
696 692 .Pp
697 693 The following restrictions must be observed in the polled I/O functions:
698 694 .Bl -enum -offset indent
699 695 .It
700 696 The driver must not allocate memory.
701 697 .It
702 698 The driver must not wait on mutexes.
703 699 .It
704 700 The driver must not wait for interrupts.
705 701 .It
706 702 The driver must not call any DDI or LDI services.
707 703 .It
708 704 The driver must not call any system services.
709 705 .El
710 706 .Pp
711 707 The system is single-threaded when calling these functions, meaning that all
712 708 other threads are effectively halted.
713 709 Single-threading makes mutexes (which
714 710 cannot be held) easier to deal with, so long as the driver does not disturb any
715 711 shared state.
716 712 See
717 713 .%T Writing Device Drivers
718 714 for more information about implementing polled I/O entry points.
719 715 .Sh SEE ALSO
720 716 .Xr ioctl 2
721 717 .Rs
722 718 .%T Writing Device Drivers
723 719 .Re
724 720 .Sh NOTES
725 721 On SPARC systems, compatible drivers supporting the kernel terminal emulator
726 722 should export the
727 723 .Sy tem-support
728 724 DDI property.
729 725 .Sy tem-support
730 726 indicates that the driver supports the kernel terminal emulator.
731 727 By exporting
732 728 .Sy tem-support
733 729 it's possible to avoid premature handling of an incompatible driver.
734 730 .Bl -tag -width tem-support
735 731 .It Sy tem-support
736 732 This DDI property, set to 1, means driver is compatible with the console
737 733 kernel framebuffer interface.
738 734 .El
↓ open down ↓ |
41 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX