Ignore:
Timestamp:
Apr 30, 2010, 1:15:49 PM (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.10, 4.11, master
Children:
439d00ca
Parents:
2a2469b
Message:

2010-04-30 Sebastian Huber <sebastian.huber@…>

  • at91rm9200/irq/irq.c, at91rm9200/irq/irq.h, lpc22xx/irq/irq.c, lpc22xx/irq/irq.h, mc9328mxl/irq/irq.c, mc9328mxl/irq/irq.h, pxa255/irq/irq.c, pxa255/irq/irq.h, s3c24xx/irq/irq.c, s3c24xx/irq/irq.h: The previous interrupt warning fix changed the interrupt handler API. To fix this problem the generic interrupt support framework will be used now. This eliminates a lot of copy and paste code. The interrupt header file is now <bsp/irq.h>.
  • at91rm9200/clock/clock.c, lpc22xx/clock/clockdrv.c, mc9328mxl/clock/clockdrv.c, pxa255/clock/clock.c, s3c24xx/clock/clockdrv.c: Include <bsp/irq.h> instead of <irq.h>.
  • at91rm9200/irq/bsp_irq_asm.S, at91rm9200/irq/bsp_irq_init.c, mc9328mxl/irq/bsp_irq_asm.S, mc9328mxl/irq/bsp_irq_init.c, s3c24xx/irq/bsp_irq_asm.S, s3c24xx/irq/bsp_irq_init.c: Removed files.
  • Makefile.am, preinstall.am: Reflect changes above.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libcpu/arm/at91rm9200/irq/irq.c

    r2a2469b rf4dc319a  
    11/*
    22 * Atmel AT91RM9200 Interrupt handler
     3 *
     4 * Copyright (c) 2010 embedded brains GmbH.
    35 *
    46 * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
     
    1113 *  $Id$
    1214 */
     15
    1316#include <bsp.h>
    14 #include <irq.h>
    15 #include <rtems/score/thread.h>
    16 #include <rtems/score/apiext.h>
     17#include <bsp/irq.h>
     18#include <bsp/irq-generic.h>
     19
    1720#include <at91rm9200.h>
    1821
    19 /*
    20  * This function check that the value given for the irq line
    21  * is valid.
    22  */
    23 static int isValidInterrupt(int irq)
     22void bsp_interrupt_dispatch(void)
    2423{
    25     if ( (irq < 0) || (irq >= AT91RM9200_MAX_INT)) {
    26         return 0;
    27     }
    28     return 1;
     24  rtems_vector_number vector = AIC_CTL_REG(AIC_ISR);
     25
     26  bsp_interrupt_handler_dispatch(vector);
     27
     28  AIC_CTL_REG(AIC_EOICR) = 0;
    2929}
    3030
    31 /*
    32  * Installs the interrupt handler.
    33  */
    34 int BSP_install_rtems_irq_handler  (const rtems_irq_connect_data* irq)
     31rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
    3532{
    36     rtems_interrupt_level level;
     33  AIC_CTL_REG(AIC_IECR) = 1 << vector;
    3734
    38     if (!isValidInterrupt(irq->name)) {
    39         return 0;
    40     }
    41 
    42     /*
    43      * Check if default handler is actually connected. If not, issue
    44      * an error. Note: irq->name is a number corresponding to the
    45      * sources PID (see the at91rm9200_pid for this mapping).  We
    46      * convert it to a long word offset to get source's vector register
    47      */
    48     if (AIC_SVR_REG(irq->name * 4) != (uint32_t) default_int_handler) {
    49         return 0;
    50     }
    51 
    52     rtems_interrupt_disable(level);
    53 
    54     /*
    55      * store the new handler
    56      */
    57     AIC_SVR_REG(irq->name * 4) = (uint32_t) irq->hdl;
    58 
    59     /*
    60      * unmask interrupt
    61      */
    62     AIC_CTL_REG(AIC_IECR) = 1 << irq->name;
    63 
    64     /*
    65      * Enable interrupt on device
    66      */
    67     if(irq->on) {
    68         irq->on(irq);
    69     }
    70 
    71     rtems_interrupt_enable(level);
    72 
    73     return 1;
     35  return RTEMS_SUCCESSFUL;
    7436}
    7537
    76 /*
    77  * Remove and interrupt handler
    78  */
    79 int BSP_remove_rtems_irq_handler  (const rtems_irq_connect_data* irq)
     38rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
    8039{
    81     rtems_interrupt_level level;
     40  AIC_CTL_REG(AIC_IDCR) = 1 << vector;
    8241
    83     if (!isValidInterrupt(irq->name)) {
    84         return 0;
    85     }
     42  return RTEMS_SUCCESSFUL;
     43}
    8644
    87     /*
    88      * Check if the handler is actually connected. If not, issue an error.
    89      */
    90     if (AIC_SVR_REG(irq->name * 4) != (uint32_t) irq->hdl) {
    91       return 0;
    92     }
    93     rtems_interrupt_disable(level);
     45rtems_status_code bsp_interrupt_facility_initialize(void)
     46{
     47  /* disable all interrupts */
     48  AIC_CTL_REG(AIC_IDCR) = 0xffffffff;
    9449
    95     /*
    96      * mask interrupt
    97      */
    98     AIC_CTL_REG(AIC_IDCR) = 1 << irq->name;
     50  _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL);
    9951
    100     /*
    101      * Disable interrupt on device
    102      */
    103     if(irq->off) {
    104         irq->off(irq);
    105     }
     52  return RTEMS_SUCCESSFUL;
     53}
    10654
    107     /*
    108      * restore the default irq value
    109      */
    110     AIC_SVR_REG(irq->name * 4) = (uint32_t) default_int_handler;
    111 
    112     rtems_interrupt_enable(level);
    113 
    114     return 1;
     55void bsp_interrupt_handler_default(rtems_vector_number vector)
     56{
     57  printk("spurious interrupt: %u\n", vector);
    11558}
Note: See TracChangeset for help on using the changeset viewer.