|
| 1 | +/* |
| 2 | + * Copyright (C) 2020 Intel Corporation. All rights reserved. |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: BSD-3-Clause |
| 5 | + */ |
| 6 | + |
| 7 | +/* multiboot2.h - Multiboot 2 header file. */ |
| 8 | +/* Copyright (C) 1999,2003,2007,2008,2009,2010 Free Software Foundation, Inc. |
| 9 | + * |
| 10 | + * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 11 | + * of this software and associated documentation files (the "Software"), to |
| 12 | + * deal in the Software without restriction, including without limitation the |
| 13 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 14 | + * sell copies of the Software, and to permit persons to whom the Software is |
| 15 | + * furnished to do so, subject to the following conditions: |
| 16 | + * |
| 17 | + * The above copyright notice and this permission notice shall be included in |
| 18 | + * all copies or substantial portions of the Software. |
| 19 | + * |
| 20 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 21 | + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 22 | + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ANY |
| 23 | + * DEVELOPER OR DISTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
| 24 | + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR |
| 25 | + * IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 26 | + */ |
| 27 | + |
| 28 | +#ifndef MULTIBOOT2_H |
| 29 | +#define MULTIBOOT2_H |
| 30 | + |
| 31 | +#define MULTIBOOT2_HEADER_ALIGN 8 |
| 32 | + |
| 33 | +#define MULTIBOOT2_HEADER_MAGIC 0xe85250d6U |
| 34 | + |
| 35 | +/* This should be in %eax. */ |
| 36 | +#define MULTIBOOT2_INFO_MAGIC 0x36d76289U |
| 37 | + |
| 38 | +/* Alignment of the multiboot info structure. */ |
| 39 | +#define MULTIBOOT2_INFO_ALIGN 0x00000008U |
| 40 | + |
| 41 | +/* Flags set in the 'flags' member of the multiboot header. */ |
| 42 | + |
| 43 | +#define MULTIBOOT2_TAG_ALIGN 8U |
| 44 | +#define MULTIBOOT2_TAG_TYPE_END 0U |
| 45 | +#define MULTIBOOT2_TAG_TYPE_CMDLINE 1U |
| 46 | +#define MULTIBOOT2_TAG_TYPE_BOOT_LOADER_NAME 2U |
| 47 | +#define MULTIBOOT2_TAG_TYPE_MODULE 3U |
| 48 | +#define MULTIBOOT2_TAG_TYPE_BASIC_MEMINFO 4U |
| 49 | +#define MULTIBOOT2_TAG_TYPE_BOOTDEV 5U |
| 50 | +#define MULTIBOOT2_TAG_TYPE_MMAP 6U |
| 51 | +#define MULTIBOOT2_TAG_TYPE_VBE 7U |
| 52 | +#define MULTIBOOT2_TAG_TYPE_FRAMEBUFFER 8U |
| 53 | +#define MULTIBOOT2_TAG_TYPE_ELF_SECTIONS 9U |
| 54 | +#define MULTIBOOT2_TAG_TYPE_APM 10U |
| 55 | +#define MULTIBOOT2_TAG_TYPE_EFI32 11U |
| 56 | +#define MULTIBOOT2_TAG_TYPE_EFI64 12U |
| 57 | +#define MULTIBOOT2_TAG_TYPE_SMBIOS 13U |
| 58 | +#define MULTIBOOT2_TAG_TYPE_ACPI_OLD 14U |
| 59 | +#define MULTIBOOT2_TAG_TYPE_ACPI_NEW 15U |
| 60 | +#define MULTIBOOT2_TAG_TYPE_NETWORK 16U |
| 61 | +#define MULTIBOOT2_TAG_TYPE_EFI_MMAP 17U |
| 62 | +#define MULTIBOOT2_TAG_TYPE_EFI_BS 18U |
| 63 | +#define MULTIBOOT2_TAG_TYPE_EFI32_IH 19U |
| 64 | +#define MULTIBOOT2_TAG_TYPE_EFI64_IH 20U |
| 65 | +#define MULTIBOOT2_TAG_TYPE_LOAD_BASE_ADDR 21U |
| 66 | + |
| 67 | +#define MULTIBOOT2_HEADER_TAG_END 0 |
| 68 | +#define MULTIBOOT2_HEADER_TAG_INFORMATION_REQUEST 1 |
| 69 | +#define MULTIBOOT2_HEADER_TAG_ADDRESS 2 |
| 70 | +#define MULTIBOOT2_HEADER_TAG_ENTRY_ADDRESS 3 |
| 71 | +#define MULTIBOOT2_HEADER_TAG_CONSOLE_FLAGS 4 |
| 72 | +#define MULTIBOOT2_HEADER_TAG_FRAMEBUFFER 5 |
| 73 | +#define MULTIBOOT2_HEADER_TAG_MODULE_ALIGN 6 |
| 74 | +#define MULTIBOOT2_HEADER_TAG_EFI_BS 7 |
| 75 | +#define MULTIBOOT2_HEADER_TAG_ENTRY_ADDRESS_EFI32 8 |
| 76 | +#define MULTIBOOT2_HEADER_TAG_ENTRY_ADDRESS_EFI64 9 |
| 77 | +#define MULTIBOOT2_HEADER_TAG_RELOCATABLE 10 |
| 78 | + |
| 79 | +#define MULTIBOOT2_ARCHITECTURE_I386 0 |
| 80 | +#define MULTIBOOT2_ARCHITECTURE_MIPS32 4 |
| 81 | + |
| 82 | +#ifndef ASSEMBLER |
| 83 | +struct multiboot2_mmap_entry |
| 84 | +{ |
| 85 | + uint64_t addr; |
| 86 | + uint64_t len; |
| 87 | + uint32_t type; |
| 88 | + uint32_t zero; |
| 89 | +}; |
| 90 | + |
| 91 | +struct multiboot2_tag |
| 92 | +{ |
| 93 | + uint32_t type; |
| 94 | + uint32_t size; |
| 95 | +}; |
| 96 | + |
| 97 | +struct multiboot2_tag_string |
| 98 | +{ |
| 99 | + uint32_t type; |
| 100 | + uint32_t size; |
| 101 | + char string[0]; |
| 102 | +}; |
| 103 | + |
| 104 | +struct multiboot2_tag_module |
| 105 | +{ |
| 106 | + uint32_t type; |
| 107 | + uint32_t size; |
| 108 | + uint32_t mod_start; |
| 109 | + uint32_t mod_end; |
| 110 | + char cmdline[0]; |
| 111 | +}; |
| 112 | + |
| 113 | +struct multiboot2_tag_mmap |
| 114 | +{ |
| 115 | + uint32_t type; |
| 116 | + uint32_t size; |
| 117 | + uint32_t entry_size; |
| 118 | + uint32_t entry_version; |
| 119 | + struct multiboot2_mmap_entry entries[0]; |
| 120 | +}; |
| 121 | + |
| 122 | +struct multiboot2_tag_new_acpi |
| 123 | +{ |
| 124 | + uint32_t type; |
| 125 | + uint32_t size; |
| 126 | + uint8_t rsdp[0]; |
| 127 | +}; |
| 128 | + |
| 129 | +#endif /* ASSEMBLER */ |
| 130 | + |
| 131 | +#endif /* MULTIBOOT2_H */ |
0 commit comments