diff options
Diffstat (limited to 'cpukit/score/cpu/sparc')
-rw-r--r-- | cpukit/score/cpu/sparc/Makefile.am | 1 | ||||
-rw-r--r-- | cpukit/score/cpu/sparc/preinstall.am | 4 | ||||
-rw-r--r-- | cpukit/score/cpu/sparc/rtems/score/cpusmplock.h | 105 |
3 files changed, 0 insertions, 110 deletions
diff --git a/cpukit/score/cpu/sparc/Makefile.am b/cpukit/score/cpu/sparc/Makefile.am index 6e248a2a4c..504a5752fe 100644 --- a/cpukit/score/cpu/sparc/Makefile.am +++ b/cpukit/score/cpu/sparc/Makefile.am @@ -8,7 +8,6 @@ include_rtems_score_HEADERS = rtems/score/sparc.h include_rtems_score_HEADERS += rtems/score/cpu.h include_rtems_score_HEADERS += rtems/score/types.h include_rtems_score_HEADERS += rtems/score/cpuatomic.h -include_rtems_score_HEADERS += rtems/score/cpusmplock.h noinst_LIBRARIES = libscorecpu.a libscorecpu_a_SOURCES = cpu.c cpu_asm.S diff --git a/cpukit/score/cpu/sparc/preinstall.am b/cpukit/score/cpu/sparc/preinstall.am index e497b48f7f..a2bb01bfd2 100644 --- a/cpukit/score/cpu/sparc/preinstall.am +++ b/cpukit/score/cpu/sparc/preinstall.am @@ -43,7 +43,3 @@ $(PROJECT_INCLUDE)/rtems/score/cpuatomic.h: rtems/score/cpuatomic.h $(PROJECT_IN $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpuatomic.h PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpuatomic.h -$(PROJECT_INCLUDE)/rtems/score/cpusmplock.h: rtems/score/cpusmplock.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp) - $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpusmplock.h -PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpusmplock.h - diff --git a/cpukit/score/cpu/sparc/rtems/score/cpusmplock.h b/cpukit/score/cpu/sparc/rtems/score/cpusmplock.h deleted file mode 100644 index 63b11b4d69..0000000000 --- a/cpukit/score/cpu/sparc/rtems/score/cpusmplock.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * @file - * - * @ingroup ScoreSMPLockSPARC - * - * @brief SPARC SMP Lock Implementation - */ - -/* - * COPYRIGHT (c) 1989-2011. - * On-Line Applications Research Corporation (OAR). - * - * Copyright (c) 2013 embedded brains GmbH - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.com/license/LICENSE. - */ - -#ifndef _RTEMS_SCORE_SPARC_SMPLOCK_H -#define _RTEMS_SCORE_SPARC_SMPLOCK_H - -#include <rtems/score/cpu.h> - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - * @defgroup ScoreSMPLockSPARC SPARC SMP Locks - * - * @ingroup ScoreSMPLock - * - * The implementation is Test and Swap. - * - * @{ - */ - -typedef struct { - uint32_t locked; -} CPU_SMP_lock_Control; - -#define CPU_SMP_LOCK_INITIALIZER { 0 } - -static inline void _CPU_SMP_lock_Initialize( CPU_SMP_lock_Control *lock ) -{ - lock->locked = 0; -} - -/* - * Function to access memory and bypass the cache. - * - * NOTE: address space 1 is uncacheable - * - * FIXME: This implementation uses specific Leon features. - */ -static inline uint32_t _SPARC_Atomic_swap( - volatile uint32_t *address, - uint32_t value -) -{ - asm volatile ( - "swapa [%2] %3, %0" - : "=r" (value) - : "0" (value), "r" (address), "i" (1) - : "memory" - ); - - return value; -} - -static inline void _CPU_SMP_lock_Acquire( CPU_SMP_lock_Control *lock ) -{ - do { - while ( lock->locked ) { - RTEMS_COMPILER_MEMORY_BARRIER(); - } - } while ( _SPARC_Atomic_swap( &lock->locked, 1 ) ); -} - -static inline void _CPU_SMP_lock_Release( CPU_SMP_lock_Control *lock ) -{ - RTEMS_COMPILER_MEMORY_BARRIER(); - lock->locked = 0; -} - -#define _CPU_SMP_lock_ISR_disable_and_acquire( lock, isr_cookie ) \ - do { \ - _CPU_ISR_Disable( isr_cookie ); \ - _CPU_SMP_lock_Acquire( lock ); \ - } while (0) - -#define _CPU_SMP_lock_Release_and_ISR_enable( lock, isr_cookie ) \ - do { \ - _CPU_SMP_lock_Release( lock ); \ - _CPU_ISR_Enable( isr_cookie ); \ - } while (0) - -/**@}*/ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* _RTEMS_SCORE_SPARC_SMPLOCK_H */ |