1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
From 3f698a1cf08cc02911cdb2ca3217be77eeba794b Mon Sep 17 00:00:00 2001
From: Kurt Mahan <kmahan@freescale.com>
Date: Tue, 27 Nov 2007 23:17:53 -0700
Subject: [PATCH] Change inline assembly memory params.
For various routines change how the assembly memory pointer
is passed in.
LTIBName: mcfv4e-inline-memory-params
Signed-off-by: Kurt Mahan <kmahan@freescale.com>
---
include/asm-m68k/bitops.h | 68 ++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 67 insertions(+), 1 deletions(-)
--- a/include/asm-m68k/bitops.h
+++ b/include/asm-m68k/bitops.h
@@ -465,7 +465,7 @@ static inline int ext2_find_next_bit(con
__constant_coldfire_test_and_set_bit(nr, vaddr) : \
__generic_coldfire_test_and_set_bit(nr, vaddr))
-
+#if 0
static __inline__ int __constant_coldfire_test_and_set_bit(int nr,
volatile void *vaddr)
{
@@ -477,6 +477,17 @@ static __inline__ int __constant_coldfir
: "di" (nr & 7));
return retval;
}
+#else
+static __inline__ int __constant_coldfire_test_and_set_bit(int nr,volatile void * vaddr)
+{
+ char retval;
+ volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
+ __asm__ __volatile__ ("bset %2,(%4); sne %0"
+ : "=d" (retval), "=m" (*p)
+ : "di" (nr & 7), "m" (*p), "a" (p));
+ return retval;
+}
+#endif
static __inline__ int __generic_coldfire_test_and_set_bit(int nr,
volatile void *vaddr)
@@ -496,6 +507,7 @@ static __inline__ int __generic_coldfire
__constant_coldfire_set_bit(nr, vaddr) : \
__generic_coldfire_set_bit(nr, vaddr))
+#if 0
static __inline__ void __constant_coldfire_set_bit(int nr,
volatile void *vaddr)
{
@@ -503,6 +515,14 @@ static __inline__ void __constant_coldfi
__asm__ __volatile__ ("bset %1,%0"
: "+QUd" (*p) : "di" (nr & 7));
}
+#else
+static __inline__ void __constant_coldfire_set_bit(int nr, volatile void * vaddr)
+{
+ volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
+ __asm__ __volatile__ ("bset %1,(%3)"
+ : "=m" (*p) : "di" (nr & 7), "m" (*p), "a" (p));
+}
+#endif
static __inline__ void __generic_coldfire_set_bit(int nr, volatile void *vaddr)
{
@@ -518,6 +538,7 @@ static __inline__ void __generic_coldfir
__constant_coldfire_test_and_clear_bit(nr, vaddr) : \
__generic_coldfire_test_and_clear_bit(nr, vaddr))
+#if 0
static __inline__ int __constant_coldfire_test_and_clear_bit(int nr,
volatile void *vaddr)
{
@@ -530,6 +551,19 @@ static __inline__ int __constant_coldfir
return retval;
}
+#else
+static __inline__ int __constant_coldfire_test_and_clear_bit(int nr, volatile void *vaddr)
+{
+ char retval;
+ volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
+
+ __asm__ __volatile__ ("bclr %2,(%4); sne %0"
+ : "=d" (retval), "=m" (*p)
+ : "id" (nr & 7), "m" (*p), "a" (p));
+
+ return retval;
+}
+#endif
static __inline__ int __generic_coldfire_test_and_clear_bit(int nr,
volatile void *vaddr)
@@ -556,6 +590,7 @@ static __inline__ int __generic_coldfire
__constant_coldfire_clear_bit(nr, vaddr) : \
__generic_coldfire_clear_bit(nr, vaddr))
+#if 0
static __inline__ void __constant_coldfire_clear_bit(int nr,
volatile void *vaddr)
{
@@ -563,6 +598,14 @@ static __inline__ void __constant_coldfi
__asm__ __volatile__ ("bclr %1,%0"
: "+QUd" (*p) : "id" (nr & 7));
}
+#else
+static __inline__ void __constant_coldfire_clear_bit(int nr, volatile void * vaddr)
+{
+ volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
+ __asm__ __volatile__ ("bclr %1,(%3)"
+ : "=m" (*p) : "id" (nr & 7), "m" (*p), "a" (p));
+}
+#endif
static __inline__ void __generic_coldfire_clear_bit(int nr,
volatile void *vaddr)
@@ -579,6 +622,7 @@ static __inline__ void __generic_coldfir
__constant_coldfire_test_and_change_bit(nr, vaddr) : \
__generic_coldfire_test_and_change_bit(nr, vaddr))
+#if 0
static __inline__ int __constant_coldfire_test_and_change_bit(int nr,
volatile void *vaddr)
{
@@ -591,6 +635,19 @@ static __inline__ int __constant_coldfir
return retval;
}
+#else
+static __inline__ int __constant_coldfire_test_and_change_bit(int nr, volatile void * vaddr)
+{
+ char retval;
+ volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
+
+ __asm__ __volatile__ ("bchg %2,(%4); sne %0"
+ : "=d" (retval), "=m" (*p)
+ : "id" (nr & 7), "m" (*p), "a" (p));
+
+ return retval;
+}
+#endif
static __inline__ int __generic_coldfire_test_and_change_bit(int nr,
volatile void *vaddr)
@@ -612,6 +669,7 @@ static __inline__ int __generic_coldfire
__constant_coldfire_change_bit(nr, vaddr) : \
__generic_coldfire_change_bit(nr, vaddr))
+#if 0
static __inline__ void __constant_coldfire_change_bit(int nr,
volatile void *vaddr)
{
@@ -619,6 +677,14 @@ static __inline__ void __constant_coldfi
__asm__ __volatile__ ("bchg %1,%0"
: "+QUd" (*p) : "id" (nr & 7));
}
+#else
+static __inline__ void __constant_coldfire_change_bit(int nr, volatile void * vaddr)
+{
+ volatile char *p = &((volatile char *)vaddr)[(nr^31) >> 3];
+ __asm__ __volatile__ ("bchg %1,(%3)"
+ : "=m" (*p) : "id" (nr & 7), "m" (*p), "a" (p));
+}
+#endif
static __inline__ void __generic_coldfire_change_bit(int nr,
volatile void *vaddr)
|