Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch G/C _lock_cas(); it is no longer needed (kern_mutex...



details:   https://anonhg.NetBSD.org/src/rev/4731e1f76800
branches:  trunk
changeset: 1023113:4731e1f76800
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Aug 25 13:28:51 2021 +0000

description:
G/C _lock_cas(); it is no longer needed (kern_mutex.c uses atomic_cas_ulong()
with appropriate memory barriers).

diffstat:

 sys/arch/alpha/alpha/lock_stubs.s     |  27 ++-------------------------
 sys/arch/sparc64/sparc64/lock_stubs.s |  14 +-------------
 2 files changed, 3 insertions(+), 38 deletions(-)

diffs (83 lines):

diff -r 79b84dd10d5d -r 4731e1f76800 sys/arch/alpha/alpha/lock_stubs.s
--- a/sys/arch/alpha/alpha/lock_stubs.s Wed Aug 25 09:06:02 2021 +0000
+++ b/sys/arch/alpha/alpha/lock_stubs.s Wed Aug 25 13:28:51 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock_stubs.s,v 1.9 2021/07/14 02:18:10 thorpej Exp $   */
+/*     $NetBSD: lock_stubs.s,v 1.10 2021/08/25 13:28:51 thorpej Exp $  */
 
 /*-
  * Copyright (c) 2007, 2021 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 
 #include <machine/asm.h>
 
-__KERNEL_RCSID(0, "$NetBSD: lock_stubs.s,v 1.9 2021/07/14 02:18:10 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lock_stubs.s,v 1.10 2021/08/25 13:28:51 thorpej Exp $");
 
 #include "assym.h"
 
@@ -48,27 +48,6 @@
 #define        MB(label)       /* nothing */
 #endif
 
-/*
- * int _lock_cas(uintptr_t *ptr, uintptr_t old, uintptr_t new)
- */
-LEAF(_lock_cas, 3)
-1:
-       mov     a2, v0
-       ldq_l   t1, 0(a0)
-       cmpeq   t1, a1, t1
-       beq     t1, 2f
-       stq_c   v0, 0(a0)
-       beq     v0, 3f
-       MB(.L__lock_cas_mb_1)
-       RET
-2:
-       mov     zero, v0
-       MB(.L__lock_cas_mb_2)
-       RET
-3:
-       br      1b
-       END(_lock_cas)
-
 #if !defined(LOCKDEBUG)
 
 /*
@@ -396,8 +375,6 @@
        .section ".rodata"
        .globl  lock_stub_patch_table
 lock_stub_patch_table:
-       .quad   .L__lock_cas_mb_1
-       .quad   .L__lock_cas_mb_2
 #if !defined(LOCKDEBUG)
        .quad   .L_mutex_enter_mb_1
        .quad   .L_mutex_exit_mb_1
diff -r 79b84dd10d5d -r 4731e1f76800 sys/arch/sparc64/sparc64/lock_stubs.s
--- a/sys/arch/sparc64/sparc64/lock_stubs.s     Wed Aug 25 09:06:02 2021 +0000
+++ b/sys/arch/sparc64/sparc64/lock_stubs.s     Wed Aug 25 13:28:51 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock_stubs.s,v 1.9 2013/04/28 23:42:23 nakayama Exp $  */
+/*     $NetBSD: lock_stubs.s,v 1.10 2021/08/25 13:28:51 thorpej Exp $  */
 
 /*-
  * Copyright (c) 2002, 2006 The NetBSD Foundation, Inc.
@@ -48,18 +48,6 @@
 #define        MB_MEM  /* nothing */
 #endif
 
-/*
- * int _lock_cas(uintptr_t *ptr, uintptr_t old, uintptr_t new);
- */
-.align 32
-ENTRY(_lock_cas)
-       CASPTR  [%o0], %o1, %o2                 ! compare-and-swap
-       MB_MEM
-       xor     %o1, %o2, %o2                   ! expected == actual?
-       clr     %o0
-       retl
-        movrz  %o2, 1, %o0
-
 #if !defined(LOCKDEBUG)
 
 /*



Home | Main Index | Thread Index | Old Index