Skip to content

Commit 097cf5d

Browse files
hcahcaVasily Gorbik
authored andcommitted
s390/boot: Convert detect_diag9c() to extable
Shorten detect_diag9c() 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 b1879e7 commit 097cf5d

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
@@ -73,30 +73,17 @@ static void detect_machine_type(void)
7373

7474
static void detect_diag9c(void)
7575
{
76-
unsigned long reg1, reg2;
7776
unsigned int cpu;
7877
int rc = 1;
79-
psw_t old;
8078

8179
cpu = stap();
8280
asm volatile(
83-
" mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
84-
" epsw %[reg1],%[reg2]\n"
85-
" st %[reg1],0(%[psw_pgm])\n"
86-
" st %[reg2],4(%[psw_pgm])\n"
87-
" larl %[reg1],1f\n"
88-
" stg %[reg1],8(%[psw_pgm])\n"
89-
" diag %[cpu],0,0x9c\n"
90-
" lhi %[rc],0\n"
91-
"1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
92-
: [reg1] "=&d" (reg1),
93-
[reg2] "=&a" (reg2),
94-
[rc] "+&d" (rc),
95-
"+Q" (get_lowcore()->program_new_psw),
96-
"=Q" (old)
97-
: [psw_old] "a" (&old),
98-
[psw_pgm] "a" (&get_lowcore()->program_new_psw),
99-
[cpu] "d" (cpu)
81+
" diag %[cpu],%%r0,0x9c\n"
82+
"0: lhi %[rc],0\n"
83+
"1:\n"
84+
EX_TABLE(0b, 1b)
85+
: [rc] "+d" (rc)
86+
: [cpu] "d" (cpu)
10087
: "cc", "memory");
10188
if (!rc)
10289
set_machine_feature(MFEATURE_DIAG9C);

0 commit comments

Comments
 (0)