blob: 678b8792c60149b1e7dc247eb7cc499fd0f72fb9 [file] [log] [blame]
Gary Morrison3d7f6542021-01-27 13:08:47 -06001/*
2 * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <lib/el3_runtime/context_mgmt.h>
8#include <lib/el3_runtime/pubsub_events.h>
9
10#include <platform_def.h>
11
12
13/*******************************************************************************
14 * File contains EL2 equivalents of EL3 functions from
15 * .../lib/el3_runtime/aarch64/context_mgmt.c
16 ******************************************************************************/
17
18/*******************************************************************************
19 * Prepare the CPU system registers for first entry into secure or normal world
20 *
21 * The majority of the work needed is only for switching to non-secure, which
22 * is not available on v8-R64 cores, so this function is very simple.
23 ******************************************************************************/
24void cm_prepare_el2_exit(uint32_t security_state)
25{
26 cm_el1_sysregs_context_restore(security_state);
27 cm_set_next_eret_context(security_state);
28}