summaryrefslogtreecommitdiff
path: root/bsp/dm365/platform/trap.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/dm365/platform/trap.c')
-rw-r--r--bsp/dm365/platform/trap.c126
1 files changed, 63 insertions, 63 deletions
diff --git a/bsp/dm365/platform/trap.c b/bsp/dm365/platform/trap.c
index 8c067f9f3b..5c5f0272b3 100644
--- a/bsp/dm365/platform/trap.c
+++ b/bsp/dm365/platform/trap.c
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
- * Date Author Notes
- * 2010-11-13 weety first version
+ * Date Author Notes
+ * 2010-11-13 weety first version
*/
@@ -32,13 +32,13 @@ extern long list_thread(void);
void rt_hw_show_register (struct rt_hw_register *regs)
{
- rt_kprintf("Execption:\n");
- rt_kprintf("r00:0x%08x r01:0x%08x r02:0x%08x r03:0x%08x\n", regs->r0, regs->r1, regs->r2, regs->r3);
- rt_kprintf("r04:0x%08x r05:0x%08x r06:0x%08x r07:0x%08x\n", regs->r4, regs->r5, regs->r6, regs->r7);
- rt_kprintf("r08:0x%08x r09:0x%08x r10:0x%08x\n", regs->r8, regs->r9, regs->r10);
- rt_kprintf("fp :0x%08x ip :0x%08x\n", regs->fp, regs->ip);
- rt_kprintf("sp :0x%08x lr :0x%08x pc :0x%08x\n", regs->sp, regs->lr, regs->pc);
- rt_kprintf("cpsr:0x%08x\n", regs->cpsr);
+ rt_kprintf("Execption:\n");
+ rt_kprintf("r00:0x%08x r01:0x%08x r02:0x%08x r03:0x%08x\n", regs->r0, regs->r1, regs->r2, regs->r3);
+ rt_kprintf("r04:0x%08x r05:0x%08x r06:0x%08x r07:0x%08x\n", regs->r4, regs->r5, regs->r6, regs->r7);
+ rt_kprintf("r08:0x%08x r09:0x%08x r10:0x%08x\n", regs->r8, regs->r9, regs->r10);
+ rt_kprintf("fp :0x%08x ip :0x%08x\n", regs->fp, regs->ip);
+ rt_kprintf("sp :0x%08x lr :0x%08x pc :0x%08x\n", regs->sp, regs->lr, regs->pc);
+ rt_kprintf("cpsr:0x%08x\n", regs->cpsr);
}
/**
@@ -51,15 +51,15 @@ void rt_hw_show_register (struct rt_hw_register *regs)
*/
void rt_hw_trap_udef(struct rt_hw_register *regs)
{
- rt_hw_show_register(regs);
+ rt_hw_show_register(regs);
- rt_kprintf("undefined instruction\n");
- rt_kprintf("thread - %s stack:\n", rt_current_thread->name);
+ rt_kprintf("undefined instruction\n");
+ rt_kprintf("thread - %s stack:\n", rt_current_thread->name);
#ifdef RT_USING_FINSH
- list_thread();
+ list_thread();
#endif
- rt_hw_cpu_shutdown();
+ rt_hw_cpu_shutdown();
}
/**
@@ -73,10 +73,10 @@ void rt_hw_trap_udef(struct rt_hw_register *regs)
*/
void rt_hw_trap_swi(struct rt_hw_register *regs)
{
- rt_hw_show_register(regs);
+ rt_hw_show_register(regs);
- rt_kprintf("software interrupt\n");
- rt_hw_cpu_shutdown();
+ rt_kprintf("software interrupt\n");
+ rt_hw_cpu_shutdown();
}
/**
@@ -89,15 +89,15 @@ void rt_hw_trap_swi(struct rt_hw_register *regs)
*/
void rt_hw_trap_pabt(struct rt_hw_register *regs)
{
- rt_hw_show_register(regs);
+ rt_hw_show_register(regs);
- rt_kprintf("prefetch abort\n");
- rt_kprintf("thread - %s stack:\n", rt_current_thread->name);
+ rt_kprintf("prefetch abort\n");
+ rt_kprintf("thread - %s stack:\n", rt_current_thread->name);
#ifdef RT_USING_FINSH
- list_thread();
+ list_thread();
#endif
- rt_hw_cpu_shutdown();
+ rt_hw_cpu_shutdown();
}
/**
@@ -110,30 +110,30 @@ void rt_hw_trap_pabt(struct rt_hw_register *regs)
*/
void rt_hw_trap_dabt(struct rt_hw_register *regs)
{
- rt_uint32_t fault_addr;
- rt_uint32_t fault_status;
- asm volatile ("mrc p15, 0, %0, c6, c0, 0"
- :
- :"r"(fault_addr)
- :"cc");
- rt_kprintf("unhandler access to 0x%08x\n", fault_addr);
+ rt_uint32_t fault_addr;
+ rt_uint32_t fault_status;
+ asm volatile ("mrc p15, 0, %0, c6, c0, 0"
+ :
+ :"r"(fault_addr)
+ :"cc");
+ rt_kprintf("unhandler access to 0x%08x\n", fault_addr);
- /* read DFSR */
- asm volatile ("MRC p15, 0, %0, c5, c0, 0"
- :
- :"r"(fault_status)
- :"cc");
- rt_kprintf("fault status 0x%08x\n", fault_status);
+ /* read DFSR */
+ asm volatile ("MRC p15, 0, %0, c5, c0, 0"
+ :
+ :"r"(fault_status)
+ :"cc");
+ rt_kprintf("fault status 0x%08x\n", fault_status);
- rt_hw_show_register(regs);
+ rt_hw_show_register(regs);
- rt_kprintf("data abort\n");
- rt_kprintf("thread - %s stack:\n", rt_current_thread->name);
+ rt_kprintf("data abort\n");
+ rt_kprintf("thread - %s stack:\n", rt_current_thread->name);
#ifdef RT_USING_FINSH
- list_thread();
+ list_thread();
#endif
- rt_hw_cpu_shutdown();
+ rt_hw_cpu_shutdown();
}
/**
@@ -145,9 +145,9 @@ void rt_hw_trap_dabt(struct rt_hw_register *regs)
*/
void rt_hw_trap_resv(struct rt_hw_register *regs)
{
- rt_kprintf("not used\n");
- rt_hw_show_register(regs);
- rt_hw_cpu_shutdown();
+ rt_kprintf("not used\n");
+ rt_hw_show_register(regs);
+ rt_hw_cpu_shutdown();
}
extern struct rt_irq_desc irq_desc[];
@@ -155,32 +155,32 @@ extern struct rt_irq_desc irq_desc[];
void rt_hw_trap_irq()
{
- rt_isr_handler_t isr_func;
- rt_uint32_t val, irq, mask;
- void *param;
+ rt_isr_handler_t isr_func;
+ rt_uint32_t val, irq, mask;
+ void *param;
- /* get irq number */
- val = readl(DAVINCI_ARM_INTC_BASE+0x14) - readl(DAVINCI_ARM_INTC_BASE+0x24);
- irq = (val >> 2) - 1;
- /* clear pending register */
- mask = 1 << (irq & 0x1f);
- if (irq > 31)
- writel(mask, DAVINCI_ARM_INTC_BASE+0x0c); //IRQ1
- else
- writel(mask, DAVINCI_ARM_INTC_BASE+0x08); //IRQ0
-
- /* get interrupt service routine */
- isr_func = irq_desc[irq].handler;
- param = irq_desc[irq].param;
+ /* get irq number */
+ val = readl(DAVINCI_ARM_INTC_BASE+0x14) - readl(DAVINCI_ARM_INTC_BASE+0x24);
+ irq = (val >> 2) - 1;
+ /* clear pending register */
+ mask = 1 << (irq & 0x1f);
+ if (irq > 31)
+ writel(mask, DAVINCI_ARM_INTC_BASE+0x0c); //IRQ1
+ else
+ writel(mask, DAVINCI_ARM_INTC_BASE+0x08); //IRQ0
- /* turn to interrupt service routine */
- isr_func(irq, param);
- irq_desc[irq].counter++;
+ /* get interrupt service routine */
+ isr_func = irq_desc[irq].handler;
+ param = irq_desc[irq].param;
+
+ /* turn to interrupt service routine */
+ isr_func(irq, param);
+ irq_desc[irq].counter++;
}
void rt_hw_trap_fiq()
{
- rt_kprintf("fast interrupt request\n");
+ rt_kprintf("fast interrupt request\n");
}
/*@}*/