From 8097989a01d752250db578c5a6752b0ce8890529 Mon Sep 17 00:00:00 2001 From: Evgeniy Paltsev Date: Thu, 8 Jul 2021 15:30:19 +0300 Subject: [PATCH] ARC: MWDT: workaround paddr_t defined in both Zephyr and toolchain MWDT provides paddr_t type and it conflicts witn Zephyr definition: - Zephyr defines paddr_t as a uintptr_t - MWDT defines paddr_t as a unsigned long This causes extra warnings. However we can safely define paddr_t as a unsigned long for the case when MWDT toolchain is used as they are both unsighned, have same size and aligning. Signed-off-by: Eugeniy Paltsev Signed-off-by: Evgeniy Paltsev --- include/arch/arc/arc_addr_types.h | 27 +++++++++++++++++++++++++++ include/arch/arc/arch.h | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 include/arch/arc/arc_addr_types.h diff --git a/include/arch/arc/arc_addr_types.h b/include/arch/arc/arc_addr_types.h new file mode 100644 index 00000000000..a6073cdd4b8 --- /dev/null +++ b/include/arch/arc/arc_addr_types.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2021 Synopsys. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef ZEPHYR_INCLUDE_ARCH_ARC_ADDR_TYPES_H_ +#define ZEPHYR_INCLUDE_ARCH_ARC_ADDR_TYPES_H_ +#ifndef _ASMLANGUAGE + +/* + * MWDT provides paddr_t type and it conflicts witn Zephyr definition: + * - Zephyr defines paddr_t as a uintptr_t + * - MWDT defines paddr_t as a unsigned long + * This causes extra warnings. However we can safely define + * paddr_t as a unsigned long for the case when MWDT toolchain is used as + * they are both unsighned, have same size and aligning. + */ +#ifdef __CCAC__ +typedef unsigned long paddr_t; +typedef void *vaddr_t; +#else +#include +#endif + +#endif /* _ASMLANGUAGE */ +#endif /* ZEPHYR_INCLUDE_ARCH_ARC_ADDR_TYPES_H_ */ diff --git a/include/arch/arc/arch.h b/include/arch/arc/arch.h index b94ece4db02..79b8ee139db 100644 --- a/include/arch/arc/arch.h +++ b/include/arch/arc/arch.h @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #ifdef CONFIG_ARC_CONNECT