xref: /kvmtool/x86/include/asm/bios/vesa.h (revision 23323929011bbb2027c2a5341ab43e9befd75876)
1*23323929SAndre Przywara /* ----------------------------------------------------------------------- *
2*23323929SAndre Przywara  *
3*23323929SAndre Przywara  *   Copyright 1999-2007 H. Peter Anvin - All Rights Reserved
4*23323929SAndre Przywara  *
5*23323929SAndre Przywara  *   This program is free software; you can redistribute it and/or modify
6*23323929SAndre Przywara  *   it under the terms of the GNU General Public License as published by
7*23323929SAndre Przywara  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8*23323929SAndre Przywara  *   Boston MA 02111-1307, USA; either version 2 of the License, or
9*23323929SAndre Przywara  *   (at your option) any later version; incorporated herein by reference.
10*23323929SAndre Przywara  *
11*23323929SAndre Przywara  * ----------------------------------------------------------------------- */
12*23323929SAndre Przywara 
13*23323929SAndre Przywara #ifndef BOOT_VESA_H
14*23323929SAndre Przywara #define BOOT_VESA_H
15*23323929SAndre Przywara 
16*23323929SAndre Przywara typedef struct {
17*23323929SAndre Przywara 	u16 off, seg;
18*23323929SAndre Przywara } far_ptr;
19*23323929SAndre Przywara 
20*23323929SAndre Przywara /* VESA General Information table */
21*23323929SAndre Przywara struct vesa_general_info {
22*23323929SAndre Przywara 	u32 signature;		/* 0 Magic number = "VESA" */
23*23323929SAndre Przywara 	u16 version;		/* 4 */
24*23323929SAndre Przywara 	far_ptr vendor_string;	/* 6 */
25*23323929SAndre Przywara 	u32 capabilities;	/* 10 */
26*23323929SAndre Przywara 	far_ptr video_mode_ptr;	/* 14 */
27*23323929SAndre Przywara 	u16 total_memory;	/* 18 */
28*23323929SAndre Przywara 
29*23323929SAndre Przywara 	u8 reserved[236];	/* 20 */
30*23323929SAndre Przywara } __attribute__ ((packed));
31*23323929SAndre Przywara 
32*23323929SAndre Przywara #define VESA_MAGIC ('V' + ('E' << 8) + ('S' << 16) + ('A' << 24))
33*23323929SAndre Przywara 
34*23323929SAndre Przywara struct vesa_mode_info {
35*23323929SAndre Przywara 	u16 mode_attr;		/* 0 */
36*23323929SAndre Przywara 	u8 win_attr[2];		/* 2 */
37*23323929SAndre Przywara 	u16 win_grain;		/* 4 */
38*23323929SAndre Przywara 	u16 win_size;		/* 6 */
39*23323929SAndre Przywara 	u16 win_seg[2];		/* 8 */
40*23323929SAndre Przywara 	far_ptr win_scheme;	/* 12 */
41*23323929SAndre Przywara 	u16 logical_scan;	/* 16 */
42*23323929SAndre Przywara 
43*23323929SAndre Przywara 	u16 h_res;		/* 18 */
44*23323929SAndre Przywara 	u16 v_res;		/* 20 */
45*23323929SAndre Przywara 	u8 char_width;		/* 22 */
46*23323929SAndre Przywara 	u8 char_height;		/* 23 */
47*23323929SAndre Przywara 	u8 memory_planes;	/* 24 */
48*23323929SAndre Przywara 	u8 bpp;			/* 25 */
49*23323929SAndre Przywara 	u8 banks;		/* 26 */
50*23323929SAndre Przywara 	u8 memory_layout;	/* 27 */
51*23323929SAndre Przywara 	u8 bank_size;		/* 28 */
52*23323929SAndre Przywara 	u8 image_planes;	/* 29 */
53*23323929SAndre Przywara 	u8 page_function;	/* 30 */
54*23323929SAndre Przywara 
55*23323929SAndre Przywara 	u8 rmask;		/* 31 */
56*23323929SAndre Przywara 	u8 rpos;		/* 32 */
57*23323929SAndre Przywara 	u8 gmask;		/* 33 */
58*23323929SAndre Przywara 	u8 gpos;		/* 34 */
59*23323929SAndre Przywara 	u8 bmask;		/* 35 */
60*23323929SAndre Przywara 	u8 bpos;		/* 36 */
61*23323929SAndre Przywara 	u8 resv_mask;		/* 37 */
62*23323929SAndre Przywara 	u8 resv_pos;		/* 38 */
63*23323929SAndre Przywara 	u8 dcm_info;		/* 39 */
64*23323929SAndre Przywara 
65*23323929SAndre Przywara 	u32 lfb_ptr;		/* 40 Linear frame buffer address */
66*23323929SAndre Przywara 	u32 offscreen_ptr;	/* 44 Offscreen memory address */
67*23323929SAndre Przywara 	u16 offscreen_size;	/* 48 */
68*23323929SAndre Przywara 
69*23323929SAndre Przywara 	u8 reserved[206];	/* 50 */
70*23323929SAndre Przywara } __attribute__ ((packed));
71*23323929SAndre Przywara 
72*23323929SAndre Przywara #endif				/* LIB_SYS_VESA_H */
73