source: rtems/c/src/lib/libcpu/arm/lpc22xx/irq/irq.c @ 370c2c80

4.115
Last change on this file since 370c2c80 was 370c2c80, checked in by Sebastian Huber <sebastian.huber@…>, on 01/04/13 at 12:06:51

arm: Rename arm_exc_interrupt()

Rename arm_exc_interrupt() to _ARMV4_Exception_interrupt().

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/*
2 * Philps LPC22XX Interrupt handler
3 *
4 * Copyright (c) 2010 embedded brains GmbH.
5 *
6 * Copyright (c)  2006 by Ray<rayx.cn@gmail.com>  to support LPC ARM
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.com/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 <lpc22xx.h>
19
20void bsp_interrupt_dispatch(void)
21{
22  rtems_vector_number vector = 31 - __builtin_clz(VICIRQStatus);
23
24  bsp_interrupt_handler_dispatch(vector);
25
26  VICVectAddr = 0;
27}
28
29rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
30{
31  VICIntEnable |= 1 << vector;
32
33  return RTEMS_SUCCESSFUL;
34}
35
36rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
37{
38  VICIntEnClr = 1 << vector;
39
40  return RTEMS_SUCCESSFUL;
41}
42
43rtems_status_code bsp_interrupt_facility_initialize(void)
44{
45  volatile uint32_t *ctrl = (volatile uint32_t *) VICVectCntlBase;
46  size_t i = 0;
47
48  /* Disable all interrupts */
49  VICIntEnClr = 0xffffffff;
50
51  /* Use IRQ category */
52  VICIntSelect = 0;
53
54  /* Enable access in USER mode */
55  VICProtection = 0;
56
57  for (i = 0; i < 16; ++i) {
58    /* Disable vector mode */
59    ctrl [i] = 0;
60
61    /* Acknowledge interrupts for all priorities */
62    VICVectAddr = 0;
63  }
64
65  /* Acknowledge interrupts for all priorities */
66  VICVectAddr = 0;
67
68  /* Install the IRQ exception handler */
69  _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
70
71  return RTEMS_SUCCESSFUL;
72}
Note: See TracBrowser for help on using the repository browser.