This source file includes following definitions.
- in_idx
- out_idx
- tst_idx
1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef BOOT_VIDEO_H
14 #define BOOT_VIDEO_H
15
16 #include <linux/types.h>
17
18
19
20
21
22
23
24
25
26
27 #define VIDEO_FIRST_MENU 0x0000
28
29
30 #define VIDEO_FIRST_BIOS 0x0100
31
32
33 #define VIDEO_FIRST_VESA 0x0200
34
35
36 #define VIDEO_FIRST_V7 0x0900
37
38
39 #define VIDEO_FIRST_SPECIAL 0x0f00
40 #define VIDEO_80x25 0x0f00
41 #define VIDEO_8POINT 0x0f01
42 #define VIDEO_80x43 0x0f02
43 #define VIDEO_80x28 0x0f03
44 #define VIDEO_CURRENT_MODE 0x0f04
45 #define VIDEO_80x30 0x0f05
46 #define VIDEO_80x34 0x0f06
47 #define VIDEO_80x60 0x0f07
48 #define VIDEO_GFX_HACK 0x0f08
49 #define VIDEO_LAST_SPECIAL 0x0f09
50
51
52 #define VIDEO_FIRST_RESOLUTION 0x1000
53
54
55 #define VIDEO_RECALC 0x8000
56
57 void store_screen(void);
58 #define DO_STORE() store_screen()
59
60
61
62
63
64 struct mode_info {
65 u16 mode;
66 u16 x, y;
67 u16 depth;
68 };
69
70 struct card_info {
71 const char *card_name;
72 int (*set_mode)(struct mode_info *mode);
73 int (*probe)(void);
74 struct mode_info *modes;
75 int nmodes;
76 int unsafe;
77 u16 xmode_first;
78 u16 xmode_n;
79 };
80
81 #define __videocard struct card_info __attribute__((used,section(".videocards")))
82 extern struct card_info video_cards[], video_cards_end[];
83
84 int mode_defined(u16 mode);
85
86
87 #define ADAPTER_CGA 0
88 #define ADAPTER_EGA 1
89 #define ADAPTER_VGA 2
90
91 extern int adapter;
92 extern int force_x, force_y;
93 extern int do_restore;
94 extern int graphic_mode;
95
96
97 static inline u8 in_idx(u16 port, u8 index)
98 {
99 outb(index, port);
100 return inb(port+1);
101 }
102
103 static inline void out_idx(u8 v, u16 port, u8 index)
104 {
105 outw(index+(v << 8), port);
106 }
107
108
109 static inline u8 tst_idx(u8 v, u16 port, u8 index)
110 {
111 out_idx(port, index, v);
112 return in_idx(port, index);
113 }
114
115
116 u16 vga_crtc(void);
117
118 #endif