Because 'static' we have multiple copies in the binary - does it have pros, or only cons of extra binary size?
Was the hope to have this method always inlined to save on branching?
I am looking at my objdump and it looks like method is not inlined. On the other hand __set_BASEPRI declared "__attribute__( ( always_inline ) ) __STATIC_INLINE" is in fact inlined.
Is that GCC refusing to cooperate on my current optimization level, is it playing smart and choosing to inline __set_BASEPRI but not port_lock ?
Sorry if that's not really a ChibiOS question
Code: Select all
08001bb0 <port_lock>:
/**
* @brief Kernel-lock action.
* @details In this port this function raises the base priority to kernel
* level.
*/
static inline void port_lock(void) {
8001bb0: b082 sub sp, #8
8001bb2: 2320 movs r3, #32
8001bb4: 9301 str r3, [sp, #4]
\param [in] basePri Base Priority value to set
*/
__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_BASEPRI(uint32_t value)
{
__ASM volatile ("MSR basepri, %0" : : "r" (value) : "memory");
8001bb6: 9b01 ldr r3, [sp, #4]
8001bb8: f383 8811 msr BASEPRI, r3
#endif
#endif
#else /* CORTEX_SIMPLIFIED_PRIORITY */
__disable_irq();
#endif /* CORTEX_SIMPLIFIED_PRIORITY */
}
8001bbc: bf00 nop
8001bbe: b002 add sp, #8
8001bc0: 4770 bx lr
8001bc2: bf00 nop
...