Skip to content

Commit b1879e7

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/boot: Convert diag500_storage_limit() to extable
Shorten diag500_storage_limit() and use regular EX_TABLE program check handling. Acked-by: Alexander Gordeev <[email protected]> Signed-off-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent 7063bb2 commit b1879e7

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

arch/s390/boot/physmem_info.c

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,15 @@ static int diag260(void)
104104
static int diag500_storage_limit(unsigned long *max_physmem_end)
105105
{
106106
unsigned long storage_limit;
107-
unsigned long reg1, reg2;
108-
psw_t old;
109107

110108
asm volatile(
111-
" mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
112-
" epsw %[reg1],%[reg2]\n"
113-
" st %[reg1],0(%[psw_pgm])\n"
114-
" st %[reg2],4(%[psw_pgm])\n"
115-
" larl %[reg1],1f\n"
116-
" stg %[reg1],8(%[psw_pgm])\n"
117-
" lghi 1,%[subcode]\n"
118-
" lghi 2,0\n"
119-
" diag 2,4,0x500\n"
120-
"1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
121-
" lgr %[slimit],2\n"
122-
: [reg1] "=&d" (reg1),
123-
[reg2] "=&a" (reg2),
124-
[slimit] "=d" (storage_limit),
125-
"=Q" (get_lowcore()->program_new_psw),
126-
"=Q" (old)
127-
: [psw_old] "a" (&old),
128-
[psw_pgm] "a" (&get_lowcore()->program_new_psw),
129-
[subcode] "i" (DIAG500_SC_STOR_LIMIT)
109+
" lghi %%r1,%[subcode]\n"
110+
" lghi %%r2,0\n"
111+
" diag %%r2,%%r4,0x500\n"
112+
"0: lgr %[slimit],%%r2\n"
113+
EX_TABLE(0b, 0b)
114+
: [slimit] "=d" (storage_limit)
115+
: [subcode] "i" (DIAG500_SC_STOR_LIMIT)
130116
: "memory", "1", "2");
131117
if (!storage_limit)
132118
return -EINVAL;

0 commit comments

Comments
 (0)