source: rtems/bsps/arm/csb337/irq/irq.c @ 8f8ccee

5
Last change on this file since 8f8ccee was 8f8ccee, checked in by Sebastian Huber <sebastian.huber@…>, on 04/23/18 at 07:50:39

bsps: Move interrupt controller support to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 1.2 KB
Line 
1/*
2 * Atmel AT91RM9200 Interrupt handler
3 *
4 * Copyright (c) 2010 embedded brains GmbH.
5 *
6 * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.rtems.org/license/LICENSE.
11 */
12
13#include <rtems/score/armv4.h>
14
15#include <bsp.h>
16#include <bsp/irq.h>
17#include <bsp/irq-generic.h>
18
19#include <at91rm9200.h>
20
21void bsp_interrupt_dispatch(void)
22{
23  rtems_vector_number vector = AIC_CTL_REG(AIC_IVR);
24
25  bsp_interrupt_handler_dispatch(vector);
26
27  AIC_CTL_REG(AIC_EOICR) = 0;
28}
29
30void bsp_interrupt_vector_enable(rtems_vector_number vector)
31{
32  bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
33  AIC_CTL_REG(AIC_IECR) = 1 << vector;
34}
35
36void bsp_interrupt_vector_disable(rtems_vector_number vector)
37{
38  bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
39  AIC_CTL_REG(AIC_IDCR) = 1 << vector;
40}
41
42rtems_status_code bsp_interrupt_facility_initialize(void)
43{
44  unsigned long i = 0;
45
46  for (i = 0; i < 32; ++i) {
47    AIC_SVR_REG(i<<2) = i;
48  }
49
50  /* disable all interrupts */
51  AIC_CTL_REG(AIC_IDCR) = 0xffffffff;
52
53  _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
54
55  return RTEMS_SUCCESSFUL;
56}
Note: See TracBrowser for help on using the repository browser.