-#include <cyg/infra/cyg_trac.h> // tracing macros
-#include <cyg/infra/cyg_ass.h> // assertion macros
+#include <cyg/infra/cyg_trac.h> // tracing macros
+#include <cyg/infra/cyg_ass.h> // assertion macros
#include <cyg/infra/diag.h>
/*------------------------------------------------------------------------*/
#include <cyg/infra/diag.h>
/*------------------------------------------------------------------------*/
- hold_vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH] = hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH];
- hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH] = vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH];
- hold_vectors[CYGNUM_HAL_VECTOR_ABORT_DATA] = hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_DATA];
- hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_DATA] = vectors[CYGNUM_HAL_VECTOR_ABORT_DATA];
+ hold_vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH] = hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH];
+ hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH] = vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH];
+ hold_vectors[CYGNUM_HAL_VECTOR_ABORT_DATA] = hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_DATA];
+ hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_DATA] = vectors[CYGNUM_HAL_VECTOR_ABORT_DATA];
- hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH] = hold_vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH];
- hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_DATA] = hold_vectors[CYGNUM_HAL_VECTOR_ABORT_DATA];
+ hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH] = hold_vectors[CYGNUM_HAL_VECTOR_ABORT_PREFETCH];
+ hardware_vectors[CYGNUM_HAL_VECTOR_ABORT_DATA] = hold_vectors[CYGNUM_HAL_VECTOR_ABORT_DATA];
- // Special case handler for code which has chosen to take care
- // of data exceptions (i.e. code which expects them to happen)
- // This is common in discovery code, e.g. checking for a particular
- // device which may generate an exception when probing if the
- // device is not present
+ // Special case handler for code which has chosen to take care
+ // of data exceptions (i.e. code which expects them to happen)
+ // This is common in discovery code, e.g. checking for a particular
+ // device which may generate an exception when probing if the
+ // device is not present
- if (__mem_fault_handler &&
- regs->vector == CYGNUM_HAL_EXCEPTION_DATA_ACCESS) {
- regs->pc = (unsigned long)__mem_fault_handler;
- return; // Caught an exception inside stubs
- }
+ if (__mem_fault_handler &&
+ regs->vector == CYGNUM_HAL_EXCEPTION_DATA_ACCESS) {
+ regs->pc = (unsigned long)__mem_fault_handler;
+ return; // Caught an exception inside stubs
+ }
- // We should decode the vector and pass a more appropriate
- // value as the second argument. For now we simply pass a
- // pointer to the saved registers. We should also divert
- // breakpoint and other debug vectors into the debug stubs.
+ // We should decode the vector and pass a more appropriate
+ // value as the second argument. For now we simply pass a
+ // pointer to the saved registers. We should also divert
+ // breakpoint and other debug vectors into the debug stubs.
- static pfunc *p = &__CTOR_END__[-1];
-
- cyg_hal_stop_constructors = 0;
- for (; p >= __CTOR_LIST__; p--) {
- (*p) ();
- if (cyg_hal_stop_constructors) {
- p--;
- break;
- }
- }
+ static pfunc *p = &__CTOR_END__[-1];
+
+ cyg_hal_stop_constructors = 0;
+ for (; p >= __CTOR_LIST__; p--) {
+ (*p) ();
+ if (cyg_hal_stop_constructors) {
+ p--;
+ break;
+ }
+ }
- HAL_SavedRegisters *rp = (HAL_SavedRegisters *)frame;
- int i;
- diag_dump_buf(frame, 128);
- diag_printf("Registers:\n");
- for (i = 0; i <= 10; i++) {
- if ((i == 0) || (i == 6)) diag_printf("R%d: ", i);
- diag_printf("%08X ", rp->d[i]);
- if ((i == 5) || (i == 10)) diag_printf("\n");
- }
- diag_printf("FP: %08X, SP: %08X, LR: %08X, PC: %08X, PSR: %08X\n",
- rp->fp, rp->sp, rp->lr, rp->pc, rp->cpsr);
+ HAL_SavedRegisters *rp = (HAL_SavedRegisters *)frame;
+ int i;
+ diag_dump_buf(frame, 128);
+ diag_printf("Registers:\n");
+ for (i = 0; i <= 10; i++) {
+ if ((i == 0) || (i == 6)) diag_printf("R%d: ", i);
+ diag_printf("%08X ", rp->d[i]);
+ if ((i == 5) || (i == 10)) diag_printf("\n");
+ }
+ diag_printf("FP: %08X, SP: %08X, LR: %08X, PC: %08X, PSR: %08X\n",
+ rp->fp, rp->sp, rp->lr, rp->pc, rp->cpsr);
- int old;
- HAL_DISABLE_INTERRUPTS(old);
- diag_printf("[IN] IRQ Frame:\n");
- dump_frame((unsigned char *)frame);
- HAL_RESTORE_INTERRUPTS(old);
+ int old;
+ HAL_DISABLE_INTERRUPTS(old);
+ diag_printf("[IN] IRQ Frame:\n");
+ dump_frame((unsigned char *)frame);
+ HAL_RESTORE_INTERRUPTS(old);
- int old;
- HAL_DISABLE_INTERRUPTS(old);
- diag_printf("[OUT] IRQ Frame:\n");
- dump_frame((unsigned char *)frame);
- HAL_RESTORE_INTERRUPTS(old);
+ int old;
+ HAL_DISABLE_INTERRUPTS(old);
+ diag_printf("[OUT] IRQ Frame:\n");
+ dump_frame((unsigned char *)frame);
+ HAL_RESTORE_INTERRUPTS(old);
- int old;
- HAL_DISABLE_INTERRUPTS(old);
- diag_printf("[UNDEFINED INSTRUCTION] Frame:\n");
- dump_frame((unsigned char *)frame);
- HAL_RESTORE_INTERRUPTS(old);
+ int old;
+ HAL_DISABLE_INTERRUPTS(old);
+ diag_printf("[UNDEFINED INSTRUCTION] Frame:\n");
+ dump_frame((unsigned char *)frame);
+ HAL_RESTORE_INTERRUPTS(old);
- int old;
- HAL_DISABLE_INTERRUPTS(old);
- diag_printf("[SOFTWARE INTERRUPT] Frame:\n");
- dump_frame((unsigned char *)frame);
- HAL_RESTORE_INTERRUPTS(old);
+ int old;
+ HAL_DISABLE_INTERRUPTS(old);
+ diag_printf("[SOFTWARE INTERRUPT] Frame:\n");
+ dump_frame((unsigned char *)frame);
+ HAL_RESTORE_INTERRUPTS(old);
- int old;
- HAL_DISABLE_INTERRUPTS(old);
- diag_printf("[ABORT PREFETCH] Frame:\n");
- dump_frame((unsigned char *)frame);
- HAL_RESTORE_INTERRUPTS(old);
+ int old;
+ HAL_DISABLE_INTERRUPTS(old);
+ diag_printf("[ABORT PREFETCH] Frame:\n");
+ dump_frame((unsigned char *)frame);
+ HAL_RESTORE_INTERRUPTS(old);
- int old;
- HAL_DISABLE_INTERRUPTS(old);
- diag_printf("[ABORT DATA] Frame:\n");
- dump_frame((unsigned char *)frame);
- HAL_RESTORE_INTERRUPTS(old);
+ int old;
+ HAL_DISABLE_INTERRUPTS(old);
+ diag_printf("[ABORT DATA] Frame:\n");
+ dump_frame((unsigned char *)frame);
+ HAL_RESTORE_INTERRUPTS(old);
-{
- int old;
- HAL_DISABLE_INTERRUPTS(old);
- diag_printf("Exception handler returned!\n");
- dump_frame((unsigned char *)frame);
- HAL_RESTORE_INTERRUPTS(old);
+{
+ int old;
+ HAL_DISABLE_INTERRUPTS(old);
+ diag_printf("Exception handler returned!\n");
+ dump_frame((unsigned char *)frame);
+ HAL_RESTORE_INTERRUPTS(old);