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