Skip to content
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
7 changes: 4 additions & 3 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,6 @@ config ARCH_CHIP_CXD56XX
select ARCH_HAVE_MATH_H
select ARCH_HAVE_I2CRESET
select ARCH_HAVE_CUSTOM_TESTSET
select LIBC_ARCH_ATOMIC if SMP
---help---
Sony CXD56XX (ARM Cortex-M4) architectures

Expand Down Expand Up @@ -935,15 +934,14 @@ config ARCH_CHIP_CXD32XX
bool "Sony CXD32xx"
select ARCH_CORTEXM4
select ARCH_HAVE_FPU
select LIBC_ARCH_ATOMIC
select LIBC_ATOMIC_IRQ
---help---
Sony CXD32XX (ARM Cortex-M4) architectures

config ARCH_CHIP_HT32F491X3
bool "Holtek HT32F491x3"
select ARCH_CORTEXM4
select ARCH_HAVE_FPU
select LIBC_ARCH_ATOMIC
---help---
Holtek HT32F491x3 (ARM Cortex-M4) architectures

Expand All @@ -967,6 +965,7 @@ config ARCH_ARM7TDMI
default n
select ARCH_DCACHE
select ARCH_ICACHE
select LIBC_ATOMIC_IRQ
---help---
The Arm7TDMI-S is an excellent workhorse processor capable of a wide
array of applications. Traditionally used in mobile handsets, the
Expand Down Expand Up @@ -996,6 +995,7 @@ config ARCH_ARM926EJS
select ARCH_ICACHE
select ARCH_HAVE_MMU
select ARCH_USE_MMU
select LIBC_ATOMIC_IRQ
---help---
Arm926EJ-S is the entry point processor capable of supporting full
Operating Systems including Linux, WindowsCE, and Symbian.
Expand Down Expand Up @@ -1051,6 +1051,7 @@ config ARCH_ARMV6M
bool
default n
select ARCH_HAVE_CPUINFO
select LIBC_ATOMIC_IRQ

config ARCH_CORTEXM0
bool
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/armv7-a/arm_gicv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static atomic_t g_gic_init_done;
#if defined(CONFIG_SMP) && CONFIG_SMP_NCPUS > 1
static void arm_gic_init_done(void)
{
atomic_fetch_or(&g_gic_init_done, 1 << this_cpu());
atomic_or(&g_gic_init_done, 1 << this_cpu());
}

static void arm_gic_wait_done(cpu_set_t cpuset)
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/src/rtl8720c/amebaz_depend.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ static void *device_mutex[5];
static void device_mutex_init(uint32_t device)
{
irqstate_t status;
if (atomic_fetch_or(&mutex_init, (1 << device)) & (1 << device) == 0)
if (atomic_or(&mutex_init, (1 << device)) & (1 << device) == 0)
{
rtw_mutex_init(&device_mutex[device]);
}
Expand Down
1 change: 1 addition & 0 deletions arch/arm/src/s32k1xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ config ARCH_CHIP_S32K11X
bool
select ARCH_CORTEXM0
select S32K1XX_HAVE_FIRC_CMU
select LIBC_ATOMIC_IRQ

config ARCH_CHIP_S32K14X
bool
Expand Down
2 changes: 1 addition & 1 deletion arch/arm64/src/imx9/imx9_scmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ static int imx9_scmi_tx(uint32_t channel, uint32_t protocol_id,
*header = SCMI_HEADER_MSG(message_id)
| SCMI_HEADER_PROTOCOL(protocol_id)
| SCMI_HEADER_TYPE(0UL)
| SCMI_HEADER_TOKEN(atomic_fetch_add(&g_token, 1));
| SCMI_HEADER_TOKEN(atomic_add(&g_token, 1));
msg->header = *header;

/* Send message via transport */
Expand Down
4 changes: 4 additions & 0 deletions arch/avr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ config ARCH_CHIP_ATMEGA
bool "ATMega family"
select ARCH_FAMILY_AVR
select MM_SMALL
select LIBC_ATOMIC_IRQ
---help---
Atmel ATMega family of 8-bit AVRs.

config ARCH_CHIP_AT90USB
bool "AT90USB family"
select ARCH_FAMILY_AVR
select LIBC_ATOMIC_IRQ
select MM_SMALL
---help---
Atmel AT90USB family of 8-bit AVRs.
Expand All @@ -35,12 +37,14 @@ config ARCH_CHIP_AVRDX
config ARCH_CHIP_AT32UC3
bool "AVR32 AT32UC3* family"
select ARCH_FAMILY_AVR32
select LIBC_ATOMIC_IRQ
---help---
Atmel AT32UC3A/B/C family of 32-bit AVR32s.

config ARCH_CHIP_AVR_CUSTOM
bool "Custom AVR chip"
select ARCH_CHIP_CUSTOM
select LIBC_ATOMIC_IRQ
---help---
Select this option if there is no directory for the chip under arch/avr/src/.

Expand Down
1 change: 1 addition & 0 deletions arch/renesas/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ config ARCH_RENESAS_RX
default n
select ARCH_HAVE_SETJMP
select CYGWIN_WINTOOL if WINDOWS_CYGWIN
select LIBC_ATOMIC_IRQ

config ARCH_RX65N
bool
Expand Down
5 changes: 5 additions & 0 deletions arch/risc-v/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ config ARCH_CHIP_BL602
select ONESHOT_COUNT
select ONESHOT_FAST_DIVISION
select ALARM_ARCH
select LIBC_ATOMIC_IRQ
---help---
BouffaloLab BL602(rv32imfc)

Expand Down Expand Up @@ -112,6 +113,7 @@ config ARCH_CHIP_ESP32C3_LEGACY
select ARCH_HAVE_RAMFUNCS
select ONESHOT_COUNT if ONESHOT
select ONESHOT_FAST_DIVISION if ONESHOT
select LIBC_ATOMIC_IRQ
---help---
Espressif ESP32-C3 (RV32IMC). Legacy implementation.

Expand Down Expand Up @@ -145,6 +147,7 @@ config ARCH_CHIP_ESP32C3
select ONESHOT_COUNT if ONESHOT
select ONESHOT_FAST_DIVISION if ONESHOT
select ARCH_MINIMAL_VECTORTABLE
select LIBC_ATOMIC_IRQ
---help---
ESP32-C3 chip with a single RISC-V IMC core, no embedded Flash memory

Expand Down Expand Up @@ -210,6 +213,7 @@ config ARCH_CHIP_ESP32H2
select ONESHOT_COUNT if ONESHOT
select ONESHOT_FAST_DIVISION if ONESHOT
select ARCH_MINIMAL_VECTORTABLE
select LIBC_ATOMIC_IRQ
---help---
Espressif ESP32-H2 (RV32IMC).

Expand Down Expand Up @@ -296,6 +300,7 @@ config ARCH_CHIP_RV32M1
select ONESHOT_COUNT
select ONESHOT_FAST_DIVISION
select ALARM_ARCH
select LIBC_ATOMIC_IRQ
---help---
NXP RV32M1 processor (RISC-V Core with PULP extensions).

Expand Down
8 changes: 4 additions & 4 deletions arch/sim/src/sim/sim_ummheap.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,8 @@ static void update_stats(struct mm_heap_s *heap, void *mem, size_t size,
list_add_tail(&heap->alloclist, &node->node);
spin_unlock_irqrestore(&heap->lock, flags);

atomic_fetch_add(&heap->aordblks, 1);
atomic_fetch_add(&heap->uordblks, size);
atomic_add(&heap->aordblks, 1);
atomic_add(&heap->uordblks, size);
usmblks = atomic_read(&heap->usmblks);
do
{
Expand All @@ -189,8 +189,8 @@ static void update_stats(struct mm_heap_s *heap, void *mem, size_t size,
list_delete(&node->node);
spin_unlock_irqrestore(&heap->lock, flags);

atomic_fetch_sub(&heap->aordblks, 1);
atomic_fetch_sub(&heap->uordblks, size);
atomic_sub(&heap->aordblks, 1);
atomic_sub(&heap->uordblks, size);
}
}

Expand Down
2 changes: 2 additions & 0 deletions arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ config ARCH_CHIP_BM3803
select ARCH_HAVE_RAMFUNCS
select ARCH_HAVE_TICKLESS
select ARCH_HAVE_SERIAL_TERMIOS
select LIBC_ATOMIC_IRQ
---help---
Microchip BM3803 (ARCH_SPARC_V8)

Expand All @@ -29,6 +30,7 @@ config ARCH_CHIP_BM3823
select ARCH_VECNOTIRQ
select ARCH_HAVE_RAMFUNCS
select ARCH_HAVE_SERIAL_TERMIOS
select LIBC_ATOMIC_IRQ
---help---
Microchip BM3823 (ARCH_SPARC_V8)

Expand Down
1 change: 1 addition & 0 deletions arch/xtensa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ config ARCH_CHIP_ESP32S2
select LIBC_ARCH_STRNCPY
select LIBC_ARCH_STRLEN
select LIBC_ARCH_STRNLEN
select LIBC_ATOMIC_IRQ
---help---
ESP32-S2 is a truly secure, highly integrated, low-power, 2.4 GHz Wi-Fi
Microcontroller SoC supporting Wi-Fi HT40 and having 43 GPIOs.
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/src/esp32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ config ESP32_RTC_HEAP
config ESP32_IRAM_HEAP
bool "Use the rest of IRAM as a separate heap"
select ARCH_HAVE_EXTRA_HEAPS
select LIBC_ARCH_ATOMIC
select LIBC_ATOMIC_IRQ
select ARCH_USE_TEXT_HEAP
default n

Expand Down
1 change: 0 additions & 1 deletion boards/arm/am67/t3-gem-o1/configs/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ CONFIG_FS_PROCFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_INIT_ENTRYPOINT="nsh_main"
CONFIG_LIBC_ARCH_ATOMIC=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_READLINE=y
Expand Down
4 changes: 2 additions & 2 deletions drivers/i3c/master.c
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ static void i3c_master_handle_ibi(FAR void *arg)
}

master->ops->recycle_ibi_slot(dev, slot);
atomic_fetch_sub(&dev->ibi->pending_ibis, 1);
atomic_sub(&dev->ibi->pending_ibis, 1);
if (!atomic_read(&dev->ibi->pending_ibis))
{
sem_post(&dev->ibi->all_ibis_handled);
Expand Down Expand Up @@ -1800,7 +1800,7 @@ int i3c_master_add_i3c_dev_locked(FAR struct i3c_master_controller *master,
void i3c_master_queue_ibi(FAR struct i3c_dev_desc *dev,
FAR struct i3c_ibi_slot *slot)
{
atomic_fetch_add(&dev->ibi->pending_ibis, 1);
atomic_add(&dev->ibi->pending_ibis, 1);
work_queue(HPWORK, &slot->work, i3c_master_handle_ibi, slot, 0);
}

Expand Down
12 changes: 6 additions & 6 deletions drivers/net/netdev_upperhalf.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static FAR netpkt_t *netpkt_get(FAR struct net_driver_s *dev,
* cases will be limited by netdev_upper_can_tx and seldom reaches here.
*/

if (atomic_fetch_sub(&upper->lower->quota_ptr[type], 1) <= 0)
if (atomic_sub(&upper->lower->quota_ptr[type], 1) <= 0)
{
nwarn("WARNING: Allowing temporarily exceeding quota of %s.\n",
dev->d_ifname);
Expand All @@ -196,7 +196,7 @@ static void netpkt_put(FAR struct net_driver_s *dev, FAR netpkt_t *pkt,

DEBUGASSERT(dev && pkt);

atomic_fetch_add(&upper->lower->quota_ptr[type], 1);
atomic_add(&upper->lower->quota_ptr[type], 1);
netdev_iob_replace_l2(dev, pkt);
}

Expand Down Expand Up @@ -1723,9 +1723,9 @@ FAR netpkt_t *netpkt_alloc(FAR struct netdev_lowerhalf_s *dev,
{
FAR netpkt_t *pkt;

if (atomic_fetch_sub(&dev->quota_ptr[type], 1) <= 0)
if (atomic_sub(&dev->quota_ptr[type], 1) <= 0)
{
atomic_fetch_add(&dev->quota_ptr[type], 1);
atomic_add(&dev->quota_ptr[type], 1);
return NULL;
}

Expand All @@ -1742,7 +1742,7 @@ FAR netpkt_t *netpkt_alloc(FAR struct netdev_lowerhalf_s *dev,

if (pkt == NULL)
{
atomic_fetch_add(&dev->quota_ptr[type], 1);
atomic_add(&dev->quota_ptr[type], 1);
return NULL;
}

Expand All @@ -1766,7 +1766,7 @@ FAR netpkt_t *netpkt_alloc(FAR struct netdev_lowerhalf_s *dev,
void netpkt_free(FAR struct netdev_lowerhalf_s *dev, FAR netpkt_t *pkt,
enum netpkt_type_e type)
{
atomic_fetch_add(&dev->quota_ptr[type], 1);
atomic_add(&dev->quota_ptr[type], 1);
iob_free_chain(pkt);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/note/notesnap_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static inline void notesnap_common(FAR struct note_driver_s *drv,

/* Atomic operation, equivalent to snap.index++; */

index = atomic_fetch_add(&snap->index, 1);
index = atomic_add(&snap->index, 1);
note = &snap->buffer[index % CONFIG_DRIVERS_NOTESNAP_NBUFFERS];

note->type = type;
Expand Down
12 changes: 6 additions & 6 deletions drivers/reset/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ reset_control_get_internal(FAR struct reset_controller_dev *rcdev,
return NULL;
}

atomic_fetch_add(&rstc->refcnt, 1);
atomic_add(&rstc->refcnt, 1);
return rstc;
}
}
Expand Down Expand Up @@ -332,7 +332,7 @@ static void reset_control_put_internal(FAR struct reset_control *rstc)
{
DEBUGASSERT(nxmutex_is_locked(&g_reset_list_mutex));

if (atomic_fetch_sub(&rstc->refcnt, 1) == 1)
if (atomic_sub(&rstc->refcnt, 1) == 1)
{
DEBUGASSERT(nxmutex_is_locked(&g_reset_list_mutex));
list_delete(&rstc->list);
Expand Down Expand Up @@ -533,7 +533,7 @@ int reset_control_reset(FAR struct reset_control *rstc)
return -EINVAL;
}

if (atomic_fetch_add(&rstc->triggered_count, 1) != 0)
if (atomic_add(&rstc->triggered_count, 1) != 0)
{
return 0;
}
Expand All @@ -552,7 +552,7 @@ int reset_control_reset(FAR struct reset_control *rstc)

if (rstc->shared && ret < 0)
{
atomic_fetch_sub(&rstc->triggered_count, 1);
atomic_sub(&rstc->triggered_count, 1);
}

return ret;
Expand Down Expand Up @@ -609,7 +609,7 @@ int reset_control_assert(FAR struct reset_control *rstc)
return -EINVAL;
}

if (atomic_fetch_sub(&rstc->deassert_count, 1) != 1)
if (atomic_sub(&rstc->deassert_count, 1) != 1)
{
return 0;
}
Expand Down Expand Up @@ -688,7 +688,7 @@ int reset_control_deassert(FAR struct reset_control *rstc)
return -EINVAL;
}

if (atomic_fetch_add(&rstc->deassert_count, 1) != 0)
if (atomic_add(&rstc->deassert_count, 1) != 0)
{
return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/rpmsg/rpmsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ void rpmsg_modify_signals(FAR struct rpmsg_s *rpmsg,
FAR struct metal_list *node;
bool needlock;

atomic_fetch_and_acquire(&rpmsg->signals, ~clrflags);
atomic_fetch_or_acquire(&rpmsg->signals, setflags);
atomic_and_acquire(&rpmsg->signals, ~clrflags);
atomic_or_acquire(&rpmsg->signals, setflags);

/* Send signal to Router Hub */

Expand Down
4 changes: 2 additions & 2 deletions drivers/rpmsg/rpmsg_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static void rpmsg_port_hold_rx_buffer(FAR struct rpmsg_device *rdev,
{
FAR struct rpmsg_hdr *rphdr = RPMSG_LOCATE_HDR(rxbuf);

atomic_fetch_add(&rphdr->reserved, 1 << RPMSG_BUF_HELD_SHIFT);
atomic_add(&rphdr->reserved, 1 << RPMSG_BUF_HELD_SHIFT);
}

/****************************************************************************
Expand All @@ -345,7 +345,7 @@ static void rpmsg_port_release_rx_buffer(FAR struct rpmsg_device *rdev,
FAR struct rpmsg_port_header_s *hdr =
metal_container_of(rphdr, struct rpmsg_port_header_s, buf);
uint32_t reserved =
atomic_fetch_sub(&rphdr->reserved, 1 << RPMSG_BUF_HELD_SHIFT);
atomic_sub(&rphdr->reserved, 1 << RPMSG_BUF_HELD_SHIFT);

if ((reserved & RPMSG_BUF_HELD_MASK) == (1 << RPMSG_BUF_HELD_SHIFT))
{
Expand Down
Loading
Loading