summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/kern/kern_timeout.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-25 09:27:50 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-09-25 10:01:15 +0200
commitb42dea9e51579ee27f1e063e75b936fec6c55141 (patch)
tree77a2a3e10305dde7e8679215f4ebd2d221e1b49a /freebsd/sys/kern/kern_timeout.c
parentmedia01: Improve output messages (diff)
downloadrtems-libbsd-b42dea9e51579ee27f1e063e75b936fec6c55141.tar.bz2
CONFIG_INTRHOOK(9): Port to RTEMS
Some device drivers (e.g. MMC) need a complex intialization with working callouts. Remove the dummy CONFIG_INTRHOOK() implementation and replace it with the real one from FreeBSD. Make sure TIMEOUT(9) services work at this point. Update #3525.
Diffstat (limited to 'freebsd/sys/kern/kern_timeout.c')
-rw-r--r--freebsd/sys/kern/kern_timeout.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/freebsd/sys/kern/kern_timeout.c b/freebsd/sys/kern/kern_timeout.c
index d33c158a..8ef42c9a 100644
--- a/freebsd/sys/kern/kern_timeout.c
+++ b/freebsd/sys/kern/kern_timeout.c
@@ -326,7 +326,15 @@ rtems_bsd_timeout_init_late(void *unused)
rtems_status_code sc;
rtems_id id;
- (void) unused;
+ (void)unused;
+
+ /*
+ * Giant unlock moved from mi_startup() to here. We have to unlock the
+ * Giant lock earlier, since otherwise deadlocks with non-mpsafe
+ * callouts may occur.
+ */
+ mtx_assert(&Giant, MA_OWNED | MA_NOTRECURSED);
+ mtx_unlock(&Giant);
sc = rtems_timer_create(rtems_build_name('_', 'C', 'L', 'O'), &id);
BSD_ASSERT(sc == RTEMS_SUCCESSFUL);
@@ -338,7 +346,7 @@ rtems_bsd_timeout_init_late(void *unused)
SYSINIT(rtems_bsd_timeout_early, SI_SUB_VM, SI_ORDER_FIRST,
rtems_bsd_timeout_init_early, NULL);
-SYSINIT(rtems_bsd_timeout_late, SI_SUB_LAST, SI_ORDER_FIRST,
+SYSINIT(rtems_bsd_timeout_late, SI_SUB_KICK_SCHEDULER, SI_ORDER_FIRST,
rtems_bsd_timeout_init_late, NULL);
static void