netbsd_bootinfo.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2008,2009 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /* $NetBSD: bootinfo.h,v 1.16 2009/08/24 02:15:46 jmcneill Exp $ */
  19. /*
  20. * Copyright (c) 1997
  21. * Matthias Drochner. All rights reserved.
  22. *
  23. * Redistribution and use in source and binary forms, with or without
  24. * modification, are permitted provided that the following conditions
  25. * are met:
  26. * 1. Redistributions of source code must retain the above copyright
  27. * notice, this list of conditions and the following disclaimer.
  28. * 2. Redistributions in binary form must reproduce the above copyright
  29. * notice, this list of conditions and the following disclaimer in the
  30. * documentation and/or other materials provided with the distribution.
  31. *
  32. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  33. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  34. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  35. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  36. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  37. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  38. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  39. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  40. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  41. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  42. *
  43. */
  44. #ifndef GRUB_NETBSD_BOOTINFO_CPU_HEADER
  45. #define GRUB_NETBSD_BOOTINFO_CPU_HEADER 1
  46. #include <grub/types.h>
  47. #define NETBSD_BTINFO_BOOTPATH 0
  48. #define NETBSD_BTINFO_ROOTDEVICE 1
  49. #define NETBSD_BTINFO_BOOTDISK 3
  50. #define NETBSD_BTINFO_CONSOLE 6
  51. #define NETBSD_BTINFO_SYMTAB 8
  52. #define NETBSD_BTINFO_MEMMAP 9
  53. #define NETBSD_BTINFO_BOOTWEDGE 10
  54. #define NETBSD_BTINFO_MODULES 11
  55. #define NETBSD_BTINFO_FRAMEBUF 12
  56. #define NETBSD_BTINFO_USERCONFCOMMANDS 13
  57. #define NETBSD_BTINFO_EFI 14
  58. struct grub_netbsd_bootinfo
  59. {
  60. grub_uint32_t bi_count;
  61. grub_uint32_t bi_data[0];
  62. };
  63. struct grub_netbsd_btinfo_common
  64. {
  65. grub_uint32_t len;
  66. grub_uint32_t type;
  67. };
  68. #define GRUB_NETBSD_MAX_BOOTPATH_LEN 80
  69. struct grub_netbsd_btinfo_bootdisk
  70. {
  71. grub_uint32_t labelsector; /* label valid if != 0xffffffff */
  72. struct
  73. {
  74. grub_uint16_t type, checksum;
  75. char packname[16];
  76. } label;
  77. grub_uint32_t biosdev;
  78. grub_uint32_t partition;
  79. };
  80. struct grub_netbsd_btinfo_bootwedge {
  81. grub_uint32_t biosdev;
  82. grub_disk_addr_t startblk;
  83. grub_uint64_t nblks;
  84. grub_disk_addr_t matchblk;
  85. grub_uint64_t matchnblks;
  86. grub_uint8_t matchhash[16]; /* MD5 hash */
  87. } GRUB_PACKED;
  88. struct grub_netbsd_btinfo_symtab
  89. {
  90. grub_uint32_t nsyms;
  91. grub_uint32_t ssyms;
  92. grub_uint32_t esyms;
  93. };
  94. struct grub_netbsd_btinfo_serial
  95. {
  96. char devname[16];
  97. grub_uint32_t addr;
  98. grub_uint32_t speed;
  99. };
  100. struct grub_netbsd_btinfo_modules
  101. {
  102. grub_uint32_t num;
  103. grub_uint32_t last_addr;
  104. struct grub_netbsd_btinfo_module
  105. {
  106. char name[80];
  107. #define GRUB_NETBSD_MODULE_RAW 0
  108. #define GRUB_NETBSD_MODULE_ELF 1
  109. grub_uint32_t type;
  110. grub_uint32_t size;
  111. grub_uint32_t addr;
  112. } mods[0];
  113. };
  114. struct grub_netbsd_btinfo_framebuf
  115. {
  116. grub_uint64_t fbaddr;
  117. grub_uint32_t flags;
  118. grub_uint32_t width;
  119. grub_uint32_t height;
  120. grub_uint16_t pitch;
  121. grub_uint8_t bpp;
  122. grub_uint8_t red_mask_size;
  123. grub_uint8_t green_mask_size;
  124. grub_uint8_t blue_mask_size;
  125. grub_uint8_t red_field_pos;
  126. grub_uint8_t green_field_pos;
  127. grub_uint8_t blue_field_pos;
  128. grub_uint8_t reserved[16];
  129. };
  130. #define GRUB_NETBSD_MAX_ROOTDEVICE_LEN 16
  131. struct grub_netbsd_btinfo_efi
  132. {
  133. void *pa_systbl; /* Physical address of the EFI System Table */
  134. };
  135. #endif