Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax/include Add non-_KERNEL variants so regress/sys...



details:   https://anonhg.NetBSD.org/src/rev/39a353e1d567
branches:  trunk
changeset: 536247:39a353e1d567
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Sep 12 07:31:13 2002 +0000

description:
Add non-_KERNEL variants so regress/sys/kern/lock will compile.

diffstat:

 sys/arch/vax/include/lock.h |  39 ++++++++++++++++++++++++++++-----------
 1 files changed, 28 insertions(+), 11 deletions(-)

diffs (97 lines):

diff -r ef886e001fb6 -r 39a353e1d567 sys/arch/vax/include/lock.h
--- a/sys/arch/vax/include/lock.h       Thu Sep 12 06:58:13 2002 +0000
+++ b/sys/arch/vax/include/lock.h       Thu Sep 12 07:31:13 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lock.h,v 1.8 2001/06/04 21:37:12 ragge Exp $   */
+/*     $NetBSD: lock.h,v 1.9 2002/09/12 07:31:13 matt Exp $    */
 
 /*
  * Copyright (c) 2000 Ludd, University of Lule}, Sweden.
@@ -41,14 +41,16 @@
 static __inline void
 __cpu_simple_lock_init(__cpu_simple_lock_t *alp)
 {
+#ifdef _KERNEL
        __asm__ __volatile ("movl %0,r1;jsb Sunlock"
                : /* No output */
                : "g"(alp)
                : "r1","cc","memory");
-#if 0
-       __asm__ __volatile ("bbcci $0, %0, 1f;1:"
+#else
+       __asm__ __volatile ("bbcci $0,%0,1f;1:"
                : /* No output */
-               : "m"(*alp));
+               : "m"(*alp)
+               : "cc");
 #endif
 }
 
@@ -57,22 +59,25 @@
 {
        int ret;
 
+#ifdef _KERNEL
        __asm__ __volatile ("movl %1,r1;jsb Slocktry;movl r0,%0"
                : "=&r"(ret)
                : "g"(alp)
                : "r0","r1","cc","memory");
-#if 0
-       __asm__ __volatile ("movl $0,%0;bbssi $0,%1,1f;incl %0;1:"
+#else
+       __asm__ __volatile ("clrl %0;bbssi $0,%1,1f;incl %0;1:"
                : "=&r"(ret)
-               : "m"(*alp));
+               : "m"(*alp)
+               : "cc");
 #endif
 
        return ret;
 }
 
+#ifdef _KERNEL
 #define        VAX_LOCK_CHECKS ((1 << IPI_SEND_CNCHAR) | (1 << IPI_DDB))
 #define        __cpu_simple_lock(alp)                                          \
-{                                                                      \
+do {                                                                   \
        struct cpu_info *__ci = curcpu();                               \
                                                                        \
        while (__cpu_simple_lock_try(alp) == 0) {                       \
@@ -84,7 +89,17 @@
                        splx(__s);                                      \
                }                                                       \
        }                                                               \
+} while (0)
+#else
+static __inline void
+__cpu_simple_lock(__cpu_simple_lock_t *alp)
+{
+       __asm__ __volatile ("1:bbssi $0,%0,1b"
+               : /* No outputs */
+               : "m"(*alp)
+               : "cc");
 }
+#endif /* _KERNEL */
 
 #if 0
 static __inline void
@@ -119,14 +134,16 @@
 static __inline void
 __cpu_simple_unlock(__cpu_simple_lock_t *alp)
 {
+#ifdef _KERNEL
        __asm__ __volatile ("movl %0,r1;jsb Sunlock"
                : /* No output */
                : "g"(alp)
                : "r1","cc","memory");
-#if 0
-       __asm__ __volatile ("bbcci $0, %0, 1f;1:"
+#else
+       __asm__ __volatile ("bbcci $0,%0,1f;1:"
                : /* No output */
-               : "m"(*alp));
+               : "m"(*alp)
+               : "cc");
 #endif
 }
 



Home | Main Index | Thread Index | Old Index