Skip to content

Removed all references to __CC_ARM #12654

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2020
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
9 changes: 2 additions & 7 deletions features/FEATURE_BLE/ble/Gap.h
Original file line number Diff line number Diff line change
Expand Up @@ -2636,12 +2636,9 @@ class LegacyGap :

/* -------- deprecated template implementation -------- */

#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined(__CC_ARM)
#pragma push
#pragma diag_suppress 1361
#endif

#if BLE_ROLE_OBSERVER
Expand Down Expand Up @@ -2687,10 +2684,8 @@ void LegacyGap<Impl>::onRadioNotification(T *tptr, void (T::*mptr)(bool))
radioNotificationCallback.attach(tptr, mptr);
}

#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__CC_ARM)
#pragma pop
#endif

} // interface
Expand Down
11 changes: 2 additions & 9 deletions features/FEATURE_BLE/ble/pal/Deprecated.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,20 @@
/**
* Declare the beginning of a code block that uses a deprecated API
*/
#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#define BLE_DEPRECATED_API_USE_BEGIN() \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#elif defined(__CC_ARM)
#define BLE_DEPRECATED_API_USE_BEGIN() \
_Pragma("push") \
_Pragma("diag_suppress 1361")
Copy link
Member

Choose a reason for hiding this comment

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

Could you use the clang pragma instead when the file is compiled with ARMC6 ?
Please have a look at: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0742b/chr1398848167694.html

#else
#define BLE_DEPRECATED_API_USE_BEGIN()
#endif

/**
* Declare the end of a code block that uses a deprecated API
*/
#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#define BLE_DEPRECATED_API_USE_END() \
_Pragma("GCC diagnostic pop")
#elif defined(__CC_ARM)
#define BLE_DEPRECATED_API_USE_END() \
_Pragma("pop")
#else
#define BLE_DEPRECATED_API_USE_END()
#endif
Expand Down
9 changes: 2 additions & 7 deletions features/FEATURE_BLE/source/LegacyGap.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,9 @@ ble_error_t LegacyGap<Impl>::initRadioNotification(void) {

/* -------- deprecated template implementation -------- */

#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined(__CC_ARM)
#pragma push
#pragma diag_suppress 1361
#endif

template<class Impl>
Expand Down Expand Up @@ -850,10 +847,8 @@ void LegacyGap<Impl>::processAdvertisementReport(
onAdvertisementReport.call(&params);
}

#if defined(__GNUC__) && !defined(__CC_ARM)
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#elif defined(__CC_ARM)
#pragma pop
#endif

#if BLE_ROLE_BROADCASTER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
**************************************************************************************************/

/*! \brief Print function attributes. */
#if defined(__GNUC__) || defined(__CC_ARM)
#if defined(__GNUC__)
#define PRINT_ATTRIBUTE(a, b) __attribute__((format(printf, a, b)))
#else
#define PRINT_ATTRIBUTE(a, b)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extern "C" {
#if (((defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) && \
(!defined(__ICC8051__) || (__ICC8051__ == 0))) || \
(defined(__clang__) || defined(_MSC_VER)) || \
defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) || defined(__ARMCC_VERSION))
defined(__IAR_SYSTEMS_ICC__) || defined(__ARMCC_VERSION))
#include <stdint.h>
#else
/*! \brief Signed 8-bit value. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void uECC_set_rng_ll(uECC_RNG_Function rng_function) {
g_rng_function = rng_function;
}

#if !defined(__CC_ARM) && !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
#if !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
#if (uECC_ASM && (uECC_PLATFORM == uECC_arm || uECC_PLATFORM == uECC_arm_thumb || \
uECC_PLATFORM == uECC_arm_thumb2))
#include "asm_arm.inc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ uECC_asm_fast - Use GCC inline assembly optimized for maximum speed. */
#define uECC_asm_small 1
#define uECC_asm_fast 2
#ifndef uECC_ASM
#if !defined(__CC_ARM) && !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
#if !defined(__ARMCC_VERSION) && !defined(__ICCARM__) && defined(__GNUC__) /* Only support GCC inline asm for now */
#define uECC_ASM uECC_asm_fast
#else // DG: ARMCC 5, unlike GCC, IAR and CLANG, doesn't support GNU-style inline assembly
#define uECC_ASM uECC_asm_none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@
#include "app_error.h"


#if defined(__CC_ARM)
#pragma push
#pragma anon_unions
#elif defined(__ICCARM__)
#if defined(__ICCARM__)
#pragma language=extended
#elif defined(__GNUC__)
/* anonymous unions are enabled by default */
Expand Down Expand Up @@ -80,9 +77,7 @@ typedef struct
} ble_conn_state_t;


#if defined(__CC_ARM)
#pragma pop
#elif defined(__ICCARM__)
#if defined(__ICCARM__)
/* leave anonymous unions enabled */
#elif defined(__GNUC__)
/* anonymous unions are enabled by default */
Expand Down Expand Up @@ -411,4 +406,3 @@ sdk_mapped_flags_t ble_conn_state_user_flag_collection(ble_conn_state_user_flag_
return 0;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@
#include "ble_hci.h"
#include "app_error.h"

#if defined ( __CC_ARM )
#ifndef __ALIGN
#define __ALIGN(x) __align(x) /**< Forced aligment keyword for ARM Compiler */
#endif
#elif defined ( __ICCARM__ )
#if defined ( __ICCARM__ )
#ifndef __ALIGN
#define __ALIGN(x) /**< Forced aligment keyword for IAR Compiler */
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,7 @@

/*lint ++flb "Enter library region" */

#if defined ( __CC_ARM )

#ifndef __ASM
#define __ASM __asm
#endif

#ifndef __INLINE
#define __INLINE __inline
#endif

#ifndef __WEAK
#define __WEAK __weak
#endif

#ifndef __ALIGN
#define __ALIGN(n) __align(n)
#endif

#define GET_SP() __current_sp()

#elif defined ( __ICCARM__ )

#if defined ( __ICCARM__ )
#ifndef __ASM
#define __ASM __asm
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ typedef enum {


/* ------------------- Start of section using anonymous unions ------------------ */
#if defined(__CC_ARM)
#pragma push
#pragma anon_unions
#elif defined(__ICCARM__)
#if defined(__ICCARM__)
#pragma language=extended
#elif defined(__GNUC__)
/* anonymous unions are enabled by default */
Expand Down Expand Up @@ -1155,9 +1152,7 @@ typedef struct { /*!< GPIO Structure


/* -------------------- End of section using anonymous unions ------------------- */
#if defined(__CC_ARM)
#pragma pop
#elif defined(__ICCARM__)
#if defined(__ICCARM__)
/* leave anonymous unions enabled */
#elif defined(__GNUC__)
/* anonymous unions are enabled by default */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,75 +43,8 @@
* @param number_of_ms
*/
/*lint --e{438, 522} "Variable not used" "Function lacks side-effects" */
#if defined ( __CC_ARM )

static __ASM void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
{
loop
SUBS R0, R0, #1
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
#ifdef NRF52
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP
#endif
BNE loop
BX LR
}

#elif defined ( __ICCARM__ )
#if defined ( __ICCARM__ )
Copy link
Member

Choose a reason for hiding this comment

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

Why not provide the proper replacement for ARM compiler 6 assembler ?


static void __INLINE nrf_delay_us(uint32_t volatile number_of_us)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,42 +49,7 @@
*
* @note This function will never return but issue a reset into provided application.
*/
#if defined ( __CC_ARM )
__asm static void bootloader_util_reset(uint32_t start_addr)
{
LDR R5, [R0] ; Get App initial MSP for bootloader.
MSR MSP, R5 ; Set the main stack pointer to the applications MSP.
LDR R0, [R0, #0x04] ; Load Reset handler into R0. This will be first argument to branch instruction (BX).

MOVS R4, #0xFF ; Load ones to R4.
SXTB R4, R4 ; Sign extend R4 to obtain 0xFFFFFFFF instead of 0xFF.
MRS R5, IPSR ; Load IPSR to R5 to check for handler or thread mode.
CMP R5, #0x00 ; Compare, if 0 then we are in thread mode and can continue to reset handler of bootloader.
BNE isr_abort ; If not zero we need to exit current ISR and jump to reset handler of bootloader.

MOV LR, R4 ; Clear the link register and set to ones to ensure no return, R4 = 0xFFFFFFFF.
BX R0 ; Branch to reset handler of bootloader.

isr_abort
; R4 contains ones from line above. Will be popped as R12 when exiting ISR (Cleaning up the registers).
MOV R5, R4 ; Fill with ones before jumping to reset handling. We be popped as LR when exiting ISR. Ensures no return to application.
MOV R6, R0 ; Move address of reset handler to R6. Will be popped as PC when exiting ISR. Ensures the reset handler will be executed when exist ISR.
MOVS r7, #0x21 ; Move MSB reset value of xPSR to R7. Will be popped as xPSR when exiting ISR. xPSR is 0x21000000 thus MSB is 0x21.
REV r7, r7 ; Reverse byte order to put 0x21 as MSB.
PUSH {r4-r7} ; Push everything to new stack to allow interrupt handler to fetch it on exiting the ISR.

MOVS R4, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R0 when exiting ISR (Cleaning up of the registers).
MOVS R5, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R1 when exiting ISR (Cleaning up of the registers).
MOVS R6, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R2 when exiting ISR (Cleaning up of the registers).
MOVS R7, #0x00 ; Fill with zeros before jumping to reset handling. We be popped as R3 when exiting ISR (Cleaning up of the registers).
PUSH {r4-r7} ; Push zeros (R4-R7) to stack to prepare for exiting the interrupt routine.

MOVS R0, #0xF9 ; Move the execution return command into register, 0xFFFFFFF9.
SXTB R0, R0 ; Sign extend R0 to obtain 0xFFFFFFF9 instead of 0xF9.
BX R0 ; No return - Handler mode will be exited. Stack will be popped and execution will continue in reset handler initializing other application.
ALIGN
}
#elif defined ( __GNUC__ )
#if defined ( __GNUC__ )
Copy link
Member

Choose a reason for hiding this comment

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

Is GCC assembly language compatible with ARMC6 ?

static inline void bootloader_util_reset(uint32_t start_addr)
{
__asm volatile(
Expand Down
Loading