blob: 6a4b59ce335caa02f286b84c5c5d36f1de3b22b8 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Elliott Hughesabd62612013-11-08 11:45:48 -08007#ifndef _ASM_X86_BOOTPARAM_H
8#define _ASM_X86_BOOTPARAM_H
Christopher Ferris7f4c8372024-06-03 14:22:19 -07009#include <asm/setup_data.h>
Christopher Ferris48af7cb2017-02-21 12:35:09 -080010#define RAMDISK_IMAGE_START_MASK 0x07FF
Christopher Ferris38062f92014-07-09 15:33:25 -070011#define RAMDISK_PROMPT_FLAG 0x8000
Elliott Hughesabd62612013-11-08 11:45:48 -080012#define RAMDISK_LOAD_FLAG 0x4000
Tao Baod7db5942015-01-28 10:07:51 -080013#define LOADED_HIGH (1 << 0)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080014#define KASLR_FLAG (1 << 1)
Christopher Ferris05d08e92016-02-04 13:16:38 -080015#define QUIET_FLAG (1 << 5)
Tao Baod7db5942015-01-28 10:07:51 -080016#define KEEP_SEGMENTS (1 << 6)
17#define CAN_USE_HEAP (1 << 7)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080018#define XLF_KERNEL_64 (1 << 0)
Christopher Ferris05d08e92016-02-04 13:16:38 -080019#define XLF_CAN_BE_LOADED_ABOVE_4G (1 << 1)
Tao Baod7db5942015-01-28 10:07:51 -080020#define XLF_EFI_HANDOVER_32 (1 << 2)
21#define XLF_EFI_HANDOVER_64 (1 << 3)
Christopher Ferris48af7cb2017-02-21 12:35:09 -080022#define XLF_EFI_KEXEC (1 << 4)
Christopher Ferrisb8a95e22019-10-02 18:29:20 -070023#define XLF_5LEVEL (1 << 5)
24#define XLF_5LEVEL_ENABLED (1 << 6)
Christopher Ferris7f4c8372024-06-03 14:22:19 -070025#define XLF_MEM_ENCRYPTION (1 << 7)
Christopher Ferris05d08e92016-02-04 13:16:38 -080026#ifndef __ASSEMBLY__
Elliott Hughesabd62612013-11-08 11:45:48 -080027#include <linux/types.h>
28#include <linux/screen_info.h>
Christopher Ferris48af7cb2017-02-21 12:35:09 -080029#include <linux/apm_bios.h>
Christopher Ferris05d08e92016-02-04 13:16:38 -080030#include <linux/edd.h>
Elliott Hughesabd62612013-11-08 11:45:48 -080031#include <asm/ist.h>
Christopher Ferris48af7cb2017-02-21 12:35:09 -080032#include <video/edid.h>
Elliott Hughesabd62612013-11-08 11:45:48 -080033struct setup_header {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080034 __u8 setup_sects;
Christopher Ferris05d08e92016-02-04 13:16:38 -080035 __u16 root_flags;
Tao Baod7db5942015-01-28 10:07:51 -080036 __u32 syssize;
37 __u16 ram_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080038 __u16 vid_mode;
Christopher Ferris05d08e92016-02-04 13:16:38 -080039 __u16 root_dev;
Tao Baod7db5942015-01-28 10:07:51 -080040 __u16 boot_flag;
41 __u16 jump;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080042 __u32 header;
Christopher Ferris05d08e92016-02-04 13:16:38 -080043 __u16 version;
Tao Baod7db5942015-01-28 10:07:51 -080044 __u32 realmode_swtch;
Christopher Ferris525ce912017-07-26 13:12:53 -070045 __u16 start_sys_seg;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080046 __u16 kernel_version;
Christopher Ferris05d08e92016-02-04 13:16:38 -080047 __u8 type_of_loader;
Tao Baod7db5942015-01-28 10:07:51 -080048 __u8 loadflags;
49 __u16 setup_move_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080050 __u32 code32_start;
Christopher Ferris05d08e92016-02-04 13:16:38 -080051 __u32 ramdisk_image;
Tao Baod7db5942015-01-28 10:07:51 -080052 __u32 ramdisk_size;
53 __u32 bootsect_kludge;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080054 __u16 heap_end_ptr;
Christopher Ferris05d08e92016-02-04 13:16:38 -080055 __u8 ext_loader_ver;
Tao Baod7db5942015-01-28 10:07:51 -080056 __u8 ext_loader_type;
57 __u32 cmd_line_ptr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080058 __u32 initrd_addr_max;
Christopher Ferris05d08e92016-02-04 13:16:38 -080059 __u32 kernel_alignment;
Tao Baod7db5942015-01-28 10:07:51 -080060 __u8 relocatable_kernel;
61 __u8 min_alignment;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080062 __u16 xloadflags;
Christopher Ferris05d08e92016-02-04 13:16:38 -080063 __u32 cmdline_size;
Tao Baod7db5942015-01-28 10:07:51 -080064 __u32 hardware_subarch;
65 __u64 hardware_subarch_data;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080066 __u32 payload_offset;
Christopher Ferris05d08e92016-02-04 13:16:38 -080067 __u32 payload_length;
Tao Baod7db5942015-01-28 10:07:51 -080068 __u64 setup_data;
69 __u64 pref_address;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080070 __u32 init_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080071 __u32 handover_offset;
Christopher Ferrisd32ca142020-02-04 16:16:51 -080072 __u32 kernel_info_offset;
Elliott Hughesabd62612013-11-08 11:45:48 -080073} __attribute__((packed));
74struct sys_desc_table {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080075 __u16 length;
Christopher Ferris05d08e92016-02-04 13:16:38 -080076 __u8 table[14];
Elliott Hughesabd62612013-11-08 11:45:48 -080077};
78struct olpc_ofw_header {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080079 __u32 ofw_magic;
Christopher Ferris05d08e92016-02-04 13:16:38 -080080 __u32 ofw_version;
Tao Baod7db5942015-01-28 10:07:51 -080081 __u32 cif_handler;
82 __u32 irq_desc_table;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080083} __attribute__((packed));
Christopher Ferris05d08e92016-02-04 13:16:38 -080084struct efi_info {
Tao Baod7db5942015-01-28 10:07:51 -080085 __u32 efi_loader_signature;
86 __u32 efi_systab;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080087 __u32 efi_memdesc_size;
Christopher Ferris05d08e92016-02-04 13:16:38 -080088 __u32 efi_memdesc_version;
Tao Baod7db5942015-01-28 10:07:51 -080089 __u32 efi_memmap;
90 __u32 efi_memmap_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -080091 __u32 efi_systab_hi;
Christopher Ferris05d08e92016-02-04 13:16:38 -080092 __u32 efi_memmap_hi;
Elliott Hughesabd62612013-11-08 11:45:48 -080093};
Christopher Ferris525ce912017-07-26 13:12:53 -070094#define E820_MAX_ENTRIES_ZEROPAGE 128
Christopher Ferris76a1d452018-06-27 14:12:29 -070095#define JAILHOUSE_SETUP_REQUIRED_VERSION 1
Elliott Hughesabd62612013-11-08 11:45:48 -080096struct boot_params {
Christopher Ferris48af7cb2017-02-21 12:35:09 -080097 struct screen_info screen_info;
Christopher Ferris05d08e92016-02-04 13:16:38 -080098 struct apm_bios_info apm_bios_info;
Tao Baod7db5942015-01-28 10:07:51 -080099 __u8 _pad2[4];
100 __u64 tboot_addr;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800101 struct ist_info ist_info;
Christopher Ferris86a48372019-01-10 14:14:59 -0800102 __u64 acpi_rsdp_addr;
103 __u8 _pad3[8];
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u8 hd0_info[16];
105 __u8 hd1_info[16];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800106 struct sys_desc_table sys_desc_table;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800107 struct olpc_ofw_header olpc_ofw_header;
Tao Baod7db5942015-01-28 10:07:51 -0800108 __u32 ext_ramdisk_image;
109 __u32 ext_ramdisk_size;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800110 __u32 ext_cmd_line_ptr;
Christopher Ferris80ae69d2022-08-02 16:32:21 -0700111 __u8 _pad4[112];
112 __u32 cc_blob_address;
Tao Baod7db5942015-01-28 10:07:51 -0800113 struct edid_info edid_info;
114 struct efi_info efi_info;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800115 __u32 alt_mem_k;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800116 __u32 scratch;
Tao Baod7db5942015-01-28 10:07:51 -0800117 __u8 e820_entries;
118 __u8 eddbuf_entries;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800119 __u8 edd_mbr_sig_buf_entries;
Christopher Ferris05d08e92016-02-04 13:16:38 -0800120 __u8 kbd_status;
Christopher Ferris525ce912017-07-26 13:12:53 -0700121 __u8 secure_boot;
122 __u8 _pad5[2];
Tao Baod7db5942015-01-28 10:07:51 -0800123 __u8 sentinel;
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800124 __u8 _pad6[1];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800125 struct setup_header hdr;
Tao Baod7db5942015-01-28 10:07:51 -0800126 __u8 _pad7[0x290 - 0x1f1 - sizeof(struct setup_header)];
127 __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX];
Christopher Ferris525ce912017-07-26 13:12:53 -0700128 struct boot_e820_entry e820_table[E820_MAX_ENTRIES_ZEROPAGE];
Christopher Ferris05d08e92016-02-04 13:16:38 -0800129 __u8 _pad8[48];
Tao Baod7db5942015-01-28 10:07:51 -0800130 struct edd_info eddbuf[EDDMAXNR];
131 __u8 _pad9[276];
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800132} __attribute__((packed));
Christopher Ferris106b3a82016-08-24 12:15:38 -0700133enum x86_hardware_subarch {
Tao Baod7db5942015-01-28 10:07:51 -0800134 X86_SUBARCH_PC = 0,
135 X86_SUBARCH_LGUEST,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800136 X86_SUBARCH_XEN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800137 X86_SUBARCH_INTEL_MID,
Tao Baod7db5942015-01-28 10:07:51 -0800138 X86_SUBARCH_CE4100,
139 X86_NR_SUBARCHS,
Christopher Ferris48af7cb2017-02-21 12:35:09 -0800140};
Elliott Hughesabd62612013-11-08 11:45:48 -0800141#endif
Christopher Ferris05d08e92016-02-04 13:16:38 -0800142#endif