source: rtems/c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_init.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.5 KB
Line 
1/*
2 *  NXP/Philips LPC22XX/LPC21xx Interrupt handler
3 *  Ray 2007 <rayx.cn@gmail.com> to support LPC ARM
4 *  The license and distribution terms for this file may be
5 *  found in the file LICENSE in this distribution or at
6 *  http://www.rtems.org/license/LICENSE.
7 */
8#include <irq.h>
9#include <bsp.h>
10#include <lpc22xx.h>
11
12
13/*
14 * Interrupt system initialization. Disable interrupts, clear
15 * any that are pending.
16 */
17void BSP_rtems_irq_mngt_init(void)
18{
19  long *vectorTable;
20  int i;
21
22    /* disable all interrupts */
23  VICIntEnClr = 0xFFFFFFFF;
24
25  vectorTable = (long *) VECTOR_TABLE;
26  /* Initialize the vector table contents with default handler */
27  for (i=0; i<BSP_MAX_INT; i++) {
28      *(vectorTable + i) = (long)(default_int_handler);
29  }
30
31  /*
32   * Set IRQHandler
33   */
34  IRQ_VECTOR_ADDR = 0xE59FF018;           /* LDR PC,[PC,#0x18] instruction */
35
36  /*
37   * Set FIQHandler
38   */
39  FIQ_VECTOR_ADDR = 0xE59FF018;           /* LDR PC,[PC,#0x18] instruction */
40
41  /*
42   * We does not need the next interrupt sources in the moment,
43   * therefore jump to itself.
44   */
45  UNDEFINED_INSTRUCTION_VECTOR_ADDR = 0xEAFFFFFE;
46  SOFTWARE_INTERRUPT_VECTOR_ADDR    = 0xEAFFFFFE;
47  PREFETCH_ABORT_VECTOR_ADDR        = 0xEAFFFFFE;
48
49  /*
50   * In case we must find an ABORT error,
51   * enable the next lines and set a breakpoint
52   * in ABORTHandler.
53   */
54#if 1
55  DATA_ABORT_VECTOR_ADDR = 0xE59FF018;
56#endif
57
58  /*
59   * Init the Vectored Interrupt Controller (VIC)
60   */
61  VICProtection = 0;
62  VICIntSelect = 0;
63  VICVectAddr = 0;
64}
65
Note: See TracBrowser for help on using the repository browser.