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