Skip to content

Commit 38d3a82

Browse files
author
Jan Kamidra
committed
fix ASM issue
1 parent d39fa23 commit 38d3a82

File tree

4 files changed

+91
-9
lines changed

4 files changed

+91
-9
lines changed

CMakeLists.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,7 @@ endif()
255255
if(NOT MBED_IS_NATIVE_BUILD)
256256
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/generated-headers)
257257
mbed_write_target_config_header(${CMAKE_CURRENT_BINARY_DIR}/generated-headers/mbed-target-config.h MBED_TARGET_DEFINITIONS MBED_CONFIG_DEFINITIONS)
258-
# Scope preincluded target config to C/C++ only to avoid leaking into ASM builds
259-
# Use a single OR-ed generator expression and avoid semicolons to prevent
260-
# creation of an empty "-include" argument.
261-
target_compile_options(mbed-core-flags INTERFACE
262-
$<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-include ${CMAKE_CURRENT_BINARY_DIR}/generated-headers/mbed-target-config.h>
263-
)
258+
target_compile_options(mbed-core-flags INTERFACE -include ${CMAKE_CURRENT_BINARY_DIR}/generated-headers/mbed-target-config.h)
264259
target_include_directories(mbed-core-flags INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated-headers)
265260
endif()
266261

cmsis/CMSIS_cmake/cmsis_rtos_rtx.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ endif()
7070
# Make RTX headers and Mbed's device RTOS wrapper headers visible to ALL profiles
7171
# (needed for typedefs like mbed_rtos_storage_* used by headers even in bare-metal)
7272
target_include_directories(mbed-core-flags
73+
BEFORE
7374
INTERFACE
74-
${CMAKE_CURRENT_LIST_DIR}/../device/rtos/include/RTX
75-
${CMAKE_CURRENT_LIST_DIR}/../CMSIS-RTX/Include
76-
${CMAKE_CURRENT_LIST_DIR}/../CMSIS-RTX/Source
75+
${CMAKE_CURRENT_LIST_DIR}/../device/rtos/include/RTX/RTX_overrides
76+
${CMAKE_CURRENT_LIST_DIR}/../device/rtos/include/RTX
77+
${CMAKE_CURRENT_LIST_DIR}/../CMSIS-RTX/Include
78+
${CMAKE_CURRENT_LIST_DIR}/../CMSIS-RTX/Source
7779
)
7880

7981
# RTX source files (only compiled when building with RTOS)
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
/*
2+
* Copyright (c) 2021-2023 Arm Limited. All rights reserved.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the License); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
14+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*
18+
* -----------------------------------------------------------------------------
19+
*
20+
* Project: CMSIS-RTOS RTX
21+
* Title: RTX derived definitions
22+
*
23+
* -----------------------------------------------------------------------------
24+
*/
25+
26+
#ifndef RTX_DEF_H_
27+
#define RTX_DEF_H_
28+
29+
//# ============================================================================
30+
// Mbed OS patch: Exclude RTE_Components.h and RTX_Config.h inclusion in .S files only
31+
// This patch was originally applied in each .S file before including rtx_def.h.
32+
// Apply it here, but restrict to assembler to avoid impacting C/C++ where
33+
// RTX_Config.h must be included to provide macros like OS_TICK_FREQ.
34+
//# ============================================================================
35+
#if defined(__ASSEMBLER__) || defined(__ASSEMBLY__)
36+
#define RTX_CONFIG_H_
37+
#undef _RTE_
38+
#endif
39+
//# ============================================================================
40+
41+
#ifdef _RTE_
42+
#include "RTE_Components.h"
43+
#endif
44+
#include "RTX_Config.h"
45+
46+
#if (defined(OS_SAFETY_FEATURES) && (OS_SAFETY_FEATURES != 0))
47+
#define RTX_SAFETY_FEATURES
48+
#if (defined(OS_SAFETY_CLASS) && (OS_SAFETY_CLASS != 0))
49+
#define RTX_SAFETY_CLASS
50+
#endif
51+
#if (defined(OS_EXECUTION_ZONE) && (OS_EXECUTION_ZONE != 0))
52+
#define RTX_EXECUTION_ZONE
53+
#endif
54+
#if (defined(OS_THREAD_WATCHDOG) && (OS_THREAD_WATCHDOG != 0))
55+
#define RTX_THREAD_WATCHDOG
56+
#endif
57+
#if (defined(OS_OBJ_PTR_CHECK) && (OS_OBJ_PTR_CHECK != 0))
58+
#define RTX_OBJ_PTR_CHECK
59+
#endif
60+
#if (defined(OS_SVC_PTR_CHECK) && (OS_SVC_PTR_CHECK != 0))
61+
#define RTX_SVC_PTR_CHECK
62+
#endif
63+
#endif
64+
65+
#if (defined(OS_OBJ_MEM_USAGE) && (OS_OBJ_MEM_USAGE != 0))
66+
#define RTX_OBJ_MEM_USAGE
67+
#endif
68+
69+
#if (defined(OS_STACK_CHECK) && (OS_STACK_CHECK != 0))
70+
#define RTX_STACK_CHECK
71+
#endif
72+
73+
#if (defined(OS_TZ_CONTEXT) && (OS_TZ_CONTEXT != 0))
74+
#define RTX_TZ_CONTEXT
75+
#endif
76+
77+
#ifndef DOMAIN_NS
78+
#ifdef RTE_CMSIS_RTOS2_RTX5_ARMV8M_NS
79+
#define DOMAIN_NS 1
80+
#else
81+
#define DOMAIN_NS 0
82+
#endif
83+
#endif
84+
85+
#endif // RTX_DEF_H_

0 commit comments

Comments
 (0)