Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Prepend `cpu_' to the machine-dependent atomic lock...



details:   https://anonhg.NetBSD.org/src/rev/a3bdafeb3d59
branches:  trunk
changeset: 474957:a3bdafeb3d59
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Jul 27 21:45:39 1999 +0000

description:
Prepend `cpu_' to the machine-dependent atomic locking primitivies.

diffstat:

 sys/arch/alpha/alpha/lock_machdep.c |  24 +++++++++++++-----------
 sys/arch/alpha/include/lock.h       |  17 ++++++-----------
 sys/arch/sparc/include/lock.h       |  25 ++++++++++---------------
 sys/arch/sparc64/include/lock.h     |  25 ++++++++++---------------
 4 files changed, 39 insertions(+), 52 deletions(-)

diffs (244 lines):

diff -r 5bfcb1ffb160 -r a3bdafeb3d59 sys/arch/alpha/alpha/lock_machdep.c
--- a/sys/arch/alpha/alpha/lock_machdep.c       Tue Jul 27 21:33:57 1999 +0000
+++ b/sys/arch/alpha/alpha/lock_machdep.c       Tue Jul 27 21:45:39 1999 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: lock_machdep.c,v 1.1 1998/09/24 22:32:35 thorpej Exp $ */
+/* $NetBSD: lock_machdep.c,v 1.2 1999/07/27 21:45:41 thorpej Exp $ */
 
 /*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -39,7 +39,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: lock_machdep.c,v 1.1 1998/09/24 22:32:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lock_machdep.c,v 1.2 1999/07/27 21:45:41 thorpej Exp $");
 
 /*
  * Machine-dependent spin lock operations.
@@ -51,40 +51,42 @@
 #include <machine/alpha_cpu.h>
 
 void
-simple_lock_init(alp)
+cpu_simple_lock_init(alp)
        __volatile struct simplelock *alp;
 {
 
-       alp->lock_data = 0;
+       alp->lock_data = SIMPLELOCK_UNLOCKED;
        alpha_mb();
 }
 
 void
-simple_lock(alp)
+cpu_simple_lock(alp)
        __volatile struct simplelock *alp;
 {
 
        /* atomic operation performs barrier */
-       while (alpha_atomic_testset_l((unsigned int *)&alp->lock_data, 1) == 0)
+       while (alpha_atomic_testset_l((unsigned int *)&alp->lock_data,
+           SIMPLELOCK_LOCKED) == 0)
                /* spin */ ;
 }
 
 int
-simple_lock_try(alp)
+cpu_simple_lock_try(alp)
        __volatile struct simplelock *alp;
 {
 
        /* atomic operation performs barrier */
-       if (alpha_atomic_testset_l((unsigned int *)&alp->lock_data, 1))
+       if (alpha_atomic_testset_l((unsigned int *)&alp->lock_data,
+           SIMPLELOCK_LOCKED))
                return (1);
        return (0);
 }
 
 void
-simple_unlock(alp)
+cpu_simple_unlock(alp)
        __volatile struct simplelock *alp;
 {
 
-       alp->lock_data = 0;
+       alp->lock_data = SIMPLELOCK_UNLOCKED;
        alpha_mb();
 }
diff -r 5bfcb1ffb160 -r a3bdafeb3d59 sys/arch/alpha/include/lock.h
--- a/sys/arch/alpha/include/lock.h     Tue Jul 27 21:33:57 1999 +0000
+++ b/sys/arch/alpha/include/lock.h     Tue Jul 27 21:45:39 1999 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: lock.h,v 1.2 1998/11/04 06:19:55 chs Exp $ */
+/* $NetBSD: lock.h,v 1.3 1999/07/27 21:45:39 thorpej Exp $ */
 
 /*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -42,13 +42,8 @@
  */
 
 #if defined(_KERNEL)
-void   simple_lock_init __P((__volatile struct simplelock *));
-void   simple_lock __P((__volatile struct simplelock *));
-int    simple_lock_try __P((__volatile struct simplelock *));
-void   simple_unlock __P((__volatile struct simplelock *));
-
-#if defined(LOCKDEBUG)
-#define simple_lock_dump()
-#define simple_lock_freecheck(start, end)
-#endif /* LOCKDEBUG */
+void   cpu_simple_lock_init __P((__volatile struct simplelock *));
+void   cpu_simple_lock __P((__volatile struct simplelock *));
+int    cpu_simple_lock_try __P((__volatile struct simplelock *));
+void   cpu_simple_unlock __P((__volatile struct simplelock *));
 #endif /* _KERNEL */
diff -r 5bfcb1ffb160 -r a3bdafeb3d59 sys/arch/sparc/include/lock.h
--- a/sys/arch/sparc/include/lock.h     Tue Jul 27 21:33:57 1999 +0000
+++ b/sys/arch/sparc/include/lock.h     Tue Jul 27 21:45:39 1999 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: lock.h,v 1.3 1998/11/04 06:19:55 chs Exp $ */
+/*     $NetBSD: lock.h,v 1.4 1999/07/27 21:45:41 thorpej Exp $ */
 
 /*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -47,13 +47,13 @@
 
 #include <sparc/sparc/asm.h>
 
-static void    simple_lock_init __P((__volatile struct simplelock *));
-static void    simple_lock __P((__volatile struct simplelock *));
-static int     simple_lock_try __P((__volatile struct simplelock *));
-static void    simple_unlock __P((__volatile struct simplelock *));
+static void    cpu_simple_lock_init __P((__volatile struct simplelock *));
+static void    cpu_simple_lock __P((__volatile struct simplelock *));
+static int     cpu_simple_lock_try __P((__volatile struct simplelock *));
+static void    cpu_simple_unlock __P((__volatile struct simplelock *));
 
 static __inline__ void
-simple_lock_init (alp)
+cpu_simple_lock_init (alp)
        __volatile struct simplelock *alp;
 {
 
@@ -61,7 +61,7 @@
 }
 
 static __inline__ void
-simple_lock (alp)
+cpu_simple_lock (alp)
        __volatile struct simplelock *alp;
 {
 
@@ -79,7 +79,7 @@
 }
 
 static __inline__ int
-simple_lock_try (alp)
+cpu_simple_lock_try (alp)
        __volatile struct simplelock *alp;
 {
 
@@ -87,18 +87,13 @@
 }
 
 static __inline__ void
-simple_unlock (alp)
+cpu_simple_unlock (alp)
        __volatile struct simplelock *alp;
 {
 
        alp->lock_data = 0;
 }
 
-#if defined(LOCKDEBUG)
-#define simple_lock_dump()
-#define simple_lock_freecheck(start, end)
-#endif /* LOCKDEBUG */
-
 #endif /* _KERNEL */
 
 #endif /* _MACHINE_LOCK_H */
diff -r 5bfcb1ffb160 -r a3bdafeb3d59 sys/arch/sparc64/include/lock.h
--- a/sys/arch/sparc64/include/lock.h   Tue Jul 27 21:33:57 1999 +0000
+++ b/sys/arch/sparc64/include/lock.h   Tue Jul 27 21:45:39 1999 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: lock.h,v 1.1 1999/05/30 18:57:27 eeh Exp $ */
+/*     $NetBSD: lock.h,v 1.2 1999/07/27 21:45:41 thorpej Exp $ */
 
 /*-
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -47,13 +47,13 @@
 
 #include <sparc64/sparc64/asm.h>
 
-static void    simple_lock_init __P((__volatile struct simplelock *));
-static void    simple_lock __P((__volatile struct simplelock *));
-static int     simple_lock_try __P((__volatile struct simplelock *));
-static void    simple_unlock __P((__volatile struct simplelock *));
+static void    cpu_simple_lock_init __P((__volatile struct simplelock *));
+static void    cpu_simple_lock __P((__volatile struct simplelock *));
+static int     cpu_simple_lock_try __P((__volatile struct simplelock *));
+static void    cpu_simple_unlock __P((__volatile struct simplelock *));
 
 static __inline__ void
-simple_lock_init (alp)
+cpu_simple_lock_init (alp)
        __volatile struct simplelock *alp;
 {
 
@@ -61,7 +61,7 @@
 }
 
 static __inline__ void
-simple_lock (alp)
+cpu_simple_lock (alp)
        __volatile struct simplelock *alp;
 {
 
@@ -79,7 +79,7 @@
 }
 
 static __inline__ int
-simple_lock_try (alp)
+cpu_simple_lock_try (alp)
        __volatile struct simplelock *alp;
 {
 
@@ -87,18 +87,13 @@
 }
 
 static __inline__ void
-simple_unlock (alp)
+cpu_simple_unlock (alp)
        __volatile struct simplelock *alp;
 {
 
        alp->lock_data = 0;
 }
 
-#if defined(LOCKDEBUG)
-#define simple_lock_dump()
-#define simple_lock_freecheck(start, end)
-#endif /* LOCKDEBUG */
-
 #endif /* _KERNEL */
 
 #endif /* _MACHINE_LOCK_H */



Home | Main Index | Thread Index | Old Index