diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2007-10-21 20:56:19 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2007-10-23 01:49:47 -0400 |
commit | ee8e7cfe9d330d6f1ce0b9b1620d6df5d9cf6b70 (patch) | |
tree | a9534bac7060e546c0c3e6ea34d0469d8903bf0e /include/linux | |
parent | 9525ca0286afd54a5cd69d9ded741b4df8d0c554 (diff) |
Make asm-x86/bootparam.h includable from userspace.
To actually write a bootloader (or, say, the lguest launcher)
currently requires duplication of these structures. Making them
includable from userspace is much nicer.
We merge the common userspace-required definitions of e820_32/64.h
into e820.h for export.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/Kbuild | 2 | ||||
-rw-r--r-- | include/linux/apm_bios.h | 30 | ||||
-rw-r--r-- | include/linux/edd.h | 137 | ||||
-rw-r--r-- | include/linux/screen_info.h | 81 |
4 files changed, 132 insertions, 118 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index e3ffd14a3f0b..758834538a19 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -186,6 +186,7 @@ unifdef-y += cyclades.h | |||
186 | unifdef-y += dccp.h | 186 | unifdef-y += dccp.h |
187 | unifdef-y += dirent.h | 187 | unifdef-y += dirent.h |
188 | unifdef-y += dlm.h | 188 | unifdef-y += dlm.h |
189 | unifdef-y += edd.h | ||
189 | unifdef-y += elfcore.h | 190 | unifdef-y += elfcore.h |
190 | unifdef-y += errno.h | 191 | unifdef-y += errno.h |
191 | unifdef-y += errqueue.h | 192 | unifdef-y += errqueue.h |
@@ -306,6 +307,7 @@ unifdef-y += rtc.h | |||
306 | unifdef-y += rtnetlink.h | 307 | unifdef-y += rtnetlink.h |
307 | unifdef-y += scc.h | 308 | unifdef-y += scc.h |
308 | unifdef-y += sched.h | 309 | unifdef-y += sched.h |
310 | unifdef-y += screen_info.h | ||
309 | unifdef-y += sdla.h | 311 | unifdef-y += sdla.h |
310 | unifdef-y += selinux_netlink.h | 312 | unifdef-y += selinux_netlink.h |
311 | unifdef-y += sem.h | 313 | unifdef-y += sem.h |
diff --git a/include/linux/apm_bios.h b/include/linux/apm_bios.h index 5f921c84827a..9754baa14921 100644 --- a/include/linux/apm_bios.h +++ b/include/linux/apm_bios.h | |||
@@ -16,29 +16,29 @@ | |||
16 | * General Public License for more details. | 16 | * General Public License for more details. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | typedef unsigned short apm_event_t; | 19 | #include <linux/types.h> |
20 | typedef unsigned short apm_eventinfo_t; | 20 | |
21 | struct apm_bios_info { | ||
22 | __u16 version; | ||
23 | __u16 cseg; | ||
24 | __u32 offset; | ||
25 | __u16 cseg_16; | ||
26 | __u16 dseg; | ||
27 | __u16 flags; | ||
28 | __u16 cseg_len; | ||
29 | __u16 cseg_16_len; | ||
30 | __u16 dseg_len; | ||
31 | }; | ||
21 | 32 | ||
22 | #ifdef __KERNEL__ | 33 | #ifdef __KERNEL__ |
23 | 34 | ||
24 | #include <linux/types.h> | 35 | typedef unsigned short apm_event_t; |
36 | typedef unsigned short apm_eventinfo_t; | ||
25 | 37 | ||
26 | #define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) | 38 | #define APM_CS (GDT_ENTRY_APMBIOS_BASE * 8) |
27 | #define APM_CS_16 (APM_CS + 8) | 39 | #define APM_CS_16 (APM_CS + 8) |
28 | #define APM_DS (APM_CS_16 + 8) | 40 | #define APM_DS (APM_CS_16 + 8) |
29 | 41 | ||
30 | struct apm_bios_info { | ||
31 | u16 version; | ||
32 | u16 cseg; | ||
33 | u32 offset; | ||
34 | u16 cseg_16; | ||
35 | u16 dseg; | ||
36 | u16 flags; | ||
37 | u16 cseg_len; | ||
38 | u16 cseg_16_len; | ||
39 | u16 dseg_len; | ||
40 | }; | ||
41 | |||
42 | /* Results of APM Installation Check */ | 42 | /* Results of APM Installation Check */ |
43 | #define APM_16_BIT_SUPPORT 0x0001 | 43 | #define APM_16_BIT_SUPPORT 0x0001 |
44 | #define APM_32_BIT_SUPPORT 0x0002 | 44 | #define APM_32_BIT_SUPPORT 0x0002 |
diff --git a/include/linux/edd.h b/include/linux/edd.h index 7b647822d6dc..5d747c5cd0fe 100644 --- a/include/linux/edd.h +++ b/include/linux/edd.h | |||
@@ -67,113 +67,113 @@ | |||
67 | #define EDD_INFO_USE_INT13_FN50 (1 << 7) | 67 | #define EDD_INFO_USE_INT13_FN50 (1 << 7) |
68 | 68 | ||
69 | struct edd_device_params { | 69 | struct edd_device_params { |
70 | u16 length; | 70 | __u16 length; |
71 | u16 info_flags; | 71 | __u16 info_flags; |
72 | u32 num_default_cylinders; | 72 | __u32 num_default_cylinders; |
73 | u32 num_default_heads; | 73 | __u32 num_default_heads; |
74 | u32 sectors_per_track; | 74 | __u32 sectors_per_track; |
75 | u64 number_of_sectors; | 75 | __u64 number_of_sectors; |
76 | u16 bytes_per_sector; | 76 | __u16 bytes_per_sector; |
77 | u32 dpte_ptr; /* 0xFFFFFFFF for our purposes */ | 77 | __u32 dpte_ptr; /* 0xFFFFFFFF for our purposes */ |
78 | u16 key; /* = 0xBEDD */ | 78 | __u16 key; /* = 0xBEDD */ |
79 | u8 device_path_info_length; /* = 44 */ | 79 | __u8 device_path_info_length; /* = 44 */ |
80 | u8 reserved2; | 80 | __u8 reserved2; |
81 | u16 reserved3; | 81 | __u16 reserved3; |
82 | u8 host_bus_type[4]; | 82 | __u8 host_bus_type[4]; |
83 | u8 interface_type[8]; | 83 | __u8 interface_type[8]; |
84 | union { | 84 | union { |
85 | struct { | 85 | struct { |
86 | u16 base_address; | 86 | __u16 base_address; |
87 | u16 reserved1; | 87 | __u16 reserved1; |
88 | u32 reserved2; | 88 | __u32 reserved2; |
89 | } __attribute__ ((packed)) isa; | 89 | } __attribute__ ((packed)) isa; |
90 | struct { | 90 | struct { |
91 | u8 bus; | 91 | __u8 bus; |
92 | u8 slot; | 92 | __u8 slot; |
93 | u8 function; | 93 | __u8 function; |
94 | u8 channel; | 94 | __u8 channel; |
95 | u32 reserved; | 95 | __u32 reserved; |
96 | } __attribute__ ((packed)) pci; | 96 | } __attribute__ ((packed)) pci; |
97 | /* pcix is same as pci */ | 97 | /* pcix is same as pci */ |
98 | struct { | 98 | struct { |
99 | u64 reserved; | 99 | __u64 reserved; |
100 | } __attribute__ ((packed)) ibnd; | 100 | } __attribute__ ((packed)) ibnd; |
101 | struct { | 101 | struct { |
102 | u64 reserved; | 102 | __u64 reserved; |
103 | } __attribute__ ((packed)) xprs; | 103 | } __attribute__ ((packed)) xprs; |
104 | struct { | 104 | struct { |
105 | u64 reserved; | 105 | __u64 reserved; |
106 | } __attribute__ ((packed)) htpt; | 106 | } __attribute__ ((packed)) htpt; |
107 | struct { | 107 | struct { |
108 | u64 reserved; | 108 | __u64 reserved; |
109 | } __attribute__ ((packed)) unknown; | 109 | } __attribute__ ((packed)) unknown; |
110 | } interface_path; | 110 | } interface_path; |
111 | union { | 111 | union { |
112 | struct { | 112 | struct { |
113 | u8 device; | 113 | __u8 device; |
114 | u8 reserved1; | 114 | __u8 reserved1; |
115 | u16 reserved2; | 115 | __u16 reserved2; |
116 | u32 reserved3; | 116 | __u32 reserved3; |
117 | u64 reserved4; | 117 | __u64 reserved4; |
118 | } __attribute__ ((packed)) ata; | 118 | } __attribute__ ((packed)) ata; |
119 | struct { | 119 | struct { |
120 | u8 device; | 120 | __u8 device; |
121 | u8 lun; | 121 | __u8 lun; |
122 | u8 reserved1; | 122 | __u8 reserved1; |
123 | u8 reserved2; | 123 | __u8 reserved2; |
124 | u32 reserved3; | 124 | __u32 reserved3; |
125 | u64 reserved4; | 125 | __u64 reserved4; |
126 | } __attribute__ ((packed)) atapi; | 126 | } __attribute__ ((packed)) atapi; |
127 | struct { | 127 | struct { |
128 | u16 id; | 128 | __u16 id; |
129 | u64 lun; | 129 | __u64 lun; |
130 | u16 reserved1; | 130 | __u16 reserved1; |
131 | u32 reserved2; | 131 | __u32 reserved2; |
132 | } __attribute__ ((packed)) scsi; | 132 | } __attribute__ ((packed)) scsi; |
133 | struct { | 133 | struct { |
134 | u64 serial_number; | 134 | __u64 serial_number; |
135 | u64 reserved; | 135 | __u64 reserved; |
136 | } __attribute__ ((packed)) usb; | 136 | } __attribute__ ((packed)) usb; |
137 | struct { | 137 | struct { |
138 | u64 eui; | 138 | __u64 eui; |
139 | u64 reserved; | 139 | __u64 reserved; |
140 | } __attribute__ ((packed)) i1394; | 140 | } __attribute__ ((packed)) i1394; |
141 | struct { | 141 | struct { |
142 | u64 wwid; | 142 | __u64 wwid; |
143 | u64 lun; | 143 | __u64 lun; |
144 | } __attribute__ ((packed)) fibre; | 144 | } __attribute__ ((packed)) fibre; |
145 | struct { | 145 | struct { |
146 | u64 identity_tag; | 146 | __u64 identity_tag; |
147 | u64 reserved; | 147 | __u64 reserved; |
148 | } __attribute__ ((packed)) i2o; | 148 | } __attribute__ ((packed)) i2o; |
149 | struct { | 149 | struct { |
150 | u32 array_number; | 150 | __u32 array_number; |
151 | u32 reserved1; | 151 | __u32 reserved1; |
152 | u64 reserved2; | 152 | __u64 reserved2; |
153 | } __attribute__ ((packed)) raid; | 153 | } __attribute__ ((packed)) raid; |
154 | struct { | 154 | struct { |
155 | u8 device; | 155 | __u8 device; |
156 | u8 reserved1; | 156 | __u8 reserved1; |
157 | u16 reserved2; | 157 | __u16 reserved2; |
158 | u32 reserved3; | 158 | __u32 reserved3; |
159 | u64 reserved4; | 159 | __u64 reserved4; |
160 | } __attribute__ ((packed)) sata; | 160 | } __attribute__ ((packed)) sata; |
161 | struct { | 161 | struct { |
162 | u64 reserved1; | 162 | __u64 reserved1; |
163 | u64 reserved2; | 163 | __u64 reserved2; |
164 | } __attribute__ ((packed)) unknown; | 164 | } __attribute__ ((packed)) unknown; |
165 | } device_path; | 165 | } device_path; |
166 | u8 reserved4; | 166 | __u8 reserved4; |
167 | u8 checksum; | 167 | __u8 checksum; |
168 | } __attribute__ ((packed)); | 168 | } __attribute__ ((packed)); |
169 | 169 | ||
170 | struct edd_info { | 170 | struct edd_info { |
171 | u8 device; | 171 | __u8 device; |
172 | u8 version; | 172 | __u8 version; |
173 | u16 interface_support; | 173 | __u16 interface_support; |
174 | u16 legacy_max_cylinder; | 174 | __u16 legacy_max_cylinder; |
175 | u8 legacy_max_head; | 175 | __u8 legacy_max_head; |
176 | u8 legacy_sectors_per_track; | 176 | __u8 legacy_sectors_per_track; |
177 | struct edd_device_params params; | 177 | struct edd_device_params params; |
178 | } __attribute__ ((packed)); | 178 | } __attribute__ ((packed)); |
179 | 179 | ||
@@ -184,8 +184,9 @@ struct edd { | |||
184 | unsigned char edd_info_nr; | 184 | unsigned char edd_info_nr; |
185 | }; | 185 | }; |
186 | 186 | ||
187 | #ifdef __KERNEL__ | ||
187 | extern struct edd edd; | 188 | extern struct edd edd; |
188 | 189 | #endif /* __KERNEL__ */ | |
189 | #endif /*!__ASSEMBLY__ */ | 190 | #endif /*!__ASSEMBLY__ */ |
190 | 191 | ||
191 | #endif /* _LINUX_EDD_H */ | 192 | #endif /* _LINUX_EDD_H */ |
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h index ba81ffe9958a..827b85bbf388 100644 --- a/include/linux/screen_info.h +++ b/include/linux/screen_info.h | |||
@@ -8,45 +8,43 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | struct screen_info { | 10 | struct screen_info { |
11 | u8 orig_x; /* 0x00 */ | 11 | __u8 orig_x; /* 0x00 */ |
12 | u8 orig_y; /* 0x01 */ | 12 | __u8 orig_y; /* 0x01 */ |
13 | u16 ext_mem_k; /* 0x02 */ | 13 | __u16 ext_mem_k; /* 0x02 */ |
14 | u16 orig_video_page; /* 0x04 */ | 14 | __u16 orig_video_page; /* 0x04 */ |
15 | u8 orig_video_mode; /* 0x06 */ | 15 | __u8 orig_video_mode; /* 0x06 */ |
16 | u8 orig_video_cols; /* 0x07 */ | 16 | __u8 orig_video_cols; /* 0x07 */ |
17 | u16 unused2; /* 0x08 */ | 17 | __u16 unused2; /* 0x08 */ |
18 | u16 orig_video_ega_bx; /* 0x0a */ | 18 | __u16 orig_video_ega_bx;/* 0x0a */ |
19 | u16 unused3; /* 0x0c */ | 19 | __u16 unused3; /* 0x0c */ |
20 | u8 orig_video_lines; /* 0x0e */ | 20 | __u8 orig_video_lines; /* 0x0e */ |
21 | u8 orig_video_isVGA; /* 0x0f */ | 21 | __u8 orig_video_isVGA; /* 0x0f */ |
22 | u16 orig_video_points; /* 0x10 */ | 22 | __u16 orig_video_points;/* 0x10 */ |
23 | 23 | ||
24 | /* VESA graphic mode -- linear frame buffer */ | 24 | /* VESA graphic mode -- linear frame buffer */ |
25 | u16 lfb_width; /* 0x12 */ | 25 | __u16 lfb_width; /* 0x12 */ |
26 | u16 lfb_height; /* 0x14 */ | 26 | __u16 lfb_height; /* 0x14 */ |
27 | u16 lfb_depth; /* 0x16 */ | 27 | __u16 lfb_depth; /* 0x16 */ |
28 | u32 lfb_base; /* 0x18 */ | 28 | __u32 lfb_base; /* 0x18 */ |
29 | u32 lfb_size; /* 0x1c */ | 29 | __u32 lfb_size; /* 0x1c */ |
30 | u16 cl_magic, cl_offset; /* 0x20 */ | 30 | __u16 cl_magic, cl_offset; /* 0x20 */ |
31 | u16 lfb_linelength; /* 0x24 */ | 31 | __u16 lfb_linelength; /* 0x24 */ |
32 | u8 red_size; /* 0x26 */ | 32 | __u8 red_size; /* 0x26 */ |
33 | u8 red_pos; /* 0x27 */ | 33 | __u8 red_pos; /* 0x27 */ |
34 | u8 green_size; /* 0x28 */ | 34 | __u8 green_size; /* 0x28 */ |
35 | u8 green_pos; /* 0x29 */ | 35 | __u8 green_pos; /* 0x29 */ |
36 | u8 blue_size; /* 0x2a */ | 36 | __u8 blue_size; /* 0x2a */ |
37 | u8 blue_pos; /* 0x2b */ | 37 | __u8 blue_pos; /* 0x2b */ |
38 | u8 rsvd_size; /* 0x2c */ | 38 | __u8 rsvd_size; /* 0x2c */ |
39 | u8 rsvd_pos; /* 0x2d */ | 39 | __u8 rsvd_pos; /* 0x2d */ |
40 | u16 vesapm_seg; /* 0x2e */ | 40 | __u16 vesapm_seg; /* 0x2e */ |
41 | u16 vesapm_off; /* 0x30 */ | 41 | __u16 vesapm_off; /* 0x30 */ |
42 | u16 pages; /* 0x32 */ | 42 | __u16 pages; /* 0x32 */ |
43 | u16 vesa_attributes; /* 0x34 */ | 43 | __u16 vesa_attributes; /* 0x34 */ |
44 | u32 capabilities; /* 0x36 */ | 44 | __u32 capabilities; /* 0x36 */ |
45 | u8 _reserved[6]; /* 0x3a */ | 45 | __u8 _reserved[6]; /* 0x3a */ |
46 | } __attribute__((packed)); | 46 | } __attribute__((packed)); |
47 | 47 | ||
48 | extern struct screen_info screen_info; | ||
49 | |||
50 | #define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ | 48 | #define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ |
51 | #define VIDEO_TYPE_CGA 0x11 /* CGA Display */ | 49 | #define VIDEO_TYPE_CGA 0x11 /* CGA Display */ |
52 | #define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */ | 50 | #define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */ |
@@ -65,4 +63,17 @@ extern struct screen_info screen_info; | |||
65 | 63 | ||
66 | #define VIDEO_TYPE_PMAC 0x60 /* PowerMacintosh frame buffer. */ | 64 | #define VIDEO_TYPE_PMAC 0x60 /* PowerMacintosh frame buffer. */ |
67 | 65 | ||
66 | #ifdef __KERNEL__ | ||
67 | extern struct screen_info screen_info; | ||
68 | |||
69 | #define ORIG_X (screen_info.orig_x) | ||
70 | #define ORIG_Y (screen_info.orig_y) | ||
71 | #define ORIG_VIDEO_MODE (screen_info.orig_video_mode) | ||
72 | #define ORIG_VIDEO_COLS (screen_info.orig_video_cols) | ||
73 | #define ORIG_VIDEO_EGA_BX (screen_info.orig_video_ega_bx) | ||
74 | #define ORIG_VIDEO_LINES (screen_info.orig_video_lines) | ||
75 | #define ORIG_VIDEO_ISVGA (screen_info.orig_video_isVGA) | ||
76 | #define ORIG_VIDEO_POINTS (screen_info.orig_video_points) | ||
77 | #endif /* __KERNEL__ */ | ||
78 | |||
68 | #endif /* _SCREEN_INFO_H */ | 79 | #endif /* _SCREEN_INFO_H */ |