/* genpvec.c * * These routines handle the external exception. Multiple ISRs occur off * of this one interrupt. This method will allow multiple ISRs to be * called using the same IRQ index. However, removing the ISR routines is * presently not supported. * * The external exception vector numbers begin with DMV170_IRQ_FIRST. * DMV170_IRQ_FIRST is defined to be one greater than the last processor * interrupt. * * COPYRIGHT (c) 1989-1998. * On-Line Applications Research Corporation (OAR). * Copyright assigned to U.S. Government, 1994. * * The license and distribution terms for this file may in * the file LICENSE in this distribution or at * http://www.OARcorp.com/rtems/license.html. * * $Id: */ #include #include "chain.h" #include #define NUM_LIRQ_HANDLERS 20 #define NUM_LIRQ ( MAX_BOARD_IRQS - PPC_IRQ_LAST ) /* * Structure to for one of possible multiple interrupt handlers for * a given interrupt. */ typedef struct { Chain_Node Node; rtems_isr_entry handler; /* isr routine */ rtems_vector_number vector; /* vector number */ } EE_ISR_Type; /* * Note: The following will not work if we add a method to remove * handlers at a later time. */ EE_ISR_Type ISR_Nodes [NUM_LIRQ_HANDLERS]; rtems_unsigned16 Nodes_Used; Chain_Control ISR_Array [NUM_LIRQ]; /*PAGE * * external_exception_ISR * * This interrupt service routine is called for an External Exception. * * Input parameters: * vector - vector number representing the external exception vector. * * Output parameters: NONE * * Return values: */ rtems_isr external_exception_ISR ( rtems_vector_number vector /* IN */ ) { rtems_unsigned16 index; Chain_Node *node; EE_ISR_Type *ee_isr; /* * Read vector. */ index = 0; node = ISR_Array[ index ].first; while ( !_Chain_Is_tail( &ISR_Array[ index ], node ) ) { ee_isr = (EE_ISR_Type *) node; (*ee_isr->handler)( ee_isr->vector ); node = node->next; } /* * Clear the interrupt. */ } /*PAGE * * initialize_external_exception_vector * * This routine initializes the external exception vector * * Input parameters: NONE * * Output parameters: NONE * * Return values: NONE */ void initialize_external_exception_vector () { int i; rtems_isr_entry previous_isr; rtems_status_code status; Nodes_Used = 0; for (i=0; i