armv8: Refactor EFI loader
[barrelfish] / tools / armv8_bootimage / blob.h
1 /*
2  * EFI Blob structure for the ARMv8 platforms
3  *
4  * Copyright (c) 2018, ETH Zurich.
5  * All rights reserved.
6  *
7  * This file is distributed under the terms in the attached LICENSE file.
8  * If you do not find this file, copies can be found by writing to:
9  * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
10  */
11
12 #ifndef BLOB_H
13 #define BLOB_H
14
15 #define BASE_PAGE_SIZE (1<<12)
16
17 // Blob header
18 struct Blob {                   // offsets
19     union {
20         struct {
21             uint64_t magic;
22             uint64_t multiboot; // offset of the Multiboot2 boot info
23             uint64_t multiboot_size;
24             uint64_t modules;
25             uint64_t modules_size;
26             uint64_t boot_driver_entry;
27             uint64_t boot_driver_segment;       // offset of the boot driver image
28             uint64_t boot_driver_segment_size;
29             uint64_t boot_driver_relocations;
30             uint64_t boot_driver_relocations_count;
31             uint64_t cpu_driver_entry;
32             uint64_t cpu_driver_segment;    // offset of the cpu kernel image
33             uint64_t cpu_driver_segment_size;
34             uint64_t cpu_driver_relocations;
35             uint64_t cpu_driver_relocations_count;
36         };
37         unsigned char data[BASE_PAGE_SIZE];
38     };
39 };
40
41 struct Blob_relocation {
42     uint64_t offset, addend;
43 };
44
45 #endif