mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
s390/boot: Convert diag500_storage_limit() to extable
Shorten diag500_storage_limit() and use regular EX_TABLE program check handling. Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
This commit is contained in:
parent
7063bb2900
commit
b1879e7ee7
|
|
@ -104,29 +104,15 @@ static int diag260(void)
|
|||
static int diag500_storage_limit(unsigned long *max_physmem_end)
|
||||
{
|
||||
unsigned long storage_limit;
|
||||
unsigned long reg1, reg2;
|
||||
psw_t old;
|
||||
|
||||
asm volatile(
|
||||
" mvc 0(16,%[psw_old]),0(%[psw_pgm])\n"
|
||||
" epsw %[reg1],%[reg2]\n"
|
||||
" st %[reg1],0(%[psw_pgm])\n"
|
||||
" st %[reg2],4(%[psw_pgm])\n"
|
||||
" larl %[reg1],1f\n"
|
||||
" stg %[reg1],8(%[psw_pgm])\n"
|
||||
" lghi 1,%[subcode]\n"
|
||||
" lghi 2,0\n"
|
||||
" diag 2,4,0x500\n"
|
||||
"1: mvc 0(16,%[psw_pgm]),0(%[psw_old])\n"
|
||||
" lgr %[slimit],2\n"
|
||||
: [reg1] "=&d" (reg1),
|
||||
[reg2] "=&a" (reg2),
|
||||
[slimit] "=d" (storage_limit),
|
||||
"=Q" (get_lowcore()->program_new_psw),
|
||||
"=Q" (old)
|
||||
: [psw_old] "a" (&old),
|
||||
[psw_pgm] "a" (&get_lowcore()->program_new_psw),
|
||||
[subcode] "i" (DIAG500_SC_STOR_LIMIT)
|
||||
" lghi %%r1,%[subcode]\n"
|
||||
" lghi %%r2,0\n"
|
||||
" diag %%r2,%%r4,0x500\n"
|
||||
"0: lgr %[slimit],%%r2\n"
|
||||
EX_TABLE(0b, 0b)
|
||||
: [slimit] "=d" (storage_limit)
|
||||
: [subcode] "i" (DIAG500_SC_STOR_LIMIT)
|
||||
: "memory", "1", "2");
|
||||
if (!storage_limit)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user