bootparam.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. #ifndef _ASM_X86_BOOTPARAM_H
  2. #define _ASM_X86_BOOTPARAM_H
  3. /* setup_data types */
  4. #define SETUP_NONE 0
  5. #define SETUP_E820_EXT 1
  6. #define SETUP_DTB 2
  7. #define SETUP_PCI 3
  8. /* ram_size flags */
  9. #define RAMDISK_IMAGE_START_MASK 0x07FF
  10. #define RAMDISK_PROMPT_FLAG 0x8000
  11. #define RAMDISK_LOAD_FLAG 0x4000
  12. /* loadflags */
  13. #define LOADED_HIGH (1<<0)
  14. #define QUIET_FLAG (1<<5)
  15. #define KEEP_SEGMENTS (1<<6)
  16. #define CAN_USE_HEAP (1<<7)
  17. /* xloadflags */
  18. #define XLF_KERNEL_64 (1<<0)
  19. #define XLF_CAN_BE_LOADED_ABOVE_4G (1<<1)
  20. #define XLF_EFI_HANDOVER_32 (1<<2)
  21. #define XLF_EFI_HANDOVER_64 (1<<3)
  22. #ifndef __ASSEMBLY__
  23. #include <linux/types.h>
  24. #include <linux/screen_info.h>
  25. #include <linux/apm_bios.h>
  26. #include <linux/edd.h>
  27. #include <asm/e820.h>
  28. #include <asm/ist.h>
  29. #include <video/edid.h>
  30. /* extensible setup data list node */
  31. struct setup_data {
  32. __u64 next;
  33. __u32 type;
  34. __u32 len;
  35. __u8 data[0];
  36. };
  37. struct setup_header {
  38. __u8 setup_sects;
  39. __u16 root_flags;
  40. __u32 syssize;
  41. __u16 ram_size;
  42. __u16 vid_mode;
  43. __u16 root_dev;
  44. __u16 boot_flag;
  45. __u16 jump;
  46. __u32 header;
  47. __u16 version;
  48. __u32 realmode_swtch;
  49. __u16 start_sys;
  50. __u16 kernel_version;
  51. __u8 type_of_loader;
  52. __u8 loadflags;
  53. __u16 setup_move_size;
  54. __u32 code32_start;
  55. __u32 ramdisk_image;
  56. __u32 ramdisk_size;
  57. __u32 bootsect_kludge;
  58. __u16 heap_end_ptr;
  59. __u8 ext_loader_ver;
  60. __u8 ext_loader_type;
  61. __u32 cmd_line_ptr;
  62. __u32 initrd_addr_max;
  63. __u32 kernel_alignment;
  64. __u8 relocatable_kernel;
  65. __u8 min_alignment;
  66. __u16 xloadflags;
  67. __u32 cmdline_size;
  68. __u32 hardware_subarch;
  69. __u64 hardware_subarch_data;
  70. __u32 payload_offset;
  71. __u32 payload_length;
  72. __u64 setup_data;
  73. __u64 pref_address;
  74. __u32 init_size;
  75. __u32 handover_offset;
  76. } __attribute__((packed));
  77. struct sys_desc_table {
  78. __u16 length;
  79. __u8 table[14];
  80. };
  81. /* Gleaned from OFW's set-parameters in cpu/x86/pc/linux.fth */
  82. struct olpc_ofw_header {
  83. __u32 ofw_magic; /* OFW signature */
  84. __u32 ofw_version;
  85. __u32 cif_handler; /* callback into OFW */
  86. __u32 irq_desc_table;
  87. } __attribute__((packed));
  88. struct efi_info {
  89. __u32 efi_loader_signature;
  90. __u32 efi_systab;
  91. __u32 efi_memdesc_size;
  92. __u32 efi_memdesc_version;
  93. __u32 efi_memmap;
  94. __u32 efi_memmap_size;
  95. __u32 efi_systab_hi;
  96. __u32 efi_memmap_hi;
  97. };
  98. /* The so-called "zeropage" */
  99. struct boot_params {
  100. struct screen_info screen_info; /* 0x000 */
  101. struct apm_bios_info apm_bios_info; /* 0x040 */
  102. __u8 _pad2[4]; /* 0x054 */
  103. __u64 tboot_addr; /* 0x058 */
  104. struct ist_info ist_info; /* 0x060 */
  105. __u8 _pad3[16]; /* 0x070 */
  106. __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */
  107. __u8 hd1_info[16]; /* obsolete! */ /* 0x090 */
  108. struct sys_desc_table sys_desc_table; /* 0x0a0 */
  109. struct olpc_ofw_header olpc_ofw_header; /* 0x0b0 */
  110. __u32 ext_ramdisk_image; /* 0x0c0 */
  111. __u32 ext_ramdisk_size; /* 0x0c4 */
  112. __u32 ext_cmd_line_ptr; /* 0x0c8 */
  113. __u8 _pad4[116]; /* 0x0cc */
  114. struct edid_info edid_info; /* 0x140 */
  115. struct efi_info efi_info; /* 0x1c0 */
  116. __u32 alt_mem_k; /* 0x1e0 */
  117. __u32 scratch; /* Scratch field! */ /* 0x1e4 */
  118. __u8 e820_entries; /* 0x1e8 */
  119. __u8 eddbuf_entries; /* 0x1e9 */
  120. __u8 edd_mbr_sig_buf_entries; /* 0x1ea */
  121. __u8 kbd_status; /* 0x1eb */
  122. __u8 _pad5[3]; /* 0x1ec */
  123. /*
  124. * The sentinel is set to a nonzero value (0xff) in header.S.
  125. *
  126. * A bootloader is supposed to only take setup_header and put
  127. * it into a clean boot_params buffer. If it turns out that
  128. * it is clumsy or too generous with the buffer, it most
  129. * probably will pick up the sentinel variable too. The fact
  130. * that this variable then is still 0xff will let kernel
  131. * know that some variables in boot_params are invalid and
  132. * kernel should zero out certain portions of boot_params.
  133. */
  134. __u8 sentinel; /* 0x1ef */
  135. __u8 _pad6[1]; /* 0x1f0 */
  136. struct setup_header hdr; /* setup header */ /* 0x1f1 */
  137. __u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)];
  138. __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */
  139. struct e820entry e820_map[E820MAX]; /* 0x2d0 */
  140. __u8 _pad8[48]; /* 0xcd0 */
  141. struct edd_info eddbuf[EDDMAXNR]; /* 0xd00 */
  142. __u8 _pad9[276]; /* 0xeec */
  143. } __attribute__((packed));
  144. enum {
  145. X86_SUBARCH_PC = 0,
  146. X86_SUBARCH_LGUEST,
  147. X86_SUBARCH_XEN,
  148. X86_SUBARCH_MRST,
  149. X86_SUBARCH_CE4100,
  150. X86_NR_SUBARCHS,
  151. };
  152. #endif /* __ASSEMBLY__ */
  153. #endif /* _ASM_X86_BOOTPARAM_H */