| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is subject to the terms and conditions of the GNU General Public |
| 3 | * License. See the file "COPYING" in the main directory of this archive |
| 4 | * for more details. |
| 5 | * |
| Ralf Baechle | f65e4fa | 2006-09-28 01:45:21 +0100 | [diff] [blame] | 6 | * Copyright (C) 1999, 2000, 06 Ralf Baechle (ralf@linux-mips.org) |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * Copyright (C) 1999, 2000 Silicon Graphics, Inc. |
| 8 | */ |
| 9 | #ifndef _ASM_SPINLOCK_H |
| 10 | #define _ASM_SPINLOCK_H |
| 11 | |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 12 | #include <linux/compiler.h> |
| 13 | |
| Ralf Baechle | 0004a9d | 2006-10-31 03:45:07 +0000 | [diff] [blame] | 14 | #include <asm/barrier.h> |
| Peter Zijlstra | 726328d | 2016-05-26 10:35:03 +0200 | [diff] [blame] | 15 | #include <asm/processor.h> |
| Paul Burton | 25da4e9 | 2017-06-09 17:26:42 -0700 | [diff] [blame^] | 16 | #include <asm/qrwlock.h> |
| Maciej W. Rozycki | b0984c4 | 2014-11-15 22:08:48 +0000 | [diff] [blame] | 17 | #include <asm/compiler.h> |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | #include <asm/war.h> |
| 19 | |
| 20 | /* |
| 21 | * Your basic SMP spinlocks, allowing only a single CPU anywhere |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 22 | * |
| Ralf Baechle | 7034228 | 2013-01-22 12:59:30 +0100 | [diff] [blame] | 23 | * Simple spin lock operations. There are two variants, one clears IRQ's |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | * on the local processor, one does not. |
| 25 | * |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 26 | * These are fair FIFO ticket locks |
| 27 | * |
| 28 | * (the type definitions are in asm/spinlock_types.h) |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | */ |
| 30 | |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 31 | |
| 32 | /* |
| 33 | * Ticket locks are conceptually two parts, one indicating the current head of |
| 34 | * the queue, and the other indicating the current tail. The lock is acquired |
| 35 | * by atomically noting the tail and incrementing it by one (thus adding |
| 36 | * ourself to the queue and noting our position), then waiting until the head |
| 37 | * becomes equal to the the initial value of the tail. |
| 38 | */ |
| 39 | |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 40 | static inline int arch_spin_is_locked(arch_spinlock_t *lock) |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 41 | { |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 42 | u32 counters = ACCESS_ONCE(lock->lock); |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 43 | |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 44 | return ((counters >> 16) ^ counters) & 0xffff; |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 45 | } |
| 46 | |
| Paul Burton | 5fac4f7 | 2015-07-30 08:16:10 -0700 | [diff] [blame] | 47 | static inline int arch_spin_value_unlocked(arch_spinlock_t lock) |
| 48 | { |
| 49 | return lock.h.serving_now == lock.h.ticket; |
| 50 | } |
| 51 | |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 52 | #define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock) |
| Peter Zijlstra | 726328d | 2016-05-26 10:35:03 +0200 | [diff] [blame] | 53 | |
| 54 | static inline void arch_spin_unlock_wait(arch_spinlock_t *lock) |
| 55 | { |
| 56 | u16 owner = READ_ONCE(lock->h.serving_now); |
| 57 | smp_rmb(); |
| 58 | for (;;) { |
| 59 | arch_spinlock_t tmp = READ_ONCE(*lock); |
| 60 | |
| 61 | if (tmp.h.serving_now == tmp.h.ticket || |
| 62 | tmp.h.serving_now != owner) |
| 63 | break; |
| 64 | |
| 65 | cpu_relax(); |
| 66 | } |
| 67 | smp_acquire__after_ctrl_dep(); |
| 68 | } |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 69 | |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 70 | static inline int arch_spin_is_contended(arch_spinlock_t *lock) |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 71 | { |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 72 | u32 counters = ACCESS_ONCE(lock->lock); |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 73 | |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 74 | return (((counters >> 16) - counters) & 0xffff) > 1; |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 75 | } |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 76 | #define arch_spin_is_contended arch_spin_is_contended |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 77 | |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 78 | static inline void arch_spin_lock(arch_spinlock_t *lock) |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | { |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 80 | int my_ticket; |
| 81 | int tmp; |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 82 | int inc = 0x10000; |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 83 | |
| 84 | if (R10000_LLSC_WAR) { |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 85 | __asm__ __volatile__ ( |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 86 | " .set push # arch_spin_lock \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 87 | " .set noreorder \n" |
| 88 | " \n" |
| 89 | "1: ll %[ticket], %[ticket_ptr] \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 90 | " addu %[my_ticket], %[ticket], %[inc] \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 91 | " sc %[my_ticket], %[ticket_ptr] \n" |
| 92 | " beqzl %[my_ticket], 1b \n" |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | " nop \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 94 | " srl %[my_ticket], %[ticket], 16 \n" |
| 95 | " andi %[ticket], %[ticket], 0xffff \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 96 | " bne %[ticket], %[my_ticket], 4f \n" |
| 97 | " subu %[ticket], %[my_ticket], %[ticket] \n" |
| 98 | "2: \n" |
| Ralf Baechle | f65e4fa | 2006-09-28 01:45:21 +0100 | [diff] [blame] | 99 | " .subsection 2 \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 100 | "4: andi %[ticket], %[ticket], 0xffff \n" |
| David Daney | 0e6826c | 2009-03-27 10:07:02 -0700 | [diff] [blame] | 101 | " sll %[ticket], 5 \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 102 | " \n" |
| 103 | "6: bnez %[ticket], 6b \n" |
| 104 | " subu %[ticket], 1 \n" |
| 105 | " \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 106 | " lhu %[ticket], %[serving_now_ptr] \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 107 | " beq %[ticket], %[my_ticket], 2b \n" |
| 108 | " subu %[ticket], %[my_ticket], %[ticket] \n" |
| David Daney | 0e6826c | 2009-03-27 10:07:02 -0700 | [diff] [blame] | 109 | " b 4b \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 110 | " subu %[ticket], %[ticket], 1 \n" |
| Ralf Baechle | f65e4fa | 2006-09-28 01:45:21 +0100 | [diff] [blame] | 111 | " .previous \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 112 | " .set pop \n" |
| Markos Chandras | 94bfb75 | 2015-01-26 12:44:11 +0000 | [diff] [blame] | 113 | : [ticket_ptr] "+" GCC_OFF_SMALL_ASM() (lock->lock), |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 114 | [serving_now_ptr] "+m" (lock->h.serving_now), |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 115 | [ticket] "=&r" (tmp), |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 116 | [my_ticket] "=&r" (my_ticket) |
| 117 | : [inc] "r" (inc)); |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 118 | } else { |
| 119 | __asm__ __volatile__ ( |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 120 | " .set push # arch_spin_lock \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 121 | " .set noreorder \n" |
| 122 | " \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 123 | "1: ll %[ticket], %[ticket_ptr] \n" |
| 124 | " addu %[my_ticket], %[ticket], %[inc] \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 125 | " sc %[my_ticket], %[ticket_ptr] \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 126 | " beqz %[my_ticket], 1b \n" |
| 127 | " srl %[my_ticket], %[ticket], 16 \n" |
| 128 | " andi %[ticket], %[ticket], 0xffff \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 129 | " bne %[ticket], %[my_ticket], 4f \n" |
| 130 | " subu %[ticket], %[my_ticket], %[ticket] \n" |
| Paul Burton | 4b5347a | 2017-02-23 14:50:24 +0000 | [diff] [blame] | 131 | "2: .insn \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 132 | " .subsection 2 \n" |
| Markos Chandras | 9ff897c | 2015-04-20 10:54:34 +0100 | [diff] [blame] | 133 | "4: andi %[ticket], %[ticket], 0xffff \n" |
| David Daney | 0e6826c | 2009-03-27 10:07:02 -0700 | [diff] [blame] | 134 | " sll %[ticket], 5 \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 135 | " \n" |
| 136 | "6: bnez %[ticket], 6b \n" |
| 137 | " subu %[ticket], 1 \n" |
| 138 | " \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 139 | " lhu %[ticket], %[serving_now_ptr] \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 140 | " beq %[ticket], %[my_ticket], 2b \n" |
| 141 | " subu %[ticket], %[my_ticket], %[ticket] \n" |
| David Daney | 0e6826c | 2009-03-27 10:07:02 -0700 | [diff] [blame] | 142 | " b 4b \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 143 | " subu %[ticket], %[ticket], 1 \n" |
| 144 | " .previous \n" |
| 145 | " .set pop \n" |
| Markos Chandras | 94bfb75 | 2015-01-26 12:44:11 +0000 | [diff] [blame] | 146 | : [ticket_ptr] "+" GCC_OFF_SMALL_ASM() (lock->lock), |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 147 | [serving_now_ptr] "+m" (lock->h.serving_now), |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 148 | [ticket] "=&r" (tmp), |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 149 | [my_ticket] "=&r" (my_ticket) |
| 150 | : [inc] "r" (inc)); |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 151 | } |
| Ralf Baechle | 0004a9d | 2006-10-31 03:45:07 +0000 | [diff] [blame] | 152 | |
| Ralf Baechle | 17099b1 | 2007-07-14 13:24:05 +0100 | [diff] [blame] | 153 | smp_llsc_mb(); |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | } |
| 155 | |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 156 | static inline void arch_spin_unlock(arch_spinlock_t *lock) |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | { |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 158 | unsigned int serving_now = lock->h.serving_now + 1; |
| 159 | wmb(); |
| 160 | lock->h.serving_now = (u16)serving_now; |
| 161 | nudge_writes(); |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | } |
| 163 | |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 164 | static inline unsigned int arch_spin_trylock(arch_spinlock_t *lock) |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | { |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 166 | int tmp, tmp2, tmp3; |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 167 | int inc = 0x10000; |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 168 | |
| 169 | if (R10000_LLSC_WAR) { |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 170 | __asm__ __volatile__ ( |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 171 | " .set push # arch_spin_trylock \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 172 | " .set noreorder \n" |
| 173 | " \n" |
| 174 | "1: ll %[ticket], %[ticket_ptr] \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 175 | " srl %[my_ticket], %[ticket], 16 \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 176 | " andi %[now_serving], %[ticket], 0xffff \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 177 | " bne %[my_ticket], %[now_serving], 3f \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 178 | " addu %[ticket], %[ticket], %[inc] \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 179 | " sc %[ticket], %[ticket_ptr] \n" |
| 180 | " beqzl %[ticket], 1b \n" |
| 181 | " li %[ticket], 1 \n" |
| 182 | "2: \n" |
| Ralf Baechle | f65e4fa | 2006-09-28 01:45:21 +0100 | [diff] [blame] | 183 | " .subsection 2 \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 184 | "3: b 2b \n" |
| 185 | " li %[ticket], 0 \n" |
| Ralf Baechle | f65e4fa | 2006-09-28 01:45:21 +0100 | [diff] [blame] | 186 | " .previous \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 187 | " .set pop \n" |
| Markos Chandras | 94bfb75 | 2015-01-26 12:44:11 +0000 | [diff] [blame] | 188 | : [ticket_ptr] "+" GCC_OFF_SMALL_ASM() (lock->lock), |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 189 | [ticket] "=&r" (tmp), |
| 190 | [my_ticket] "=&r" (tmp2), |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 191 | [now_serving] "=&r" (tmp3) |
| 192 | : [inc] "r" (inc)); |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 193 | } else { |
| 194 | __asm__ __volatile__ ( |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 195 | " .set push # arch_spin_trylock \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 196 | " .set noreorder \n" |
| 197 | " \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 198 | "1: ll %[ticket], %[ticket_ptr] \n" |
| 199 | " srl %[my_ticket], %[ticket], 16 \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 200 | " andi %[now_serving], %[ticket], 0xffff \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 201 | " bne %[my_ticket], %[now_serving], 3f \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 202 | " addu %[ticket], %[ticket], %[inc] \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 203 | " sc %[ticket], %[ticket_ptr] \n" |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 204 | " beqz %[ticket], 1b \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 205 | " li %[ticket], 1 \n" |
| Paul Burton | 4b5347a | 2017-02-23 14:50:24 +0000 | [diff] [blame] | 206 | "2: .insn \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 207 | " .subsection 2 \n" |
| 208 | "3: b 2b \n" |
| 209 | " li %[ticket], 0 \n" |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 210 | " .previous \n" |
| 211 | " .set pop \n" |
| Markos Chandras | 94bfb75 | 2015-01-26 12:44:11 +0000 | [diff] [blame] | 212 | : [ticket_ptr] "+" GCC_OFF_SMALL_ASM() (lock->lock), |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 213 | [ticket] "=&r" (tmp), |
| 214 | [my_ticket] "=&r" (tmp2), |
| David Daney | 500c2e1 | 2010-02-04 11:31:49 -0800 | [diff] [blame] | 215 | [now_serving] "=&r" (tmp3) |
| 216 | : [inc] "r" (inc)); |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | } |
| 218 | |
| Ralf Baechle | 17099b1 | 2007-07-14 13:24:05 +0100 | [diff] [blame] | 219 | smp_llsc_mb(); |
| Ralf Baechle | 0004a9d | 2006-10-31 03:45:07 +0000 | [diff] [blame] | 220 | |
| Ralf Baechle | 2a31b03 | 2008-08-28 15:17:49 +0100 | [diff] [blame] | 221 | return tmp; |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 222 | } |
| 223 | |
| Thomas Gleixner | e593194 | 2009-12-03 20:08:46 +0100 | [diff] [blame] | 224 | #define arch_read_lock_flags(lock, flags) arch_read_lock(lock) |
| 225 | #define arch_write_lock_flags(lock, flags) arch_write_lock(lock) |
| Ralf Baechle | 65316fd | 2006-08-31 14:16:06 +0100 | [diff] [blame] | 226 | |
| Thomas Gleixner | 0199c4e | 2009-12-02 20:01:25 +0100 | [diff] [blame] | 227 | #define arch_spin_relax(lock) cpu_relax() |
| 228 | #define arch_read_relax(lock) cpu_relax() |
| 229 | #define arch_write_relax(lock) cpu_relax() |
| Martin Schwidefsky | ef6edc9 | 2006-09-30 23:27:43 -0700 | [diff] [blame] | 230 | |
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | #endif /* _ASM_SPINLOCK_H */ |