2 * Mostly IRQ support for Hexagon
4 * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and
8 * only version 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #include <linux/kernel.h>
22 #include <linux/sched/debug.h>
23 #include <asm/registers.h>
24 #include <linux/irq.h>
25 #include <linux/hardirq.h>
28 * show_regs - print pt_regs structure
29 * @regs: pointer to pt_regs
31 * To-do: add all the accessor definitions to registers.h
33 * Will make this routine a lot easier to write.
35 void show_regs(struct pt_regs
*regs
)
37 show_regs_print_info(KERN_EMERG
);
39 printk(KERN_EMERG
"restart_r0: \t0x%08lx syscall_nr: %ld\n",
40 regs
->restart_r0
, regs
->syscall_nr
);
41 printk(KERN_EMERG
"preds: \t\t0x%08lx\n", regs
->preds
);
42 printk(KERN_EMERG
"lc0: \t0x%08lx sa0: 0x%08lx m0: 0x%08lx\n",
43 regs
->lc0
, regs
->sa0
, regs
->m0
);
44 printk(KERN_EMERG
"lc1: \t0x%08lx sa1: 0x%08lx m1: 0x%08lx\n",
45 regs
->lc1
, regs
->sa1
, regs
->m1
);
46 printk(KERN_EMERG
"gp: \t0x%08lx ugp: 0x%08lx usr: 0x%08lx\n",
47 regs
->gp
, regs
->ugp
, regs
->usr
);
48 printk(KERN_EMERG
"cs0: \t0x%08lx cs1: 0x%08lx\n",
49 regs
->cs0
, regs
->cs1
);
50 printk(KERN_EMERG
"r0: \t0x%08lx %08lx %08lx %08lx\n", regs
->r00
,
54 printk(KERN_EMERG
"r4: \t0x%08lx %08lx %08lx %08lx\n", regs
->r04
,
58 printk(KERN_EMERG
"r8: \t0x%08lx %08lx %08lx %08lx\n", regs
->r08
,
62 printk(KERN_EMERG
"r12: \t0x%08lx %08lx %08lx %08lx\n", regs
->r12
,
66 printk(KERN_EMERG
"r16: \t0x%08lx %08lx %08lx %08lx\n", regs
->r16
,
70 printk(KERN_EMERG
"r20: \t0x%08lx %08lx %08lx %08lx\n", regs
->r20
,
74 printk(KERN_EMERG
"r24: \t0x%08lx %08lx %08lx %08lx\n", regs
->r24
,
78 printk(KERN_EMERG
"r28: \t0x%08lx %08lx %08lx %08lx\n", regs
->r28
,
83 printk(KERN_EMERG
"elr: \t0x%08lx cause: 0x%08lx user_mode: %d\n",
84 pt_elr(regs
), pt_cause(regs
), user_mode(regs
));
85 printk(KERN_EMERG
"psp: \t0x%08lx badva: 0x%08lx int_enabled: %d\n",
86 pt_psp(regs
), pt_badva(regs
), ints_enabled(regs
));
89 void dummy_handler(struct pt_regs
*regs
)
91 unsigned int elr
= pt_elr(regs
);
92 printk(KERN_ERR
"Unimplemented handler; ELR=0x%08x\n", elr
);
96 void arch_do_IRQ(struct pt_regs
*regs
)
98 int irq
= pt_cause(regs
);
99 struct pt_regs
*old_regs
= set_irq_regs(regs
);
102 generic_handle_irq(irq
);
104 set_irq_regs(old_regs
);