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