summaryrefslogtreecommitdiffstats
path: root/freebsd/sys/dev/usb
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-09 08:56:49 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-10 09:09:19 +0200
commitab415f95a9ee784f0aa2131d237455ed6aad2dde (patch)
tree5dbc6edb5c1fe248dc5ca4204b271f5a19c1270d /freebsd/sys/dev/usb
parentMake default test initialization task preemptive (diff)
downloadrtems-libbsd-ab415f95a9ee784f0aa2131d237455ed6aad2dde.tar.bz2
Use extension to attach a struct thread to threads
Add test thread01.
Diffstat (limited to 'freebsd/sys/dev/usb')
-rw-r--r--freebsd/sys/dev/usb/usb_process.c8
-rw-r--r--freebsd/sys/dev/usb/usb_process.h4
2 files changed, 1 insertions, 11 deletions
diff --git a/freebsd/sys/dev/usb/usb_process.c b/freebsd/sys/dev/usb/usb_process.c
index 67ddf693..8cb00473 100644
--- a/freebsd/sys/dev/usb/usb_process.c
+++ b/freebsd/sys/dev/usb/usb_process.c
@@ -99,11 +99,11 @@ usb_process(void *arg)
{
struct usb_process *up = arg;
struct usb_proc_msg *pm;
-#ifndef __rtems__
struct thread *td;
/* adjust priority */
td = curthread;
+#ifndef __rtems__
thread_lock(td);
sched_prio(td, up->up_prio);
thread_unlock(td);
@@ -111,9 +111,7 @@ usb_process(void *arg)
mtx_lock(up->up_mtx);
-#ifndef __rtems__
up->up_curtd = td;
-#endif /* __rtems__ */
while (1) {
@@ -390,11 +388,7 @@ usb_proc_mwait(struct usb_process *up, void *_pm0, void *_pm1)
mtx_assert(up->up_mtx, MA_OWNED);
-#ifndef __rtems__
if (up->up_curtd == curthread) {
-#else /* __rtems__ */
- if (up->up_ptr->td_id == rtems_task_self()) {
-#endif /* __rtems__ */
/* Just remove the messages from the queue. */
if (pm0->pm_qentry.tqe_prev) {
TAILQ_REMOVE(&up->up_qhead, pm0, pm_qentry);
diff --git a/freebsd/sys/dev/usb/usb_process.h b/freebsd/sys/dev/usb/usb_process.h
index f9a3c38d..b4159af1 100644
--- a/freebsd/sys/dev/usb/usb_process.h
+++ b/freebsd/sys/dev/usb/usb_process.h
@@ -49,16 +49,12 @@ struct usb_process {
struct cv up_cv;
struct cv up_drain;
-#ifndef __rtems__
#if (__FreeBSD_version >= 800000)
struct thread *up_ptr;
#else
struct proc *up_ptr;
#endif
struct thread *up_curtd;
-#else /* __rtems__ */
- struct thread *up_ptr;
-#endif /* __rtems__ */
struct mtx *up_mtx;
usb_size_t up_msg_num;