5 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
6 * Michael Hohmuth <hohmuth@os.inf.tu-dresden.de>
7 * economic rights: Technische Universität Dresden (Germany)
8 * This file is part of TUD:OS and distributed under the terms of the
9 * GNU Lesser General Public License 2.1.
10 * Please see the COPYING-LGPL-2.1 file for details.
13 #include <l4/sys/types.h>
14 #include <l4/sys/factory.h>
15 #include <l4/sys/thread.h>
16 #include <l4/sys/scheduler.h>
18 #include <l4/util/thread.h>
21 l4util_create_thread(l4_cap_idx_t id, l4_utcb_t *thread_utcb,
23 l4_umword_t pc, l4_umword_t sp, l4_cap_idx_t pager,
25 l4_cap_idx_t scheduler, l4_sched_param_t scp) L4_NOTHROW
27 l4_msgtag_t res = l4_factory_create_thread(factory, id);
31 l4_thread_control_start();
32 l4_thread_control_pager(pager);
33 l4_thread_control_bind(thread_utcb, task);
34 res = l4_thread_control_commit(id);
38 res = l4_thread_ex_regs(id, pc, sp, 0);
42 if (!l4_is_invalid_cap(scheduler))
44 res = l4_scheduler_run_thread(scheduler, id, &scp);