Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43255 )
Change subject: arch/arm/include/smp/spinlock.h: Drop dead code ......................................................................
arch/arm/include/smp/spinlock.h: Drop dead code
This code is not even being build-tested. Drop it before it grows moss.
Change-Id: I23f9aa969febe58dd3842e6a7cc75a6777b90b17 Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/arch/arm/include/smp/spinlock.h 1 file changed, 0 insertions(+), 45 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/43255/1
diff --git a/src/arch/arm/include/smp/spinlock.h b/src/arch/arm/include/smp/spinlock.h index e7aa367..9fddfad 100644 --- a/src/arch/arm/include/smp/spinlock.h +++ b/src/arch/arm/include/smp/spinlock.h @@ -5,50 +5,5 @@
/* FIXME: implement this for ARM */ #error "implement this for ARM" -#if 0 -/* - * Your basic SMP spinlocks, allowing only a single CPU anywhere - */
-typedef struct { - volatile unsigned int lock; -} spinlock_t; - - -#define SPIN_LOCK_UNLOCKED (spinlock_t) { 1 } -#define DECLARE_SPIN_LOCK(x) static spinlock_t x = SPIN_LOCK_UNLOCKED; - -#define barrier() (__asm__ __volatile__("" : : : "memory")) -#define spin_is_locked(x) (*(volatile char *)(&(x)->lock) != 0) -#define spin_unlock_wait(x) do { barrier(); } while (spin_is_locked(x)) - -static __always_inline void spin_lock(spinlock_t *lock) -{ - unsigned long tmp; - __asm__ __volatile__ ( - "1: ldrex %0, [%1]\n" - " teq %0, #0\n" - " strexeq %0, %2, [%1]\n" - " teqeq %0, #0\n" - " bne 1b\n" - : "=&r" (tmp) - : "r" (&lock->lock), "r" (1) - : "cc" - ); - barrier(); -} - -static __always_inline void spin_unlock(spinlock_t *lock) -{ - __asm__ __volatile__( - " str %1, [%0]\n" - : - : "r" (&lock->lock), "r" (0) - : "cc" - ); -} - -#define cpu_relax() barrier() - -#endif #endif /* ARCH_SMP_SPINLOCK_H */
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43255 )
Change subject: arch/arm/include/smp/spinlock.h: Drop dead code ......................................................................
Patch Set 1: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/43255/1/src/arch/arm/include/smp/sp... File src/arch/arm/include/smp/spinlock.h:
https://review.coreboot.org/c/coreboot/+/43255/1/src/arch/arm/include/smp/sp... PS1, Line 7: #error "implement this for ARM" I'd be okay with just removing the whole file, too.
Hello Julius Werner,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/43255
to look at the new patch set (#3).
Change subject: arch/arm/include/smp/spinlock.h: Drop dead code ......................................................................
arch/arm/include/smp/spinlock.h: Drop dead code
This code is not even being build-tested. Drop it before it grows moss.
Change-Id: I23f9aa969febe58dd3842e6a7cc75a6777b90b17 Signed-off-by: Angel Pons th3fanbus@gmail.com --- D src/arch/arm/include/smp/spinlock.h 1 file changed, 0 insertions(+), 54 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/55/43255/3
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43255 )
Change subject: arch/arm/include/smp/spinlock.h: Drop dead code ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/coreboot/+/43255/1/src/arch/arm/include/smp/sp... File src/arch/arm/include/smp/spinlock.h:
https://review.coreboot.org/c/coreboot/+/43255/1/src/arch/arm/include/smp/sp... PS1, Line 7: #error "implement this for ARM"
I'd be okay with just removing the whole file, too.
Done
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43255 )
Change subject: arch/arm/include/smp/spinlock.h: Drop dead code ......................................................................
Patch Set 3: Code-Review+2
Michael Niewöhner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/43255 )
Change subject: arch/arm/include/smp/spinlock.h: Drop dead code ......................................................................
Patch Set 3: Code-Review+2
Michael Niewöhner has submitted this change. ( https://review.coreboot.org/c/coreboot/+/43255 )
Change subject: arch/arm/include/smp/spinlock.h: Drop dead code ......................................................................
arch/arm/include/smp/spinlock.h: Drop dead code
This code is not even being build-tested. Drop it before it grows moss.
Change-Id: I23f9aa969febe58dd3842e6a7cc75a6777b90b17 Signed-off-by: Angel Pons th3fanbus@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/43255 Reviewed-by: Julius Werner jwerner@chromium.org Reviewed-by: Michael Niewöhner Tested-by: build bot (Jenkins) no-reply@coreboot.org --- D src/arch/arm/include/smp/spinlock.h 1 file changed, 0 insertions(+), 54 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved Michael Niewöhner: Looks good to me, approved
diff --git a/src/arch/arm/include/smp/spinlock.h b/src/arch/arm/include/smp/spinlock.h deleted file mode 100644 index e7aa367..0000000 --- a/src/arch/arm/include/smp/spinlock.h +++ /dev/null @@ -1,54 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ - -#ifndef ARCH_SMP_SPINLOCK_H -#define ARCH_SMP_SPINLOCK_H - -/* FIXME: implement this for ARM */ -#error "implement this for ARM" -#if 0 -/* - * Your basic SMP spinlocks, allowing only a single CPU anywhere - */ - -typedef struct { - volatile unsigned int lock; -} spinlock_t; - - -#define SPIN_LOCK_UNLOCKED (spinlock_t) { 1 } -#define DECLARE_SPIN_LOCK(x) static spinlock_t x = SPIN_LOCK_UNLOCKED; - -#define barrier() (__asm__ __volatile__("" : : : "memory")) -#define spin_is_locked(x) (*(volatile char *)(&(x)->lock) != 0) -#define spin_unlock_wait(x) do { barrier(); } while (spin_is_locked(x)) - -static __always_inline void spin_lock(spinlock_t *lock) -{ - unsigned long tmp; - __asm__ __volatile__ ( - "1: ldrex %0, [%1]\n" - " teq %0, #0\n" - " strexeq %0, %2, [%1]\n" - " teqeq %0, #0\n" - " bne 1b\n" - : "=&r" (tmp) - : "r" (&lock->lock), "r" (1) - : "cc" - ); - barrier(); -} - -static __always_inline void spin_unlock(spinlock_t *lock) -{ - __asm__ __volatile__( - " str %1, [%0]\n" - : - : "r" (&lock->lock), "r" (0) - : "cc" - ); -} - -#define cpu_relax() barrier() - -#endif -#endif /* ARCH_SMP_SPINLOCK_H */