summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/gba/irq
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2010-04-30 14:55:55 +0000
committerSebastian Huber <sebastian.huber@embedded-brains.de>2010-04-30 14:55:55 +0000
commit536f2d2b6a7b2854fff08ae62d10728a83fb17d6 (patch)
treebfb11e753120b82b2add03caefaa6e665469f01a /c/src/lib/libbsp/arm/gba/irq
parent6e6886d5812e9824a7402bee7362ed5da80c452e (diff)
downloadrtems-536f2d2b6a7b2854fff08ae62d10728a83fb17d6.tar.bz2
2010-04-30 Sebastian Huber <sebastian.huber@embedded-brains.de>
* irq/irq_asm.S, irq/irq_init.c, irq/bsp_irq_asm.S, irq/bsp_irq_init.c: Removed files. * Makefile.am, preinstall.am: Reflect changes above. Added generic interrupt support modules. * irq/irq.h, irq/irq.c: The previous interrupt warning fix changed the interrupt handler API. To fix this problem the generic interrupt support framework will be used now. This eliminates a lot of copy and paste code. The interrupt header file is now <bsp/irq.h>. * include/bsp.h: Define BSP_FEATURE_IRQ_EXTENSION. * start/start.S, startup/bspstart.c, clock/clockdrv.c, console/console.c, timer/timer.c: Interrupt support changes.
Diffstat (limited to 'c/src/lib/libbsp/arm/gba/irq')
-rw-r--r--c/src/lib/libbsp/arm/gba/irq/bsp_irq_asm.S179
-rw-r--r--c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c48
-rw-r--r--c/src/lib/libbsp/arm/gba/irq/irq.c153
-rw-r--r--c/src/lib/libbsp/arm/gba/irq/irq.h85
-rw-r--r--c/src/lib/libbsp/arm/gba/irq/irq_asm.S183
-rw-r--r--c/src/lib/libbsp/arm/gba/irq/irq_init.c71
6 files changed, 61 insertions, 658 deletions
diff --git a/c/src/lib/libbsp/arm/gba/irq/bsp_irq_asm.S b/c/src/lib/libbsp/arm/gba/irq/bsp_irq_asm.S
deleted file mode 100644
index 238b9deead..0000000000
--- a/c/src/lib/libbsp/arm/gba/irq/bsp_irq_asm.S
+++ /dev/null
@@ -1,179 +0,0 @@
-/**
- * @file bsp_irq_asm.S
- *
- * Intererrupt handler for GameBoy Advance.
- */
-/*
- * 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$
- */
-
-#define __asm__
-#include <asm_macros.h>
-#include <gba_registers.h>
-#include <arm_mode_bits.h>
-/* @cond INCLUDE_ASM */
-
-/**
- * Execute interrupt handler
- * function void bsp_interrupt_dispatch(void)
- *
- * Look at interrupt status register to determine source.
- * From source, determine offset into expanded vector table
- * and load handler address into r0.
- * irq_vector_table is defined in linkcmds
- *
- */
- .align
-/* .section .iwram */
-
-PUBLIC_ARM_FUNCTION(bsp_interrupt_dispatch)
- ldr r1, =GBA_REG_IE_ADDR
- ldrh r1, [r1]
- ldr r2, =GBA_REG_IF_ADDR
- ldrh r2, [r2]
- and r3, r1, r2 /* only look at interrupts which are enabled */
-
-check_lcdv:
- tst r3, #0x0001
- beq check_lcdh
- ldr r0, =(irq_vector_table + (4 * 0)) /* load the vector number */
- ldr r3,=0x0001
- b get_handler
-
-check_lcdh:
- tst r3, #0x0002
- beq check_lcdvc
- ldr r0, =(irq_vector_table + (4 * 1)) /* load the vector number */
- ldr r3,=0x0002
- b get_handler
-
-check_lcdvc:
- tst r3, #0x0004
- beq check_t0
- ldr r0, =(irq_vector_table + (4 * 2)) /* load the vector number */
- ldr r3,=0x0004
- b get_handler
-
-check_t0:
- tst r3, #0x0008
- beq check_t1
- ldr r0, =(irq_vector_table + (4 * 3)) /* load the vector number */
- ldr r3,=0x0008
- b get_handler
-
-check_t1:
- tst r3, #0x0010
- beq check_t2
- ldr r0, =(irq_vector_table + (4 * 4)) /* load the vector number */
- ldr r3,=0x0010
- b get_handler
-
-check_t2:
- tst r3, #0x0020
- beq check_t3
- ldr r0, =(irq_vector_table + (4 * 5)) /* load the vector number */
- ldr r3,=0x0020
- b get_handler
-
-check_t3:
- tst r3, #0x0040
- beq check_ser
- ldr r0, =(irq_vector_table + (4 * 6)) /* load the vector number */
- ldr r3,=0x0040
- b get_handler
-
-check_ser:
- tst r3, #0x0080
- beq check_dma0
- ldr r0, =(irq_vector_table + (4 * 7)) /* load the vector number */
- ldr r3,=0x0080
- b get_handler
-
-check_dma0:
- tst r3, #0x0100
- beq check_dma1
- ldr r0, =(irq_vector_table + (4 * 8)) /* load the vector number */
- ldr r3,=0x0100
- b get_handler
-
-check_dma1:
- tst r3, #0x0200
- beq check_dma2
- ldr r0, =(irq_vector_table + (4 * 9)) /* load the vector number */
- ldr r3,=0x0200
- b get_handler
-
-check_dma2:
- tst r3, #0x0400
- beq check_dma3
- ldr r0, =(irq_vector_table + (4 * 10)) /* load the vector number */
- ldr r3,=0x0400
- b get_handler
-
-check_dma3:
- tst r3, #0x0800
- beq check_keypad
- ldr r0, =(irq_vector_table + (4 * 11)) /* load the vector number */
- ldr r3,=0x0800
- b get_handler
-
-check_keypad:
- tst r3, #0x1000
- beq check_gamepak
- ldr r0, =(irq_vector_table + (4 * 12)) /* load the vector number */
- ldr r3,=0x1000
- b get_handler
-
-check_gamepak:
- tst r3, #0x2000
- beq IRQ_NoInterrupt
- ldr r0, =(irq_vector_table + (4 * 13)) /* load the vector number */
- ldr r3,=0x2000
- b get_handler
-
-unknown_irq:
- ldr r0, =(default_int_handler) /* Unknown Interrupt? */
- ldr r3,=0x0000
-
-get_handler:
- ldr r0, [r0] /* extract the IT handler */
-
- ldr r2, =GBA_REG_IF_ADDR /* Clear IF */
- strh r3, [r2]
-
- /*
- * re-enable interrupts at processor level
- */
- mrs r1, cpsr
- bic r1, r1, #Int_Bits
- msr cpsr, r1
-
- stmdb sp!,{lr}
- ldr lr, =IRQ_return /* prepare the return from handler */
- mov pc, r0 /* EXECUTE INT HANDLER */
-
-IRQ_return:
- ldmia sp!,{lr}
-
- /*
- * disable interrupts_again
- */
- mrs r0, cpsr
- orr r0, r0, #Int_Bits
- msr cpsr, r0
-
-IRQ_NoInterrupt:
- /* return to the "main" interrupt handler */
- mov pc, lr
-
-LABEL_END(bsp_interrupt_dispatch)
-/* @endcond */
-
diff --git a/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c b/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c
deleted file mode 100644
index 73841bdca1..0000000000
--- a/c/src/lib/libbsp/arm/gba/irq/bsp_irq_init.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/**
- * @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;
-}
diff --git a/c/src/lib/libbsp/arm/gba/irq/irq.c b/c/src/lib/libbsp/arm/gba/irq/irq.c
index 6abc48f6e3..567cf91be8 100644
--- a/c/src/lib/libbsp/arm/gba/irq/irq.c
+++ b/c/src/lib/libbsp/arm/gba/irq/irq.c
@@ -6,6 +6,8 @@
/*
* RTEMS GBA BSP
*
+ * Copyright (c) 2010 embedded brains GmbH.
+ *
* Copyright (c) 2002 by Jay Monkman <jtm@smoothsmoothie.com>
*
* Copyright (c) 2002 by Charlie Steader <charlies@poliac.com>
@@ -20,144 +22,51 @@
*/
#include <bsp.h>
-#include <irq.h>
-#include <gba_registers.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/apiext.h>
+#include <bsp/irq.h>
+#include <bsp/irq-generic.h>
+#include <gba_registers.h>
-/**
- * @brief isValidInterrupt function check that the value given for the irq line is valid.
- *
- * @param irq irq number
- * @return status code TRUE/FALSE (0/1)
- */
-static int isValidInterrupt(int irq)
+void bsp_interrupt_dispatch(void)
{
- if ( (irq < 0) || (irq > BSP_MAX_INT)) {
- return 0;
- }
- return 1;
-}
+ unsigned reg_ie = GBA_REG_IE;
+ unsigned reg_if = GBA_REG_IF & reg_ie;
+ rtems_vector_number vector = 31 - __builtin_clz(reg_if);
-/*
- * ------------------------ RTEMS Single Irq Handler Mngt Routines ----------------
- */
+ bsp_interrupt_handler_dispatch(vector);
+ GBA_REG_IF = 1 << vector;
+}
-/**
- * @brief BSP_install_rtems_irq_handler function install rtems irq handler.
- *
- * @param irq irq connect data
- * @return status code TRUE/FALSE (0/1)
- */
-int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq)
+rtems_status_code bsp_interrupt_vector_enable(rtems_vector_number vector)
{
- rtems_irq_hdl *HdlTable;
- rtems_interrupt_level level;
-
- if (!isValidInterrupt(irq->name)) {
- return 0;
- }
- /*
- * Check if default handler is actually connected. If not issue an error.
- */
- HdlTable = (rtems_irq_hdl *) (uint32_t)VECTOR_TABLE;
- if (*(HdlTable + irq->name) != default_int_handler) {
- return 0;
- }
-
- rtems_interrupt_disable(level);
-
- /*
- * store the new handler
- */
- *(HdlTable + irq->name) = irq->hdl;
+ GBA_REG_IE |= 1 << vector;
- /*
- * ack pending interrupt
- */
- GBA_REG_IF |= (1 << (irq->name));
-
- /*
- * initialize the control register for the concerned interrupt
- */
- GBA_REG_IE |= (1 << (irq->name));
-
- /*
- * Enable interrupt on device
- */
- if (irq->on)
- irq->on(irq);
-
- rtems_interrupt_enable(level);
-
- return 1;
+ return RTEMS_SUCCESSFUL;
}
-/**
- * @brief BSP_remove_rtems_irq_handler function removes rtems irq handler.
- *
- * @param irq irq connect data
- * @return status code TRUE/FALSE (0/1)
- */
-int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq)
+rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
{
- rtems_irq_hdl *HdlTable;
- rtems_interrupt_level level;
-
- if (!isValidInterrupt(irq->name)) {
- return 0;
- }
- /*
- * Check if the handler is actually connected. If not issue an error.
- */
- HdlTable = (rtems_irq_hdl *) (uint32_t)VECTOR_TABLE;
- if (*(HdlTable + irq->name) != irq->hdl) {
- return 0;
- }
- rtems_interrupt_disable(level);
+ GBA_REG_IE &= ~(1 << vector);
- /*
- * mask at INT controller level
- */
- GBA_REG_IE &= ~(1 << irq->name);
-
- /*
- * Disable interrupt on device
- */
- if (irq->off)
- irq->off(irq);
+ return RTEMS_SUCCESSFUL;
+}
- /*
- * restore the default irq value
- */
- *(HdlTable + irq->name) = default_int_handler;
+rtems_status_code bsp_interrupt_facility_initialize(void)
+{
+ /* clear all interrupt status flags */
+ GBA_REG_IF = 0xffff;
+ /* disable all interrupts */
+ GBA_REG_IE = 0;
+ /* set master interrupt enable */
+ GBA_REG_IME = 1;
- rtems_interrupt_enable(level);
+ /* Exception handler is already present in the ROM BIOS */
- return 1;
+ return RTEMS_SUCCESSFUL;
}
-
-/**
- * @brief _ThreadProcessSignalsFromIrq function check that the value given for the irq line is valid.
- *
- * @param cxt exeption frame
- * @return None
- */
-void _ThreadProcessSignalsFromIrq (CPU_Exception_frame* ctx)
+void bsp_interrupt_handler_default(rtems_vector_number vector)
{
- /*
- * Process pending signals that have not already been
- * processed by _Thread_Dispatch. This happens quite
- * unfrequently : the ISR must have posted an action
- * to the current running thread.
- */
- if ( _Thread_Do_post_task_switch_extension ||
- _Thread_Executing->do_post_task_switch_extension )
- {
- _Thread_Executing->do_post_task_switch_extension = false;
- _API_extensions_Run_postswitch();
- }
+ printk("spurious interrupt: %u\n", vector);
}
diff --git a/c/src/lib/libbsp/arm/gba/irq/irq.h b/c/src/lib/libbsp/arm/gba/irq/irq.h
index 7bb00e456a..7b32e6d283 100644
--- a/c/src/lib/libbsp/arm/gba/irq/irq.h
+++ b/c/src/lib/libbsp/arm/gba/irq/irq.h
@@ -7,6 +7,8 @@
/*
* RTEMS GBA BSP
*
+ * Copyright (c) 2010 embedded brains GmbH.
+ *
* Copyright (c) 2004 Markku Puro <markku.puro@kopteri.net>
*
* The license and distribution terms for this file may be
@@ -16,25 +18,16 @@
* $Id$
*/
-#ifndef _IRQ_H_
-#define _IRQ_H_
-
+#ifndef __asm__
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Include some preprocessor value also used by assember code
- */
-
-#define VECTOR_TABLE (&irq_vector_table[0])
-
-#include <stdint.h>
-#include <rtems/irq.h>
#include <rtems.h>
+#include <rtems/irq.h>
+#include <rtems/irq-extension.h>
-extern void default_int_handler(rtems_irq_hdl_param unused);
+#endif /* __asm__ */
+
+#ifndef _IRQ_H_
+#define _IRQ_H_
/*---------------------------------------------------------------------------*
* MACROS *
@@ -48,44 +41,26 @@ extern void default_int_handler(rtems_irq_hdl_param unused);
| Constants
+--------------------------------------------------------------------------*/
-typedef enum {
- BSP_IRQ_VBLANK = 0,
- BSP_IRQ_HBLANK = 1,
- BSP_IRQ_VCOUNTER = 2,
- BSP_IRQ_TIMER0 = 3,
- BSP_IRQ_TIMER1 = 4,
- BSP_IRQ_TIMER2 = 5,
- BSP_IRQ_TIMER3 = 6,
- BSP_IRQ_SERIAL = 7,
- BSP_IRQ_DMA0 = 8,
- BSP_IRQ_DMA1 = 9,
- BSP_IRQ_DMA2 = 10,
- BSP_IRQ_DMA3 = 11,
- BSP_IRQ_KEY = 12,
- BSP_IRQ_CART = 13,
- BSP_IRQ_NA14 = 14,
- BSP_IRQ_NA15 = 15,
- BSP_MAX_INT = 16 /**< BSP_MAX_INT <= _irq_max_vector in linkcmds */
-} rtems_irq_symbolic_name;
-
-
-extern void _irq_max_vector; /**< defined in lincmds */
-extern uint32_t irq_vector_table[BSP_MAX_INT]; /**< allocated in linkcmds */
-
-/*-------------------------------------------------------------------------+
-| Function Prototypes.
-+--------------------------------------------------------------------------*/
-/*
- * ------------------------ RTEMS Single Irq Handler Mngt Routines ----------------
- */
-
-/**
- * @brief function to initialize the interrupt for a specific BSP
- */
-void BSP_rtems_irq_mngt_init();
-
-#ifdef __cplusplus
-}
-#endif
+#define BSP_IRQ_VBLANK 0
+#define BSP_IRQ_HBLANK 1
+#define BSP_IRQ_VCOUNTER 2
+#define BSP_IRQ_TIMER0 3
+#define BSP_IRQ_TIMER1 4
+#define BSP_IRQ_TIMER2 5
+#define BSP_IRQ_TIMER3 6
+#define BSP_IRQ_SERIAL 7
+#define BSP_IRQ_DMA0 8
+#define BSP_IRQ_DMA1 9
+#define BSP_IRQ_DMA2 10
+#define BSP_IRQ_DMA3 11
+#define BSP_IRQ_KEY 12
+#define BSP_IRQ_CART 13
+#define BSP_IRQ_NA14 14
+#define BSP_IRQ_NA15 15
+#define BSP_MAX_INT 16
+
+#define BSP_INTERRUPT_VECTOR_MIN 0
+
+#define BSP_INTERRUPT_VECTOR_MAX (BSP_MAX_INT - 1)
#endif /* _IRQ_H_ */
diff --git a/c/src/lib/libbsp/arm/gba/irq/irq_asm.S b/c/src/lib/libbsp/arm/gba/irq/irq_asm.S
deleted file mode 100644
index 1fb3586e05..0000000000
--- a/c/src/lib/libbsp/arm/gba/irq/irq_asm.S
+++ /dev/null
@@ -1,183 +0,0 @@
-/**
- * @file irq_asm.S
- *
- * This file contains the implementation of the IRQ handler.
- */
-/*
- * RTEMS GBA BSP
- *
- * Copyright (c) 2002 Advent Networks, Inc.
- * Jay Monkman <jmonkman@adventnetworks.com>
- *
- * Copyright (C) 2000 Canon Research France SA.
- * Emmanuel Raguet, mailto:raguet@crf.canon.fr
- *
- * Modified Andy Dachs <a.dachs@sstl.co.uk>
- * Copyright (c) 2001 Surrey Satellite Technolgy Limited
- *
- * Modified Markku Puro <markku.puro@kopteri.net>
- * Copyright (c) 2004
- *
- * 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$
- */
-
-#define __asm__
-#include <rtems/asm.h>
-#include <asm_macros.h>
-#include <arm_mode_bits.h>
-/* @cond INCLUDE_ASM */
-
-/**
- * Interrupt handler
- * function void _ISR_Handler(void)
- *
- */
- .align
-/* .section .iwram */
-
-PUBLIC_ARM_FUNCTION(_ISR_Handler)
- stmdb sp!, {r0, r1, r2, r3, r12} /* save regs on INT stack */
- stmdb sp!, {lr} /* now safe to call C funcs */
-
-
-/* one nest level deeper */
- ldr r0, =_ISR_Nest_level
- ldr r1, [r0]
- add r1, r1,#1
- str r1, [r0]
-
-/* disable multitasking */
- ldr r0, =_Thread_Dispatch_disable_level
- ldr r1, [r0]
- add r1, r1,#1
- str r1, [r0]
-
-/* BSP specific function to INT handler */
- bl bsp_interrupt_dispatch
-
-/* one less nest level */
- ldr r0, =_ISR_Nest_level
- ldr r1, [r0]
- sub r1, r1,#1
- str r1, [r0]
-
-/* unnest multitasking */
- ldr r0, =_Thread_Dispatch_disable_level
- ldr r1, [r0]
- sub r1, r1,#1
- str r1, [r0]
-
-/* check to see if we interrupted (no FIQ in GBA) */
- mrs r0, spsr
- and r0, r0, #Mode_Bits
- cmp r0, #Mode_IRQ /* is it INT mode? */
- beq exitit
-
-/* If thread dispatching is disabled, exit */
- cmp r1, #0
- bne exitit
-
-/* If a task switch is necessary, call scheduler */
- ldr r0, =_Context_Switch_necessary
- ldrb r1, [r0]
- cmp r1, #0
-
- /* since bframe is going to clear _ISR_Signals_to_thread_executing, */
- /* we need to load it here */
- ldr r0, =_ISR_Signals_to_thread_executing
- ldrb r1, [r0]
- bne bframe
-
-/* If a signals to be sent (_ISR_Signals_to_thread_executing != 0), */
-/* call scheduler */
- cmp r1, #0
- beq exitit
-
-/* _ISR_Signals_to_thread_executing = FALSE */
- mov r1, #0
- strb r1, [r0]
-
-bframe:
-/* Now we need to set up the return from this ISR to be _ISR_Dispatch */
-/* To do that, we need to save the current lr_int and spsr_int on the */
-/* SVC stack */
- mrs r0, spsr
- ldmia sp!, {r1} /* get lr off stack */
- stmdb sp!, {r1}
- mrs r2, cpsr
- bic r3, r2, #Mode_Bits
- orr r3, r3, #ModePriv /* change to SVC mode */
- msr cpsr_c, r3
-
- /* now in SVC mode */
- stmdb sp!, {r0, r1} /* put spsr_int and lr_int on SVC stack */
- msr cpsr_c, r2 /* change back to INT mode */
-
- /* now in INT mode */
-
- /* replace lr with address of _ISR_Dispatch */
- ldr lr, =_ISR_Dispatch_p_4 /* On entry to an ISR, the lr is */
- /* the return address + 4, so */
- /* we have to emulate that */
- ldmia sp!, {r1} /* out with the old */
- stmdb sp!, {lr} /* in with the new (lr) */
-
-
- orr r0, r0, #Int_Bits
- msr spsr, r0
-
-exitit:
- ldmia sp!, {lr} /* restore regs from INT stack */
- ldmia sp!, {r0, r1, r2, r3, r12} /* restore regs from INT stack */
- subs pc, lr , #4 /* return */
-LABEL_END(_ISR_Handler)
-
- /* on entry to _ISR_Dispatch, we're in SVC mode */
-PUBLIC_ARM_FUNCTION(_ISR_Dispatch)
- stmdb sp!, {r0-r3, r12,lr} /* save regs on SVC stack */
- /* (now safe to call C funcs) */
- /* we don't save lr, since */
- /* it's just going to get */
- /* overwritten */
-_ISR_Dispatch_p_4:
- bl _Thread_Dispatch
- ldmia sp!, {r0-r3, r12, lr}
-
- stmdb sp!, {r0-r2}
- /* Now we have to screw with the stack */
- mov r0, sp /* copy the SVC stack pointer */
-
- mrs r1, cpsr
- bic r2, r1, #Mode_Bits /* clear mode bits */
- orr r2, r2, #(Mode_IRQ | Int_Bits) /* change to INT mode */
- msr cpsr_c, r2 /* disable interrupts */
-
- /* now in INT mode */
- stmdb sp!, {r4, r5, r6} /* save temp vars on INT stack */
- ldmia r0!, {r4, r5, r6} /* Get r0-r3 from SVC stack */
- stmdb sp!, {r4, r5, r6} /* and save them on INT stack */
-
- ldmia r0!, {r4, r5} /* get saved values from SVC stack */
- /* r4=spsr, r5=lr */
- mov lr, r5 /* restore lr_int */
- msr spsr, r4 /* restore spsr_int */
-
- /* switch to SVC mode, update sp, then return to INT mode */
- msr cpsr_c, r1 /* switch to SVC mode */
- mov sp, r0 /* update sp_svc */
- msr cpsr_c, r2 /* switch back to INT mode */
-
- /* pop all the registers from the stack */
- ldmia sp!, {r0, r1, r2}
- ldmia sp!, {r4, r5, r6}
-
- /* Finally, we can return to the interrupted task */
- subs pc, lr, #4
-
-LABEL_END(_ISR_Dispatch)
-/* @endcond */
-
diff --git a/c/src/lib/libbsp/arm/gba/irq/irq_init.c b/c/src/lib/libbsp/arm/gba/irq/irq_init.c
deleted file mode 100644
index dfa6ec2744..0000000000
--- a/c/src/lib/libbsp/arm/gba/irq/irq_init.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * @file irq_init.c
- *
- * This file contains the implementation of rtems initialization
- * related to interrupt handling.
- */
-/*
- * RTEMS GBA BSP
- *
- * CopyRight (C) 2000 Canon Research Centre France SA.
- * Emmanuel Raguet, mailto:raguet@crf.canon.fr
- *
- * 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 <stdint.h>
-#include <bsp.h>
-#include <irq.h>
-#include <rtems/bspIo.h>
-
-/** default int vector */
-extern void _ISR_Handler(void);
-
-/** max number of vectors, defined in linkcmds */
-extern void _irq_max_vector;
-
-/**
- * @brief default_int_handler BSP routine is default int_handler
- *
- * @param None
- * @return None
- */
-void default_int_handler(rtems_irq_hdl_param unused)
-{
- printk("raw_idt_notify has been called \n");
-}
-
-/**
- * @brief rtems_irq_mngt_init BSP routine initialize rtems_irq_mngt
- *
- * @param None
- * @return None
- */
-void rtems_irq_mngt_init(void)
-{
- int i;
- uint32_t *vectorTable;
- rtems_interrupt_level level;
-
- vectorTable = (uint32_t *)VECTOR_TABLE;
-
- rtems_interrupt_disable(level);
-
- /* @todo Can't use exception vectors in GBA because they are already in GBA ROM BIOS */
- /* First, connect the ISR_Handler for IRQ and FIQ interrupts */
- /*_CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ISR_Handler, NULL);*/
- /*_CPU_ISR_install_vector(ARM_EXCEPTION_FIQ, _ISR_Handler, NULL);*/
-
- /* Initialize the vector table contents with default handler */
- for (i=0 ; i < (uint32_t)&_irq_max_vector ; i++) {
- *(vectorTable + i) = (uint32_t)(default_int_handler);
- }
- /* Initialize the INT at the BSP level */
- BSP_rtems_irq_mngt_init();
-}
-