Skip to content

Commit 68d6996

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/boot: Convert cmma_test_essa() to extable
Shorten cmma_test_essa() 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 6067891 commit 68d6996

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

arch/s390/boot/startup.c

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -147,30 +147,17 @@ static void detect_facilities(void)
147147

148148
static int cmma_test_essa(void)
149149
{
150-
unsigned long reg1, reg2, tmp = 0;
150+
unsigned long tmp = 0;
151151
int rc = 1;
152-
psw_t old;
153152

154153
/* Test ESSA_GET_STATE */
155154
asm volatile(
156-
" mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
157-
" epsw %[reg1],%[reg2]\n"
158-
" st %[reg1],0(%[psw_pgm])\n"
159-
" st %[reg2],4(%[psw_pgm])\n"
160-
" larl %[reg1],1f\n"
161-
" stg %[reg1],8(%[psw_pgm])\n"
162155
" .insn rrf,0xb9ab0000,%[tmp],%[tmp],%[cmd],0\n"
163-
" la %[rc],0\n"
164-
"1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
165-
: [reg1] "=&d" (reg1),
166-
[reg2] "=&a" (reg2),
167-
[rc] "+&d" (rc),
168-
[tmp] "=&d" (tmp),
169-
"+Q" (get_lowcore()->program_new_psw),
170-
"=Q" (old)
171-
: [psw_old] "a" (&old),
172-
[psw_pgm] "a" (&get_lowcore()->program_new_psw),
173-
[cmd] "i" (ESSA_GET_STATE)
156+
"0: lhi %[rc],0\n"
157+
"1:\n"
158+
EX_TABLE(0b, 1b)
159+
: [rc] "+d" (rc), [tmp] "+d" (tmp)
160+
: [cmd] "i" (ESSA_GET_STATE)
174161
: "cc", "memory");
175162
return rc;
176163
}

0 commit comments

Comments
 (0)