Skip to content

Commit

Permalink
Merge branch 'backport/linker_script_check_missing_function_v53' into…
Browse files Browse the repository at this point in the history
… 'release/v5.3'

fix(ieee802154): fix linker error due to static function being inlined(Backport v5.3)

See merge request espressif/esp-idf!34721
  • Loading branch information
Jiang Jiang Jian committed Nov 8, 2024
2 parents 0eb655b + c4bddd3 commit 780f99b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
24 changes: 12 additions & 12 deletions components/ieee802154/driver/esp_ieee802154_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static IRAM_ATTR void receive_ack_timeout_timer_start(uint32_t duration)
}
#endif

static void ieee802154_rx_frame_info_update(void)
static IEEE802154_NOINLINE void ieee802154_rx_frame_info_update(void)
{
uint8_t len = s_rx_frame[s_rx_index][0];
int8_t rssi = s_rx_frame[s_rx_index][len - 1]; // crc is not written to rx buffer
Expand All @@ -161,7 +161,7 @@ uint8_t ieee802154_get_recent_lqi(void)
return s_rx_frame_info[s_recent_rx_frame_info_index].lqi;
}

IEEE802154_STATIC void set_next_rx_buffer(void)
IEEE802154_STATIC IEEE802154_NOINLINE void set_next_rx_buffer(void)
{
uint8_t* next_rx_buffer = NULL;
uint8_t index = 0;
Expand Down Expand Up @@ -194,7 +194,7 @@ IEEE802154_STATIC void set_next_rx_buffer(void)
ieee802154_ll_set_rx_addr(next_rx_buffer);
}

static bool stop_rx(void)
IEEE802154_NOINLINE static bool stop_rx(void)
{
ieee802154_ll_events events;

Expand All @@ -210,7 +210,7 @@ static bool stop_rx(void)
return true;
}

static bool stop_tx_ack(void)
IEEE802154_NOINLINE static bool stop_tx_ack(void)
{
ieee802154_set_cmd(IEEE802154_CMD_STOP);

Expand All @@ -221,7 +221,7 @@ static bool stop_tx_ack(void)
return true;
}

static bool stop_tx(void)
IEEE802154_NOINLINE static bool stop_tx(void)
{
ieee802154_ll_events events;

Expand All @@ -245,21 +245,21 @@ static bool stop_tx(void)
return true;
}

static bool stop_cca(void)
IEEE802154_NOINLINE static bool stop_cca(void)
{
ieee802154_set_cmd(IEEE802154_CMD_STOP);
ieee802154_ll_clear_events(IEEE802154_EVENT_ED_DONE | IEEE802154_EVENT_RX_ABORT);
return true;
}

static bool stop_tx_cca(void)
IEEE802154_NOINLINE static bool stop_tx_cca(void)
{
stop_tx(); // in case the transmission already started
ieee802154_ll_clear_events(IEEE802154_EVENT_TX_ABORT);
return true;
}

static bool stop_rx_ack(void)
IEEE802154_NOINLINE static bool stop_rx_ack(void)
{
ieee802154_ll_events events;

Expand All @@ -281,7 +281,7 @@ static bool stop_rx_ack(void)
return true;
}

static bool stop_ed(void)
IEEE802154_NOINLINE static bool stop_ed(void)
{
ieee802154_set_cmd(IEEE802154_CMD_STOP);

Expand All @@ -290,7 +290,7 @@ static bool stop_ed(void)
return true;
}

IEEE802154_STATIC bool stop_current_operation(void)
IEEE802154_NOINLINE IEEE802154_STATIC bool stop_current_operation(void)
{
event_end_process();
switch (s_ieee802154_state) {
Expand Down Expand Up @@ -629,7 +629,7 @@ IEEE802154_STATIC IRAM_ATTR void ieee802154_exit_critical(void)
portEXIT_CRITICAL(&s_ieee802154_spinlock);
}

static void ieee802154_isr(void *arg)
IEEE802154_NOINLINE static void ieee802154_isr(void *arg)
{
ieee802154_enter_critical();
ieee802154_ll_events events = ieee802154_ll_get_events();
Expand Down Expand Up @@ -878,7 +878,7 @@ esp_err_t ieee802154_transmit(const uint8_t *frame, bool cca)
return ieee802154_transmit_internal(frame, cca);
}

static inline bool is_target_time_expired(uint32_t target, uint32_t now)
IEEE802154_NOINLINE static bool is_target_time_expired(uint32_t target, uint32_t now)
{
return (((now - target) & (1 << 31)) == 0);
}
Expand Down
8 changes: 4 additions & 4 deletions components/ieee802154/driver/esp_ieee802154_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ IEEE802154_STATIC IEEE802154_INLINE bool is_suported_frame_type(uint8_t frame_ty
frame_type == IEEE802154_FRAME_TYPE_ACK || frame_type == IEEE802154_FRAME_TYPE_COMMAND);
}

IEEE802154_STATIC bool is_dst_panid_present(const uint8_t *frame)
IEEE802154_STATIC IEEE802154_NOINLINE bool is_dst_panid_present(const uint8_t *frame)
{
uint8_t dst_mode = dst_addr_mode(frame);
bool dst_panid_present = false;
Expand Down Expand Up @@ -79,7 +79,7 @@ IEEE802154_STATIC bool is_dst_panid_present(const uint8_t *frame)
return dst_panid_present;
}

IEEE802154_STATIC bool is_src_panid_present(const uint8_t *frame)
IEEE802154_STATIC IEEE802154_NOINLINE bool is_src_panid_present(const uint8_t *frame)
{
uint8_t src_mode = src_addr_mode(frame);
bool panid_compression = is_panid_compression(frame);
Expand Down Expand Up @@ -160,7 +160,7 @@ IEEE802154_STATIC IRAM_ATTR uint8_t ieee802154_frame_address_size(const uint8_t
return address_size;
}

IEEE802154_STATIC uint8_t ieee802154_frame_security_header_offset(const uint8_t *frame)
IEEE802154_STATIC IEEE802154_NOINLINE uint8_t ieee802154_frame_security_header_offset(const uint8_t *frame)
{
ESP_RETURN_ON_FALSE_ISR(is_suported_frame_type(ieee802154_frame_get_type(frame)), IEEE802154_FRAME_INVALID_ADDR_MODE, IEEE802154_TAG, "invalid frame type");
uint8_t offset = ieee802154_frame_address_offset(frame);
Expand All @@ -174,7 +174,7 @@ IEEE802154_STATIC uint8_t ieee802154_frame_security_header_offset(const uint8_t
return offset;
}

IEEE802154_STATIC uint8_t ieee802154_frame_get_security_field_len(const uint8_t *frame)
IEEE802154_STATIC IEEE802154_NOINLINE uint8_t ieee802154_frame_get_security_field_len(const uint8_t *frame)
{
ESP_RETURN_ON_FALSE_ISR(is_suported_frame_type(ieee802154_frame_get_type(frame)), IEEE802154_FRAME_INVALID_OFFSET, IEEE802154_TAG, "invalid frame type");

Expand Down
2 changes: 1 addition & 1 deletion components/ieee802154/driver/esp_ieee802154_pib.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void ieee802154_pib_init(void)
set_pending();
}

static uint8_t ieee802154_txpower_convert(int8_t txpower)
IEEE802154_NOINLINE static uint8_t ieee802154_txpower_convert(int8_t txpower)
{
uint8_t ieee820154_txpower_index = 0;
if (txpower >= IEEE802154_TXPOWER_VALUE_MAX) {
Expand Down
3 changes: 1 addition & 2 deletions components/ieee802154/linker.lf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
archive: libieee802154.a
entries:
if IEEE802154_ENABLED = y:
# When adding static functions here, add IEEE802154_NOINLINE attribute to them
esp_ieee802154_ack: ieee802154_ack_config_pending_bit (noflash)
esp_ieee802154_dev: ieee802154_rx_frame_info_update (noflash)
esp_ieee802154_dev: ieee802154_isr (noflash)
Expand Down Expand Up @@ -43,7 +44,6 @@ entries:
esp_ieee802154_dev: ieee802154_receive (noflash)
esp_ieee802154_pib: ieee802154_pib_update (noflash)
esp_ieee802154_pib: ieee802154_txpower_convert (noflash)
esp_ieee802154_pib: ieee802154_set_panid_addr (noflash)
esp_ieee802154_util: ieee802154_channel_to_freq (noflash)
esp_ieee802154: esp_ieee802154_transmit_at (noflash)
esp_ieee802154: esp_ieee802154_receive_at (noflash)
Expand All @@ -54,7 +54,6 @@ entries:
esp_ieee802154: esp_ieee802154_enh_ack_generator (noflash)
esp_ieee802154: esp_ieee802154_get_extended_address (noflash)
esp_ieee802154: esp_ieee802154_set_transmit_security (noflash)
esp_ieee802154_pib: ieee802154_pib_get_extended_address (noflash)

if OPENTHREAD_LINK_METRICS = y:
esp_ieee802154: esp_ieee802154_get_recent_lqi (noflash)
Expand Down
1 change: 1 addition & 0 deletions components/ieee802154/private_include/esp_ieee802154_dev.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ extern void esp_ieee802154_timer1_done(void);
#define IEEE802154_STATIC static
#define IEEE802154_INLINE inline
#endif // CONFIG_IEEE802154_TEST
#define IEEE802154_NOINLINE __attribute__((noinline))

#ifdef __cplusplus
}
Expand Down

0 comments on commit 780f99b

Please sign in to comment.