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