Module Name:    src
Committed By:   rin
Date:           Sun Mar  8 06:12:01 UTC 2020

Modified Files:
        src/sys/arch/m68k/include: mutex.h
        src/sys/arch/m68k/m68k: lock_stubs.s

Log Message:
Remove mutex stubs for 68010 that merely fall back to C codes, and
do not work with kern_mutex.c rev 1.85 and later:

    http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_mutex.c#rev1.85
    http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/kern_mutex.c#rev1.86

Fix sun2 kernel freeze during early boot stage in mutex_exit(9).


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/include/mutex.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/m68k/m68k/lock_stubs.s

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/m68k/include/mutex.h
diff -u src/sys/arch/m68k/include/mutex.h:1.9 src/sys/arch/m68k/include/mutex.h:1.10
--- src/sys/arch/m68k/include/mutex.h:1.9	Fri Nov 29 22:55:33 2019
+++ src/sys/arch/m68k/include/mutex.h	Sun Mar  8 06:12:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mutex.h,v 1.9 2019/11/29 22:55:33 riastradh Exp $	*/
+/*	$NetBSD: mutex.h,v 1.10 2020/03/08 06:12:01 rin Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007 The NetBSD Foundation, Inc.
@@ -60,7 +60,9 @@ struct kmutex {
 #define	mtx_lock		u.s.mtxs_lock
 
 #define	__HAVE_SIMPLE_MUTEXES		1
+#ifndef	__mc68010__
 #define	__HAVE_MUTEX_STUBS		1
+#endif
 
 #define	MUTEX_CAS(p, o, n)		(atomic_cas_uint((p), (o), (n)) == (o))
 

Index: src/sys/arch/m68k/m68k/lock_stubs.s
diff -u src/sys/arch/m68k/m68k/lock_stubs.s:1.9 src/sys/arch/m68k/m68k/lock_stubs.s:1.10
--- src/sys/arch/m68k/m68k/lock_stubs.s:1.9	Thu Aug  1 13:42:52 2013
+++ src/sys/arch/m68k/m68k/lock_stubs.s	Sun Mar  8 06:12:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock_stubs.s,v 1.9 2013/08/01 13:42:52 matt Exp $	*/
+/*	$NetBSD: lock_stubs.s,v 1.10 2020/03/08 06:12:01 rin Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -83,32 +83,30 @@ STRONG_ALIAS(_atomic_cas_ulong_ni,_atomi
 
 #if !defined(LOCKDEBUG)
 
+#if !defined(__mc68010__)
 /*
  * void mutex_enter(kmutex_t *mtx);
  */
 ENTRY(mutex_enter)
-#if !defined(__mc68010__)
 	movq	#0,%d0
 	movl	_C_LABEL(curlwp),%d1
 	movl	4(%sp),%a0
 	casl	%d0,%d1,(%a0)
 	bnes	1f
 	rts
-#endif /* !__mc68010__ */
 1:	jra	_C_LABEL(mutex_vector_enter)
 
 /*
  * void mutex_exit(kmutex_t *mtx);
  */
 ENTRY(mutex_exit)
-#if !defined(__mc68010__)
 	movl	_C_LABEL(curlwp),%d0
 	movq	#0,%d1
 	movl	4(%sp),%a0
 	casl	%d0,%d1,(%a0)
 	bnes	1f
 	rts
-#endif /* !__mc68010__ */
 1:	jra	_C_LABEL(mutex_vector_exit)
+#endif /* !__mc68010__ */
 
 #endif	/* !LOCKDEBUG */

Reply via email to