esp_hw_support: Remove compare_set.h API

This function removes the following legacy atomic CAS functions:

From compare_set.h (file removed):
- compare_and_set_native()
- compare_and_set_extram()

From portmacro.h
- uxPortCompareSet()
- uxPortCompareSetExtram()

Users should call esp_cpu_compare_and_set() instead as this function hides the details
of atomic CAS on internal and external RAM addresses.

Due to the removal of compare_set.h, some missing header includes are also fixed in this commit.
This commit is contained in:
Darian Leung
2022-07-21 19:14:41 +08:00
parent d37fa7e244
commit 781d06af73
35 changed files with 36 additions and 225 deletions

View File

@@ -13,6 +13,7 @@
#include "esp_macros.h"
#include "hal/cpu_hal.h"
#include "esp_private/crosscore_int.h"
#include "esp_memory_utils.h"
#ifdef __cplusplus
extern "C" {
@@ -241,42 +242,6 @@ static inline BaseType_t xPortInIsrContext(void)
// Added for backward compatibility with IDF
#define xPortInterruptedFromISRContext() xPortInIsrContext()
// ---------------------- Spinlocks ------------------------
/**
* @brief Wrapper for atomic compare-and-set instruction
*
* @note Isn't a real atomic CAS.
* @note [refactor-todo] check if we still need this
* @note [refactor-todo] Check if this function should be renamed (due to void return type)
*
* @param[inout] addr Pointer to target address
* @param[in] compare Compare value
* @param[inout] set Pointer to set value
*/
static inline void __attribute__((always_inline)) uxPortCompareSet(volatile uint32_t *addr, uint32_t compare, uint32_t *set)
{
compare_and_set_native(addr, compare, set);
}
/**
* @brief Wrapper for atomic compare-and-set instruction in external RAM
*
* @note Isn't a real atomic CAS.
* @note [refactor-todo] check if we still need this
* @note [refactor-todo] Check if this function should be renamed (due to void return type)
*
* @param[inout] addr Pointer to target address
* @param[in] compare Compare value
* @param[inout] set Pointer to set value
*/
static inline void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set)
{
#if defined(CONFIG_SPIRAM)
compare_and_set_extram(addr, compare, set);
#endif
}
// ------------------ Critical Sections --------------------
/*