diff options
Diffstat (limited to 'rtemsbsd')
-rw-r--r-- | rtemsbsd/include/machine/rtems-bsd-thread.h | 9 | ||||
-rw-r--r-- | rtemsbsd/include/rtems/bsd/local/opt_sleepqueue_profiling.h | 0 | ||||
-rw-r--r-- | rtemsbsd/include/sys/sleepqueue.h | 1 | ||||
-rw-r--r-- | rtemsbsd/rtems/rtems-bsd-thread.c | 16 |
4 files changed, 4 insertions, 22 deletions
diff --git a/rtemsbsd/include/machine/rtems-bsd-thread.h b/rtemsbsd/include/machine/rtems-bsd-thread.h index 2f99ad10..9a2caeee 100644 --- a/rtemsbsd/include/machine/rtems-bsd-thread.h +++ b/rtemsbsd/include/machine/rtems-bsd-thread.h @@ -43,20 +43,11 @@ #include <rtems/bsd/sys/param.h> #include <rtems/bsd/sys/types.h> #include <sys/proc.h> -#include <sys/queue.h> -#include <rtems/score/threadq.h> #include <rtems.h> #define BSD_TASK_NAME rtems_build_name('_', 'B', 'S', 'D') -struct sleepqueue { - Thread_queue_Control sq_blocked; - LIST_ENTRY(sleepqueue) sq_hash; - LIST_HEAD(, sleepqueue) sq_free; - void *sq_wchan; -}; - struct thread * rtems_bsd_get_thread(const Thread_Control *thread); diff --git a/rtemsbsd/include/rtems/bsd/local/opt_sleepqueue_profiling.h b/rtemsbsd/include/rtems/bsd/local/opt_sleepqueue_profiling.h new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/rtemsbsd/include/rtems/bsd/local/opt_sleepqueue_profiling.h diff --git a/rtemsbsd/include/sys/sleepqueue.h b/rtemsbsd/include/sys/sleepqueue.h deleted file mode 100644 index 936ffd88..00000000 --- a/rtemsbsd/include/sys/sleepqueue.h +++ /dev/null @@ -1 +0,0 @@ -/* EMPTY */ diff --git a/rtemsbsd/rtems/rtems-bsd-thread.c b/rtemsbsd/rtems/rtems-bsd-thread.c index ef94188f..77057ba7 100644 --- a/rtemsbsd/rtems/rtems-bsd-thread.c +++ b/rtemsbsd/rtems/rtems-bsd-thread.c @@ -49,6 +49,7 @@ #include <sys/kthread.h> #include <sys/malloc.h> #include <sys/selinfo.h> +#include <sys/sleepqueue.h> #include <rtems/bsd/bsd.h> @@ -100,23 +101,14 @@ struct thread * rtems_bsd_thread_create(Thread_Control *thread, int wait) { struct thread *td = malloc(sizeof(*td), M_TEMP, M_ZERO | wait); - struct sleepqueue *sq = malloc(sizeof(*sq), M_TEMP, wait); + struct sleepqueue *sq = sleepq_alloc(); if (td != NULL && sq != NULL) { td->td_thread = thread; td->td_sleepqueue = sq; - - LIST_INIT(&sq->sq_free); - - _Thread_queue_Initialize( - &sq->sq_blocked, - THREAD_QUEUE_DISCIPLINE_PRIORITY, - STATES_WAITING_FOR_BSD_WAKEUP, - EWOULDBLOCK - ); } else { free(td, M_TEMP); - free(sq, M_TEMP); + sleepq_free(sq); td = NULL; } @@ -185,7 +177,7 @@ rtems_bsd_extension_thread_delete( if (td != NULL) { seltdfini(td); - free(td->td_sleepqueue, M_TEMP); + sleepq_free(td->td_sleepqueue); free(td, M_TEMP); } } |