1/*
2 * Copyright 2014, General Dynamics C4 Systems
3 *
4 * This software may be distributed and modified according to the terms of
5 * the GNU General Public License version 2. Note that NO WARRANTY is provided.
6 * See "LICENSE_GPLv2.txt" for details.
7 *
8 * @TAG(GD_GPL)
9 */
10
11#include <config.h>
12#include <util.h>
13#include <api/types.h>
14#include <arch/types.h>
15#include <arch/model/statedata.h>
16#include <arch/object/structures.h>
17#include <arch/machine/debug_conf.h>
18#include <linker.h>
19#include <plat/machine/hardware.h>
20
21#ifdef CONFIG_IPC_BUF_GLOBALS_FRAME
22/* The global frame, mapped in all address spaces */
23word_t armKSGlobalsFrame[BIT(ARMSmallPageBits) / sizeof(word_t)]
24ALIGN_BSS(BIT(ARMSmallPageBits));
25#endif /* CONFIG_IPC_BUF_GLOBALS_FRAME */
26
27/* The top level asid mapping table */
28asid_pool_t *armKSASIDTable[BIT(asidHighBits)];
29
30/* The hardware ASID to virtual ASID mapping table */
31asid_t armKSHWASIDTable[BIT(hwASIDBits)];
32hw_asid_t armKSNextASID;
33
34#ifndef CONFIG_ARM_HYPERVISOR_SUPPORT
35/* The global, privileged, physically-mapped PD */
36pde_t armKSGlobalPD[BIT(PD_INDEX_BITS)] ALIGN_BSS(BIT(seL4_PageDirBits));
37
38/* The global, privileged, page table. */
39pte_t armKSGlobalPT[BIT(PT_INDEX_BITS)] ALIGN_BSS(BIT(seL4_PageTableBits));
40
41#ifdef CONFIG_BENCHMARK_USE_KERNEL_LOG_BUFFER
42pte_t armKSGlobalLogPT[BIT(PT_INDEX_BITS)] ALIGN_BSS(BIT(seL4_PageTableBits));
43#endif /* CONFIG_BENCHMARK_USE_KERNEL_LOG_BUFFER */
44
45#else
46/* The global, hypervisor, level 1 page table */
47pdeS1_t  armHSGlobalPGD[BIT(PGD_INDEX_BITS)] ALIGN_BSS(BIT(PGD_SIZE_BITS));
48/* The global, hypervisor, level 2 page table */
49pdeS1_t  armHSGlobalPD[BIT(PT_INDEX_BITS)]   ALIGN_BSS(BIT(seL4_PageTableBits));
50/* The global, hypervisor, level 3 page table */
51pteS1_t  armHSGlobalPT[BIT(PT_INDEX_BITS)]   ALIGN_BSS(BIT(seL4_PageTableBits));
52/* Global user space mappings, which are empty as there is no hared kernel region */
53pde_t armUSGlobalPD[BIT(PD_INDEX_BITS)] ALIGN_BSS(BIT(seL4_PageDirBits));;
54#ifdef CONFIG_IPC_BUF_GLOBALS_FRAME
55/* User space global mappings */
56pte_t  armUSGlobalPT[BIT(PT_INDEX_BITS)]   ALIGN_BSS(BIT(seL4_PageTableBits));
57#endif /* CONFIG_IPC_BUF_GLOBALS_FRAME */
58/* Current VCPU */
59vcpu_t *armHSCurVCPU;
60/* Whether the current loaded VCPU is enabled in the hardware or not */
61bool_t armHSVCPUActive;
62
63#ifdef CONFIG_HAVE_FPU
64/* Whether the hyper-mode kernel is allowed to execute FPU instructions */
65bool_t armHSFPUEnabled;
66#endif
67
68#endif /* CONFIG_ARM_HYPERVISOR_SUPPORT */
69
70#ifdef ARM_BASE_CP14_SAVE_AND_RESTORE
71/* Null state for the Debug coprocessor's break/watchpoint registers */
72user_breakpoint_state_t armKSNullBreakpointState;
73#endif
74