From ba1d939e89fd4fe3c8455dae93babe872b057efe Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Tue, 7 Oct 2014 17:20:43 -0500 Subject: arm/shared/abort/abort.c: Fix warnings and clean up --- c/src/lib/libbsp/arm/shared/abort/abort.c | 45 +++++++++++++++++++------------ 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'c/src/lib/libbsp/arm/shared') diff --git a/c/src/lib/libbsp/arm/shared/abort/abort.c b/c/src/lib/libbsp/arm/shared/abort/abort.c index a686a624b4..d509a2a7a6 100644 --- a/c/src/lib/libbsp/arm/shared/abort/abort.c +++ b/c/src/lib/libbsp/arm/shared/abort/abort.c @@ -1,6 +1,10 @@ /* * ARM CPU Dependent Source * + * If you want a small footprint RTEMS, pls use simple_abort.c + */ + +/* * COPYRIGHT (c) 2007 Ray Xu. * mailto: Rayx at gmail dot com * @@ -10,8 +14,6 @@ * Copyright (c) 2002 Advent Networks, Inc * Jay Monkman * - * If you want a small footprint RTEMS, pls use simple_abort.c - * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * http://www.rtems.org/license/LICENSE. @@ -44,21 +46,26 @@ #define SET_REG(r, ctx, v) (((uint32_t *)ctx)[r] = v) #define GET_OFFSET(insn) (insn & 0xfff) -uint32_t g_data_abort_cnt = 0; +/* + * Prototypes + */ +void _print_full_context(uint32_t); +void do_data_abort(uint32_t, uint32_t, Context_Control *); + +uint32_t g_data_abort_cnt = 0; /*this is a big overhead for MCU only got 16K RAM*/ -uint32_t g_data_abort_insn_list[1024]; +uint32_t g_data_abort_insn_list[1024]; char *_print_full_context_mode2txt[0x20]={ - [0x0]="user", /* User */ - [0x1]="fiq", /* FIQ - Fast Interrupt Request */ - [0x2]="irq", /* IRQ - Interrupt Request */ - [0x3]="super", /* Supervisor */ - [0x7]="abort", /* Abort */ - [0xb]="undef", /* Undefined */ - [0xf]="system" /* System */ - }; - + [0x0]="user", /* User */ + [0x1]="fiq", /* FIQ - Fast Interrupt Request */ + [0x2]="irq", /* IRQ - Interrupt Request */ + [0x3]="super", /* Supervisor */ + [0x7]="abort", /* Abort */ + [0xb]="undef", /* Undefined */ + [0xf]="system" /* System */ +}; void _print_full_context(uint32_t spsr) { @@ -82,7 +89,7 @@ void _print_full_context(uint32_t spsr) : [arm_switch_reg] "=&r" (arm_switch_reg), [prev_sp] "=&r" (prev_sp), [prev_lr] "=&r" (prev_lr), [cpsr] "=&r" (cpsr) : [spsr] "r" (spsr) - : "cc"); + : "cc"); printk("Previous sp=0x%08x lr=0x%08x and actual cpsr=%08x\n", prev_sp, prev_lr, cpsr); @@ -102,8 +109,11 @@ void _print_full_context(uint32_t spsr) * All unhandled instructions cause the system to hang. */ -void do_data_abort(uint32_t insn, uint32_t spsr, - Context_Control *ctx) +void do_data_abort( + uint32_t insn, + uint32_t spsr, + Context_Control *ctx +) { /* Clarify, which type is correct, CPU_Exception_frame or Context_Control */ uint8_t decode; @@ -153,9 +163,10 @@ void do_data_abort(uint32_t insn, uint32_t spsr, /* disable interrupts, wait forever */ rtems_interrupt_disable(level); + (void) level; /* avoid set but unused warning */ + while(1) { continue; } - return; } -- cgit v1.2.3