debuggers.hg

view tools/libxc/linux_boot_params.h @ 3644:281346e5fc97

bitkeeper revision 1.1159.212.67 (42001d370Zk3jsfUjyC3iV9vgEJAlA)

Create the e820 map dynamically. This makes it easy to run VMX guests
of different memory sizes (no need to manually edit the e820 map).

Signed-off-by: Xin B Li <xin.b.li@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: ian.pratt@cl.cam.ac.uk
author iap10@labyrinth.cl.cam.ac.uk
date Wed Feb 02 00:22:15 2005 +0000 (2005-02-02)
parents 2afa7aa0076f
children bbe8541361dd
line source
1 #ifndef __LINUX_BOOT_PARAMS_H__
2 #define __LINUX_BOOT_PARAMS_H__
4 #include <asm/types.h>
6 #define E820MAX 32
8 struct mem_map {
9 int nr_map;
10 struct entry {
11 unsigned long long addr; /* start of memory segment */
12 unsigned long long size; /* size of memory segment */
13 unsigned long type; /* type of memory segment */
14 #define E820_RAM 1
15 #define E820_RESERVED 2
16 #define E820_ACPI 3 /* usable as RAM once ACPI tables have been read */
17 #define E820_NVS 4
18 #define E820_IO 16
19 #define E820_SHARED 17
21 unsigned long caching_attr; /* used by hypervisor */
22 #define MEMMAP_UC 0
23 #define MEMMAP_WC 1
24 #define MEMMAP_WT 4
25 #define MEMMAP_WP 5
26 #define MEMMAP_WB 6
28 }map[E820MAX];
29 };
31 struct e820entry {
32 unsigned long long addr; /* start of memory segment */
33 unsigned long long size; /* size of memory segment */
34 unsigned long type; /* type of memory segment */
35 };
37 struct e820map {
38 int nr_map;
39 struct e820entry map[E820MAX];
40 };
42 struct drive_info_struct { __u8 dummy[32]; };
44 struct sys_desc_table {
45 __u16 length;
46 __u8 table[318];
47 };
49 struct screen_info {
50 unsigned char orig_x; /* 0x00 */
51 unsigned char orig_y; /* 0x01 */
52 unsigned short dontuse1; /* 0x02 -- EXT_MEM_K sits here */
53 unsigned short orig_video_page; /* 0x04 */
54 unsigned char orig_video_mode; /* 0x06 */
55 unsigned char orig_video_cols; /* 0x07 */
56 unsigned short unused2; /* 0x08 */
57 unsigned short orig_video_ega_bx; /* 0x0a */
58 unsigned short unused3; /* 0x0c */
59 unsigned char orig_video_lines; /* 0x0e */
60 unsigned char orig_video_isVGA; /* 0x0f */
61 unsigned short orig_video_points; /* 0x10 */
63 /* VESA graphic mode -- linear frame buffer */
64 unsigned short lfb_width; /* 0x12 */
65 unsigned short lfb_height; /* 0x14 */
66 unsigned short lfb_depth; /* 0x16 */
67 unsigned long lfb_base; /* 0x18 */
68 unsigned long lfb_size; /* 0x1c */
69 unsigned short dontuse2, dontuse3; /* 0x20 -- CL_MAGIC and CL_OFFSET here */
70 unsigned short lfb_linelength; /* 0x24 */
71 unsigned char red_size; /* 0x26 */
72 unsigned char red_pos; /* 0x27 */
73 unsigned char green_size; /* 0x28 */
74 unsigned char green_pos; /* 0x29 */
75 unsigned char blue_size; /* 0x2a */
76 unsigned char blue_pos; /* 0x2b */
77 unsigned char rsvd_size; /* 0x2c */
78 unsigned char rsvd_pos; /* 0x2d */
79 unsigned short vesapm_seg; /* 0x2e */
80 unsigned short vesapm_off; /* 0x30 */
81 unsigned short pages; /* 0x32 */
82 /* 0x34 -- 0x3f reserved for future expansion */
83 };
85 struct screen_info_overlap {
86 __u8 reserved1[2]; /* 0x00 */
87 __u16 ext_mem_k; /* 0x02 */
88 __u8 reserved2[0x20 - 0x04]; /* 0x04 */
89 __u16 cl_magic; /* 0x20 */
90 #define CL_MAGIC_VALUE 0xA33F
91 __u16 cl_offset; /* 0x22 */
92 __u8 reserved3[0x40 - 0x24]; /* 0x24 */
93 };
96 struct apm_bios_info {
97 __u16 version;
98 __u16 cseg;
99 __u32 offset;
100 __u16 cseg_16;
101 __u16 dseg;
102 __u16 flags;
103 __u16 cseg_len;
104 __u16 cseg_16_len;
105 __u16 dseg_len;
106 };
108 struct linux_boot_params {
109 union { /* 0x00 */
110 struct screen_info info;
111 struct screen_info_overlap overlap;
112 } screen;
114 struct apm_bios_info apm_bios_info; /* 0x40 */
115 __u8 reserved4[0x80 - 0x54]; /* 0x54 */
116 struct drive_info_struct drive_info; /* 0x80 */
117 struct sys_desc_table sys_desc_table; /* 0xa0 */
118 __u32 alt_mem_k; /* 0x1e0 */
119 __u8 reserved5[4]; /* 0x1e4 */
120 __u8 e820_map_nr; /* 0x1e8 */
121 __u8 reserved6[8]; /* 0x1e9 */
122 __u8 setup_sects; /* 0x1f1 */
123 __u16 mount_root_rdonly; /* 0x1f2 */
124 __u16 syssize; /* 0x1f4 */
125 __u16 swapdev; /* 0x1f6 */
126 __u16 ramdisk_flags; /* 0x1f8 */
127 #define RAMDISK_IMAGE_START_MASK 0x07FF
128 #define RAMDISK_PROMPT_FLAG 0x8000
129 #define RAMDISK_LOAD_FLAG 0x4000
130 __u16 vid_mode; /* 0x1fa */
131 __u16 root_dev; /* 0x1fc */
132 __u8 reserved9[1]; /* 0x1fe */
133 __u8 aux_device_info; /* 0x1ff */
134 /* 2.00+ */
135 __u8 reserved10[2]; /* 0x200 */
136 __u8 header_magic[4]; /* 0x202 */
137 __u16 protocol_version; /* 0x206 */
138 __u8 reserved11[8]; /* 0x208 */
139 __u8 loader_type; /* 0x210 */
140 #define LOADER_TYPE_LOADLIN 1
141 #define LOADER_TYPE_BOOTSECT_LOADER 2
142 #define LOADER_TYPE_SYSLINUX 3
143 #define LOADER_TYPE_ETHERBOOT 4
144 #define LOADER_TYPE_UNKNOWN 0xFF
145 __u8 loader_flags; /* 0x211 */
146 __u8 reserved12[2]; /* 0x212 */
147 __u32 code32_start; /* 0x214 */
148 __u32 initrd_start; /* 0x218 */
149 __u32 initrd_size; /* 0x21c */
150 __u8 reserved13[4]; /* 0x220 */
151 /* 2.01+ */
152 __u16 heap_end_ptr; /* 0x224 */
153 __u8 reserved14[2]; /* 0x226 */
154 /* 2.02+ */
155 __u32 cmd_line_ptr; /* 0x228 */
156 /* 2.03+ */
157 __u32 ramdisk_max; /* 0x22c */
158 __u8 reserved15[0x2d0 - 0x230]; /* 0x230 */
159 struct e820entry e820_map[E820MAX]; /* 0x2d0 */
160 __u64 shared_info; /* 0x550 */
161 __u8 padding[0x800 - 0x558]; /* 0x558 */
162 __u8 cmd_line[0x800]; /* 0x800 */
163 } __attribute__((packed));
165 #endif /* __LINUX_BOOT_PARAMS_H__ */