diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-23 09:50:39 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2018-04-23 15:18:44 +0200 |
commit | 8f8ccee0d9e1c3adfb1de484f26f6d9f6ff08708 (patch) | |
tree | 5dc76f7a4527b0a500fbf5ee91486b2780e47a1a /c/src/lib/libbsp/arm/lpc176x | |
parent | bsps: Move SPI drivers to bsps (diff) | |
download | rtems-8f8ccee0d9e1c3adfb1de484f26f6d9f6ff08708.tar.bz2 |
bsps: Move interrupt controller support to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
Diffstat (limited to 'c/src/lib/libbsp/arm/lpc176x')
-rw-r--r-- | c/src/lib/libbsp/arm/lpc176x/Makefile.am | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/lpc176x/irq/irq.c | 75 |
2 files changed, 3 insertions, 78 deletions
diff --git a/c/src/lib/libbsp/arm/lpc176x/Makefile.am b/c/src/lib/libbsp/arm/lpc176x/Makefile.am index 1437b12ea3..383bbfd51d 100644 --- a/c/src/lib/libbsp/arm/lpc176x/Makefile.am +++ b/c/src/lib/libbsp/arm/lpc176x/Makefile.am @@ -54,9 +54,9 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/lpc176x/start/bspstart.c # IRQ librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-default-handler.c -librtemsbsp_a_SOURCES += ../shared/armv7m/irq/armv7m-irq.c -librtemsbsp_a_SOURCES += ../shared/armv7m/irq/armv7m-irq-dispatch.c -librtemsbsp_a_SOURCES += irq/irq.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/irq/irq-armv7m.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/shared/irq/irq-dispatch-armv7m.c +librtemsbsp_a_SOURCES += ../../../../../../bsps/arm/lpc176x/irq/irq.c # Console librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/serial/console-termios-init.c diff --git a/c/src/lib/libbsp/arm/lpc176x/irq/irq.c b/c/src/lib/libbsp/arm/lpc176x/irq/irq.c deleted file mode 100644 index e05fd59e6c..0000000000 --- a/c/src/lib/libbsp/arm/lpc176x/irq/irq.c +++ /dev/null @@ -1,75 +0,0 @@ -/** - * @file - * - * @ingroup bsp_interrupt - * - * @brief LPC176X interrupt support. - */ - -/* - * Copyright (c) 2008-2012 embedded brains GmbH. All rights reserved. - * - * embedded brains GmbH - * Obere Lagerstr. 30 - * 82178 Puchheim - * Germany - * <rtems@embedded-brains.de> - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#include <rtems/score/armv4.h> -#include <rtems/score/armv7m.h> - -#include <bsp.h> -#include <bsp/irq.h> -#include <bsp/irq-generic.h> -#include <bsp/lpc176x.h> -#include <bsp/linker-symbols.h> - -/** - * @brief Checks if the current interrupt vector length is valid or not. - * - * @param vector The current interrupt vector length. - * @return TRUE if valid. - * FALSE otherwise. - */ -static inline bool lpc176x_irq_is_valid( const rtems_vector_number vector ) -{ - return vector <= BSP_INTERRUPT_VECTOR_MAX; -} - -void lpc176x_irq_set_priority( - const rtems_vector_number vector, - unsigned priority -) -{ - if ( lpc176x_irq_is_valid( vector ) ) { - if ( priority > LPC176X_IRQ_PRIORITY_VALUE_MAX ) { - priority = LPC176X_IRQ_PRIORITY_VALUE_MAX; - } - - /* else implies that the priority is unlocked. Also, - there is nothing to do. */ - - _ARMV7M_NVIC_Set_priority( (int) vector, (int) ( priority << 3u ) ); - } - - /* else implies that the rtems vector number is invalid. Also, - there is nothing to do. */ -} - -unsigned lpc176x_irq_get_priority( const rtems_vector_number vector ) -{ - unsigned priority; - - if ( lpc176x_irq_is_valid( vector ) ) { - priority = (unsigned) ( _ARMV7M_NVIC_Get_priority( (int) vector ) >> 3u ); - } else { - priority = LPC176X_IRQ_PRIORITY_VALUE_MIN - 1u; - } - - return priority; -} |