summaryrefslogtreecommitdiffstats
path: root/bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c b/bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c
index fbbe5fa9bb..35d23c1858 100644
--- a/bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c
+++ b/bsps/shared/grlib/drvmgr/ambapp_bus_grlib.c
@@ -1,3 +1,5 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/* LEON3 GRLIB AMBA Plug & Play bus driver.
*
* COPYRIGHT (c) 2008.
@@ -6,9 +8,26 @@
* This is driver is a wrapper for the general AMBA Plug & Play bus
* driver. This is the root bus driver for GRLIB systems.
*
- * 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 <stdlib.h>
@@ -22,7 +41,7 @@
#include <grlib/genirq.h>
#include <bsp.h>
-#include <bsp/irq.h>
+#include <bsp/irq-generic.h>
#include <grlib/grlib_impl.h>
@@ -208,7 +227,10 @@ static int ambapp_grlib_int_clear
struct drvmgr_dev *dev,
int irq)
{
- BSP_shared_interrupt_clear(irq);
+ if (rtems_interrupt_clear(irq) != RTEMS_SUCCESSFUL) {
+ return DRVMGR_FAIL;
+ }
+
return DRVMGR_OK;
}
@@ -218,7 +240,10 @@ static int ambapp_grlib_int_mask
int irq
)
{
- BSP_shared_interrupt_mask(irq);
+ if (rtems_interrupt_vector_disable(irq) != RTEMS_SUCCESSFUL) {
+ return DRVMGR_FAIL;
+ }
+
return DRVMGR_OK;
}
@@ -228,7 +253,10 @@ static int ambapp_grlib_int_unmask
int irq
)
{
- BSP_shared_interrupt_unmask(irq);
+ if (rtems_interrupt_vector_enable(irq) != RTEMS_SUCCESSFUL) {
+ return DRVMGR_FAIL;
+ }
+
return DRVMGR_OK;
}