blob: 772f552ccd14d455631cb5997ae5e736ebd3661e [file] [log] [blame]
Elliott Hughesabd62612013-11-08 11:45:48 -08001/****************************************************************************
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
Elliott Hughesabd62612013-11-08 11:45:48 -080023#define SETUP_DTB 2
24#define SETUP_PCI 3
Christopher Ferris38062f92014-07-09 15:33:25 -070025#define SETUP_EFI 4
Christopher Ferris48af7cb2017-02-21 12:35:09 -080026#define SETUP_APPLE_PROPERTIES 5
Christopher Ferris48af7cb2017-02-21 12:35:09 -080027#define RAMDISK_IMAGE_START_MASK 0x07FF
Christopher Ferris38062f92014-07-09 15:33:25 -070028#define RAMDISK_PROMPT_FLAG 0x8000
Elliott Hughesabd62612013-11-08 11:45:48 -080029#define RAMDISK_LOAD_FLAG 0x4000
Tao Baod7db5942015-01-28 10:07:51 -080030#define LOADED_HIGH (1 << 0)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080031#define KASLR_FLAG (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080032#define QUIET_FLAG (1 << 5)
Tao Baod7db5942015-01-28 10:07:51 -080033#define KEEP_SEGMENTS (1 << 6)
34#define CAN_USE_HEAP (1 << 7)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080035#define XLF_KERNEL_64 (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -080036#define XLF_CAN_BE_LOADED_ABOVE_4G (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -080037#define XLF_EFI_HANDOVER_32 (1 << 2)
38#define XLF_EFI_HANDOVER_64 (1 << 3)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080039#define XLF_EFI_KEXEC (1 << 4)
Christopher Ferris05d08e92016-02-04 13:16:38 -080040#ifndef __ASSEMBLY__
Elliott Hughesabd62612013-11-08 11:45:48 -080041#include <linux/types.h>
42#include <linux/screen_info.h>
Christopher Ferris48af7cb2017-02-21 12:35:09 -080043#include <linux/apm_bios.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080044#include <linux/edd.h>
Elliott Hughesabd62612013-11-08 11:45:48 -080045#include <asm/ist.h>
Christopher Ferris48af7cb2017-02-21 12:35:09 -080046#include <video/edid.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080047struct setup_data {
Tao Baod7db5942015-01-28 10:07:51 -080048 __u64 next;
49 __u32 type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080050 __u32 len;
Christopher Ferris05d08e92016-02-04 13:16:38 -080051 __u8 data[0];
Elliott Hughesabd62612013-11-08 11:45:48 -080052};
53struct setup_header {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080054 __u8 setup_sects;
Christopher Ferris05d08e92016-02-04 13:16:38 -080055 __u16 root_flags;
Tao Baod7db5942015-01-28 10:07:51 -080056 __u32 syssize;
57 __u16 ram_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080058 __u16 vid_mode;
Christopher Ferris05d08e92016-02-04 13:16:38 -080059 __u16 root_dev;
Tao Baod7db5942015-01-28 10:07:51 -080060 __u16 boot_flag;
61 __u16 jump;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080062 __u32 header;
Christopher Ferris05d08e92016-02-04 13:16:38 -080063 __u16 version;
Tao Baod7db5942015-01-28 10:07:51 -080064 __u32 realmode_swtch;
Christopher Ferris525ce912017-07-26 13:12:53 -070065 __u16 start_sys_seg;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080066 __u16 kernel_version;
Christopher Ferris05d08e92016-02-04 13:16:38 -080067 __u8 type_of_loader;
Tao Baod7db5942015-01-28 10:07:51 -080068 __u8 loadflags;
69 __u16 setup_move_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080070 __u32 code32_start;
Christopher Ferris05d08e92016-02-04 13:16:38 -080071 __u32 ramdisk_image;
Tao Baod7db5942015-01-28 10:07:51 -080072 __u32 ramdisk_size;
73 __u32 bootsect_kludge;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080074 __u16 heap_end_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -080075 __u8 ext_loader_ver;
Tao Baod7db5942015-01-28 10:07:51 -080076 __u8 ext_loader_type;
77 __u32 cmd_line_ptr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080078 __u32 initrd_addr_max;
Christopher Ferris05d08e92016-02-04 13:16:38 -080079 __u32 kernel_alignment;
Tao Baod7db5942015-01-28 10:07:51 -080080 __u8 relocatable_kernel;
81 __u8 min_alignment;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080082 __u16 xloadflags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080083 __u32 cmdline_size;
Tao Baod7db5942015-01-28 10:07:51 -080084 __u32 hardware_subarch;
85 __u64 hardware_subarch_data;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080086 __u32 payload_offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080087 __u32 payload_length;
Tao Baod7db5942015-01-28 10:07:51 -080088 __u64 setup_data;
89 __u64 pref_address;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080090 __u32 init_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080091 __u32 handover_offset;
Elliott Hughesabd62612013-11-08 11:45:48 -080092} __attribute__((packed));
93struct sys_desc_table {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080094 __u16 length;
Christopher Ferris05d08e92016-02-04 13:16:38 -080095 __u8 table[14];
Elliott Hughesabd62612013-11-08 11:45:48 -080096};
97struct olpc_ofw_header {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080098 __u32 ofw_magic;
Christopher Ferris05d08e92016-02-04 13:16:38 -080099 __u32 ofw_version;
Tao Baod7db5942015-01-28 10:07:51 -0800100 __u32 cif_handler;
101 __u32 irq_desc_table;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800102} __attribute__((packed));
Christopher Ferris05d08e92016-02-04 13:16:38 -0800103struct efi_info {
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u32 efi_loader_signature;
105 __u32 efi_systab;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800106 __u32 efi_memdesc_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800107 __u32 efi_memdesc_version;
Tao Baod7db5942015-01-28 10:07:51 -0800108 __u32 efi_memmap;
109 __u32 efi_memmap_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800110 __u32 efi_systab_hi;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111 __u32 efi_memmap_hi;
Elliott Hughesabd62612013-11-08 11:45:48 -0800112};
Christopher Ferris525ce912017-07-26 13:12:53 -0700113#define E820_MAX_ENTRIES_ZEROPAGE 128
114struct boot_e820_entry {
115 __u64 addr;
116 __u64 size;
117 __u32 type;
118} __attribute__((packed));
Elliott Hughesabd62612013-11-08 11:45:48 -0800119struct boot_params {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800120 struct screen_info screen_info;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800121 struct apm_bios_info apm_bios_info;
Tao Baod7db5942015-01-28 10:07:51 -0800122 __u8 _pad2[4];
123 __u64 tboot_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800124 struct ist_info ist_info;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800125 __u8 _pad3[16];
Tao Baod7db5942015-01-28 10:07:51 -0800126 __u8 hd0_info[16];
127 __u8 hd1_info[16];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800128 struct sys_desc_table sys_desc_table;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800129 struct olpc_ofw_header olpc_ofw_header;
Tao Baod7db5942015-01-28 10:07:51 -0800130 __u32 ext_ramdisk_image;
131 __u32 ext_ramdisk_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800132 __u32 ext_cmd_line_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800133 __u8 _pad4[116];
Tao Baod7db5942015-01-28 10:07:51 -0800134 struct edid_info edid_info;
135 struct efi_info efi_info;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800136 __u32 alt_mem_k;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800137 __u32 scratch;
Tao Baod7db5942015-01-28 10:07:51 -0800138 __u8 e820_entries;
139 __u8 eddbuf_entries;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800140 __u8 edd_mbr_sig_buf_entries;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800141 __u8 kbd_status;
Christopher Ferris525ce912017-07-26 13:12:53 -0700142 __u8 secure_boot;
143 __u8 _pad5[2];
Tao Baod7db5942015-01-28 10:07:51 -0800144 __u8 sentinel;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800145 __u8 _pad6[1];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800146 struct setup_header hdr;
Tao Baod7db5942015-01-28 10:07:51 -0800147 __u8 _pad7[0x290 - 0x1f1 - sizeof(struct setup_header)];
148 __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX];
Christopher Ferris525ce912017-07-26 13:12:53 -0700149 struct boot_e820_entry e820_table[E820_MAX_ENTRIES_ZEROPAGE];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800150 __u8 _pad8[48];
Tao Baod7db5942015-01-28 10:07:51 -0800151 struct edd_info eddbuf[EDDMAXNR];
152 __u8 _pad9[276];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800153} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700154enum x86_hardware_subarch {
Tao Baod7db5942015-01-28 10:07:51 -0800155 X86_SUBARCH_PC = 0,
156 X86_SUBARCH_LGUEST,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800157 X86_SUBARCH_XEN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800158 X86_SUBARCH_INTEL_MID,
Tao Baod7db5942015-01-28 10:07:51 -0800159 X86_SUBARCH_CE4100,
160 X86_NR_SUBARCHS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800161};
Elliott Hughesabd62612013-11-08 11:45:48 -0800162#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -0800163#endif