From 0f6093054081d3eae58fac7e6c269130bee952c0 Mon Sep 17 00:00:00 2001 From: Jaxson Han Date: Mon, 19 Jul 2021 17:42:33 +0800 Subject: [PATCH] include arm64: Add mm.h to unify mmu and mpu The arm_mmu.h and arm_mpu.h have some common logic. To reduce some redundency and the ugly 'if defined' marcos, I add a new header include/arch/arm64/mm.h to include arm_mmu.h or arm_mpu.h depending on CONFIG_ARM_MMU or CONFIG_ARM_MPU. Thus, in the future, the common code of mmu and mpu should be in include/arch/arm64/mm.h. Signed-off-by: Jaxson Han --- include/arch/arm64/mm.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/arch/arm64/mm.h diff --git a/include/arch/arm64/mm.h b/include/arch/arm64/mm.h new file mode 100644 index 00000000000..373e0627cab --- /dev/null +++ b/include/arch/arm64/mm.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021 Arm Limited (or its affiliates). All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef ZEPHYR_INCLUDE_ARCH_ARM64_MM_H_ +#define ZEPHYR_INCLUDE_ARCH_ARM64_MM_H_ + +#if defined(CONFIG_ARM_MMU) +#include +#elif defined(CONFIG_ARM_MPU) +#include +#endif + +#ifndef _ASMLANGUAGE + +struct k_thread; +void z_arm64_thread_mem_domains_init(struct k_thread *thread); +void z_arm64_swap_mem_domains(struct k_thread *thread); + +#endif /* _ASMLANGUAGE */ + +#endif /* ZEPHYR_INCLUDE_ARCH_ARM64_MM_H_ */