summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-07-25 10:20:19 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-09-23 10:55:49 +0200
commit989e2dd76e3d2411d6ac79cd426d340939ad1bb9 (patch)
treead34fbc6c89900f674bef93da92d6f5540614cec /testsuite
parentnexus: Avoid NULL pointer access (diff)
downloadrtems-libbsd-989e2dd76e3d2411d6ac79cd426d340939ad1bb9.tar.bz2
CONFIG_INTRHOOK(9): Call handlers after boot
This enables adding drivers on demand which use this service after initialization.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/swi01/swi_test.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/testsuite/swi01/swi_test.c b/testsuite/swi01/swi_test.c
index 4ec64cbb..630fa125 100644
--- a/testsuite/swi01/swi_test.c
+++ b/testsuite/swi01/swi_test.c
@@ -1,8 +1,8 @@
/*
- * Copyright (c) 2012 embedded brains GmbH. All rights reserved.
+ * Copyright (c) 2012, 2019 embedded brains GmbH. All rights reserved.
*
* embedded brains GmbH
- * Obere Lagerstr. 30
+ * Dornierstr. 4
* 82178 Puchheim
* Germany
* <rtems@embedded-brains.de>
@@ -37,11 +37,11 @@
#include <unistd.h>
#include <sys/types.h>
-#include <sys/systm.h>
-
#include <sys/param.h>
#include <sys/bus.h>
#include <sys/interrupt.h>
+#include <sys/kernel.h>
+#include <sys/systm.h>
#define SWI_TEST_THREAD_PRIO (0)
@@ -194,6 +194,31 @@ void swi_test_error_has_allready_exclusive()
assert(argument == HANDLER_NOT_VISITED);
}
+static void
+ich_func(void *arg)
+{
+ int *invocations;
+
+ invocations = arg;
+ ++(*invocations);
+}
+
+static void
+test_config_intrhook_establish(void)
+{
+ int invocations;
+ struct intr_config_hook hook = {
+ .ich_func = ich_func,
+ .ich_arg = &invocations
+ };
+
+ printf("== Test config_intrhook_establish().\n");
+
+ invocations = 0;
+ config_intrhook_establish(&hook);
+ assert(invocations == 1);
+}
+
void swi_test(void)
{
swi_test_normal_handler();
@@ -204,5 +229,6 @@ void swi_test(void)
swi_test_error_name_null();
swi_test_error_handler_null();
swi_test_error_has_allready_exclusive();
+ test_config_intrhook_establish();
}