Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/next68k/include next68k: Specify proper constraints...



details:   https://anonhg.NetBSD.org/src/rev/9d50239a2cc2
branches:  trunk
changeset: 373247:9d50239a2cc2
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Fri Jan 27 15:25:47 2023 +0000

description:
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.

diffstat:

 sys/arch/next68k/include/bus_space.h |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (63 lines):

diff -r 7696e84c47b3 -r 9d50239a2cc2 sys/arch/next68k/include/bus_space.h
--- a/sys/arch/next68k/include/bus_space.h      Fri Jan 27 15:21:52 2023 +0000
+++ b/sys/arch/next68k/include/bus_space.h      Fri Jan 27 15:25:47 2023 +0000
@@ -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 @@
                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 @@
                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 @@
                jne     1b"                                     :       \
                                                                :       \
                    "r" ((h) + (o)), "g" (a), "g" (c)           :       \
-                   "a0","a1","d0");                                    \
+                   "a0","a1","d0","memory");                           \
 } while (0);
 
 /*
@@ -219,7 +219,7 @@
                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 @@
                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 @@
                jne     1b"                                     :       \
                                                                :       \
                    "r" ((h) + (o)), "g" (a), "g" (c)           :       \
-                   "a0","a1","d0");                                    \
+                   "a0","a1","d0","memory");                                   \
 } while (0);
 
 /*



Home | Main Index | Thread Index | Old Index