Changeset c782434 in mainline for arch/ppc32/src/interrupt.c


Ignore:
Timestamp:
2006-06-06T13:33:54Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e269c53
Parents:
8333801
Message:

generalize ppc32 exception handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/ppc32/src/interrupt.c

    r8333801 rc782434  
    4646
    4747
     48/** Handler of external interrupts */
     49static void exception_external(int n, istate_t *istate)
     50{
     51        int inum;
     52
     53        while ((inum = pic_get_pending()) != -1) {
     54                exc_dispatch(inum + INT_OFFSET, istate);
     55                pic_ack_interrupt(inum);
     56        }
     57}
     58
     59
    4860static void exception_decrementer(int n, istate_t *istate)
    4961{
     
    5668void interrupt_init(void)
    5769{
     70        exc_register(VECTOR_DATA_STORAGE, "data_storage", pht_refill);
     71        exc_register(VECTOR_INSTRUCTION_STORAGE, "instruction_storage", pht_refill);
     72        exc_register(VECTOR_EXTERNAL, "external", exception_external);
    5873        exc_register(VECTOR_DECREMENTER, "timer", exception_decrementer);
     74}
     75
     76
     77static void ipc_int(int n, istate_t *istate)
     78{
     79        ipc_irq_send_notif(n - INT_OFFSET);
    5980}
    6081
     
    6384void irq_ipc_bind_arch(__native irq)
    6485{
    65         panic("not implemented\n");
    66         /* TODO */
     86        int_register(irq, "ipc_int", ipc_int);
    6787}
    68 
    69 /** Handler of externul interrupts */
    70 void extint_handler(int n, istate_t *istate)
    71 {
    72         int inum;
    73 
    74         while ((inum = pic_get_pending()) != -1) {
    75                 exc_dispatch(inum+INT_OFFSET, istate);
    76                 pic_ack_interrupt(inum);
    77         }
    78 }
Note: See TracChangeset for help on using the changeset viewer.