From 20b184604b377fd212d7e5fdd0cc86a7e1bff3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Sun, 24 Jul 2016 21:26:26 +0200 Subject: [PATCH] cortexm_common: Remove atomic_arch --- cpu/cortexm_common/atomic_arch.c | 48 -------------------------------- cpu/cortexm_common/include/cpu.h | 9 ------ 2 files changed, 57 deletions(-) delete mode 100644 cpu/cortexm_common/atomic_arch.c diff --git a/cpu/cortexm_common/atomic_arch.c b/cpu/cortexm_common/atomic_arch.c deleted file mode 100644 index b6f3666dd..000000000 --- a/cpu/cortexm_common/atomic_arch.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2014-2015 Freie UniversitÀt Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser General - * Public License v2.1. See the file LICENSE in the top level directory for more - * details. - */ - -/** - * @ingroup cpu_cortexm_common - * @{ - * - * @file - * @brief Implementation of the kernels atomic interface - * - * @author Stefan Pfeiffer - * @author Hauke Petersen - * @author Joakim NohlgÄrd - * - * @} - */ - -#include -#include "atomic.h" -#include "irq.h" -#include "cpu.h" - -#if ARCH_HAS_ATOMIC_COMPARE_AND_SWAP -int atomic_cas(atomic_int_t *var, int old, int now) -{ - int tmp; - int status; - - /* Load exclusive */ - tmp = __LDREXW((volatile uint32_t *)(&ATOMIC_VALUE(*var))); - - if (tmp != old) { - /* Clear memory exclusivity */ - __CLREX(); - return 0; - } - - /* Try to write the new value */ - status = __STREXW(now, (volatile uint32_t *)(&ATOMIC_VALUE(*var))); - - return (status == 0); -} -#endif diff --git a/cpu/cortexm_common/include/cpu.h b/cpu/cortexm_common/include/cpu.h index 18e08186a..ae8c812a3 100644 --- a/cpu/cortexm_common/include/cpu.h +++ b/cpu/cortexm_common/include/cpu.h @@ -41,15 +41,6 @@ extern "C" { #endif -/** - * @brief Some members of the Cortex-M family have architecture specific - * atomic operations in atomic_arch.c - */ -#if defined(CPU_ARCH_CORTEX_M3) || defined(CPU_ARCH_CORTEX_M4) || \ - defined(CPU_ARCH_CORTEX_M4F) -#define ARCH_HAS_ATOMIC_COMPARE_AND_SWAP 1 -#endif - /** * @brief Interrupt stack canary value *