Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ if(${CMAKE_CROSSCOMPILING})

_mbed_get_cortex_a_exception_handlers()

if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
_mbed_get_cortex_m_exception_handlers(TOOLCHAIN_GCC)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
_mbed_get_cortex_m_exception_handlers(TOOLCHAIN_ARM)
endif()
_mbed_get_cortex_m_exception_handlers(TOOLCHAIN_GCC)
endif()

target_include_directories(mbed-rtos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SVC_ContextRestore:
SUBS R0,R0,#32 // Adjust address
LDMIA R0!,{R4-R7} // Restore R4..R7

MOVS R0,#~0xFFFFFFFD
MOVS R0,#2 // Binary complement of 0xFFFFFFFD
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this file is for M0, does it mean we've decided to use GNU-style assembly for all cores and not just M55? If this is the case, could we remove all the legacy armasm assembly files and rename/remove the intermediate path TOOLCHAIN_GCC?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The legacy tools only use armasm for compiling assembly, so the files are needed to avoid breaking those tools.

Copy link
Contributor

@LDong-Arm LDong-Arm May 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The legacy tools only use armasm for compiling assembly, so the files are needed to avoid breaking those tools.

Fair enough. We should've switched to armclang a long time ago with the legacy tools, but now it's frozen so there's not much we could do...

MVNS R0,R0 // Set EXC_RETURN value
BX R0 // Exit from handler

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SVC_ContextRestore:
SUBS R0,R0,#32 // Adjust address
LDMIA R0!,{R4-R7} // Restore R4..R7

MOVS R0,#~0xFFFFFFFD
MOVS R0,#2 // Binary complement of 0xFFFFFFFD
MVNS R0,R0 // Set EXC_RETURN value
BX R0 // Exit from handler

Expand Down
6 changes: 1 addition & 5 deletions platform/source/TARGET_CORTEX_M/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# Copyright (c) 2020-2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
target_sources(mbed-core INTERFACE TOOLCHAIN_GCC/except.S)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
target_sources(mbed-core INTERFACE TOOLCHAIN_ARM/except.S)
endif()
target_sources(mbed-core INTERFACE TOOLCHAIN_GCC/except.S)

target_sources(mbed-core
INTERFACE
Expand Down
4 changes: 4 additions & 0 deletions platform/source/TARGET_CORTEX_M/TOOLCHAIN_GCC/except.S
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ UsageFault_Handler:
Fault_Handler:
#if (DOMAIN_NS == 1)
#if MBED_CONF_PLATFORM_CRASH_CAPTURE_ENABLED
#if defined(__ARMCC_VERSION)
#define mbed_fault_context Image$$RW_m_crash_data$$ZI$$Base
#else
#define mbed_fault_context __CRASH_DATA_RAM_START__
#endif
#endif

MOV R12,R3
Expand Down
7 changes: 0 additions & 7 deletions tools/cmake/cores/Cortex-M55.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
)
endif()

# We'd like to use just "-mcpu=cortex-m55" in common_options, but due to a bug
# in armclang passing options to armasm, we use the following flags as a
# workaround to select M55.
list(APPEND asm_compile_options
-mcpu=cortex-r7
-Wa,--cpu=cortex-m55
)

function(mbed_set_cpu_core_definitions target)
target_compile_definitions(${target}
Expand Down