blob: 39b0a653a8329b99b2b6c888bebc5217ad79fbf2 [file] [log] [blame]
Antonio Nino Diaz609c9192017-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 */
Antonio Nino Diazfd2299e2018-07-03 11:58:49 +010018static inline uint64_t xlat_arch_regime_get_xn_desc(int regime)
Antonio Nino Diaz609c9192017-10-04 16:52:15 +010019{
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__ */