summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-08-29 11:15:00 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-09-17 13:59:15 +0200
commite96e008c66bb2cf7c80036d90b9e059d2bc8a930 (patch)
tree59c7d6f205ebed51f4515418476f3431b698cb7d
parent7e982cf603da8fe3a1cd290d28bb00c7f60d1be0 (diff)
downloadrtems-libbsd-e96e008c66bb2cf7c80036d90b9e059d2bc8a930.tar.bz2
nexus: Add DISABLE_INTERRUPT_EXTENSION
Add an easy way to avoid the interrupt extension API for BSPs that do not support it.
-rw-r--r--rtemsbsd/rtems/rtems-bsd-nexus.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/rtemsbsd/rtems/rtems-bsd-nexus.c b/rtemsbsd/rtems/rtems-bsd-nexus.c
index 1c41fa51..9c398957 100644
--- a/rtemsbsd/rtems/rtems-bsd-nexus.c
+++ b/rtemsbsd/rtems/rtems-bsd-nexus.c
@@ -52,6 +52,8 @@
#include <rtems/bsd/bsd.h>
#include <rtems/irq-extension.h>
+/* #define DISABLE_INTERRUPT_EXTENSION */
+
RTEMS_STATIC_ASSERT(SYS_RES_MEMORY == RTEMS_BSD_RES_MEMORY, RTEMS_BSD_RES_MEMORY);
RTEMS_STATIC_ASSERT(SYS_RES_IRQ == RTEMS_BSD_RES_IRQ, RTEMS_BSD_RES_IRQ);
@@ -69,6 +71,7 @@ nexus_probe(device_t dev)
device_set_desc(dev, "RTEMS Nexus device");
+#ifndef DISABLE_INTERRUPT_EXTENSION
status = rtems_interrupt_server_initialize(
BSD_TASK_PRIORITY_INTERRUPT,
BSD_MINIMUM_TASK_STACK_SIZE,
@@ -77,6 +80,7 @@ nexus_probe(device_t dev)
NULL
);
BSD_ASSERT(status == RTEMS_SUCCESSFUL);
+#endif
mem_rman.rm_start = 0;
mem_rman.rm_end = ~0UL;
@@ -197,6 +201,7 @@ nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
driver_filter_t *filt, driver_intr_t *intr, void *arg, void **cookiep)
{
int err;
+#ifndef DISABLE_INTERRUPT_EXTENSION
struct nexus_intr *ni;
ni = malloc(sizeof(*ni), M_TEMP, M_WAITOK);
@@ -232,6 +237,9 @@ nexus_setup_intr(device_t dev, device_t child, struct resource *res, int flags,
} else {
err = ENOMEM;
}
+#else
+ err = EINVAL;
+#endif
return (err);
}
@@ -241,6 +249,7 @@ nexus_teardown_intr(device_t dev, device_t child, struct resource *res,
void *cookie)
{
int err;
+#ifndef DISABLE_INTERRUPT_EXTENSION
struct nexus_intr *ni;
rtems_status_code sc;
rtems_interrupt_handler rh;
@@ -260,6 +269,9 @@ nexus_teardown_intr(device_t dev, device_t child, struct resource *res,
rman_get_start(res), device_get_nameunit(child),
RTEMS_INTERRUPT_UNIQUE, rh, ra);
err = sc == RTEMS_SUCCESSFUL ? 0 : EINVAL;
+#else
+ err = EINVAL;
+#endif
return (err);
}