source: rtems/c/src/lib/libcpu/arm/at91rm9200/irq/irq.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • 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
30rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
31{
32  AIC_CTL_REG(AIC_IECR) = 1 << vector;
33
34  return RTEMS_SUCCESSFUL;
35}
36
37rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
38{
39  AIC_CTL_REG(AIC_IDCR) = 1 << vector;
40
41  return RTEMS_SUCCESSFUL;
42}
43
44rtems_status_code bsp_interrupt_facility_initialize(void)
45{
46  unsigned long i = 0;
47
48  for (i = 0; i < 32; ++i) {
49    AIC_SVR_REG(i<<2) = i;
50  }
51
52  /* disable all interrupts */
53  AIC_CTL_REG(AIC_IDCR) = 0xffffffff;
54
55  _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
56
57  return RTEMS_SUCCESSFUL;
58}
Note: See TracBrowser for help on using the repository browser.