diff options
Diffstat (limited to 'c/src/lib/libcpu/arm/s3c24xx/irq/irq.c')
-rw-r--r-- | c/src/lib/libcpu/arm/s3c24xx/irq/irq.c | 102 |
1 files changed, 21 insertions, 81 deletions
diff --git a/c/src/lib/libcpu/arm/s3c24xx/irq/irq.c b/c/src/lib/libcpu/arm/s3c24xx/irq/irq.c index d64ace0f63..954ae49960 100644 --- a/c/src/lib/libcpu/arm/s3c24xx/irq/irq.c +++ b/c/src/lib/libcpu/arm/s3c24xx/irq/irq.c @@ -2,6 +2,8 @@ * * This file contains the implementation of the function described in irq.h * + * Copyright (c) 2010 embedded brains GmbH. + * * CopyRight (C) 2000 Canon Research France SA. * Emmanuel Raguet, mailto:raguet@crf.canon.fr * @@ -12,99 +14,37 @@ * $Id$ */ - #include <bsp.h> -#include <irq.h> -#include <rtems/score/thread.h> -#include <rtems/score/apiext.h> -#include <s3c24xx.h> +#include <bsp/irq.h> +#include <bsp/irq-generic.h> -/* - * This function check that the value given for the irq line - * is valid. - */ +#include <s3c24xx.h> -static int isValidInterrupt(int irq) +void bsp_interrupt_dispatch(void) { - if ( (irq < 0) || (irq > BSP_MAX_INT)) { - return 0; - } + rtems_vector_number vector = *((uint32_t *) rINTOFFSET_ADDR); - return 1; + bsp_interrupt_handler_dispatch(vector); } -/* - * ------------------- RTEMS Single Irq Handler Mngt Routines ---------------- - */ - -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 *)VECTOR_TABLE; - if (*(HdlTable + irq->name) != default_int_handler) { - return 0; - } - - _CPU_ISR_Disable(level); - - /* - * store the new handler - */ - *(HdlTable + irq->name) = irq->hdl; - - /* - * Enable interrupt on device - */ - if(irq->on) - { - irq->on(irq); - } - - _CPU_ISR_Enable(level); - - return 1; + return RTEMS_SUCCESSFUL; } -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 *)VECTOR_TABLE; - if (*(HdlTable + irq->name) != irq->hdl) { - return 0; - } - _CPU_ISR_Disable(level); - - /* - * 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) +{ + _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, arm_exc_interrupt, NULL); - _CPU_ISR_Enable(level); + return RTEMS_SUCCESSFUL; +} - return 1; +void bsp_interrupt_handler_default(rtems_vector_number vector) +{ + printk("spurious interrupt: %u\n", vector); } |