hw: simplify Kernel::new_thread

Don't set priority and label in platform thread and then communicate this
core object via Kernel::new_thread but communicate priority and label directly.
This way kernel doesn't need to know anymore what a platform thread is.

ref #953
This commit is contained in:
Martin Stein
2013-11-18 15:31:54 +01:00
committed by Norman Feske
parent 210216e5e1
commit 99c649c42f
6 changed files with 99 additions and 107 deletions

View File

@ -20,7 +20,6 @@
namespace Genode
{
class Native_utcb;
class Platform_thread;
class Platform_pd;
class Tlb;
}
@ -30,7 +29,6 @@ namespace Kernel
typedef Genode::Tlb Tlb;
typedef Genode::addr_t addr_t;
typedef Genode::size_t size_t;
typedef Genode::Platform_thread Platform_thread;
typedef Genode::Platform_pd Platform_pd;
typedef Genode::Native_utcb Native_utcb;
@ -200,21 +198,22 @@ namespace Kernel
/**
* Create a new thread that is stopped initially
* Create kernel object that acts as thread that isn't executed initially
*
* \param dst physical base of an appropriate portion of memory
* that is thereupon allocated to the kernel
* \param pt assigned platform thread
* \param p memory donation for the new kernel thread object
* \param priority scheduling priority of the new thread
* \param label debugging label of the new thread
*
* \retval >0 ID of the new thread
* \retval 0 if no new thread was created
* \retval >0 kernel name of the new thread
* \retval 0 failed
*
* Restricted to core threads. Regaining of the supplied memory can be done
* through 'delete_thread'.
* Restricted to core threads.
*/
inline int new_thread(void * const dst, Platform_thread * const pt)
inline int new_thread(void * const p, unsigned const priority,
char const * const label)
{
return call(Call_id::NEW_THREAD, (Call_arg)dst, (Call_arg)pt);
return call((Call_arg)Call_id::NEW_THREAD, (Call_arg)p, (Call_arg)priority,
(Call_arg)label);
}