diff options
Diffstat (limited to 'bsps/sparc/shared/irq/irq-shared.c')
-rw-r--r-- | bsps/sparc/shared/irq/irq-shared.c | 75 |
1 files changed, 44 insertions, 31 deletions
diff --git a/bsps/sparc/shared/irq/irq-shared.c b/bsps/sparc/shared/irq/irq-shared.c index c815e00e40..3d73ad90e7 100644 --- a/bsps/sparc/shared/irq/irq-shared.c +++ b/bsps/sparc/shared/irq/irq-shared.c @@ -1,31 +1,41 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* -* COPYRIGHT (c) 2012-2015 -* Cobham Gaisler -* -* 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. -* -*/ + * COPYRIGHT (c) 2012-2015 + * Cobham Gaisler + * + * 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.h> #include <bsp/irq-generic.h> +#include <rtems/score/processormaskimpl.h> static inline int bsp_irq_cpu(int irq) { -#if defined(RTEMS_SMP) - Processor_mask affinity; - - (void) bsp_interrupt_get_affinity((rtems_vector_number) irq, &affinity); - return (int) _Processor_mask_Find_last_set(&affinity); -#elif defined(LEON3) - return _LEON3_Get_current_processor(); -#else return 0; -#endif } -#if !defined(LEON3) bool bsp_interrupt_is_valid_vector(rtems_vector_number vector) { if (vector == 0) { @@ -131,22 +141,25 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector) BSP_Cpu_Mask_interrupt(vector, 0); return RTEMS_SUCCESSFUL; } -#endif - -void BSP_shared_interrupt_mask(int irq) -{ - BSP_Cpu_Mask_interrupt(irq, bsp_irq_cpu(irq)); -} -void BSP_shared_interrupt_unmask(int irq) +#if defined(RTEMS_SMP) +rtems_status_code bsp_interrupt_get_affinity( + rtems_vector_number vector, + Processor_mask *affinity +) { - BSP_Cpu_Unmask_interrupt(irq, bsp_irq_cpu(irq)); + (void) vector; + _Processor_mask_From_index( affinity, 0 ); + return RTEMS_UNSATISFIED; } -void BSP_shared_interrupt_clear(int irq) +rtems_status_code bsp_interrupt_set_affinity( + rtems_vector_number vector, + const Processor_mask *affinity +) { - /* We don't have to interrupt lock here, because the register is only - * written and self clearing - */ - BSP_Clear_interrupt(irq); + (void) vector; + (void) affinity; + return RTEMS_UNSATISFIED; } +#endif |