mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-11 04:53:04 +00:00
hw: get a thread cap in Thread_base constructor
Previously this was not done before Thread_base::start(..) in base-hw as it was not needed to have a valid cap that early. However, when changing the affinity of a thread we need the cap to be valid before Thread_base::start(..). ref #1076
This commit is contained in:
parent
52addb591b
commit
e38060d81e
@ -74,7 +74,15 @@ void Thread_base::_thread_bootstrap()
|
|||||||
void Thread_base::_init_platform_thread(Type type)
|
void Thread_base::_init_platform_thread(Type type)
|
||||||
{
|
{
|
||||||
/* nothing platform specific to do if this is not a special thread */
|
/* nothing platform specific to do if this is not a special thread */
|
||||||
if (type == NORMAL) { return; }
|
if (type == NORMAL)
|
||||||
|
{
|
||||||
|
/* create server object */
|
||||||
|
char buf[48];
|
||||||
|
name(buf, sizeof(buf));
|
||||||
|
Cpu_session * cpu = env()->cpu_session();
|
||||||
|
_thread_cap = cpu->create_thread(buf, (addr_t)&_context->utcb);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* if we got reinitialized we have to get rid of the old UTCB */
|
/* if we got reinitialized we have to get rid of the old UTCB */
|
||||||
size_t const utcb_size = sizeof(Native_utcb);
|
size_t const utcb_size = sizeof(Native_utcb);
|
||||||
|
@ -61,12 +61,6 @@ void Thread_base::_deinit_platform_thread()
|
|||||||
|
|
||||||
void Thread_base::start()
|
void Thread_base::start()
|
||||||
{
|
{
|
||||||
/* create server object */
|
|
||||||
char buf[48];
|
|
||||||
name(buf, sizeof(buf));
|
|
||||||
Cpu_session * cpu = env()->cpu_session();
|
|
||||||
_thread_cap = cpu->create_thread(buf, (addr_t)&_context->utcb);
|
|
||||||
|
|
||||||
/* assign thread to protection domain */
|
/* assign thread to protection domain */
|
||||||
env()->pd_session()->bind_thread(_thread_cap);
|
env()->pd_session()->bind_thread(_thread_cap);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user