Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amd64/amd64 Remove unused, and style.
details: https://anonhg.NetBSD.org/src/rev/516086ec3ae7
branches: trunk
changeset: 965191:516086ec3ae7
user: maxv <maxv%NetBSD.org@localhost>
date: Thu Sep 05 12:57:30 2019 +0000
description:
Remove unused, and style.
diffstat:
sys/arch/amd64/amd64/lock_stubs.S | 62 ++++++++++++++++----------------------
1 files changed, 26 insertions(+), 36 deletions(-)
diffs (187 lines):
diff -r 626b5688aa16 -r 516086ec3ae7 sys/arch/amd64/amd64/lock_stubs.S
--- a/sys/arch/amd64/amd64/lock_stubs.S Thu Sep 05 10:01:30 2019 +0000
+++ b/sys/arch/amd64/amd64/lock_stubs.S Thu Sep 05 12:57:30 2019 +0000
@@ -1,6 +1,6 @@
-/* $NetBSD: lock_stubs.S,v 1.31 2019/02/11 14:59:32 cherry Exp $ */
+/* $NetBSD: lock_stubs.S,v 1.32 2019/09/05 12:57:30 maxv Exp $ */
-/*-
+/*
* Copyright (c) 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
@@ -15,7 +15,7 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
@@ -29,15 +29,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-/*
- * AMD64 lock stubs. Calling convention:
- *
- * %rdi arg 1
- * %rsi arg 2
- * %rdx arg 3
- * %rax return value
- */
-
#include "opt_multiprocessor.h"
#include "opt_lockdebug.h"
@@ -46,31 +37,30 @@
#include "assym.h"
-#define ENDLABEL(name,a) .align a; LABEL(name)
-#define LOCK(num) \
+#define LOCK \
HOTPATCH(HP_NAME_NOLOCK, 1) ; \
lock
-#define RET(num) \
+#define RET \
HOTPATCH(HP_NAME_RETFENCE, 3) ; \
ret; nop; nop ; \
ret
#ifndef LOCKDEBUG
+ .align 64
+
/*
* void mutex_enter(kmutex_t *mtx);
*
* Acquire a mutex and post a load fence.
*/
- .align 64
-
ENTRY(mutex_enter)
movq CPUVAR(CURLWP), %rcx
xorq %rax, %rax
- LOCK(1)
+ LOCK
cmpxchgq %rcx, (%rdi)
jnz 1f
- RET(1)
+ RET
1:
jmp _C_LABEL(mutex_vector_enter)
END(mutex_enter)
@@ -114,7 +104,7 @@
testb %al, %al
jnz 1f
#endif
- RET(2)
+ RET
1:
jmp _C_LABEL(mutex_spin_retry) /* failed; hard case */
END(mutex_spin_enter)
@@ -211,11 +201,11 @@
0:
testb $(RW_WRITE_LOCKED|RW_WRITE_WANTED), %al
jnz 3f
- leaq RW_READ_INCR(%rax), %rdx
- LOCK(2)
+ leaq RW_READ_INCR(%rax), %rdx
+ LOCK
cmpxchgq %rdx, (%rdi)
jnz 1f
- RET(3)
+ RET
1:
jmp 0b
@@ -225,10 +215,10 @@
2: movq CPUVAR(CURLWP), %rcx
xorq %rax, %rax
orq $RW_WRITE_LOCKED, %rcx
- LOCK(3)
+ LOCK
cmpxchgq %rcx, (%rdi)
jnz 3f
- RET(4)
+ RET
3:
jmp _C_LABEL(rw_vector_enter)
END(rw_enter)
@@ -251,7 +241,7 @@
cmpq $RW_READ_INCR, %rax
jb 3f
leaq -RW_READ_INCR(%rax), %rdx
- LOCK(4)
+ LOCK
cmpxchgq %rdx, (%rdi)
jnz 1f
ret
@@ -264,7 +254,7 @@
2: leaq -RW_WRITE_LOCKED(%rax), %rdx
subq CPUVAR(CURLWP), %rdx
jnz 3f
- LOCK(5)
+ LOCK
cmpxchgq %rdx, (%rdi)
jnz 3f
ret
@@ -288,12 +278,12 @@
0:
testb $(RW_WRITE_LOCKED|RW_WRITE_WANTED), %al
jnz 4f
- leaq RW_READ_INCR(%rax), %rdx
- LOCK(8)
+ leaq RW_READ_INCR(%rax), %rdx
+ LOCK
cmpxchgq %rdx, (%rdi)
jnz 1f
movl %edx, %eax /* nonzero */
- RET(5)
+ RET
1:
jmp 0b
@@ -303,12 +293,12 @@
2: movq CPUVAR(CURLWP), %rcx
xorq %rax, %rax
orq $RW_WRITE_LOCKED, %rcx
- LOCK(9)
+ LOCK
cmpxchgq %rcx, (%rdi)
movl $0, %eax
setz %al
3:
- RET(6)
+ RET
ret
4:
xorl %eax, %eax
@@ -328,10 +318,10 @@
ENTRY(__cpu_simple_lock)
movl $0x0100, %eax
1:
- LOCK(6)
+ LOCK
cmpxchgb %ah, (%rdi)
jnz 2f
- RET(7)
+ RET
2:
movl $0x0100, %eax
pause
@@ -349,10 +339,10 @@
ENTRY(__cpu_simple_lock_try)
movl $0x0100, %eax
- LOCK(7)
+ LOCK
cmpxchgb %ah, (%rdi)
movl $0, %eax
setz %al
- RET(8)
+ RET
END(__cpu_simple_lock_try)
Home |
Main Index |
Thread Index |
Old Index