blob: ab9d7f3ad87dfd5c2cbb3f05d919c6163172a964 [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 Ferris76a1d452018-06-27 14:12:29 -070027#define SETUP_JAILHOUSE 6
Christopher Ferris80ae69d2022-08-02 16:32:21 -070028#define SETUP_CC_BLOB 7
Christopher Ferris7447a1c2022-10-04 18:24:44 -070029#define SETUP_IMA 8
30#define SETUP_RNG_SEED 9
31#define SETUP_ENUM_MAX SETUP_RNG_SEED
Christopher Ferrisd32ca142020-02-04 16:16:51 -080032#define SETUP_INDIRECT (1 << 31)
Christopher Ferris7447a1c2022-10-04 18:24:44 -070033#define SETUP_TYPE_MAX (SETUP_ENUM_MAX | SETUP_INDIRECT)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080034#define RAMDISK_IMAGE_START_MASK 0x07FF
Christopher Ferris38062f92014-07-09 15:33:25 -070035#define RAMDISK_PROMPT_FLAG 0x8000
Elliott Hughesabd62612013-11-08 11:45:48 -080036#define RAMDISK_LOAD_FLAG 0x4000
Tao Baod7db5942015-01-28 10:07:51 -080037#define LOADED_HIGH (1 << 0)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080038#define KASLR_FLAG (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080039#define QUIET_FLAG (1 << 5)
Tao Baod7db5942015-01-28 10:07:51 -080040#define KEEP_SEGMENTS (1 << 6)
41#define CAN_USE_HEAP (1 << 7)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080042#define XLF_KERNEL_64 (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -080043#define XLF_CAN_BE_LOADED_ABOVE_4G (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -080044#define XLF_EFI_HANDOVER_32 (1 << 2)
45#define XLF_EFI_HANDOVER_64 (1 << 3)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080046#define XLF_EFI_KEXEC (1 << 4)
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070047#define XLF_5LEVEL (1 << 5)
48#define XLF_5LEVEL_ENABLED (1 << 6)
Christopher Ferris05d08e92016-02-04 13:16:38 -080049#ifndef __ASSEMBLY__
Elliott Hughesabd62612013-11-08 11:45:48 -080050#include <linux/types.h>
51#include <linux/screen_info.h>
Christopher Ferris48af7cb2017-02-21 12:35:09 -080052#include <linux/apm_bios.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080053#include <linux/edd.h>
Elliott Hughesabd62612013-11-08 11:45:48 -080054#include <asm/ist.h>
Christopher Ferris48af7cb2017-02-21 12:35:09 -080055#include <video/edid.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080056struct setup_data {
Tao Baod7db5942015-01-28 10:07:51 -080057 __u64 next;
58 __u32 type;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080059 __u32 len;
Christopher Ferris7447a1c2022-10-04 18:24:44 -070060 __u8 data[];
Elliott Hughesabd62612013-11-08 11:45:48 -080061};
Christopher Ferrisd32ca142020-02-04 16:16:51 -080062struct setup_indirect {
63 __u32 type;
64 __u32 reserved;
65 __u64 len;
66 __u64 addr;
67};
Elliott Hughesabd62612013-11-08 11:45:48 -080068struct setup_header {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080069 __u8 setup_sects;
Christopher Ferris05d08e92016-02-04 13:16:38 -080070 __u16 root_flags;
Tao Baod7db5942015-01-28 10:07:51 -080071 __u32 syssize;
72 __u16 ram_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080073 __u16 vid_mode;
Christopher Ferris05d08e92016-02-04 13:16:38 -080074 __u16 root_dev;
Tao Baod7db5942015-01-28 10:07:51 -080075 __u16 boot_flag;
76 __u16 jump;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080077 __u32 header;
Christopher Ferris05d08e92016-02-04 13:16:38 -080078 __u16 version;
Tao Baod7db5942015-01-28 10:07:51 -080079 __u32 realmode_swtch;
Christopher Ferris525ce912017-07-26 13:12:53 -070080 __u16 start_sys_seg;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080081 __u16 kernel_version;
Christopher Ferris05d08e92016-02-04 13:16:38 -080082 __u8 type_of_loader;
Tao Baod7db5942015-01-28 10:07:51 -080083 __u8 loadflags;
84 __u16 setup_move_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080085 __u32 code32_start;
Christopher Ferris05d08e92016-02-04 13:16:38 -080086 __u32 ramdisk_image;
Tao Baod7db5942015-01-28 10:07:51 -080087 __u32 ramdisk_size;
88 __u32 bootsect_kludge;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080089 __u16 heap_end_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -080090 __u8 ext_loader_ver;
Tao Baod7db5942015-01-28 10:07:51 -080091 __u8 ext_loader_type;
92 __u32 cmd_line_ptr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080093 __u32 initrd_addr_max;
Christopher Ferris05d08e92016-02-04 13:16:38 -080094 __u32 kernel_alignment;
Tao Baod7db5942015-01-28 10:07:51 -080095 __u8 relocatable_kernel;
96 __u8 min_alignment;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080097 __u16 xloadflags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080098 __u32 cmdline_size;
Tao Baod7db5942015-01-28 10:07:51 -080099 __u32 hardware_subarch;
100 __u64 hardware_subarch_data;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800101 __u32 payload_offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800102 __u32 payload_length;
Tao Baod7db5942015-01-28 10:07:51 -0800103 __u64 setup_data;
104 __u64 pref_address;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800105 __u32 init_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800106 __u32 handover_offset;
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800107 __u32 kernel_info_offset;
Elliott Hughesabd62612013-11-08 11:45:48 -0800108} __attribute__((packed));
109struct sys_desc_table {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800110 __u16 length;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800111 __u8 table[14];
Elliott Hughesabd62612013-11-08 11:45:48 -0800112};
113struct olpc_ofw_header {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800114 __u32 ofw_magic;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800115 __u32 ofw_version;
Tao Baod7db5942015-01-28 10:07:51 -0800116 __u32 cif_handler;
117 __u32 irq_desc_table;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800118} __attribute__((packed));
Christopher Ferris05d08e92016-02-04 13:16:38 -0800119struct efi_info {
Tao Baod7db5942015-01-28 10:07:51 -0800120 __u32 efi_loader_signature;
121 __u32 efi_systab;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800122 __u32 efi_memdesc_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800123 __u32 efi_memdesc_version;
Tao Baod7db5942015-01-28 10:07:51 -0800124 __u32 efi_memmap;
125 __u32 efi_memmap_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800126 __u32 efi_systab_hi;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800127 __u32 efi_memmap_hi;
Elliott Hughesabd62612013-11-08 11:45:48 -0800128};
Christopher Ferris525ce912017-07-26 13:12:53 -0700129#define E820_MAX_ENTRIES_ZEROPAGE 128
130struct boot_e820_entry {
131 __u64 addr;
132 __u64 size;
133 __u32 type;
134} __attribute__((packed));
Christopher Ferris76a1d452018-06-27 14:12:29 -0700135#define JAILHOUSE_SETUP_REQUIRED_VERSION 1
136struct jailhouse_setup_data {
Christopher Ferrisd32ca142020-02-04 16:16:51 -0800137 struct {
138 __u16 version;
139 __u16 compatible_version;
140 } __attribute__((packed)) hdr;
141 struct {
142 __u16 pm_timer_address;
143 __u16 num_cpus;
144 __u64 pci_mmconfig_base;
145 __u32 tsc_khz;
146 __u32 apic_khz;
147 __u8 standard_ioapic;
148 __u8 cpu_ids[255];
149 } __attribute__((packed)) v1;
150 struct {
151 __u32 flags;
152 } __attribute__((packed)) v2;
Christopher Ferris76a1d452018-06-27 14:12:29 -0700153} __attribute__((packed));
Christopher Ferris7447a1c2022-10-04 18:24:44 -0700154struct ima_setup_data {
155 __u64 addr;
156 __u64 size;
157} __attribute__((packed));
Elliott Hughesabd62612013-11-08 11:45:48 -0800158struct boot_params {
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800159 struct screen_info screen_info;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800160 struct apm_bios_info apm_bios_info;
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u8 _pad2[4];
162 __u64 tboot_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800163 struct ist_info ist_info;
Christopher Ferris86a48372019-01-10 14:14:59 -0800164 __u64 acpi_rsdp_addr;
165 __u8 _pad3[8];
Tao Baod7db5942015-01-28 10:07:51 -0800166 __u8 hd0_info[16];
167 __u8 hd1_info[16];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800168 struct sys_desc_table sys_desc_table;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800169 struct olpc_ofw_header olpc_ofw_header;
Tao Baod7db5942015-01-28 10:07:51 -0800170 __u32 ext_ramdisk_image;
171 __u32 ext_ramdisk_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800172 __u32 ext_cmd_line_ptr;
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700173 __u8 _pad4[112];
174 __u32 cc_blob_address;
Tao Baod7db5942015-01-28 10:07:51 -0800175 struct edid_info edid_info;
176 struct efi_info efi_info;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800177 __u32 alt_mem_k;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800178 __u32 scratch;
Tao Baod7db5942015-01-28 10:07:51 -0800179 __u8 e820_entries;
180 __u8 eddbuf_entries;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800181 __u8 edd_mbr_sig_buf_entries;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800182 __u8 kbd_status;
Christopher Ferris525ce912017-07-26 13:12:53 -0700183 __u8 secure_boot;
184 __u8 _pad5[2];
Tao Baod7db5942015-01-28 10:07:51 -0800185 __u8 sentinel;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800186 __u8 _pad6[1];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800187 struct setup_header hdr;
Tao Baod7db5942015-01-28 10:07:51 -0800188 __u8 _pad7[0x290 - 0x1f1 - sizeof(struct setup_header)];
189 __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX];
Christopher Ferris525ce912017-07-26 13:12:53 -0700190 struct boot_e820_entry e820_table[E820_MAX_ENTRIES_ZEROPAGE];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800191 __u8 _pad8[48];
Tao Baod7db5942015-01-28 10:07:51 -0800192 struct edd_info eddbuf[EDDMAXNR];
193 __u8 _pad9[276];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800194} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700195enum x86_hardware_subarch {
Tao Baod7db5942015-01-28 10:07:51 -0800196 X86_SUBARCH_PC = 0,
197 X86_SUBARCH_LGUEST,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800198 X86_SUBARCH_XEN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800199 X86_SUBARCH_INTEL_MID,
Tao Baod7db5942015-01-28 10:07:51 -0800200 X86_SUBARCH_CE4100,
201 X86_NR_SUBARCHS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800202};
Elliott Hughesabd62612013-11-08 11:45:48 -0800203#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -0800204#endif