Module Name:    src
Committed By:   tsutsui
Date:           Fri Jan 27 15:25:47 UTC 2023

Modified Files:
        src/sys/arch/next68k/include: bus_space.h

Log Message:
next68k: Specify proper constraints for bus_space_read region and multi ops.

These functions write the read data into memory at a specified pointer,
but without the "memory" constraint gcc could optimize out these ops
if the memory is allocated on local stack.

With this fix nextkbd(4) works again.

Should be pulled up to netbsd-10 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/next68k/include/bus_space.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/next68k/include/bus_space.h
diff -u src/sys/arch/next68k/include/bus_space.h:1.19 src/sys/arch/next68k/include/bus_space.h:1.20
--- src/sys/arch/next68k/include/bus_space.h:1.19	Sat Jan 23 19:38:08 2021
+++ src/sys/arch/next68k/include/bus_space.h	Fri Jan 27 15:25:47 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.h,v 1.19 2021/01/23 19:38:08 christos Exp $	*/
+/*	$NetBSD: bus_space.h,v 1.20 2023/01/27 15:25:47 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -167,7 +167,7 @@ typedef u_long	bus_space_handle_t;
 		jne	1b"					:	\
 								:	\
 		    "r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		    "a0","a1","d0");					\
+		    "a0","a1","d0","memory");				\
 } while (0);
 
 #define	bus_space_read_multi_2(t, h, o, a, c) do {			\
@@ -181,7 +181,7 @@ typedef u_long	bus_space_handle_t;
 		jne	1b"					:	\
 								:	\
 		    "r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		    "a0","a1","d0");					\
+		    "a0","a1","d0","memory");				\
 } while (0);
 
 #define	bus_space_read_multi_4(t, h, o, a, c) do {			\
@@ -195,7 +195,7 @@ typedef u_long	bus_space_handle_t;
 		jne	1b"					:	\
 								:	\
 		    "r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		    "a0","a1","d0");					\
+		    "a0","a1","d0","memory");				\
 } while (0);
 
 /*
@@ -219,7 +219,7 @@ typedef u_long	bus_space_handle_t;
 		jne	1b"					:	\
 								:	\
 		    "r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		    "a0","a1","d0");					\
+		    "a0","a1","d0","memory");				\
 } while (0);
 
 #define	bus_space_read_region_2(t, h, o, a, c) do {			\
@@ -233,7 +233,7 @@ typedef u_long	bus_space_handle_t;
 		jne	1b"					:	\
 								:	\
 		    "r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		    "a0","a1","d0");					\
+		    "a0","a1","d0","memory");					\
 } while (0);
 
 #define	bus_space_read_region_4(t, h, o, a, c) do {			\
@@ -247,7 +247,7 @@ typedef u_long	bus_space_handle_t;
 		jne	1b"					:	\
 								:	\
 		    "r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		    "a0","a1","d0");					\
+		    "a0","a1","d0","memory");					\
 } while (0);
 
 /*

Reply via email to