void bsp_spurious_initialize() { uint32_t trap; uint32_t level; uint32_t mask; level = sparc_disable_interrupts(); mask = LEON_REG.Interrupt_Mask; for ( trap=0 ; trap<256 ; trap++ ) { /* * Skip window overflow, underflow, and flush as well as software * trap 0 which we will use as a shutdown. Also avoid trap 0x70 - 0x7f * which cannot happen and where some of the space is used to pass * paramaters to the program. */ if (( trap == 5 || trap == 6 ) || (( trap >= 0x11 ) && ( trap <= 0x1f )) || (( trap >= 0x70 ) && ( trap <= 0x83 ))) continue; set_vector( (rtems_isr_entry) bsp_spurious_handler, SPARC_SYNCHRONOUS_TRAP( trap ), 1 ); } LEON_REG.Interrupt_Mask = mask; sparc_enable_interrupts(level); }
void __gnat_install_handler_common (int t1, int t2) { uint32_t trap; rtems_isr_entry previous_isr; sigaction (SIGSEGV, &__gnat_error_vector, NULL); sigaction (SIGFPE, &__gnat_error_vector, NULL); sigaction (SIGILL, &__gnat_error_vector, NULL); for (trap = 0; trap < 256; trap++) { /* * Skip window overflow, underflow, and flush as well as software * trap 0 which we will use as a shutdown. Also avoid trap 0x70 - 0x7f * which cannot happen and where some of the space is used to pass * paramaters to the program. 0x80 for system traps and * 0x81 - 0x83 by the remote debugging stub. * Avoid two bsp specific interrupts which normally are used * by the real-time clock and UART B. */ if ((trap >= 0x11) && (trap <= 0x1f)) { if ((trap != t1) && (trap != t2)) rtems_interrupt_catch (__gnat_interrupt_handler, trap, &previous_isr); } else if ((trap != 5 && trap != 6) && ((trap < 0x70) || (trap > 0x83))) set_vector (__gnat_exception_handler, SPARC_SYNCHRONOUS_TRAP (trap), 1); } }