| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 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 | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 23 | #define SETUP_DTB 2 | 
|  | 24 | #define SETUP_PCI 3 | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 25 | #define SETUP_EFI 4 | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 26 | #define SETUP_APPLE_PROPERTIES 5 | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 27 | #define SETUP_JAILHOUSE 6 | 
| Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 28 | #define SETUP_CC_BLOB 7 | 
| Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 29 | #define SETUP_INDIRECT (1 << 31) | 
| Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 30 | #define SETUP_TYPE_MAX (SETUP_INDIRECT | SETUP_CC_BLOB) | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 31 | #define RAMDISK_IMAGE_START_MASK 0x07FF | 
| Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 32 | #define RAMDISK_PROMPT_FLAG 0x8000 | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 33 | #define RAMDISK_LOAD_FLAG 0x4000 | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 34 | #define LOADED_HIGH (1 << 0) | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 35 | #define KASLR_FLAG (1 << 1) | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 36 | #define QUIET_FLAG (1 << 5) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 37 | #define KEEP_SEGMENTS (1 << 6) | 
|  | 38 | #define CAN_USE_HEAP (1 << 7) | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 39 | #define XLF_KERNEL_64 (1 << 0) | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 40 | #define XLF_CAN_BE_LOADED_ABOVE_4G (1 << 1) | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 41 | #define XLF_EFI_HANDOVER_32 (1 << 2) | 
|  | 42 | #define XLF_EFI_HANDOVER_64 (1 << 3) | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 43 | #define XLF_EFI_KEXEC (1 << 4) | 
| Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 44 | #define XLF_5LEVEL (1 << 5) | 
|  | 45 | #define XLF_5LEVEL_ENABLED (1 << 6) | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 46 | #ifndef __ASSEMBLY__ | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 47 | #include <linux/types.h> | 
|  | 48 | #include <linux/screen_info.h> | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 49 | #include <linux/apm_bios.h> | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 50 | #include <linux/edd.h> | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 51 | #include <asm/ist.h> | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 52 | #include <video/edid.h> | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 53 | struct setup_data { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 54 | __u64 next; | 
|  | 55 | __u32 type; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 56 | __u32 len; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 57 | __u8 data[0]; | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 58 | }; | 
| Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 59 | struct setup_indirect { | 
|  | 60 | __u32 type; | 
|  | 61 | __u32 reserved; | 
|  | 62 | __u64 len; | 
|  | 63 | __u64 addr; | 
|  | 64 | }; | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 65 | struct setup_header { | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 66 | __u8 setup_sects; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 67 | __u16 root_flags; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 68 | __u32 syssize; | 
|  | 69 | __u16 ram_size; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 70 | __u16 vid_mode; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 71 | __u16 root_dev; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 72 | __u16 boot_flag; | 
|  | 73 | __u16 jump; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 74 | __u32 header; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 75 | __u16 version; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 76 | __u32 realmode_swtch; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 77 | __u16 start_sys_seg; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 78 | __u16 kernel_version; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 79 | __u8 type_of_loader; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 80 | __u8 loadflags; | 
|  | 81 | __u16 setup_move_size; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 82 | __u32 code32_start; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 83 | __u32 ramdisk_image; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 84 | __u32 ramdisk_size; | 
|  | 85 | __u32 bootsect_kludge; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 86 | __u16 heap_end_ptr; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 87 | __u8 ext_loader_ver; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 88 | __u8 ext_loader_type; | 
|  | 89 | __u32 cmd_line_ptr; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 90 | __u32 initrd_addr_max; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 91 | __u32 kernel_alignment; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 92 | __u8 relocatable_kernel; | 
|  | 93 | __u8 min_alignment; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 94 | __u16 xloadflags; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 95 | __u32 cmdline_size; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 96 | __u32 hardware_subarch; | 
|  | 97 | __u64 hardware_subarch_data; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 98 | __u32 payload_offset; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 99 | __u32 payload_length; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 100 | __u64 setup_data; | 
|  | 101 | __u64 pref_address; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 102 | __u32 init_size; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 103 | __u32 handover_offset; | 
| Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 104 | __u32 kernel_info_offset; | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 105 | } __attribute__((packed)); | 
|  | 106 | struct sys_desc_table { | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 107 | __u16 length; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 108 | __u8 table[14]; | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 109 | }; | 
|  | 110 | struct olpc_ofw_header { | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 111 | __u32 ofw_magic; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 112 | __u32 ofw_version; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 113 | __u32 cif_handler; | 
|  | 114 | __u32 irq_desc_table; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 115 | } __attribute__((packed)); | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 116 | struct efi_info { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 117 | __u32 efi_loader_signature; | 
|  | 118 | __u32 efi_systab; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 119 | __u32 efi_memdesc_size; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 120 | __u32 efi_memdesc_version; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 121 | __u32 efi_memmap; | 
|  | 122 | __u32 efi_memmap_size; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 123 | __u32 efi_systab_hi; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 124 | __u32 efi_memmap_hi; | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 125 | }; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 126 | #define E820_MAX_ENTRIES_ZEROPAGE 128 | 
|  | 127 | struct boot_e820_entry { | 
|  | 128 | __u64 addr; | 
|  | 129 | __u64 size; | 
|  | 130 | __u32 type; | 
|  | 131 | } __attribute__((packed)); | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 132 | #define JAILHOUSE_SETUP_REQUIRED_VERSION 1 | 
|  | 133 | struct jailhouse_setup_data { | 
| Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 134 | struct { | 
|  | 135 | __u16 version; | 
|  | 136 | __u16 compatible_version; | 
|  | 137 | } __attribute__((packed)) hdr; | 
|  | 138 | struct { | 
|  | 139 | __u16 pm_timer_address; | 
|  | 140 | __u16 num_cpus; | 
|  | 141 | __u64 pci_mmconfig_base; | 
|  | 142 | __u32 tsc_khz; | 
|  | 143 | __u32 apic_khz; | 
|  | 144 | __u8 standard_ioapic; | 
|  | 145 | __u8 cpu_ids[255]; | 
|  | 146 | } __attribute__((packed)) v1; | 
|  | 147 | struct { | 
|  | 148 | __u32 flags; | 
|  | 149 | } __attribute__((packed)) v2; | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 150 | } __attribute__((packed)); | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 151 | struct boot_params { | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 152 | struct screen_info screen_info; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 153 | struct apm_bios_info apm_bios_info; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 154 | __u8 _pad2[4]; | 
|  | 155 | __u64 tboot_addr; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 156 | struct ist_info ist_info; | 
| Christopher Ferris | 86a4837 | 2019-01-10 14:14:59 -0800 | [diff] [blame] | 157 | __u64 acpi_rsdp_addr; | 
|  | 158 | __u8 _pad3[8]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 159 | __u8 hd0_info[16]; | 
|  | 160 | __u8 hd1_info[16]; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 161 | struct sys_desc_table sys_desc_table; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 162 | struct olpc_ofw_header olpc_ofw_header; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 163 | __u32 ext_ramdisk_image; | 
|  | 164 | __u32 ext_ramdisk_size; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 165 | __u32 ext_cmd_line_ptr; | 
| Christopher Ferris | 80ae69d | 2022-08-02 16:32:21 -0700 | [diff] [blame] | 166 | __u8 _pad4[112]; | 
|  | 167 | __u32 cc_blob_address; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 168 | struct edid_info edid_info; | 
|  | 169 | struct efi_info efi_info; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 170 | __u32 alt_mem_k; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 171 | __u32 scratch; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 172 | __u8 e820_entries; | 
|  | 173 | __u8 eddbuf_entries; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 174 | __u8 edd_mbr_sig_buf_entries; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 175 | __u8 kbd_status; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 176 | __u8 secure_boot; | 
|  | 177 | __u8 _pad5[2]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 178 | __u8 sentinel; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 179 | __u8 _pad6[1]; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 180 | struct setup_header hdr; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 181 | __u8 _pad7[0x290 - 0x1f1 - sizeof(struct setup_header)]; | 
|  | 182 | __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; | 
| Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 183 | struct boot_e820_entry e820_table[E820_MAX_ENTRIES_ZEROPAGE]; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 184 | __u8 _pad8[48]; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 185 | struct edd_info eddbuf[EDDMAXNR]; | 
|  | 186 | __u8 _pad9[276]; | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 187 | } __attribute__((packed)); | 
| Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 188 | enum x86_hardware_subarch { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 189 | X86_SUBARCH_PC = 0, | 
|  | 190 | X86_SUBARCH_LGUEST, | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 191 | X86_SUBARCH_XEN, | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 192 | X86_SUBARCH_INTEL_MID, | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 193 | X86_SUBARCH_CE4100, | 
|  | 194 | X86_NR_SUBARCHS, | 
| Christopher Ferris | 48af7cb | 2017-02-21 12:35:09 -0800 | [diff] [blame] | 195 | }; | 
| Elliott Hughes | abd6261 | 2013-11-08 11:45:48 -0800 | [diff] [blame] | 196 | #endif | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 197 | #endif |