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 <jaxson.han@arm.com>
This commit is contained in:
Jaxson Han 2021-07-19 17:42:33 +08:00 committed by Christopher Friedt
commit 0f60930540

23
include/arch/arm64/mm.h Normal file
View file

@ -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 <arch/arm64/arm_mmu.h>
#elif defined(CONFIG_ARM_MPU)
#include <arch/arm64/cortex_r/arm_mpu.h>
#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_ */