1/****************************************************************************
2 ****************************************************************************
3 ***
4 ***   This header was automatically generated from a Linux kernel header
5 ***   of the same name, to make information necessary for userspace to
6 ***   call into the kernel available to libc.  It contains only constants,
7 ***   structures, and macros generated from the original header, and thus,
8 ***   contains no copyrightable information.
9 ***
10 ***   To edit the content of this header, modify the corresponding
11 ***   source file (e.g. under external/kernel-headers/original/) then
12 ***   run bionic/libc/kernel/tools/update_all.py
13 ***
14 ***   Any manual change here will be lost the next time this script will
15 ***   be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _ASM_X86_BOOTPARAM_H
20#define _ASM_X86_BOOTPARAM_H
21#define SETUP_NONE 0
22#define SETUP_E820_EXT 1
23#define SETUP_DTB 2
24#define SETUP_PCI 3
25#define SETUP_EFI 4
26#define SETUP_APPLE_PROPERTIES 5
27#define SETUP_JAILHOUSE 6
28#define SETUP_INDIRECT (1 << 31)
29#define SETUP_TYPE_MAX (SETUP_INDIRECT | SETUP_JAILHOUSE)
30#define RAMDISK_IMAGE_START_MASK 0x07FF
31#define RAMDISK_PROMPT_FLAG 0x8000
32#define RAMDISK_LOAD_FLAG 0x4000
33#define LOADED_HIGH (1 << 0)
34#define KASLR_FLAG (1 << 1)
35#define QUIET_FLAG (1 << 5)
36#define KEEP_SEGMENTS (1 << 6)
37#define CAN_USE_HEAP (1 << 7)
38#define XLF_KERNEL_64 (1 << 0)
39#define XLF_CAN_BE_LOADED_ABOVE_4G (1 << 1)
40#define XLF_EFI_HANDOVER_32 (1 << 2)
41#define XLF_EFI_HANDOVER_64 (1 << 3)
42#define XLF_EFI_KEXEC (1 << 4)
43#define XLF_5LEVEL (1 << 5)
44#define XLF_5LEVEL_ENABLED (1 << 6)
45#ifndef __ASSEMBLY__
46#include <linux/types.h>
47#include <linux/screen_info.h>
48#include <linux/apm_bios.h>
49#include <linux/edd.h>
50#include <asm/ist.h>
51#include <video/edid.h>
52struct setup_data {
53  __u64 next;
54  __u32 type;
55  __u32 len;
56  __u8 data[0];
57};
58struct setup_indirect {
59  __u32 type;
60  __u32 reserved;
61  __u64 len;
62  __u64 addr;
63};
64struct setup_header {
65  __u8 setup_sects;
66  __u16 root_flags;
67  __u32 syssize;
68  __u16 ram_size;
69  __u16 vid_mode;
70  __u16 root_dev;
71  __u16 boot_flag;
72  __u16 jump;
73  __u32 header;
74  __u16 version;
75  __u32 realmode_swtch;
76  __u16 start_sys_seg;
77  __u16 kernel_version;
78  __u8 type_of_loader;
79  __u8 loadflags;
80  __u16 setup_move_size;
81  __u32 code32_start;
82  __u32 ramdisk_image;
83  __u32 ramdisk_size;
84  __u32 bootsect_kludge;
85  __u16 heap_end_ptr;
86  __u8 ext_loader_ver;
87  __u8 ext_loader_type;
88  __u32 cmd_line_ptr;
89  __u32 initrd_addr_max;
90  __u32 kernel_alignment;
91  __u8 relocatable_kernel;
92  __u8 min_alignment;
93  __u16 xloadflags;
94  __u32 cmdline_size;
95  __u32 hardware_subarch;
96  __u64 hardware_subarch_data;
97  __u32 payload_offset;
98  __u32 payload_length;
99  __u64 setup_data;
100  __u64 pref_address;
101  __u32 init_size;
102  __u32 handover_offset;
103  __u32 kernel_info_offset;
104} __attribute__((packed));
105struct sys_desc_table {
106  __u16 length;
107  __u8 table[14];
108};
109struct olpc_ofw_header {
110  __u32 ofw_magic;
111  __u32 ofw_version;
112  __u32 cif_handler;
113  __u32 irq_desc_table;
114} __attribute__((packed));
115struct efi_info {
116  __u32 efi_loader_signature;
117  __u32 efi_systab;
118  __u32 efi_memdesc_size;
119  __u32 efi_memdesc_version;
120  __u32 efi_memmap;
121  __u32 efi_memmap_size;
122  __u32 efi_systab_hi;
123  __u32 efi_memmap_hi;
124};
125#define E820_MAX_ENTRIES_ZEROPAGE 128
126struct boot_e820_entry {
127  __u64 addr;
128  __u64 size;
129  __u32 type;
130} __attribute__((packed));
131#define JAILHOUSE_SETUP_REQUIRED_VERSION 1
132struct jailhouse_setup_data {
133  struct {
134    __u16 version;
135    __u16 compatible_version;
136  } __attribute__((packed)) hdr;
137  struct {
138    __u16 pm_timer_address;
139    __u16 num_cpus;
140    __u64 pci_mmconfig_base;
141    __u32 tsc_khz;
142    __u32 apic_khz;
143    __u8 standard_ioapic;
144    __u8 cpu_ids[255];
145  } __attribute__((packed)) v1;
146  struct {
147    __u32 flags;
148  } __attribute__((packed)) v2;
149} __attribute__((packed));
150struct boot_params {
151  struct screen_info screen_info;
152  struct apm_bios_info apm_bios_info;
153  __u8 _pad2[4];
154  __u64 tboot_addr;
155  struct ist_info ist_info;
156  __u64 acpi_rsdp_addr;
157  __u8 _pad3[8];
158  __u8 hd0_info[16];
159  __u8 hd1_info[16];
160  struct sys_desc_table sys_desc_table;
161  struct olpc_ofw_header olpc_ofw_header;
162  __u32 ext_ramdisk_image;
163  __u32 ext_ramdisk_size;
164  __u32 ext_cmd_line_ptr;
165  __u8 _pad4[116];
166  struct edid_info edid_info;
167  struct efi_info efi_info;
168  __u32 alt_mem_k;
169  __u32 scratch;
170  __u8 e820_entries;
171  __u8 eddbuf_entries;
172  __u8 edd_mbr_sig_buf_entries;
173  __u8 kbd_status;
174  __u8 secure_boot;
175  __u8 _pad5[2];
176  __u8 sentinel;
177  __u8 _pad6[1];
178  struct setup_header hdr;
179  __u8 _pad7[0x290 - 0x1f1 - sizeof(struct setup_header)];
180  __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX];
181  struct boot_e820_entry e820_table[E820_MAX_ENTRIES_ZEROPAGE];
182  __u8 _pad8[48];
183  struct edd_info eddbuf[EDDMAXNR];
184  __u8 _pad9[276];
185} __attribute__((packed));
186enum x86_hardware_subarch {
187  X86_SUBARCH_PC = 0,
188  X86_SUBARCH_LGUEST,
189  X86_SUBARCH_XEN,
190  X86_SUBARCH_INTEL_MID,
191  X86_SUBARCH_CE4100,
192  X86_NR_SUBARCHS,
193};
194#endif
195#endif
196