1 /*
2  * xen/arch/arm/arm64/traps.c
3  *
4  * ARM AArch64 Specific Trap handlers
5  *
6  * Copyright (c) 2012 Citrix Systems.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  */
18 
19 #include <xen/lib.h>
20 
21 #include <asm/hsr.h>
22 #include <asm/system.h>
23 #include <asm/processor.h>
24 
25 #include <public/xen.h>
26 
27 static const char *handler[]= {
28         "Synchronous Abort",
29         "IRQ",
30         "FIQ",
31         "Error"
32 };
33 
do_bad_mode(struct cpu_user_regs * regs,int reason)34 void do_bad_mode(struct cpu_user_regs *regs, int reason)
35 {
36     union hsr hsr = { .bits = regs->hsr };
37 
38     printk("Bad mode in %s handler detected\n", handler[reason]);
39     printk("ESR=0x%08"PRIx32":  EC=%"PRIx32", IL=%"PRIx32", ISS=%"PRIx32"\n",
40            hsr.bits, hsr.ec, hsr.len, hsr.iss);
41 
42     local_irq_disable();
43     show_execution_state(regs);
44     panic("bad mode\n");
45 }
46 
47 /*
48  * Local variables:
49  * mode: C
50  * c-file-style: "BSD"
51  * c-basic-offset: 4
52  * indent-tabs-mode: nil
53  * End:
54  */
55