source: rtems/c/src/lib/libbsp/arm/gba/irq/irq.c @ 15ca4e7

4.115
Last change on this file since 15ca4e7 was 15ca4e7, checked in by Joel Sherrill <joel.sherrill@…>, on 01/28/11 at 20:29:35

2011-01-28 Joel Sherrill <joel.sherrilL@…>

  • gba/clock/clockdrv.c, gba/console/conio.c, gba/console/console.c, gba/console/defaultfont.h, gba/include/arm_mode_bits.h, gba/include/asm_macros.h, gba/include/bsp.h, gba/include/conio.h, gba/include/gba.h, gba/include/gba_registers.h, gba/irq/irq.c, gba/irq/irq.h, gba/startup/bspstart.c, gba/timer/timer.c, gp32/include/bsp.h, gp32/startup/bspreset.c, gp32/startup/bspstart.c, nds/tools/runtest, shared/comm/uart.c, shared/comm/uart.h, smdk2410/include/bsp.h: Fix typo where license said found in found in.
  • Property mode set to 100644
File size: 1.6 KB
Line 
1/**
2 *  @file irq.c
3 *
4 *  This file contains the implementation of the function described in irq.h.
5 */
6/*
7 *  RTEMS GBA BSP
8 *
9 *  Copyright (c) 2010 embedded brains GmbH.
10 *
11 *  Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
12 *
13 *  Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
14 *
15 *  Copyright (c) 2004 by Markku Puro <markku.puro@kopteri.net>
16 *
17 *  The license and distribution terms for this file may be
18 *  found in the file LICENSE in this distribution or at
19 *  http://www.rtems.com/license/LICENSE.
20 *
21 *  $Id$
22 */
23
24#include <bsp.h>
25#include <bsp/irq.h>
26#include <bsp/irq-generic.h>
27
28#include <gba_registers.h>
29
30void bsp_interrupt_dispatch(void)
31{
32  unsigned reg_ie = GBA_REG_IE;
33  unsigned reg_if = GBA_REG_IF & reg_ie;
34  rtems_vector_number vector = 31 - __builtin_clz(reg_if);
35
36  bsp_interrupt_handler_dispatch(vector);
37
38  GBA_REG_IF = 1 << vector;
39}
40
41rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
42{
43  GBA_REG_IE |= 1 << vector;
44
45  return RTEMS_SUCCESSFUL;
46}
47
48rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
49{
50  GBA_REG_IE &= ~(1 << vector);
51
52  return RTEMS_SUCCESSFUL;
53}
54
55rtems_status_code bsp_interrupt_facility_initialize(void)
56{
57  /* clear all interrupt status flags */
58  GBA_REG_IF = 0xffff;
59  /* disable all interrupts */
60  GBA_REG_IE = 0;
61  /* set master interrupt enable */
62  GBA_REG_IME = 1;
63
64  /* Exception handler is already present in the ROM BIOS */
65
66  return RTEMS_SUCCESSFUL;
67}
68
69void bsp_interrupt_handler_default(rtems_vector_number vector)
70{
71  printk("spurious interrupt: %u\n", vector);
72}
Note: See TracBrowser for help on using the repository browser.