summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c
blob: 73841bdca128d11b788166a62d4de41a1241d1d0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
 *  @file bsp_irq_init.c
 *
 *  This file contains the implementation of rtems initialization
 *  related to interrupt handling.
 */
/*
 *  RTEMS GBA BSP
 *
 *  Copyright (c) 2004  Markku Puro <markku.puro@kopteri.net>
 *
 *  The license and distribution terms for this file may be
 *  found in found in the file LICENSE in this distribution or at
 *  http://www.rtems.com/license/LICENSE.
 *
 *  $Id$
 */

#include <irq.h>
#include <bsp.h>
#include <gba_registers.h>


/**
 *  @brief BSP_rtems_irq_mngt_init BSP routine initialize irq registers
 *
 *  @param  None
 *  @return None
 */
void BSP_rtems_irq_mngt_init(void)
{
  long *vectorTable;
  int i;

  vectorTable = (long *) VECTOR_TABLE;

  /* Initialize the vector table contents with default handler */
  for (i=0; i<BSP_MAX_INT; i++) {
      *(vectorTable + i) = (long)(default_int_handler);
  }

  /* clear all interrupt status flags */
  GBA_REG_IF = 0xffff;
  /* disable all interrupts */
  GBA_REG_IE = 0;
  /* set master interrupt enable */
  GBA_REG_IME = 1;
}