mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00

This patch separates the code from SPM_MM to get xlat table context and move it to a common location. In addition, only APIs required from both SPM_MM and FF-A EL3 SPMC are moved to the common location. This allows understanding better what is required to support a S-EL0 SP instead of trying to retrofit what already exists. Signed-off-by: Achin Gupta <achin.gupta@arm.com> Signed-off-by: Nishant Sharma <nishant.sharma@arm.com> Change-Id: I142d7fbef5239869176d0de93842c66051d7ed78
46 lines
1.3 KiB
C
46 lines
1.3 KiB
C
/*
|
|
* Copyright (c) 2017-2023, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef SPM_COMMON_H
|
|
#define SPM_COMMON_H
|
|
|
|
#include <context.h>
|
|
|
|
/*******************************************************************************
|
|
* Constants that allow assembler code to preserve callee-saved registers of the
|
|
* C runtime context while performing a security state switch.
|
|
******************************************************************************/
|
|
#define SP_C_RT_CTX_X19 0x0
|
|
#define SP_C_RT_CTX_X20 0x8
|
|
#define SP_C_RT_CTX_X21 0x10
|
|
#define SP_C_RT_CTX_X22 0x18
|
|
#define SP_C_RT_CTX_X23 0x20
|
|
#define SP_C_RT_CTX_X24 0x28
|
|
#define SP_C_RT_CTX_X25 0x30
|
|
#define SP_C_RT_CTX_X26 0x38
|
|
#define SP_C_RT_CTX_X27 0x40
|
|
#define SP_C_RT_CTX_X28 0x48
|
|
#define SP_C_RT_CTX_X29 0x50
|
|
#define SP_C_RT_CTX_X30 0x58
|
|
|
|
#define SP_C_RT_CTX_SIZE 0x60
|
|
#define SP_C_RT_CTX_ENTRIES (SP_C_RT_CTX_SIZE >> DWORD_SHIFT)
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
#include <stdint.h>
|
|
#include <lib/xlat_tables/xlat_tables_v2.h>
|
|
|
|
/* Assembly helpers */
|
|
uint64_t spm_secure_partition_enter(uint64_t *c_rt_ctx);
|
|
void __dead2 spm_secure_partition_exit(uint64_t c_rt_ctx, uint64_t ret);
|
|
|
|
/* Helper to obtain a reference to the SP's translation table context */
|
|
xlat_ctx_t *spm_get_sp_xlat_context(void);
|
|
|
|
#endif /* __ASSEMBLER__ */
|
|
|
|
#endif /* SPM_COMMON_H */
|