]> git.saurik.com Git - apple/xnu.git/blob - bsd/dev/kmreg_com.h
d19bc2f20c4f7fe8030650c36cbc1cdbd76033a6
[apple/xnu.git] / bsd / dev / kmreg_com.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /* Copyright (c) 1992 NeXT Computer, Inc. All rights reserved.
24 *
25 * kmreg_com.h - machine independent km ioctl interface.
26 *
27 * HISTORY
28 * 16-Jan-92 Doug Mitchell at NeXT
29 * Created.
30 */
31
32 #ifdef KERNEL_PRIVATE
33
34 #ifndef _BSD_DEV_KMREG_COM_
35 #define _BSD_DEV_KMREG_COM_
36
37 #include <sys/types.h>
38 #include <sys/ioctl.h>
39
40 /*
41 * Colors for fg, bg in struct km_drawrect
42 */
43 #define KM_COLOR_WHITE 0
44 #define KM_COLOR_LTGRAY 1
45 #define KM_COLOR_DKGRAY 2
46 #define KM_COLOR_BLACK 3
47
48 /*
49 * The data to be rendered is treated as a pixmap of 2 bit pixels.
50 * The most significant bits of each byte is the leftmost pixel in that
51 * byte. Pixel values are assigned as described above.
52 *
53 * Each scanline should start on a 4 pixel boundry within the bitmap,
54 * and should be a multiple of 4 pixels in length.
55 *
56 * For the KMIOCERASERECT call, 'data' should be an integer set to the
57 * color to be used for the clear operation (data.fill).
58 * A rect at (x,y) measuring 'width' by 'height' will be cleared to
59 * the specified value.
60 */
61 struct km_drawrect {
62 unsigned short x; /* Upper left corner of rect to be imaged. */
63 unsigned short y;
64 unsigned short width; /* Width and height of rect to be imaged,
65 * in pixels */
66 unsigned short height;
67 union {
68 void *bits; /* Pointer to 2 bit per pixel raster data. */
69 int fill; /* Const color for erase operation. */
70 } data;
71 };
72
73 /*
74 * Argument to KMIOCANIMCTL.
75 */
76 typedef enum {
77 KM_ANIM_STOP, /* stop permanently */
78 KM_ANIM_SUSPEND, /* suspend */
79 KM_ANIM_RESUME /* resume */
80 } km_anim_ctl_t;
81
82 #define KMIOCPOPUP _IO('k', 1) /* popup new window */
83 #define KMIOCRESTORE _IO('k', 2) /* restore background */
84 #define KMIOCDUMPLOG _IO('k', 3) /* dump message log */
85 #define KMIOCDRAWRECT _IOW('k', 5, struct km_drawrect) /* Draw rect from
86 * bits */
87 #define KMIOCERASERECT _IOW('k', 6, struct km_drawrect) /* Erase a rect */
88
89 #ifdef KERNEL_PRIVATE
90 #define KMIOCDISABLCONS _IO('k', 8) /* disable console messages */
91 #endif /* KERNEL_PRIVATE */
92
93 #define KMIOCANIMCTL _IOW('k',9, km_anim_ctl_t)
94 /* stop animation */
95 #define KMIOCSTATUS _IOR('k',10, int) /* get status bits */
96 #define KMIOCSIZE _IOR('k',11, struct winsize) /* get screen size */
97
98 /*
99 * Status bits returned via KMIOCSTATUS.
100 */
101 #define KMS_SEE_MSGS 0x00000001
102
103 #endif /* _BSD_DEV_KMREG_COM_ */
104
105 #endif /* KERNEL_PRIVATE */