Skip to content

Netsocket/lwIP Stack: Remove support for ARM Compiler 5 #12671

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
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
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,7 @@ COMMON_FUNCTIONS_FN uint_fast8_t common_count_leading_zeros(uint8_t value)

COMMON_FUNCTIONS_FN uint_fast8_t common_count_leading_zeros_8(uint8_t value)
{
#ifdef __CC_ARM
return value ? __clz((unsigned int) value << 24) : 8;
#elif defined __GNUC__
#if defined __GNUC__
return value ? __builtin_clz((unsigned int) value << 24) : 8;
#else
uint_fast8_t cnt = 0;
Expand All @@ -536,9 +534,7 @@ COMMON_FUNCTIONS_FN uint_fast8_t common_count_leading_zeros_8(uint8_t value)

COMMON_FUNCTIONS_FN uint_fast8_t common_count_leading_zeros_16(uint16_t value)
{
#ifdef __CC_ARM
return value ? __clz((unsigned int) value << 16) : 16;
#elif defined __GNUC__
#if defined __GNUC__
return value ? __builtin_clz((unsigned int) value << 16) : 16;
#else
uint_fast8_t cnt = 0;
Expand Down Expand Up @@ -567,9 +563,7 @@ COMMON_FUNCTIONS_FN uint_fast8_t common_count_leading_zeros_16(uint16_t value)

COMMON_FUNCTIONS_FN uint_fast8_t common_count_leading_zeros_32(uint32_t value)
{
#ifdef __CC_ARM
return __clz(value);
#elif defined __GNUC__
#if defined __GNUC__
return value ? __builtin_clz(value) : 32;
#else
uint_fast8_t cnt = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ typedef int_fast32_t int_fast24_t;
#define NS_NORETURN _Noreturn
#elif defined __GNUC__
#define NS_NORETURN __attribute__((__noreturn__))
#elif defined __CC_ARM
#define NS_NORETURN __declspec(noreturn)
#elif defined __IAR_SYSTEMS_ICC__
#define NS_NORETURN __noreturn
#else
Expand All @@ -117,7 +115,7 @@ typedef int_fast32_t int_fast24_t;

/* C11's "alignas" macro, emulated for integer expressions if necessary */
#ifndef __alignas_is_defined
#if defined __CC_ARM || defined __TASKING__
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be

#if defined __TASKING__

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

#if defined __TASKING__
#define alignas(n) __align(n)
#define __alignas_is_defined 1
#elif (defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L) || (defined __cplusplus && __cplusplus >= 201103L)
Expand Down Expand Up @@ -149,7 +147,7 @@ typedef int_fast32_t int_fast24_t;
* static int foo(void) MAYBE_UNUSED;
* ~~~
*/
#if defined __CC_ARM || defined __GNUC__
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be

#if defined __GNUC__

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

#if defined __GNUC__
#define MAYBE_UNUSED __attribute__((unused))
#else
#define MAYBE_UNUSED
Expand Down Expand Up @@ -219,7 +217,7 @@ typedef int_fast32_t int_fast24_t;
#else /* C */
# if __STDC_VERSION__ >= 201112L
# define NS_STATIC_ASSERT(test, str) _Static_assert(test, str);
# elif defined __GNUC__ && NS_GCC_VERSION >= 40600 && !defined __CC_ARM
# elif defined __GNUC__ && NS_GCC_VERSION >= 40600
# ifdef _Static_assert
/*
* Some versions of glibc cdefs.h (which comes in via <stdint.h> above)
Expand Down Expand Up @@ -255,7 +253,7 @@ typedef int_fast32_t int_fast24_t;

/** \brief Pragma to suppress warnings about always true/false comparisons
*/
#if defined __GNUC__ && NS_GCC_VERSION >= 40600 && !defined __CC_ARM
#if defined __GNUC__ && NS_GCC_VERSION >= 40600
#define NS_FUNNY_COMPARE_OK _Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wtype-limits\"")
#define NS_FUNNY_COMPARE_RESTORE _Pragma("GCC diagnostic pop")
Expand All @@ -272,11 +270,7 @@ typedef int_fast32_t int_fast24_t;
* components should ensure this is not included by only using it in
* a ifdef blocks providing dummy definitions.
*/
#ifdef __CC_ARM
// statement is unreachable(111), controlling expression is constant(236), expression has no effect(174),
// function was declared but never referenced(177), variable was set but never used(550)
#define NS_DUMMY_DEFINITIONS_OK _Pragma("diag_suppress=111,236,174,177,550")
#elif defined __IAR_SYSTEMS_ICC__
#if defined __IAR_SYSTEMS_ICC__
// controlling expression is constant
#define NS_DUMMY_DEFINITIONS_OK _Pragma("diag_suppress=Pe236")
#else
Expand Down
9 changes: 1 addition & 8 deletions features/lwipstack/lwip-sys/arch/cc.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,7 @@ extern "C" {
#define LWIP_PROVIDE_ERRNO
#endif

#if defined(__arm__) && defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
/* Keil uVision4 tools */
#define PACK_STRUCT_BEGIN __packed
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END
#define PACK_STRUCT_FIELD(fld) fld
#define ALIGNED(n) __align(n)
#elif defined (__IAR_SYSTEMS_ICC__)
#if defined (__IAR_SYSTEMS_ICC__)
/* IAR Embedded Workbench tools */
#define PACK_STRUCT_BEGIN __packed
#define PACK_STRUCT_STRUCT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@
#elif defined(__clang__)
#define FNET_CFG_COMP_CLANG (1)
#define FNET_COMP_STR "CLANG"
/* Keil uVision compiler using armcc. */
#elif defined(__CC_ARM)
#define FNET_CFG_COMP_UV (1)
#define FNET_COMP_STR "UV"
/* GNU GCC */
#elif defined(__GNUC__)
#define FNET_CFG_COMP_GNUC (1)
Expand Down
4 changes: 0 additions & 4 deletions features/nanostack/sal-stack-nanostack/source/nsconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

#include "ns_types.h"

#ifdef __CC_ARM
#pragma diag_suppress 546 // transfer of control bypasses initialization
#endif

#define __ns_cfg_header(x) #x
#define _ns_cfg_header(x) __ns_cfg_header(configs/cfg_##x.h)
#define ns_cfg_header(x) _ns_cfg_header(x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,6 @@ bool Kinetis_EMAC::low_level_init_successful()
config.rxAccelerConfig = kENET_RxAccelMacCheckEnabled;
ENET_Init(ENET, &g_handle, &config, &buffCfg, hwaddr, sysClock);

#if defined(TOOLCHAIN_ARM)
#if defined(__OPTIMISE_TIME) && (__ARMCC_VERSION < 5060750)
/* Add multicast groups
work around for https://github.com/ARMmbed/mbed-os/issues/4372 */
ENET->GAUR = 0xFFFFFFFFu;
ENET->GALR = 0xFFFFFFFFu;
#endif
#endif

ENET_SetCallback(&g_handle, &Kinetis_EMAC::ethernet_callback, this);
ENET_ActiveRead(ENET);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,6 @@ bool Kinetis_EMAC::low_level_init_successful()
config.rxAccelerConfig = kENET_RxAccelMacCheckEnabled;
ENET_Init(ENET, &g_handle, &config, &buffCfg, hwaddr, sysClock);

#if defined(TOOLCHAIN_ARM)
#if defined(__OPTIMISE_TIME) && (__ARMCC_VERSION < 5060750)
/* Add multicast groups
work around for https://github.com/ARMmbed/mbed-os/issues/4372 */
ENET->GAUR = 0xFFFFFFFFu;
ENET->GALR = 0xFFFFFFFFu;
#endif
#endif

ENET_SetCallback(&g_handle, &Kinetis_EMAC::ethernet_callback, this);
ENET_ActiveRead(ENET);

Expand Down
6 changes: 0 additions & 6 deletions features/netsocket/emac-drivers/TARGET_STM/stm32xx_emac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@ ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptor
#pragma location=0x30040400
uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_MAX_PACKET_SIZE]; /* Ethernet Receive Buffers */

#elif defined ( __CC_ARM ) /* ARMC5 */

__attribute__((section(".RxDecripSection"))) ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */
__attribute__((section(".TxDecripSection"))) ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */
__attribute__((section(".RxArraySection"))) uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_MAX_PACKET_SIZE]; /* Ethernet Receive Buffer */

#elif defined ( __GNUC__ ) /* GCC & ARMC6*/

ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT] __attribute__((section(".RxDecripSection"))); /* Ethernet Rx DMA Descriptors */
Expand Down
9 changes: 1 addition & 8 deletions features/netsocket/ppp/ppp_service_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,7 @@ typedef int sys_prot_t;
#define OUTPUT_BUFFER 0
#define INPUT_BUFFER 1

#if defined(__arm__) && defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 6010050)
/* Keil uVision4 tools */
#define PACK_STRUCT_BEGIN __packed
#define PACK_STRUCT_STRUCT
#define PACK_STRUCT_END
#define PACK_STRUCT_FIELD(fld) fld
#define ALIGNED(n) __align(n)
#elif defined (__IAR_SYSTEMS_ICC__)
#if defined (__IAR_SYSTEMS_ICC__)
/* IAR Embedded Workbench tools */
#define PACK_STRUCT_BEGIN __packed
#define PACK_STRUCT_STRUCT
Expand Down