diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-01-20 08:39:06 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-01-20 09:19:00 +0100 |
commit | 91ea7ea614c777595661c26cfa3e064182687f91 (patch) | |
tree | e8e10a2371bcdc50d90c065e795cce4c9db08d2a /rtemsbsd/rtems/rtems-bsd-thread.c | |
parent | HOSTNAME(1): Add -m flag (diff) | |
download | rtems-libbsd-91ea7ea614c777595661c26cfa3e064182687f91.tar.bz2 |
Add and use rtems_bsd_get_task_priority()
Diffstat (limited to 'rtemsbsd/rtems/rtems-bsd-thread.c')
-rw-r--r-- | rtemsbsd/rtems/rtems-bsd-thread.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/rtemsbsd/rtems/rtems-bsd-thread.c b/rtemsbsd/rtems/rtems-bsd-thread.c index bdd9aa54..a05d7437 100644 --- a/rtemsbsd/rtems/rtems-bsd-thread.c +++ b/rtemsbsd/rtems/rtems-bsd-thread.c @@ -7,7 +7,7 @@ */ /* - * Copyright (c) 2009-2013 embedded brains GmbH. All rights reserved. + * Copyright (c) 2009-2015 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Dornierstr. 4 @@ -50,6 +50,8 @@ #include <sys/malloc.h> #include <sys/selinfo.h> +#include <rtems/bsd/bsd.h> + #include <rtems/score/objectimpl.h> #include <rtems/score/statesimpl.h> #include <rtems/score/threaddispatch.h> @@ -246,12 +248,16 @@ rtems_bsd_thread_start(struct thread **td_ptr, void (*func)(void *), void *arg, int eno = 0; rtems_status_code sc; rtems_id task_id; + struct thread *td; + char name[sizeof(td->td_name)]; BSD_ASSERT(pages >= 0); + vsnprintf(name, sizeof(name), fmt, ap); + sc = rtems_task_create( BSD_TASK_NAME, - BSD_TASK_PRIORITY_NORMAL, + rtems_bsd_get_task_priority(name), BSD_MINIMUM_TASK_STACK_SIZE + (size_t) pages * PAGE_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -259,14 +265,13 @@ rtems_bsd_thread_start(struct thread **td_ptr, void (*func)(void *), void *arg, ); if (sc == RTEMS_SUCCESSFUL) { Thread_Control *thread = rtems_bsd_get_thread_by_id(task_id); - struct thread *td; BSD_ASSERT(thread != NULL); td = rtems_bsd_get_thread(thread); BSD_ASSERT(td != NULL); - vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap); + memcpy(td->td_name, name, sizeof(name)); if (rtems_bsd_thread_ready_to_start) { sc = rtems_task_start(task_id, (rtems_task_entry) func, |