summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-20 10:06:43 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-20 10:13:49 +0200
commite65165bc2c35a84268f8362ec4f5b3328f71214c (patch)
tree2b858b56bd4d2f3137d210047499d0f864cf5452
parentUpdate due to API changes (timecounters) (diff)
downloadrtems-libbsd-e65165bc2c35a84268f8362ec4f5b3328f71214c.tar.bz2
SLEEPQUEUE(9): Update due to RTEMS API changes
-rw-r--r--freebsd/sys/kern/subr_sleepqueue.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/freebsd/sys/kern/subr_sleepqueue.c b/freebsd/sys/kern/subr_sleepqueue.c
index 6223b272..a0f25b07 100644
--- a/freebsd/sys/kern/subr_sleepqueue.c
+++ b/freebsd/sys/kern/subr_sleepqueue.c
@@ -635,7 +635,7 @@ sleepq_switch(void *wchan, int pri)
Per_CPU_Control *cpu_self;
bool unblock;
- cpu_self = _Thread_Dispatch_disable_critical();
+ cpu_self = _Thread_Dispatch_disable_critical(&lock_context);
_Thread_Lock_release_default(executing, &lock_context);
_Thread_Set_state(executing, STATES_WAITING_FOR_BSD_WAKEUP);
@@ -919,7 +919,8 @@ sleepq_resume_thread(struct sleepqueue *sq, struct thread *td, int pri)
#ifdef __rtems__
(void)sc;
thread = td->td_thread;
- _Thread_Lock_acquire_default(thread, &lock_context);
+ _ISR_lock_ISR_disable(&lock_context);
+ _Thread_Lock_acquire_default_critical(thread, &lock_context);
#endif /* __rtems__ */
td->td_wmesg = NULL;
@@ -965,7 +966,7 @@ sleepq_resume_thread(struct sleepqueue *sq, struct thread *td, int pri)
if (unblock) {
Per_CPU_Control *cpu_self;
- cpu_self = _Thread_Dispatch_disable_critical();
+ cpu_self = _Thread_Dispatch_disable_critical(&lock_context);
_Thread_Lock_release_default(thread, &lock_context);
_Watchdog_Remove_ticks(&thread->Timer);
@@ -1174,7 +1175,8 @@ sleepq_timeout(Objects_Id id, void *arg)
td = rtems_bsd_get_thread(thread);
BSD_ASSERT(td != NULL);
- _Thread_Lock_acquire_default(thread, &lock_context);
+ _ISR_lock_ISR_disable(&lock_context);
+ _Thread_Lock_acquire_default_critical(thread, &lock_context);
unblock = false;
switch (td->td_sq_state) {
@@ -1193,7 +1195,7 @@ sleepq_timeout(Objects_Id id, void *arg)
if (unblock) {
Per_CPU_Control *cpu_self;
- cpu_self = _Thread_Dispatch_disable_critical();
+ cpu_self = _Thread_Dispatch_disable_critical(&lock_context);
_Thread_Lock_release_default(thread, &lock_context);
_Thread_Clear_state(thread, STATES_WAITING_FOR_BSD_WAKEUP);