blob: d201590a452d2b1271137af2ee06d35630c4dcee [file] [log] [blame]
Antonio Nino Diazdcf9d922017-10-04 16:52:15 +01001/*
2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef __XLAT_TABLES_ARCH_PRIVATE_H__
8#define __XLAT_TABLES_ARCH_PRIVATE_H__
9
10#include <assert.h>
11#include <xlat_tables_defs.h>
12#include <xlat_tables_v2.h>
13
14/*
15 * Return the execute-never mask that will prevent instruction fetch at all ELs
16 * that are part of the given translation regime.
17 */
18static inline uint64_t xlat_arch_regime_get_xn_desc(xlat_regime_t regime)
19{
20 if (regime == EL1_EL0_REGIME) {
21 return UPPER_ATTRS(UXN) | UPPER_ATTRS(PXN);
22 } else {
23 assert(regime == EL3_REGIME);
24 return UPPER_ATTRS(XN);
25 }
26}
27
28#endif /* __XLAT_TABLES_ARCH_PRIVATE_H__ */