1 // SPDX-License-Identifier: GPL-2.0-only
3 * Mostly IRQ support for Hexagon
5 * Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
8 #include <linux/kernel.h>
9 #include <linux/sched/debug.h>
10 #include <asm/registers.h>
11 #include <linux/irq.h>
12 #include <linux/hardirq.h>
15 * show_regs - print pt_regs structure
16 * @regs: pointer to pt_regs
18 * To-do: add all the accessor definitions to registers.h
20 * Will make this routine a lot easier to write.
22 void show_regs(struct pt_regs
*regs
)
24 show_regs_print_info(KERN_EMERG
);
26 printk(KERN_EMERG
"restart_r0: \t0x%08lx syscall_nr: %ld\n",
27 regs
->restart_r0
, regs
->syscall_nr
);
28 printk(KERN_EMERG
"preds: \t\t0x%08lx\n", regs
->preds
);
29 printk(KERN_EMERG
"lc0: \t0x%08lx sa0: 0x%08lx m0: 0x%08lx\n",
30 regs
->lc0
, regs
->sa0
, regs
->m0
);
31 printk(KERN_EMERG
"lc1: \t0x%08lx sa1: 0x%08lx m1: 0x%08lx\n",
32 regs
->lc1
, regs
->sa1
, regs
->m1
);
33 printk(KERN_EMERG
"gp: \t0x%08lx ugp: 0x%08lx usr: 0x%08lx\n",
34 regs
->gp
, regs
->ugp
, regs
->usr
);
35 printk(KERN_EMERG
"cs0: \t0x%08lx cs1: 0x%08lx\n",
36 regs
->cs0
, regs
->cs1
);
37 printk(KERN_EMERG
"r0: \t0x%08lx %08lx %08lx %08lx\n", regs
->r00
,
41 printk(KERN_EMERG
"r4: \t0x%08lx %08lx %08lx %08lx\n", regs
->r04
,
45 printk(KERN_EMERG
"r8: \t0x%08lx %08lx %08lx %08lx\n", regs
->r08
,
49 printk(KERN_EMERG
"r12: \t0x%08lx %08lx %08lx %08lx\n", regs
->r12
,
53 printk(KERN_EMERG
"r16: \t0x%08lx %08lx %08lx %08lx\n", regs
->r16
,
57 printk(KERN_EMERG
"r20: \t0x%08lx %08lx %08lx %08lx\n", regs
->r20
,
61 printk(KERN_EMERG
"r24: \t0x%08lx %08lx %08lx %08lx\n", regs
->r24
,
65 printk(KERN_EMERG
"r28: \t0x%08lx %08lx %08lx %08lx\n", regs
->r28
,
70 printk(KERN_EMERG
"elr: \t0x%08lx cause: 0x%08lx user_mode: %d\n",
71 pt_elr(regs
), pt_cause(regs
), user_mode(regs
));
72 printk(KERN_EMERG
"psp: \t0x%08lx badva: 0x%08lx int_enabled: %d\n",
73 pt_psp(regs
), pt_badva(regs
), ints_enabled(regs
));
76 void dummy_handler(struct pt_regs
*regs
)
78 unsigned int elr
= pt_elr(regs
);
79 printk(KERN_ERR
"Unimplemented handler; ELR=0x%08x\n", elr
);
83 void arch_do_IRQ(struct pt_regs
*regs
)
85 int irq
= pt_cause(regs
);
86 struct pt_regs
*old_regs
= set_irq_regs(regs
);
89 generic_handle_irq(irq
);
91 set_irq_regs(old_regs
);