aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/xpram.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block/xpram.c')
-rw-r--r--drivers/s390/block/xpram.c54
1 files changed, 14 insertions, 40 deletions
diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c
index cab2c736683a..a04d9120cef0 100644
--- a/drivers/s390/block/xpram.c
+++ b/drivers/s390/block/xpram.c
@@ -89,28 +89,15 @@ MODULE_LICENSE("GPL");
89 */ 89 */
90static int xpram_page_in (unsigned long page_addr, unsigned int xpage_index) 90static int xpram_page_in (unsigned long page_addr, unsigned int xpage_index)
91{ 91{
92 int cc; 92 int cc = 2; /* return unused cc 2 if pgin traps */
93 93
94 __asm__ __volatile__ ( 94 asm volatile(
95 " lhi %0,2\n" /* return unused cc 2 if pgin traps */ 95 " .insn rre,0xb22e0000,%1,%2\n" /* pgin %1,%2 */
96 " .insn rre,0xb22e0000,%1,%2\n" /* pgin %1,%2 */ 96 "0: ipm %0\n"
97 "0: ipm %0\n" 97 " srl %0,28\n"
98 " srl %0,28\n"
99 "1:\n" 98 "1:\n"
100#ifndef CONFIG_64BIT 99 EX_TABLE(0b,1b)
101 ".section __ex_table,\"a\"\n" 100 : "+d" (cc) : "a" (__pa(page_addr)), "d" (xpage_index) : "cc");
102 " .align 4\n"
103 " .long 0b,1b\n"
104 ".previous"
105#else
106 ".section __ex_table,\"a\"\n"
107 " .align 8\n"
108 " .quad 0b,1b\n"
109 ".previous"
110#endif
111 : "=&d" (cc)
112 : "a" (__pa(page_addr)), "a" (xpage_index)
113 : "cc" );
114 if (cc == 3) 101 if (cc == 3)
115 return -ENXIO; 102 return -ENXIO;
116 if (cc == 2) { 103 if (cc == 2) {
@@ -137,28 +124,15 @@ static int xpram_page_in (unsigned long page_addr, unsigned int xpage_index)
137 */ 124 */
138static long xpram_page_out (unsigned long page_addr, unsigned int xpage_index) 125static long xpram_page_out (unsigned long page_addr, unsigned int xpage_index)
139{ 126{
140 int cc; 127 int cc = 2; /* return unused cc 2 if pgin traps */
141 128
142 __asm__ __volatile__ ( 129 asm volatile(
143 " lhi %0,2\n" /* return unused cc 2 if pgout traps */ 130 " .insn rre,0xb22f0000,%1,%2\n" /* pgout %1,%2 */
144 " .insn rre,0xb22f0000,%1,%2\n" /* pgout %1,%2 */ 131 "0: ipm %0\n"
145 "0: ipm %0\n" 132 " srl %0,28\n"
146 " srl %0,28\n"
147 "1:\n" 133 "1:\n"
148#ifndef CONFIG_64BIT 134 EX_TABLE(0b,1b)
149 ".section __ex_table,\"a\"\n" 135 : "+d" (cc) : "a" (__pa(page_addr)), "d" (xpage_index) : "cc");
150 " .align 4\n"
151 " .long 0b,1b\n"
152 ".previous"
153#else
154 ".section __ex_table,\"a\"\n"
155 " .align 8\n"
156 " .quad 0b,1b\n"
157 ".previous"
158#endif
159 : "=&d" (cc)
160 : "a" (__pa(page_addr)), "a" (xpage_index)
161 : "cc" );
162 if (cc == 3) 136 if (cc == 3)
163 return -ENXIO; 137 return -ENXIO;
164 if (cc == 2) { 138 if (cc == 2) {