LinuxBzImage.h 4.6 KB

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