Skip to content

Commit

Permalink
[S390] Add exception handler for diagnose 224
Browse files Browse the repository at this point in the history
To be able to run with the diagnose 224 switched off, a potential
specification exception has to be handled.

Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Michael Holzheu authored and Martin Schwidefsky committed May 31, 2007
1 parent 3f0a676 commit c41d4e3
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions arch/s390/hypfs/hypfs_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,17 @@ static void *diag204_store(void)

/* Diagnose 224 functions */

static void diag224(void *ptr)
static int diag224(void *ptr)
{
asm volatile("diag %0,%1,0x224" : :"d" (0), "d"(ptr) : "memory");
int rc = -ENOTSUPP;

asm volatile(
" diag %1,%2,0x224\n"
"0: lhi %0,0x0\n"
"1:\n"
EX_TABLE(0b,1b)
: "+d" (rc) :"d" (0), "d" (ptr) : "memory");
return rc;
}

static int diag224_get_name_table(void)
Expand All @@ -492,7 +500,10 @@ static int diag224_get_name_table(void)
diag224_cpu_names = kmalloc(PAGE_SIZE, GFP_KERNEL | GFP_DMA);
if (!diag224_cpu_names)
return -ENOMEM;
diag224(diag224_cpu_names);
if (diag224(diag224_cpu_names)) {
kfree(diag224_cpu_names);
return -ENOTSUPP;
}
EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16);
return 0;
}
Expand Down

0 comments on commit c41d4e3

Please sign in to comment.