diff options
Diffstat (limited to '')
-rw-r--r-- | bsps/sparc/shared/drvmgr/ambapp_bus_leon2.c | 25 | ||||
-rw-r--r-- | bsps/sparc/shared/drvmgr/leon2_amba_bus.c | 41 |
2 files changed, 55 insertions, 11 deletions
diff --git a/bsps/sparc/shared/drvmgr/ambapp_bus_leon2.c b/bsps/sparc/shared/drvmgr/ambapp_bus_leon2.c index 1a60f23b22..753247d27e 100644 --- a/bsps/sparc/shared/drvmgr/ambapp_bus_leon2.c +++ b/bsps/sparc/shared/drvmgr/ambapp_bus_leon2.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* LEON2 GRLIB AMBA Plug & Play bus driver. * * COPYRIGHT (c) 2008. @@ -10,9 +12,26 @@ * to work. The PnP information is used to extract IRQs and base * register addresses. * - * 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. + * 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> diff --git a/bsps/sparc/shared/drvmgr/leon2_amba_bus.c b/bsps/sparc/shared/drvmgr/leon2_amba_bus.c index aca776c753..9b8de54adc 100644 --- a/bsps/sparc/shared/drvmgr/leon2_amba_bus.c +++ b/bsps/sparc/shared/drvmgr/leon2_amba_bus.c @@ -1,3 +1,5 @@ +/* SPDX-License-Identifier: BSD-2-Clause */ + /* LEON2 Hardcoded bus driver. * * COPYRIGHT (c) 2008. @@ -11,9 +13,26 @@ * A Core is described by assigning a base register and * IRQ0..IRQ15 using the leon2_core structure. * - * 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. + * 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 <stdio.h> @@ -354,7 +373,7 @@ int leon2_amba_int_register DBG("Registering IRQ %d to func 0x%x arg 0x%x\n", irq, (unsigned int)isr, (unsigned int)arg); - return BSP_shared_interrupt_register(irq, info, isr, arg); + return rtems_interrupt_handler_install(irq, info, RTEMS_INTERRUPT_SHARED, isr, arg); } int leon2_amba_int_unregister @@ -373,7 +392,7 @@ int leon2_amba_int_unregister DBG("Unregistering IRQ %d to func 0x%x arg 0x%x\n", irq, (unsigned int)handler, (unsigned int)arg); - return BSP_shared_interrupt_unregister(irq, isr, arg); + return rtems_interrupt_handler_remove(irq, isr, arg); } int leon2_amba_int_clear @@ -388,7 +407,9 @@ int leon2_amba_int_clear if ( irq < 0 ) return -1; - BSP_shared_interrupt_clear(irq); + if (rtems_interrupt_clear(irq) != RTEMS_SUCCESSFUL) { + return DRVMGR_FAIL; + } return DRVMGR_OK; } @@ -405,7 +426,9 @@ int leon2_amba_int_mask if ( irq < 0 ) return -1; - BSP_shared_interrupt_mask(irq); + if (rtems_interrupt_vector_disable(irq) != RTEMS_SUCCESSFUL) { + return DRVMGR_FAIL; + } return DRVMGR_OK; } @@ -422,7 +445,9 @@ int leon2_amba_int_unmask if ( irq < 0 ) return -1; - BSP_shared_interrupt_unmask(irq); + if (rtems_interrupt_vector_enable(irq) != RTEMS_SUCCESSFUL) { + return DRVMGR_FAIL; + } return DRVMGR_OK; } |