History

Merge master.kernel.org:/home/rmk/linux-2.6-arm

Linus Torvalds committed 20 years ago

Commit ca98f822 parents b67c26e 11849fe6 files · +51 −10Browse files

Showing the changes to include (2 of 6 files). Show all

Unified · Split

2 files
  1. include/asm-arm/semaphore.h +0 −5
  2. include/asm-arm/spinlock.h +24 −2
include/asm-arm/semaphore.h+0−5
@@ -47,11 +47,6 @@ static inline void init_MUTEX_LOCKED(struct semaphore *sem) · 46 unmodified lines
4747 sema_init(sem, 0);
4848 }
4949
50−static inline int sema_count(struct semaphore *sem)
51−{
52− return atomic_read(&sem->count);
53−}
54−
5550 /*
5651 * special register calling convention
5752 */
include/asm-arm/spinlock.h+24−2
@@ -30,6 +30,9 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) · 29 unmodified lines
3030 __asm__ __volatile__(
3131 "1: ldrex %0, [%1]\n"
3232 " teq %0, #0\n"
33+#ifdef CONFIG_CPU_32v6K
34+" wfene\n"
35+#endif
3336 " strexeq %0, %2, [%1]\n"
3437 " teqeq %0, #0\n"
3538 " bne 1b"
@@ -65,7 +68,11 @@ static inline void __raw_spin_unlock(raw_spinlock_t *lock) · 29 unmodified lines
6568 smp_mb();
6669
6770 __asm__ __volatile__(
68−" str %1, [%0]"
71+" str %1, [%0]\n"
72+#ifdef CONFIG_CPU_32v6K
73+" mcr p15, 0, %1, c7, c10, 4\n" /* DSB */
74+" sev"
75+#endif
6976 :
7077 : "r" (&lock->lock), "r" (0)
7178 : "cc");
@@ -87,6 +94,9 @@ static inline void __raw_write_lock(raw_rwlock_t *rw) · 15 unmodified lines
8794 __asm__ __volatile__(
8895 "1: ldrex %0, [%1]\n"
8996 " teq %0, #0\n"
97+#ifdef CONFIG_CPU_32v6K
98+" wfene\n"
99+#endif
90100 " strexeq %0, %2, [%1]\n"
91101 " teq %0, #0\n"
92102 " bne 1b"
@@ -122,7 +132,11 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) · 29 unmodified lines
122132 smp_mb();
123133
124134 __asm__ __volatile__(
125− "str %1, [%0]"
135+ "str %1, [%0]\n"
136+#ifdef CONFIG_CPU_32v6K
137+" mcr p15, 0, %1, c7, c10, 4\n" /* DSB */
138+" sev\n"
139+#endif
126140 :
127141 : "r" (&rw->lock), "r" (0)
128142 : "cc");
@@ -148,6 +162,9 @@ static inline void __raw_read_lock(raw_rwlock_t *rw) · 19 unmodified lines
148162 "1: ldrex %0, [%2]\n"
149163 " adds %0, %0, #1\n"
150164 " strexpl %1, %0, [%2]\n"
165+#ifdef CONFIG_CPU_32v6K
166+" wfemi\n"
167+#endif
151168 " rsbpls %0, %1, #0\n"
152169 " bmi 1b"
153170 : "=&r" (tmp), "=&r" (tmp2)
@@ -169,6 +186,11 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw) · 15 unmodified lines
169186 " strex %1, %0, [%2]\n"
170187 " teq %1, #0\n"
171188 " bne 1b"
189+#ifdef CONFIG_CPU_32v6K
190+"\n cmp %0, #0\n"
191+" mcreq p15, 0, %0, c7, c10, 4\n"
192+" seveq"
193+#endif
172194 : "=&r" (tmp), "=&r" (tmp2)
173195 : "r" (&rw->lock)
174196 : "cc");