source: rtems/bsps/arm/gumstix/irq/irq.c @ 031df391

5
Last change on this file since 031df391 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 * Copyright (c) 2010 embedded brains GmbH.
3 *
4 * PXA255 Interrupt handler by Yang Xi <hiyangxi@gmail.com>
5 * Copyright (c) 2004 by Jay Monkman <jtm@lopingdog.com>
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.org/license/LICENSE.
10 */
11
12#include <rtems/score/armv4.h>
13
14#include <bsp.h>
15#include <bsp/irq.h>
16#include <bsp/irq-generic.h>
17
18#include <pxa255.h>
19
20void bsp_interrupt_dispatch(void)
21{
22  rtems_vector_number vector = 31 - __builtin_clz(XSCALE_INT_ICIP);
23
24  bsp_interrupt_handler_dispatch(vector);
25}
26
27void bsp_interrupt_vector_enable(rtems_vector_number vector)
28{
29  bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
30  XSCALE_INT_ICMR |= 1 << vector;
31}
32
33void bsp_interrupt_vector_disable(rtems_vector_number vector)
34{
35  bsp_interrupt_assert(bsp_interrupt_is_valid_vector(vector));
36  XSCALE_INT_ICMR  &= ~(1 << vector);
37}
38
39rtems_status_code bsp_interrupt_facility_initialize(void)
40{
41  /* disable all interrupts */
42  XSCALE_INT_ICMR = 0x0;
43
44  /* Direct the interrupt to IRQ*/
45  XSCALE_INT_ICLR = 0x0;
46
47  /* Install the IRQ exception handler */
48  _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
49
50  return RTEMS_SUCCESSFUL;
51}
Note: See TracBrowser for help on using the repository browser.