mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-01 09:13:37 +00:00
MIPS: Microoptimize arch_{read,write}_lock
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
parent
4bafad922a
commit
756cca61a7
1 changed files with 11 additions and 11 deletions
|
|
@ -245,16 +245,16 @@ static inline void arch_read_lock(arch_rwlock_t *rw)
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
" .set noreorder # arch_read_lock \n"
|
" .set noreorder # arch_read_lock \n"
|
||||||
"1: ll %1, %2 \n"
|
"1: ll %1, %2 \n"
|
||||||
" bltz %1, 2f \n"
|
" bltz %1, 3f \n"
|
||||||
" addu %1, 1 \n"
|
" addu %1, 1 \n"
|
||||||
" sc %1, %0 \n"
|
"2: sc %1, %0 \n"
|
||||||
" beqz %1, 1b \n"
|
" beqz %1, 1b \n"
|
||||||
" nop \n"
|
" nop \n"
|
||||||
" .subsection 2 \n"
|
" .subsection 2 \n"
|
||||||
"2: ll %1, %2 \n"
|
"3: ll %1, %2 \n"
|
||||||
" bltz %1, 2b \n"
|
" bltz %1, 3b \n"
|
||||||
" addu %1, 1 \n"
|
" addu %1, 1 \n"
|
||||||
" b 1b \n"
|
" b 2b \n"
|
||||||
" nop \n"
|
" nop \n"
|
||||||
" .previous \n"
|
" .previous \n"
|
||||||
" .set reorder \n"
|
" .set reorder \n"
|
||||||
|
|
@ -324,16 +324,16 @@ static inline void arch_write_lock(arch_rwlock_t *rw)
|
||||||
__asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
" .set noreorder # arch_write_lock \n"
|
" .set noreorder # arch_write_lock \n"
|
||||||
"1: ll %1, %2 \n"
|
"1: ll %1, %2 \n"
|
||||||
" bnez %1, 2f \n"
|
" bnez %1, 3f \n"
|
||||||
" lui %1, 0x8000 \n"
|
" lui %1, 0x8000 \n"
|
||||||
" sc %1, %0 \n"
|
"2: sc %1, %0 \n"
|
||||||
" beqz %1, 2f \n"
|
" beqz %1, 3f \n"
|
||||||
" nop \n"
|
" nop \n"
|
||||||
" .subsection 2 \n"
|
" .subsection 2 \n"
|
||||||
"2: ll %1, %2 \n"
|
"3: ll %1, %2 \n"
|
||||||
" bnez %1, 2b \n"
|
" bnez %1, 3b \n"
|
||||||
" lui %1, 0x8000 \n"
|
" lui %1, 0x8000 \n"
|
||||||
" b 1b \n"
|
" b 2b \n"
|
||||||
" nop \n"
|
" nop \n"
|
||||||
" .previous \n"
|
" .previous \n"
|
||||||
" .set reorder \n"
|
" .set reorder \n"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue