Module Name:    src
Committed By:   rin
Date:           Mon Sep 13 11:54:42 UTC 2021

Modified Files:
        src/sys/arch/powerpc/include: lock.h

Log Message:
Fix IBM405 errata 77 workaround for __cpu_simple_lock{,_try}();
adjust labels so that dcbt is executed before stwcx. insn.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/include/lock.h

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/powerpc/include/lock.h
diff -u src/sys/arch/powerpc/include/lock.h:1.15 src/sys/arch/powerpc/include/lock.h:1.16
--- src/sys/arch/powerpc/include/lock.h:1.15	Sun Mar  1 23:23:36 2020
+++ src/sys/arch/powerpc/include/lock.h	Mon Sep 13 11:54:42 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.15 2020/03/01 23:23:36 rin Exp $	*/
+/*	$NetBSD: lock.h,v 1.16 2021/09/13 11:54:42 rin Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -80,12 +80,12 @@ __cpu_simple_lock(__cpu_simple_lock_t *a
 2:	lwzx	%0,0,%1		\n\
 	cmpwi	%0,%2		\n\
 	beq+	1b		\n\
-	b	2b		\n"
+	b	2b		\n\
+3:				\n"
 #ifdef IBM405_ERRATA77
 	"dcbt	0,%1		\n"
 #endif
-"				\
-3:	stwcx.	%3,0,%1		\n\
+	"stwcx.	%3,0,%1		\n\
 	bne-	1b		\n\
 	isync			\n\
 				\n"
@@ -108,12 +108,12 @@ __cpu_simple_lock_try(__cpu_simple_lock_
 	"dcbt	0,%1		\n"
 #endif
 	"stwcx.	%3,0,%1		\n\
-	bne-	1b		\n"
+	bne-	1b		\n\
+2:				\n"
 #ifdef IBM405_ERRATA77
 	"dcbt	0,%4		\n"
 #endif
-"				\
-2:	stwcx.	%3,0,%4		\n\
+	"stwcx.	%3,0,%4		\n\
 	isync			\n\
 				\n"
 	: "=&r"(old)

Reply via email to