xref: /xnu-10063.121.3/osfmk/console/video_console.h (revision 2c2f96dc2b9a4408a43d3150ae9c105355ca3daa)
1*2c2f96dcSApple OSS Distributions /*
2*2c2f96dcSApple OSS Distributions  * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
3*2c2f96dcSApple OSS Distributions  *
4*2c2f96dcSApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5*2c2f96dcSApple OSS Distributions  *
6*2c2f96dcSApple OSS Distributions  * This file contains Original Code and/or Modifications of Original Code
7*2c2f96dcSApple OSS Distributions  * as defined in and that are subject to the Apple Public Source License
8*2c2f96dcSApple OSS Distributions  * Version 2.0 (the 'License'). You may not use this file except in
9*2c2f96dcSApple OSS Distributions  * compliance with the License. The rights granted to you under the License
10*2c2f96dcSApple OSS Distributions  * may not be used to create, or enable the creation or redistribution of,
11*2c2f96dcSApple OSS Distributions  * unlawful or unlicensed copies of an Apple operating system, or to
12*2c2f96dcSApple OSS Distributions  * circumvent, violate, or enable the circumvention or violation of, any
13*2c2f96dcSApple OSS Distributions  * terms of an Apple operating system software license agreement.
14*2c2f96dcSApple OSS Distributions  *
15*2c2f96dcSApple OSS Distributions  * Please obtain a copy of the License at
16*2c2f96dcSApple OSS Distributions  * http://www.opensource.apple.com/apsl/ and read it before using this file.
17*2c2f96dcSApple OSS Distributions  *
18*2c2f96dcSApple OSS Distributions  * The Original Code and all software distributed under the License are
19*2c2f96dcSApple OSS Distributions  * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20*2c2f96dcSApple OSS Distributions  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21*2c2f96dcSApple OSS Distributions  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22*2c2f96dcSApple OSS Distributions  * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23*2c2f96dcSApple OSS Distributions  * Please see the License for the specific language governing rights and
24*2c2f96dcSApple OSS Distributions  * limitations under the License.
25*2c2f96dcSApple OSS Distributions  *
26*2c2f96dcSApple OSS Distributions  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27*2c2f96dcSApple OSS Distributions  */
28*2c2f96dcSApple OSS Distributions /*
29*2c2f96dcSApple OSS Distributions  * @OSF_COPYRIGHT@
30*2c2f96dcSApple OSS Distributions  */
31*2c2f96dcSApple OSS Distributions /*
32*2c2f96dcSApple OSS Distributions  * @APPLE_FREE_COPYRIGHT@
33*2c2f96dcSApple OSS Distributions  */
34*2c2f96dcSApple OSS Distributions 
35*2c2f96dcSApple OSS Distributions #ifndef _VIDEO_CONSOLE_H_
36*2c2f96dcSApple OSS Distributions #define _VIDEO_CONSOLE_H_
37*2c2f96dcSApple OSS Distributions 
38*2c2f96dcSApple OSS Distributions #include <device/device_types.h>
39*2c2f96dcSApple OSS Distributions 
40*2c2f96dcSApple OSS Distributions #ifdef __cplusplus
41*2c2f96dcSApple OSS Distributions extern "C" {
42*2c2f96dcSApple OSS Distributions #endif
43*2c2f96dcSApple OSS Distributions 
44*2c2f96dcSApple OSS Distributions #define kVCSysctlProgressOptions      "kern.progressoptions"
45*2c2f96dcSApple OSS Distributions #define kVCSysctlConsoleOptions       "kern.consoleoptions"
46*2c2f96dcSApple OSS Distributions #define kVCSysctlProgressMeterEnable  "kern.progressmeterenable"
47*2c2f96dcSApple OSS Distributions #define kVCSysctlProgressMeter        "kern.progressmeter"
48*2c2f96dcSApple OSS Distributions 
49*2c2f96dcSApple OSS Distributions enum{
50*2c2f96dcSApple OSS Distributions 	kVCDarkReboot       = 0x00000001,
51*2c2f96dcSApple OSS Distributions 	kVCAcquireImmediate = 0x00000002,
52*2c2f96dcSApple OSS Distributions 	kVCUsePosition      = 0x00000004,
53*2c2f96dcSApple OSS Distributions 	kVCDarkBackground   = 0x00000008,
54*2c2f96dcSApple OSS Distributions 	kVCLightBackground  = 0x00000010,
55*2c2f96dcSApple OSS Distributions };
56*2c2f96dcSApple OSS Distributions 
57*2c2f96dcSApple OSS Distributions enum {
58*2c2f96dcSApple OSS Distributions 	kDataRotate0   = 0,
59*2c2f96dcSApple OSS Distributions 	kDataRotate90  = 1,
60*2c2f96dcSApple OSS Distributions 	kDataRotate180 = 2,
61*2c2f96dcSApple OSS Distributions 	kDataRotate270 = 3
62*2c2f96dcSApple OSS Distributions };
63*2c2f96dcSApple OSS Distributions 
64*2c2f96dcSApple OSS Distributions struct vc_progress_user_options {
65*2c2f96dcSApple OSS Distributions 	uint32_t options;
66*2c2f96dcSApple OSS Distributions 	// fractional position of middle of spinner 0 (0.0) - 0xFFFFFFFF (1.0)
67*2c2f96dcSApple OSS Distributions 	uint32_t x_pos;
68*2c2f96dcSApple OSS Distributions 	uint32_t y_pos;
69*2c2f96dcSApple OSS Distributions 	uint32_t resv[8];
70*2c2f96dcSApple OSS Distributions };
71*2c2f96dcSApple OSS Distributions typedef struct vc_progress_user_options vc_progress_user_options;
72*2c2f96dcSApple OSS Distributions 
73*2c2f96dcSApple OSS Distributions 
74*2c2f96dcSApple OSS Distributions #if XNU_KERNEL_PRIVATE
75*2c2f96dcSApple OSS Distributions 
76*2c2f96dcSApple OSS Distributions void vcputc(char);
77*2c2f96dcSApple OSS Distributions void vcputc_options(char, bool);
78*2c2f96dcSApple OSS Distributions 
79*2c2f96dcSApple OSS Distributions void video_scroll_up(   void    *start,
80*2c2f96dcSApple OSS Distributions     void    *end,
81*2c2f96dcSApple OSS Distributions     void    *dest );
82*2c2f96dcSApple OSS Distributions 
83*2c2f96dcSApple OSS Distributions void video_scroll_down( void    *start,  /* HIGH addr */
84*2c2f96dcSApple OSS Distributions     void    *end,                        /* LOW addr */
85*2c2f96dcSApple OSS Distributions     void    *dest );                     /* HIGH addr */
86*2c2f96dcSApple OSS Distributions 
87*2c2f96dcSApple OSS Distributions struct vc_info {
88*2c2f96dcSApple OSS Distributions 	unsigned int    v_height;       /* pixels */
89*2c2f96dcSApple OSS Distributions 	unsigned int    v_width;        /* pixels */
90*2c2f96dcSApple OSS Distributions 	unsigned int    v_depth;
91*2c2f96dcSApple OSS Distributions 	unsigned int    v_rowbytes;
92*2c2f96dcSApple OSS Distributions 	unsigned long   v_baseaddr;
93*2c2f96dcSApple OSS Distributions 	unsigned int    v_type;
94*2c2f96dcSApple OSS Distributions 	char            v_name[32];
95*2c2f96dcSApple OSS Distributions 	uint64_t        v_physaddr;
96*2c2f96dcSApple OSS Distributions 	unsigned int    v_rows;         /* characters */
97*2c2f96dcSApple OSS Distributions 	unsigned int    v_columns;      /* characters */
98*2c2f96dcSApple OSS Distributions 	unsigned int    v_rowscanbytes; /* Actualy number of bytes used for display per row*/
99*2c2f96dcSApple OSS Distributions 	unsigned int    v_scale;
100*2c2f96dcSApple OSS Distributions 	unsigned int    v_rotate;
101*2c2f96dcSApple OSS Distributions 	unsigned int    v_reserved[3];
102*2c2f96dcSApple OSS Distributions };
103*2c2f96dcSApple OSS Distributions 
104*2c2f96dcSApple OSS Distributions struct vc_progress_element {
105*2c2f96dcSApple OSS Distributions 	unsigned int        version;
106*2c2f96dcSApple OSS Distributions 	unsigned int        flags;
107*2c2f96dcSApple OSS Distributions 	unsigned int        time;
108*2c2f96dcSApple OSS Distributions 	unsigned char       count;
109*2c2f96dcSApple OSS Distributions 	unsigned char       res[3];
110*2c2f96dcSApple OSS Distributions 	int                 width;
111*2c2f96dcSApple OSS Distributions 	int                 height;
112*2c2f96dcSApple OSS Distributions 	int                 dx;
113*2c2f96dcSApple OSS Distributions 	int                 dy;
114*2c2f96dcSApple OSS Distributions 	int                 transparent;
115*2c2f96dcSApple OSS Distributions 	unsigned int        res2[3];
116*2c2f96dcSApple OSS Distributions };
117*2c2f96dcSApple OSS Distributions typedef struct vc_progress_element vc_progress_element;
118*2c2f96dcSApple OSS Distributions 
119*2c2f96dcSApple OSS Distributions extern struct vc_progress_user_options vc_user_options;
120*2c2f96dcSApple OSS Distributions 
121*2c2f96dcSApple OSS Distributions void vc_progress_initialize( vc_progress_element * desc,
122*2c2f96dcSApple OSS Distributions     const unsigned char * data1x,
123*2c2f96dcSApple OSS Distributions     const unsigned char * data2x,
124*2c2f96dcSApple OSS Distributions     const unsigned char * data3x,
125*2c2f96dcSApple OSS Distributions     const unsigned char * clut );
126*2c2f96dcSApple OSS Distributions 
127*2c2f96dcSApple OSS Distributions void vc_progress_set(boolean_t enable, uint32_t vc_delay);
128*2c2f96dcSApple OSS Distributions 
129*2c2f96dcSApple OSS Distributions void vc_display_icon( vc_progress_element * desc, const unsigned char * data );
130*2c2f96dcSApple OSS Distributions 
131*2c2f96dcSApple OSS Distributions int vc_display_lzss_icon(uint32_t dst_x, uint32_t dst_y,
132*2c2f96dcSApple OSS Distributions     uint32_t image_width, uint32_t image_height,
133*2c2f96dcSApple OSS Distributions     const uint8_t *compressed_image,
134*2c2f96dcSApple OSS Distributions     uint32_t       compressed_size,
135*2c2f96dcSApple OSS Distributions     const uint8_t *clut);
136*2c2f96dcSApple OSS Distributions 
137*2c2f96dcSApple OSS Distributions #if defined(XNU_TARGET_OS_OSX)
138*2c2f96dcSApple OSS Distributions 
139*2c2f96dcSApple OSS Distributions extern void vc_enable_progressmeter(int new_value);
140*2c2f96dcSApple OSS Distributions extern void vc_set_progressmeter(int new_value);
141*2c2f96dcSApple OSS Distributions extern int vc_progressmeter_enable;
142*2c2f96dcSApple OSS Distributions extern int vc_progressmeter_value;
143*2c2f96dcSApple OSS Distributions extern void vc_progress_setdiskspeed(uint32_t speed);
144*2c2f96dcSApple OSS Distributions 
145*2c2f96dcSApple OSS Distributions #endif /* defined(XNU_TARGET_OS_OSX) */
146*2c2f96dcSApple OSS Distributions 
147*2c2f96dcSApple OSS Distributions #endif /* XNU_KERNEL_PRIVATE */
148*2c2f96dcSApple OSS Distributions 
149*2c2f96dcSApple OSS Distributions #ifdef __cplusplus
150*2c2f96dcSApple OSS Distributions }
151*2c2f96dcSApple OSS Distributions #endif
152*2c2f96dcSApple OSS Distributions 
153*2c2f96dcSApple OSS Distributions #endif /* _VIDEO_CONSOLE_H_ */
154