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

This patch introduces the ability of the xlat tables library to manage EL0 and EL1 mappings from a higher exception level. Attributes MT_USER and MT_PRIVILEGED have been added to allow the user specify the target EL in the translation regime EL1&0. REGISTER_XLAT_CONTEXT2 macro is introduced to allow creating a xlat_ctx_t that targets a given translation regime (EL1&0 or EL3). A new member is added to xlat_ctx_t to represent the translation regime the xlat_ctx_t manages. The execute_never mask member is removed as it is computed from existing information. Change-Id: I95e14abc3371d7a6d6a358cc54c688aa9975c110 Co-authored-by: Douglas Raillard <douglas.raillard@arm.com> Co-authored-by: Sandrine Bailleux <sandrine.bailleux@arm.com> Co-authored-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com> Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
28 lines
694 B
C
28 lines
694 B
C
/*
|
|
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef __XLAT_TABLES_ARCH_PRIVATE_H__
|
|
#define __XLAT_TABLES_ARCH_PRIVATE_H__
|
|
|
|
#include <assert.h>
|
|
#include <xlat_tables_defs.h>
|
|
#include <xlat_tables_v2.h>
|
|
|
|
/*
|
|
* Return the execute-never mask that will prevent instruction fetch at all ELs
|
|
* that are part of the given translation regime.
|
|
*/
|
|
static inline uint64_t xlat_arch_regime_get_xn_desc(xlat_regime_t regime)
|
|
{
|
|
if (regime == EL1_EL0_REGIME) {
|
|
return UPPER_ATTRS(UXN) | UPPER_ATTRS(PXN);
|
|
} else {
|
|
assert(regime == EL3_REGIME);
|
|
return UPPER_ATTRS(XN);
|
|
}
|
|
}
|
|
|
|
#endif /* __XLAT_TABLES_ARCH_PRIVATE_H__ */
|