forked from Imagelibrary/rtems
rtems: Add rtems_interrupt_vector_enable()
Add rtems_interrupt_vector_disable(). Update #3269.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-affinity.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-default.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-default-handler.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-enable-disable.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-generic.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-handler-iterate.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-info.c
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-affinity.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-enable-disable.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-generic.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-handler-iterate.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-info.c
|
||||
|
||||
59
bsps/shared/irq/irq-enable-disable.c
Normal file
59
bsps/shared/irq/irq-enable-disable.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/* SPDX-License-Identifier: BSD-2-Clause */
|
||||
|
||||
/**
|
||||
* @file
|
||||
*
|
||||
* @ingroup bsp_interrupt
|
||||
*
|
||||
* @brief This source file contains the implementation of
|
||||
* rtems_interrupt_vector_enable() and rtems_interrupt_vector_disable().
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <bsp/irq-generic.h>
|
||||
|
||||
rtems_status_code rtems_interrupt_vector_enable( rtems_vector_number vector )
|
||||
{
|
||||
if ( !bsp_interrupt_is_valid_vector( vector ) ) {
|
||||
return RTEMS_INVALID_ID;
|
||||
}
|
||||
|
||||
bsp_interrupt_vector_enable( vector );
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
|
||||
rtems_status_code rtems_interrupt_vector_disable( rtems_vector_number vector )
|
||||
{
|
||||
if ( !bsp_interrupt_is_valid_vector( vector ) ) {
|
||||
return RTEMS_INVALID_ID;
|
||||
}
|
||||
|
||||
bsp_interrupt_vector_disable( vector );
|
||||
|
||||
return RTEMS_SUCCESSFUL;
|
||||
}
|
||||
@@ -40,6 +40,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/m68k/genmcf548x/btimer/btimer.c
|
||||
# IRQ
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-affinity.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-default-handler.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-enable-disable.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-handler-iterate.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-info.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-legacy.c
|
||||
|
||||
@@ -49,6 +49,7 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/ss555/start/vectors.S
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-affinity.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-default.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-default-handler.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-enable-disable.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-generic.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-handler-iterate.c
|
||||
librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/irq/irq-info.c
|
||||
|
||||
@@ -315,6 +315,94 @@ rtems_status_code rtems_interrupt_handler_remove(
|
||||
void *arg
|
||||
);
|
||||
|
||||
/* Generated from spec:/rtems/intr/if/vector-enable */
|
||||
|
||||
/**
|
||||
* @ingroup RTEMSAPIClassicIntr
|
||||
*
|
||||
* @brief Enables the interrupt vector.
|
||||
*
|
||||
* @param vector is the number of the interrupt vector to enable.
|
||||
*
|
||||
* The directive enables the interrupt vector specified by ``vector``. This
|
||||
* allows that interrupt service requests are issued to the target processors
|
||||
* of the interrupt vector. Interrupt service requests for an interrupt vector
|
||||
* may be raised by rtems_interrupt_raise(), rtems_interrupt_raise_on(),
|
||||
* external signals, or messages.
|
||||
*
|
||||
* @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
|
||||
*
|
||||
* @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
|
||||
* number specified by ``vector``.
|
||||
*
|
||||
* @retval ::RTEMS_UNSATISFIED The request to enable the interrupt vector has
|
||||
* not been satisfied.
|
||||
*
|
||||
* @par Notes
|
||||
* The rtems_interrupt_get_attributes() directive may be used to check if an
|
||||
* interrupt vector can be enabled. Interrupt vectors may be disabled by
|
||||
* rtems_interrupt_vector_disable().
|
||||
*
|
||||
* @par Constraints
|
||||
* @parblock
|
||||
* The following constraints apply to this directive:
|
||||
*
|
||||
* * The directive may be called from within interrupt context.
|
||||
*
|
||||
* * The directive may be called from within device driver initialization
|
||||
* context.
|
||||
*
|
||||
* * The directive may be called from within task context.
|
||||
*
|
||||
* * The directive will not cause the calling task to be preempted.
|
||||
* @endparblock
|
||||
*/
|
||||
rtems_status_code rtems_interrupt_vector_enable( rtems_vector_number vector );
|
||||
|
||||
/* Generated from spec:/rtems/intr/if/vector-disable */
|
||||
|
||||
/**
|
||||
* @ingroup RTEMSAPIClassicIntr
|
||||
*
|
||||
* @brief Disables the interrupt vector.
|
||||
*
|
||||
* @param vector is the number of the interrupt vector to disable.
|
||||
*
|
||||
* The directive disables the interrupt vector specified by ``vector``. This
|
||||
* prevents that an interrupt service request is issued to the target
|
||||
* processors of the interrupt vector.
|
||||
*
|
||||
* @retval ::RTEMS_SUCCESSFUL The requested operation was successful.
|
||||
*
|
||||
* @retval ::RTEMS_INVALID_ID There was no interrupt vector associated with the
|
||||
* number specified by ``vector``.
|
||||
*
|
||||
* @retval ::RTEMS_UNSATISFIED The request to disable the interrupt vector has
|
||||
* not been satisfied.
|
||||
*
|
||||
* @par Notes
|
||||
* The rtems_interrupt_get_attributes() directive may be used to check if an
|
||||
* interrupt vector can be disabled. Interrupt vectors may be enabled by
|
||||
* rtems_interrupt_vector_enable(). There may be targets on which some
|
||||
* interrupt vectors cannot be disabled, for example a hardware watchdog
|
||||
* interrupt or software generated interrupts.
|
||||
*
|
||||
* @par Constraints
|
||||
* @parblock
|
||||
* The following constraints apply to this directive:
|
||||
*
|
||||
* * The directive may be called from within interrupt context.
|
||||
*
|
||||
* * The directive may be called from within device driver initialization
|
||||
* context.
|
||||
*
|
||||
* * The directive may be called from within task context.
|
||||
*
|
||||
* * The directive will not cause the calling task to be preempted.
|
||||
* @endparblock
|
||||
*/
|
||||
rtems_status_code rtems_interrupt_vector_disable( rtems_vector_number vector );
|
||||
|
||||
/* Generated from spec:/rtems/intr/if/get-affinity */
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,6 +40,7 @@ source:
|
||||
- bsps/shared/dev/getentropy/getentropy-cpucounter.c
|
||||
- bsps/shared/irq/irq-affinity.c
|
||||
- bsps/shared/irq/irq-default-handler.c
|
||||
- bsps/shared/irq/irq-enable-disable.c
|
||||
- bsps/shared/irq/irq-handler-iterate.c
|
||||
- bsps/shared/irq/irq-info.c
|
||||
- bsps/shared/irq/irq-legacy.c
|
||||
|
||||
@@ -11,6 +11,7 @@ install: []
|
||||
links: []
|
||||
source:
|
||||
- bsps/shared/irq/irq-affinity.c
|
||||
- bsps/shared/irq/irq-enable-disable.c
|
||||
- bsps/shared/irq/irq-generic.c
|
||||
- bsps/shared/irq/irq-handler-iterate.c
|
||||
- bsps/shared/irq/irq-info.c
|
||||
|
||||
@@ -70,6 +70,7 @@ source:
|
||||
- bsps/shared/irq/irq-affinity.c
|
||||
- bsps/shared/irq/irq-default-handler.c
|
||||
- bsps/shared/irq/irq-default.c
|
||||
- bsps/shared/irq/irq-enable-disable.c
|
||||
- bsps/shared/irq/irq-generic.c
|
||||
- bsps/shared/irq/irq-handler-iterate.c
|
||||
- bsps/shared/irq/irq-info.c
|
||||
|
||||
Reference in New Issue
Block a user