Fix cross compilation (e.g. on Darwin). Following changes to make.tmpl,
[AROS.git] / arch / all-pc / boot / grub2-aros / include / grub / offsets.h
blob85e7401aea3e8ebb4cc2db596c9779f2f7a76cfb
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2002,2003,2007,2008 Free Software Foundation, Inc.
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.
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.
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/>.
19 #ifndef OFFSETS_HEADER
20 #define OFFSETS_HEADER 1
22 /* The offset of GRUB_COMPRESSED_SIZE. */
23 #define GRUB_DECOMPRESSOR_I386_PC_COMPRESSED_SIZE 0x08
25 /* The offset of GRUB_COMPRESSED_SIZE. */
26 #define GRUB_DECOMPRESSOR_I386_PC_UNCOMPRESSED_SIZE 0x0c
28 /* Offset of reed_solomon_redundancy. */
29 #define GRUB_KERNEL_I386_PC_REED_SOLOMON_REDUNDANCY 0x10
31 /* Offset of field holding no reed solomon length. */
32 #define GRUB_KERNEL_I386_PC_NO_REED_SOLOMON_LENGTH 0x14
34 #define GRUB_DECOMPRESSOR_I386_PC_BOOT_DEVICE 0x18
36 #define GRUB_DECOMPRESSOR_I386_PC_MAX_DECOMPRESSOR_SIZE (0x9000-0x8200)
38 /* The segment where the kernel is loaded. */
39 #define GRUB_BOOT_I386_PC_KERNEL_SEG 0x800
41 #define GRUB_KERNEL_I386_PC_LINK_ADDR 0x9000
43 /* The upper memory area (starting at 640 kiB). */
44 #define GRUB_MEMORY_I386_PC_UPPER 0xa0000
45 #define GRUB_MEMORY_I386_QEMU_UPPER GRUB_MEMORY_I386_PC_UPPER
47 /* The offset of GRUB_CORE_ENTRY_ADDR. */
48 #define GRUB_BOOT_I386_QEMU_CORE_ENTRY_ADDR 0x4
50 /* The offset of GRUB_CORE_ENTRY_ADDR. */
51 #define GRUB_KERNEL_I386_QEMU_CORE_ENTRY_ADDR 0x8
53 #define GRUB_KERNEL_I386_QEMU_LINK_ADDR 0x8200
55 /* The offset of GRUB_TOTAL_MODULE_SIZE. */
56 #define GRUB_KERNEL_SPARC64_IEEE1275_TOTAL_MODULE_SIZE 0x8
58 #define GRUB_BOOT_SPARC64_IEEE1275_LIST_SIZE 12
60 #define GRUB_BOOT_SPARC64_IEEE1275_IMAGE_ADDRESS 0x4400
61 #define GRUB_KERNEL_SPARC64_IEEE1275_LINK_ADDR 0x4400
63 #define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ALIGN 4
64 #define GRUB_KERNEL_POWERPC_IEEE1275_LINK_ADDR 0x200000
66 #define GRUB_KERNEL_MIPS_LOONGSON_LINK_ADDR 0x80200000
68 #define GRUB_KERNEL_MIPS_LOONGSON_LINK_ALIGN 32
70 #define GRUB_DECOMPRESSOR_MIPS_LOONGSON_COMPRESSED_SIZE 0x8
71 #define GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_SIZE 0xc
72 #define GRUB_DECOMPRESSOR_MIPS_LOONGSON_UNCOMPRESSED_ADDR 0x10
74 #define GRUB_KERNEL_MIPS_LOONGSON_TOTAL_MODULE_SIZE 0x08
76 #define GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ADDR 0x80200000
77 #define GRUB_KERNEL_MIPS_QEMU_MIPS_LINK_ALIGN 32
78 #define GRUB_DECOMPRESSOR_MIPS_QEMU_MIPS_COMPRESSED_SIZE 0x8
79 #define GRUB_DECOMPRESSOR_MIPS_QEMU_MIPS_UNCOMPRESSED_SIZE 0xc
80 #define GRUB_DECOMPRESSOR_MIPS_QEMU_MIPS_UNCOMPRESSED_ADDR 0x10
81 #define GRUB_KERNEL_MIPS_QEMU_MIPS_TOTAL_MODULE_SIZE 0x08
83 #define GRUB_KERNEL_MIPS_ARC_LINK_ADDR 0x88200000
84 #define GRUB_KERNEL_MIPSEL_ARC_LINK_ADDR 0x80700000
85 #define GRUB_KERNEL_MIPS_ARC_LINK_ALIGN 32
87 #define GRUB_DECOMPRESSOR_MIPS_ARC_COMPRESSED_SIZE 0x8
88 #define GRUB_DECOMPRESSOR_MIPS_ARC_UNCOMPRESSED_SIZE 0xc
89 #define GRUB_DECOMPRESSOR_MIPS_ARC_UNCOMPRESSED_ADDR 0x10
91 #define GRUB_KERNEL_MIPS_ARC_TOTAL_MODULE_SIZE 0x08
93 #define GRUB_KERNEL_I386_COREBOOT_LINK_ADDR 0x8200
94 #define GRUB_KERNEL_I386_COREBOOT_MODULES_ADDR 0x100000
96 #define GRUB_KERNEL_I386_IEEE1275_LINK_ADDR 0x10000
98 #define GRUB_KERNEL_I386_IEEE1275_MOD_ALIGN 0x1000
99 #define GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN 0x1
100 #define GRUB_KERNEL_I386_MULTIBOOT_MOD_ALIGN GRUB_KERNEL_I386_COREBOOT_MOD_ALIGN
102 #define GRUB_KERNEL_X86_64_XEN_MOD_ALIGN 0x8
103 #define GRUB_KERNEL_I386_XEN_MOD_ALIGN 0x8
105 /* Non-zero value is only needed for PowerMacs. */
106 #define GRUB_KERNEL_X86_64_XEN_MOD_GAP 0x0
107 #define GRUB_KERNEL_I386_XEN_MOD_GAP 0x0
108 #define GRUB_KERNEL_I386_IEEE1275_MOD_GAP 0x0
109 #define GRUB_KERNEL_I386_COREBOOT_MOD_GAP 0x0
110 #define GRUB_KERNEL_SPARC64_IEEE1275_MOD_GAP 0x0
111 #define GRUB_KERNEL_ARM_UBOOT_MOD_GAP 0x0
113 #define GRUB_KERNEL_POWERPC_IEEE1275_MOD_ALIGN 0x1000
114 #define GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN 3
115 #define GRUB_KERNEL_SPARC64_IEEE1275_MOD_ALIGN (1 << GRUB_KERNEL_SPARC64_IEEE1275_LOG_MOD_ALIGN)
117 #define GRUB_KERNEL_MIPS_LOONGSON_MOD_ALIGN 0x1
118 #define GRUB_KERNEL_MIPS_ARC_MOD_ALIGN 0x1
119 #define GRUB_KERNEL_MIPS_QEMU_MIPS_MOD_ALIGN 0x1
121 #define GRUB_KERNEL_ARM_UBOOT_MOD_ALIGN 0x8
122 #define GRUB_KERNEL_ARM_UBOOT_TOTAL_MODULE_SIZE 0x4
123 #define GRUB_KERNEL_ARM_UBOOT_LINK_ADDR 0x08000000
125 /* Minimal gap between _end and the start of the modules. It's a hack
126 for PowerMac to prevent "CLAIM failed" error. The real fix is to
127 rewrite grub-mkimage to generate valid ELF files. */
128 #define GRUB_KERNEL_POWERPC_IEEE1275_MOD_GAP 0x8000
130 #ifdef GRUB_MACHINE
131 #define GRUB_OFFSETS_CONCAT_(a,b,c) a ## b ## c
132 #define GRUB_OFFSETS_CONCAT(a,b,c) GRUB_OFFSETS_CONCAT_(a,b,c)
133 #define GRUB_KERNEL_MACHINE_MOD_ALIGN GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _MOD_ALIGN)
134 #define GRUB_KERNEL_MACHINE_MOD_GAP GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _MOD_GAP)
135 #define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _TOTAL_MODULE_SIZE)
137 #define GRUB_BOOT_MACHINE_KERNEL_SEG GRUB_OFFSETS_CONCAT (GRUB_BOOT_, GRUB_MACHINE, _KERNEL_SEG)
138 #define GRUB_MEMORY_MACHINE_UPPER GRUB_OFFSETS_CONCAT (GRUB_MEMORY_, GRUB_MACHINE, _UPPER)
139 #if defined (GRUB_MACHINE_ARC) && defined (GRUB_CPU_MIPSEL)
140 #define GRUB_MACHINE_LINK_ADDR GRUB_KERNEL_MIPSEL_ARC_LINK_ADDR
141 #else
142 #define GRUB_MACHINE_LINK_ADDR GRUB_OFFSETS_CONCAT (GRUB_KERNEL_, GRUB_MACHINE, _LINK_ADDR)
143 #endif
145 #define GRUB_DECOMPRESSOR_MACHINE_COMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_DECOMPRESSOR_, GRUB_MACHINE, _COMPRESSED_SIZE)
146 #define GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_SIZE GRUB_OFFSETS_CONCAT (GRUB_DECOMPRESSOR_, GRUB_MACHINE, _UNCOMPRESSED_SIZE)
147 #define GRUB_DECOMPRESSOR_MACHINE_UNCOMPRESSED_ADDR GRUB_OFFSETS_CONCAT (GRUB_DECOMPRESSOR_, GRUB_MACHINE, _UNCOMPRESSED_ADDR)
148 #endif
150 #ifndef ASM_FILE
151 struct grub_pc_bios_boot_blocklist
153 grub_uint64_t start;
154 grub_uint16_t len;
155 grub_uint16_t segment;
156 } GRUB_PACKED;
157 #endif
159 #endif