Remove unused argument in macro.
This commit is contained in:
parent
e18b0a4638
commit
f012eec2fe
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: atomic.S,v 1.26 2020/04/26 13:54:02 maxv Exp $ */
|
/* $NetBSD: atomic.S,v 1.27 2020/04/26 13:59:44 maxv Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
@ -45,10 +45,10 @@
|
|||||||
#ifdef _HARDKERNEL
|
#ifdef _HARDKERNEL
|
||||||
#include "opt_xen.h"
|
#include "opt_xen.h"
|
||||||
#include <machine/frameasm.h>
|
#include <machine/frameasm.h>
|
||||||
#define LOCK(n) HOTPATCH(HP_NAME_NOLOCK, 1); lock
|
#define LOCK HOTPATCH(HP_NAME_NOLOCK, 1); lock
|
||||||
#define ENDLABEL(a) _ALIGN_TEXT; LABEL(a)
|
#define ENDLABEL(a) _ALIGN_TEXT; LABEL(a)
|
||||||
#else
|
#else
|
||||||
#define LOCK(n) lock
|
#define LOCK lock
|
||||||
#define ENDLABEL(a) /* nothing */
|
#define ENDLABEL(a) /* nothing */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -57,7 +57,7 @@
|
|||||||
ENTRY(_atomic_add_32)
|
ENTRY(_atomic_add_32)
|
||||||
movl 4(%esp), %edx
|
movl 4(%esp), %edx
|
||||||
movl 8(%esp), %eax
|
movl 8(%esp), %eax
|
||||||
LOCK(1)
|
LOCK
|
||||||
addl %eax, (%edx)
|
addl %eax, (%edx)
|
||||||
ret
|
ret
|
||||||
END(_atomic_add_32)
|
END(_atomic_add_32)
|
||||||
@ -66,7 +66,7 @@ ENTRY(_atomic_add_32_nv)
|
|||||||
movl 4(%esp), %edx
|
movl 4(%esp), %edx
|
||||||
movl 8(%esp), %eax
|
movl 8(%esp), %eax
|
||||||
movl %eax, %ecx
|
movl %eax, %ecx
|
||||||
LOCK(2)
|
LOCK
|
||||||
xaddl %eax, (%edx)
|
xaddl %eax, (%edx)
|
||||||
addl %ecx, %eax
|
addl %ecx, %eax
|
||||||
ret
|
ret
|
||||||
@ -75,7 +75,7 @@ END(_atomic_add_32_nv)
|
|||||||
ENTRY(_atomic_and_32)
|
ENTRY(_atomic_and_32)
|
||||||
movl 4(%esp), %edx
|
movl 4(%esp), %edx
|
||||||
movl 8(%esp), %eax
|
movl 8(%esp), %eax
|
||||||
LOCK(3)
|
LOCK
|
||||||
andl %eax, (%edx)
|
andl %eax, (%edx)
|
||||||
ret
|
ret
|
||||||
END(_atomic_and_32)
|
END(_atomic_and_32)
|
||||||
@ -86,7 +86,7 @@ ENTRY(_atomic_and_32_nv)
|
|||||||
0:
|
0:
|
||||||
movl %eax, %ecx
|
movl %eax, %ecx
|
||||||
andl 8(%esp), %ecx
|
andl 8(%esp), %ecx
|
||||||
LOCK(4)
|
LOCK
|
||||||
cmpxchgl %ecx, (%edx)
|
cmpxchgl %ecx, (%edx)
|
||||||
jnz 1f
|
jnz 1f
|
||||||
movl %ecx, %eax
|
movl %ecx, %eax
|
||||||
@ -97,7 +97,7 @@ END(_atomic_and_32_nv)
|
|||||||
|
|
||||||
ENTRY(_atomic_dec_32)
|
ENTRY(_atomic_dec_32)
|
||||||
movl 4(%esp), %edx
|
movl 4(%esp), %edx
|
||||||
LOCK(5)
|
LOCK
|
||||||
decl (%edx)
|
decl (%edx)
|
||||||
ret
|
ret
|
||||||
END(_atomic_dec_32)
|
END(_atomic_dec_32)
|
||||||
@ -105,7 +105,7 @@ END(_atomic_dec_32)
|
|||||||
ENTRY(_atomic_dec_32_nv)
|
ENTRY(_atomic_dec_32_nv)
|
||||||
movl 4(%esp), %edx
|
movl 4(%esp), %edx
|
||||||
movl $-1, %eax
|
movl $-1, %eax
|
||||||
LOCK(6)
|
LOCK
|
||||||
xaddl %eax, (%edx)
|
xaddl %eax, (%edx)
|
||||||
decl %eax
|
decl %eax
|
||||||
ret
|
ret
|
||||||
@ -113,7 +113,7 @@ END(_atomic_dec_32_nv)
|
|||||||
|
|
||||||
ENTRY(_atomic_inc_32)
|
ENTRY(_atomic_inc_32)
|
||||||
movl 4(%esp), %edx
|
movl 4(%esp), %edx
|
||||||
LOCK(7)
|
LOCK
|
||||||
incl (%edx)
|
incl (%edx)
|
||||||
ret
|
ret
|
||||||
END(_atomic_inc_32)
|
END(_atomic_inc_32)
|
||||||
@ -121,7 +121,7 @@ END(_atomic_inc_32)
|
|||||||
ENTRY(_atomic_inc_32_nv)
|
ENTRY(_atomic_inc_32_nv)
|
||||||
movl 4(%esp), %edx
|
movl 4(%esp), %edx
|
||||||
movl $1, %eax
|
movl $1, %eax
|
||||||
LOCK(8)
|
LOCK
|
||||||
xaddl %eax, (%edx)
|
xaddl %eax, (%edx)
|
||||||
incl %eax
|
incl %eax
|
||||||
ret
|
ret
|
||||||
@ -130,7 +130,7 @@ END(_atomic_inc_32_nv)
|
|||||||
ENTRY(_atomic_or_32)
|
ENTRY(_atomic_or_32)
|
||||||
movl 4(%esp), %edx
|
movl 4(%esp), %edx
|
||||||
movl 8(%esp), %eax
|
movl 8(%esp), %eax
|
||||||
LOCK(9)
|
LOCK
|
||||||
orl %eax, (%edx)
|
orl %eax, (%edx)
|
||||||
ret
|
ret
|
||||||
END(_atomic_or_32)
|
END(_atomic_or_32)
|
||||||
@ -141,7 +141,7 @@ ENTRY(_atomic_or_32_nv)
|
|||||||
0:
|
0:
|
||||||
movl %eax, %ecx
|
movl %eax, %ecx
|
||||||
orl 8(%esp), %ecx
|
orl 8(%esp), %ecx
|
||||||
LOCK(10)
|
LOCK
|
||||||
cmpxchgl %ecx, (%edx)
|
cmpxchgl %ecx, (%edx)
|
||||||
jnz 1f
|
jnz 1f
|
||||||
movl %ecx, %eax
|
movl %ecx, %eax
|
||||||
@ -161,7 +161,7 @@ ENTRY(_atomic_cas_32)
|
|||||||
movl 4(%esp), %edx
|
movl 4(%esp), %edx
|
||||||
movl 8(%esp), %eax
|
movl 8(%esp), %eax
|
||||||
movl 12(%esp), %ecx
|
movl 12(%esp), %ecx
|
||||||
LOCK(12)
|
LOCK
|
||||||
cmpxchgl %ecx, (%edx)
|
cmpxchgl %ecx, (%edx)
|
||||||
/* %eax now contains the old value */
|
/* %eax now contains the old value */
|
||||||
ret
|
ret
|
||||||
@ -177,7 +177,7 @@ ENTRY(_atomic_cas_32_ni)
|
|||||||
END(_atomic_cas_32_ni)
|
END(_atomic_cas_32_ni)
|
||||||
|
|
||||||
ENTRY(_membar_consumer)
|
ENTRY(_membar_consumer)
|
||||||
LOCK(13)
|
LOCK
|
||||||
addl $0, -4(%esp)
|
addl $0, -4(%esp)
|
||||||
ret
|
ret
|
||||||
END(_membar_consumer)
|
END(_membar_consumer)
|
||||||
@ -190,7 +190,7 @@ ENTRY(_membar_producer)
|
|||||||
END(_membar_producer)
|
END(_membar_producer)
|
||||||
|
|
||||||
ENTRY(_membar_sync)
|
ENTRY(_membar_sync)
|
||||||
LOCK(14)
|
LOCK
|
||||||
addl $0, -4(%esp)
|
addl $0, -4(%esp)
|
||||||
ret
|
ret
|
||||||
END(_membar_sync)
|
END(_membar_sync)
|
||||||
@ -241,7 +241,7 @@ ENTRY(_atomic_cas_cx8)
|
|||||||
movl 20(%esp), %edx
|
movl 20(%esp), %edx
|
||||||
movl 24(%esp), %ebx
|
movl 24(%esp), %ebx
|
||||||
movl 28(%esp), %ecx
|
movl 28(%esp), %ecx
|
||||||
LOCK(15)
|
LOCK
|
||||||
cmpxchg8b (%edi)
|
cmpxchg8b (%edi)
|
||||||
popl %ebx
|
popl %ebx
|
||||||
popl %edi
|
popl %edi
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: atomic.S,v 1.20 2020/04/26 13:54:03 maxv Exp $ */
|
/* $NetBSD: atomic.S,v 1.21 2020/04/26 13:59:44 maxv Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
* Copyright (c) 2007 The NetBSD Foundation, Inc.
|
||||||
@ -40,10 +40,10 @@
|
|||||||
|
|
||||||
#ifdef _HARDKERNEL
|
#ifdef _HARDKERNEL
|
||||||
#include <machine/frameasm.h>
|
#include <machine/frameasm.h>
|
||||||
#define LOCK(n) HOTPATCH(HP_NAME_NOLOCK, 1); lock
|
#define LOCK HOTPATCH(HP_NAME_NOLOCK, 1); lock
|
||||||
#define ENDLABEL(a) _ALIGN_TEXT; LABEL(a)
|
#define ENDLABEL(a) _ALIGN_TEXT; LABEL(a)
|
||||||
#else
|
#else
|
||||||
#define LOCK(n) lock
|
#define LOCK lock
|
||||||
#define ENDLABEL(a) /* nothing */
|
#define ENDLABEL(a) /* nothing */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -52,21 +52,21 @@
|
|||||||
/* 32-bit */
|
/* 32-bit */
|
||||||
|
|
||||||
ENTRY(_atomic_add_32)
|
ENTRY(_atomic_add_32)
|
||||||
LOCK(1)
|
LOCK
|
||||||
addl %esi, (%rdi)
|
addl %esi, (%rdi)
|
||||||
ret
|
ret
|
||||||
END(_atomic_add_32)
|
END(_atomic_add_32)
|
||||||
|
|
||||||
ENTRY(_atomic_add_32_nv)
|
ENTRY(_atomic_add_32_nv)
|
||||||
movl %esi, %eax
|
movl %esi, %eax
|
||||||
LOCK(2)
|
LOCK
|
||||||
xaddl %eax, (%rdi)
|
xaddl %eax, (%rdi)
|
||||||
addl %esi, %eax
|
addl %esi, %eax
|
||||||
ret
|
ret
|
||||||
END(_atomic_add_32_nv)
|
END(_atomic_add_32_nv)
|
||||||
|
|
||||||
ENTRY(_atomic_and_32)
|
ENTRY(_atomic_and_32)
|
||||||
LOCK(3)
|
LOCK
|
||||||
andl %esi, (%rdi)
|
andl %esi, (%rdi)
|
||||||
ret
|
ret
|
||||||
END(_atomic_and_32)
|
END(_atomic_and_32)
|
||||||
@ -76,7 +76,7 @@ ENTRY(_atomic_and_32_nv)
|
|||||||
1:
|
1:
|
||||||
movl %eax, %ecx
|
movl %eax, %ecx
|
||||||
andl %esi, %ecx
|
andl %esi, %ecx
|
||||||
LOCK(4)
|
LOCK
|
||||||
cmpxchgl %ecx, (%rdi)
|
cmpxchgl %ecx, (%rdi)
|
||||||
jnz 1b
|
jnz 1b
|
||||||
movl %ecx, %eax
|
movl %ecx, %eax
|
||||||
@ -84,35 +84,35 @@ ENTRY(_atomic_and_32_nv)
|
|||||||
END(_atomic_and_32_nv)
|
END(_atomic_and_32_nv)
|
||||||
|
|
||||||
ENTRY(_atomic_dec_32)
|
ENTRY(_atomic_dec_32)
|
||||||
LOCK(5)
|
LOCK
|
||||||
decl (%rdi)
|
decl (%rdi)
|
||||||
ret
|
ret
|
||||||
END(_atomic_dec_32)
|
END(_atomic_dec_32)
|
||||||
|
|
||||||
ENTRY(_atomic_dec_32_nv)
|
ENTRY(_atomic_dec_32_nv)
|
||||||
movl $-1, %eax
|
movl $-1, %eax
|
||||||
LOCK(6)
|
LOCK
|
||||||
xaddl %eax, (%rdi)
|
xaddl %eax, (%rdi)
|
||||||
decl %eax
|
decl %eax
|
||||||
ret
|
ret
|
||||||
END(_atomic_dec_32_nv)
|
END(_atomic_dec_32_nv)
|
||||||
|
|
||||||
ENTRY(_atomic_inc_32)
|
ENTRY(_atomic_inc_32)
|
||||||
LOCK(7)
|
LOCK
|
||||||
incl (%rdi)
|
incl (%rdi)
|
||||||
ret
|
ret
|
||||||
END(_atomic_inc_32)
|
END(_atomic_inc_32)
|
||||||
|
|
||||||
ENTRY(_atomic_inc_32_nv)
|
ENTRY(_atomic_inc_32_nv)
|
||||||
movl $1, %eax
|
movl $1, %eax
|
||||||
LOCK(8)
|
LOCK
|
||||||
xaddl %eax, (%rdi)
|
xaddl %eax, (%rdi)
|
||||||
incl %eax
|
incl %eax
|
||||||
ret
|
ret
|
||||||
END(_atomic_inc_32_nv)
|
END(_atomic_inc_32_nv)
|
||||||
|
|
||||||
ENTRY(_atomic_or_32)
|
ENTRY(_atomic_or_32)
|
||||||
LOCK(9)
|
LOCK
|
||||||
orl %esi, (%rdi)
|
orl %esi, (%rdi)
|
||||||
ret
|
ret
|
||||||
END(_atomic_or_32)
|
END(_atomic_or_32)
|
||||||
@ -122,7 +122,7 @@ ENTRY(_atomic_or_32_nv)
|
|||||||
1:
|
1:
|
||||||
movl %eax, %ecx
|
movl %eax, %ecx
|
||||||
orl %esi, %ecx
|
orl %esi, %ecx
|
||||||
LOCK(10)
|
LOCK
|
||||||
cmpxchgl %ecx, (%rdi)
|
cmpxchgl %ecx, (%rdi)
|
||||||
jnz 1b
|
jnz 1b
|
||||||
movl %ecx, %eax
|
movl %ecx, %eax
|
||||||
@ -137,7 +137,7 @@ END(_atomic_swap_32)
|
|||||||
|
|
||||||
ENTRY(_atomic_cas_32)
|
ENTRY(_atomic_cas_32)
|
||||||
movl %esi, %eax
|
movl %esi, %eax
|
||||||
LOCK(12)
|
LOCK
|
||||||
cmpxchgl %edx, (%rdi)
|
cmpxchgl %edx, (%rdi)
|
||||||
/* %eax now contains the old value */
|
/* %eax now contains the old value */
|
||||||
ret
|
ret
|
||||||
@ -153,21 +153,21 @@ END(_atomic_cas_32_ni)
|
|||||||
/* 64-bit */
|
/* 64-bit */
|
||||||
|
|
||||||
ENTRY(_atomic_add_64)
|
ENTRY(_atomic_add_64)
|
||||||
LOCK(13)
|
LOCK
|
||||||
addq %rsi, (%rdi)
|
addq %rsi, (%rdi)
|
||||||
ret
|
ret
|
||||||
END(_atomic_add_64)
|
END(_atomic_add_64)
|
||||||
|
|
||||||
ENTRY(_atomic_add_64_nv)
|
ENTRY(_atomic_add_64_nv)
|
||||||
movq %rsi, %rax
|
movq %rsi, %rax
|
||||||
LOCK(14)
|
LOCK
|
||||||
xaddq %rax, (%rdi)
|
xaddq %rax, (%rdi)
|
||||||
addq %rsi, %rax
|
addq %rsi, %rax
|
||||||
ret
|
ret
|
||||||
END(_atomic_add_64_nv)
|
END(_atomic_add_64_nv)
|
||||||
|
|
||||||
ENTRY(_atomic_and_64)
|
ENTRY(_atomic_and_64)
|
||||||
LOCK(15)
|
LOCK
|
||||||
andq %rsi, (%rdi)
|
andq %rsi, (%rdi)
|
||||||
ret
|
ret
|
||||||
END(_atomic_and_64)
|
END(_atomic_and_64)
|
||||||
@ -177,7 +177,7 @@ ENTRY(_atomic_and_64_nv)
|
|||||||
1:
|
1:
|
||||||
movq %rax, %rcx
|
movq %rax, %rcx
|
||||||
andq %rsi, %rcx
|
andq %rsi, %rcx
|
||||||
LOCK(16)
|
LOCK
|
||||||
cmpxchgq %rcx, (%rdi)
|
cmpxchgq %rcx, (%rdi)
|
||||||
jnz 1b
|
jnz 1b
|
||||||
movq %rcx, %rax
|
movq %rcx, %rax
|
||||||
@ -185,35 +185,35 @@ ENTRY(_atomic_and_64_nv)
|
|||||||
END(_atomic_and_64_nv)
|
END(_atomic_and_64_nv)
|
||||||
|
|
||||||
ENTRY(_atomic_dec_64)
|
ENTRY(_atomic_dec_64)
|
||||||
LOCK(17)
|
LOCK
|
||||||
decq (%rdi)
|
decq (%rdi)
|
||||||
ret
|
ret
|
||||||
END(_atomic_dec_64)
|
END(_atomic_dec_64)
|
||||||
|
|
||||||
ENTRY(_atomic_dec_64_nv)
|
ENTRY(_atomic_dec_64_nv)
|
||||||
movq $-1, %rax
|
movq $-1, %rax
|
||||||
LOCK(18)
|
LOCK
|
||||||
xaddq %rax, (%rdi)
|
xaddq %rax, (%rdi)
|
||||||
decq %rax
|
decq %rax
|
||||||
ret
|
ret
|
||||||
END(_atomic_dec_64_nv)
|
END(_atomic_dec_64_nv)
|
||||||
|
|
||||||
ENTRY(_atomic_inc_64)
|
ENTRY(_atomic_inc_64)
|
||||||
LOCK(19)
|
LOCK
|
||||||
incq (%rdi)
|
incq (%rdi)
|
||||||
ret
|
ret
|
||||||
END(_atomic_inc_64)
|
END(_atomic_inc_64)
|
||||||
|
|
||||||
ENTRY(_atomic_inc_64_nv)
|
ENTRY(_atomic_inc_64_nv)
|
||||||
movq $1, %rax
|
movq $1, %rax
|
||||||
LOCK(20)
|
LOCK
|
||||||
xaddq %rax, (%rdi)
|
xaddq %rax, (%rdi)
|
||||||
incq %rax
|
incq %rax
|
||||||
ret
|
ret
|
||||||
END(_atomic_inc_64_nv)
|
END(_atomic_inc_64_nv)
|
||||||
|
|
||||||
ENTRY(_atomic_or_64)
|
ENTRY(_atomic_or_64)
|
||||||
LOCK(21)
|
LOCK
|
||||||
orq %rsi, (%rdi)
|
orq %rsi, (%rdi)
|
||||||
ret
|
ret
|
||||||
END(_atomic_or_64)
|
END(_atomic_or_64)
|
||||||
@ -223,7 +223,7 @@ ENTRY(_atomic_or_64_nv)
|
|||||||
1:
|
1:
|
||||||
movq %rax, %rcx
|
movq %rax, %rcx
|
||||||
orq %rsi, %rcx
|
orq %rsi, %rcx
|
||||||
LOCK(22)
|
LOCK
|
||||||
cmpxchgq %rcx, (%rdi)
|
cmpxchgq %rcx, (%rdi)
|
||||||
jnz 1b
|
jnz 1b
|
||||||
movq %rcx, %rax
|
movq %rcx, %rax
|
||||||
@ -238,7 +238,7 @@ END(_atomic_swap_64)
|
|||||||
|
|
||||||
ENTRY(_atomic_cas_64)
|
ENTRY(_atomic_cas_64)
|
||||||
movq %rsi, %rax
|
movq %rsi, %rax
|
||||||
LOCK(24)
|
LOCK
|
||||||
cmpxchgq %rdx, (%rdi)
|
cmpxchgq %rdx, (%rdi)
|
||||||
/* %eax now contains the old value */
|
/* %eax now contains the old value */
|
||||||
ret
|
ret
|
||||||
@ -254,7 +254,7 @@ END(_atomic_cas_64_ni)
|
|||||||
/* memory barriers */
|
/* memory barriers */
|
||||||
|
|
||||||
ENTRY(_membar_consumer)
|
ENTRY(_membar_consumer)
|
||||||
LOCK(25)
|
LOCK
|
||||||
addq $0, -8(%rsp)
|
addq $0, -8(%rsp)
|
||||||
ret
|
ret
|
||||||
END(_membar_consumer)
|
END(_membar_consumer)
|
||||||
@ -267,7 +267,7 @@ ENTRY(_membar_producer)
|
|||||||
END(_membar_producer)
|
END(_membar_producer)
|
||||||
|
|
||||||
ENTRY(_membar_sync)
|
ENTRY(_membar_sync)
|
||||||
LOCK(26)
|
LOCK
|
||||||
addq $0, -8(%rsp)
|
addq $0, -8(%rsp)
|
||||||
ret
|
ret
|
||||||
END(_membar_sync)
|
END(_membar_sync)
|
||||||
|
Loading…
Reference in New Issue
Block a user