1/**
2 * \file
3 * \brief Data sent to a newly booted kernel
4 */
5
6/*
7 * Copyright (c) 2012, 2017 ETH Zurich.
8 * Copyright (c) 2015, 2016 Hewlett Packard Enterprise Development LP.
9 * All rights reserved.
10 *
11 * This file is distributed under the terms in the attached LICENSE file.
12 * If you do not find this file, copies can be found by writing to:
13 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
14 */
15
16#ifndef _AARCH64_COREDATA_H
17#define _AARCH64_COREDATA_H
18
19#include <barrelfish/static_assert.h>
20
21
22struct armv8_coredata_elf {
23    uint32_t    num;
24    uint32_t    size;
25    uint32_t    addr;
26    uint32_t    shndx;
27};
28
29#define ARMV8_BOOTMAGIC_BSP     0xb001b000
30#define ARMV8_BOOTMAGIC_PSCI    0xb001b001
31#define ARMV8_BOOTMAGIC_PARKING 0xb001b002
32
33struct armv8_coredata_memreg
34{
35    genpaddr_t base;
36    gensize_t length;
37};
38
39/**
40 * \brief Data sent to a newly booted kernel
41 *
42 */
43struct armv8_core_data {
44
45    /**
46     * ARMv8 Boot magic field. Contains the value ARMV8_BOOTMAGIC_*
47     */
48    uint64_t boot_magic;
49
50    /**
51     * Physical address of the kernel stack
52     */
53    genpaddr_t cpu_driver_stack;
54
55    /**
56     * Physical address of the kernel stack
57     */
58    genpaddr_t cpu_driver_stack_limit;
59
60    /**
61     * Physical address of the global data structure shared by all
62     */
63    genpaddr_t cpu_driver_globals_pointer;
64
65    /**
66     * CPU Driver entry point
67     */
68    genvaddr_t cpu_driver_entry;
69
70    /**
71     * CPU driver command line arguments
72     */
73    char cpu_driver_cmdline[128];
74
75    /**
76     * Physical address of the L0 page table in memory
77     */
78    genpaddr_t page_table_root;
79
80    /**
81     * Memory region to be used for the new CPU driver's allocations
82     */
83    struct armv8_coredata_memreg memory;
84
85    /**
86     * Memory region to be used for the new CPU driver's allocations
87     */
88    struct armv8_coredata_memreg urpc_frame;
89
90    /**
91     * Memory region to be used for the new CPU driver's allocations
92     */
93    struct armv8_coredata_memreg monitor_binary;
94
95    /**
96     * memory region of the multiboot image
97     */
98    struct armv8_coredata_memreg multiboot_image;
99
100    lpaddr_t efi_mmap;
101
102    uint64_t    start_kernel_ram; ///< The physical start of allocated kernel memory
103    uint64_t    start_free_ram; ///< The physical start of free ram for the bsp allocator
104
105    uint32_t    chan_id;
106
107    genpaddr_t kcb; ///< The kernel control block
108
109
110    coreid_t src_core_id;
111    coreid_t dst_core_id;
112    hwid_t src_arch_id;
113    hwid_t dst_arch_id;
114
115
116};
117
118STATIC_ASSERT(sizeof(struct armv8_core_data) < 4096,
119        "Core Data structure must not exceed page size");
120
121#define ARMV8_CORE_DATA_PAGES 1100
122
123
124#endif
125