|
| 1 | +/** @file |
| 2 | +
|
| 3 | + Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.<BR> |
| 4 | +
|
| 5 | + SPDX-License-Identifier: BSD-2-Clause-Patent |
| 6 | +
|
| 7 | +**/ |
| 8 | + |
| 9 | +#ifndef __LINUX_BZIMAGE_H__ |
| 10 | +#define __LINUX_BZIMAGE_H__ |
| 11 | + |
| 12 | +#define BOOTSIG 0x1FE |
| 13 | +#define SETUP_HDR 0x53726448 /* 0x53726448 == "HdrS" */ |
| 14 | + |
| 15 | +#define E820_RAM 1 |
| 16 | +#define E820_RESERVED 2 |
| 17 | +#define E820_ACPI 3 |
| 18 | +#define E820_NVS 4 |
| 19 | +#define E820_UNUSABLE 5 |
| 20 | + |
| 21 | +#pragma pack(1) |
| 22 | + |
| 23 | +struct setup_header { |
| 24 | + UINT8 setup_secs; /* Sectors for setup code */ |
| 25 | + UINT16 root_flags; |
| 26 | + UINT32 sys_size; |
| 27 | + UINT16 ram_size; |
| 28 | + UINT16 video_mode; |
| 29 | + UINT16 root_dev; |
| 30 | + UINT16 signature; /* Boot signature */ |
| 31 | + UINT16 jump; |
| 32 | + UINT32 header; |
| 33 | + UINT16 version; |
| 34 | + UINT16 su_switch; |
| 35 | + UINT16 setup_seg; |
| 36 | + UINT16 start_sys; |
| 37 | + UINT16 kernel_ver; |
| 38 | + UINT8 loader_id; |
| 39 | + UINT8 load_flags; |
| 40 | + UINT16 movesize; |
| 41 | + UINT32 code32_start; /* Start of code loaded high */ |
| 42 | + UINT32 ramdisk_start; /* Start of initial ramdisk */ |
| 43 | + UINT32 ramdisk_len; /* Length of initial ramdisk */ |
| 44 | + UINT32 bootsect_kludge; |
| 45 | + UINT16 heap_end; |
| 46 | + UINT8 ext_loader_ver; /* Extended boot loader version */ |
| 47 | + UINT8 ext_loader_type; /* Extended boot loader ID */ |
| 48 | + UINT32 cmd_line_ptr; /* 32-bit pointer to the kernel command line */ |
| 49 | + UINT32 ramdisk_max; /* Highest legal initrd address */ |
| 50 | + UINT32 kernel_alignment; /* Physical addr alignment required for kernel */ |
| 51 | + UINT8 relocatable_kernel; /* Whether kernel is relocatable or not */ |
| 52 | + UINT8 min_alignment; |
| 53 | + UINT16 xloadflags; |
| 54 | + UINT32 cmdline_size; |
| 55 | + UINT32 hardware_subarch; |
| 56 | + UINT64 hardware_subarch_data; |
| 57 | + UINT32 payload_offset; |
| 58 | + UINT32 payload_length; |
| 59 | + UINT64 setup_data; |
| 60 | + UINT64 pref_address; |
| 61 | + UINT32 init_size; |
| 62 | + UINT32 handover_offset; |
| 63 | +}; |
| 64 | + |
| 65 | +struct efi_info { |
| 66 | + UINT32 efi_loader_signature; |
| 67 | + UINT32 efi_systab; |
| 68 | + UINT32 efi_memdesc_size; |
| 69 | + UINT32 efi_memdesc_version; |
| 70 | + UINT32 efi_memmap; |
| 71 | + UINT32 efi_memmap_size; |
| 72 | + UINT32 efi_systab_hi; |
| 73 | + UINT32 efi_memmap_hi; |
| 74 | +}; |
| 75 | + |
| 76 | +struct e820_entry { |
| 77 | + UINT64 addr; /* start of memory segment */ |
| 78 | + UINT64 size; /* size of memory segment */ |
| 79 | + UINT32 type; /* type of memory segment */ |
| 80 | +}; |
| 81 | + |
| 82 | +struct screen_info { |
| 83 | + UINT8 orig_x; /* 0x00 */ |
| 84 | + UINT8 orig_y; /* 0x01 */ |
| 85 | + UINT16 ext_mem_k; /* 0x02 */ |
| 86 | + UINT16 orig_video_page; /* 0x04 */ |
| 87 | + UINT8 orig_video_mode; /* 0x06 */ |
| 88 | + UINT8 orig_video_cols; /* 0x07 */ |
| 89 | + UINT8 flags; /* 0x08 */ |
| 90 | + UINT8 unused2; /* 0x09 */ |
| 91 | + UINT16 orig_video_ega_bx;/* 0x0a */ |
| 92 | + UINT16 unused3; /* 0x0c */ |
| 93 | + UINT8 orig_video_lines; /* 0x0e */ |
| 94 | + UINT8 orig_video_isVGA; /* 0x0f */ |
| 95 | + UINT16 orig_video_points;/* 0x10 */ |
| 96 | + |
| 97 | + /* VESA graphic mode -- linear frame buffer */ |
| 98 | + UINT16 lfb_width; /* 0x12 */ |
| 99 | + UINT16 lfb_height; /* 0x14 */ |
| 100 | + UINT16 lfb_depth; /* 0x16 */ |
| 101 | + UINT32 lfb_base; /* 0x18 */ |
| 102 | + UINT32 lfb_size; /* 0x1c */ |
| 103 | + UINT16 cl_magic, cl_offset; /* 0x20 */ |
| 104 | + UINT16 lfb_linelength; /* 0x24 */ |
| 105 | + UINT8 red_size; /* 0x26 */ |
| 106 | + UINT8 red_pos; /* 0x27 */ |
| 107 | + UINT8 green_size; /* 0x28 */ |
| 108 | + UINT8 green_pos; /* 0x29 */ |
| 109 | + UINT8 blue_size; /* 0x2a */ |
| 110 | + UINT8 blue_pos; /* 0x2b */ |
| 111 | + UINT8 rsvd_size; /* 0x2c */ |
| 112 | + UINT8 rsvd_pos; /* 0x2d */ |
| 113 | + UINT16 vesapm_seg; /* 0x2e */ |
| 114 | + UINT16 vesapm_off; /* 0x30 */ |
| 115 | + UINT16 pages; /* 0x32 */ |
| 116 | + UINT16 vesa_attributes; /* 0x34 */ |
| 117 | + UINT32 capabilities; /* 0x36 */ |
| 118 | + UINT8 _reserved[6]; /* 0x3a */ |
| 119 | +}; |
| 120 | + |
| 121 | +struct boot_params { |
| 122 | +struct screen_info screen_info; |
| 123 | + UINT8 apm_bios_info[0x14]; |
| 124 | + UINT8 _pad2[4]; |
| 125 | + UINT64 tboot_addr; |
| 126 | + UINT8 ist_info[0x10]; |
| 127 | + UINT8 _pad3[16]; |
| 128 | + UINT8 hd0_info[16]; |
| 129 | + UINT8 hd1_info[16]; |
| 130 | + UINT8 sys_desc_table[0x10]; |
| 131 | + UINT8 olpc_ofw_header[0x10]; |
| 132 | + UINT8 _pad4[128]; |
| 133 | + UINT8 edid_info[0x80]; |
| 134 | + struct efi_info efi_info; |
| 135 | + UINT32 alt_mem_k; |
| 136 | + UINT32 scratch; |
| 137 | + UINT8 e820_entries; |
| 138 | + UINT8 eddbuf_entries; |
| 139 | + UINT8 edd_mbr_sig_buf_entries; |
| 140 | + UINT8 _pad6[6]; |
| 141 | + struct setup_header hdr; |
| 142 | + UINT8 _pad7[0x290-0x1f1-sizeof(struct setup_header)]; |
| 143 | + UINT32 edd_mbr_sig_buffer[16]; |
| 144 | + struct e820_entry e820_map[128]; |
| 145 | + UINT8 _pad8[48]; |
| 146 | + UINT8 eddbuf[0x1ec]; |
| 147 | + UINT8 _pad9[276]; |
| 148 | +}; |
| 149 | + |
| 150 | +typedef struct { |
| 151 | + UINT16 limit; |
| 152 | + UINT64 *base; |
| 153 | +} dt_addr_t; |
| 154 | + |
| 155 | +#pragma pack() |
| 156 | + |
| 157 | +extern EFI_STATUS setup_graphics(struct boot_params *buf); |
| 158 | + |
| 159 | +#endif /* __LINUX_BZIMAGE_H__ */ |
0 commit comments