9
9
#include <asm/sections.h>
10
10
#include <asm/setup.h>
11
11
#include <asm/sclp.h>
12
+ #include <asm/asm.h>
12
13
#include <asm/uv.h>
13
14
#include "decompressor.h"
14
15
#include "boot.h"
@@ -59,13 +60,13 @@ static int __diag260(unsigned long rx1, unsigned long rx2)
59
60
{
60
61
unsigned long reg1 , reg2 , ry ;
61
62
union register_pair rx ;
63
+ int cc , exception ;
62
64
psw_t old ;
63
- int rc ;
64
65
65
66
rx .even = rx1 ;
66
67
rx .odd = rx2 ;
67
68
ry = 0x10 ; /* storage configuration */
68
- rc = -1 ; /* fail */
69
+ exception = 1 ;
69
70
asm volatile (
70
71
" mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
71
72
" epsw %[reg1],%[reg2]\n"
@@ -74,20 +75,22 @@ static int __diag260(unsigned long rx1, unsigned long rx2)
74
75
" larl %[reg1],1f\n"
75
76
" stg %[reg1],8(%[psw_pgm])\n"
76
77
" diag %[rx],%[ry],0x260\n"
77
- " ipm %[rc]\n"
78
- " srl %[rc],28\n"
78
+ " lhi %[exc],0\n"
79
79
"1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
80
- : [reg1 ] "=&d" (reg1 ),
80
+ CC_IPM (cc )
81
+ : CC_OUT (cc , cc ),
82
+ [exc ] "+d" (exception ),
83
+ [reg1 ] "= & d " (reg1),
81
84
[reg2 ] "= & a " (reg2),
82
- [rc ] "+&d" (rc ),
83
85
[ry ] "+&d" (ry ),
84
86
"+Q" (get_lowcore ()-> program_new_psw ),
85
87
"=Q" (old )
86
88
: [rx ] "d" (rx .pair ),
87
89
[psw_old ] "a " (&old),
88
90
[psw_pgm ] "a " (&get_lowcore()->program_new_psw)
89
- : "cc" , "memory" );
90
- return rc == 0 ? ry : -1 ;
91
+ : CC_CLOBBER_LIST ("memory" ));
92
+ cc = exception ? -1 : CC_TRANSFORM (cc );
93
+ return cc == 0 ? ry : -1 ;
91
94
}
92
95
93
96
static int diag260 (void )
@@ -148,9 +151,10 @@ static int diag500_storage_limit(unsigned long *max_physmem_end)
148
151
static int tprot (unsigned long addr )
149
152
{
150
153
unsigned long reg1 , reg2 ;
151
- int rc = - EFAULT ;
154
+ int cc , exception ;
152
155
psw_t old ;
153
156
157
+ exception = 1 ;
154
158
asm volatile (
155
159
" mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
156
160
" epsw %[reg1],%[reg2]\n"
@@ -159,19 +163,21 @@ static int tprot(unsigned long addr)
159
163
" larl %[reg1],1f\n"
160
164
" stg %[reg1],8(%[psw_pgm])\n"
161
165
" tprot 0(%[addr]),0\n"
162
- " ipm %[rc]\n"
163
- " srl %[rc],28\n"
166
+ " lhi %[exc],0\n"
164
167
"1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
165
- : [reg1 ] "=&d" (reg1 ),
168
+ CC_IPM (cc )
169
+ : CC_OUT (cc , cc ),
170
+ [exc ] "+d" (exception ),
171
+ [reg1 ] "= & d " (reg1),
166
172
[reg2 ] "=&a" (reg2 ),
167
- [rc ] "+&d" (rc ),
168
173
"=Q" (get_lowcore ()-> program_new_psw .addr ),
169
174
"=Q" (old )
170
175
: [psw_old ] "a" (& old ),
171
176
[psw_pgm ] "a " (&get_lowcore()->program_new_psw),
172
177
[addr ] "a " (addr)
173
- : "cc" , "memory" );
174
- return rc ;
178
+ : CC_CLOBBER_LIST ("memory" ));
179
+ cc = exception ? - EFAULT : CC_TRANSFORM (cc );
180
+ return cc ;
175
181
}
176
182
177
183
static unsigned long search_mem_end (void )
0 commit comments