genode/repos/base/src/core/pd_session_component.cc

54 lines
1.0 KiB
C++
Raw Normal View History

2011-12-22 16:19:25 +01:00
/*
* \brief Core implementation of the PD session interface
* \author Christian Helmuth
* \date 2006-07-17
*
* FIXME arg_string and quota missing
*/
/*
2013-01-10 21:44:47 +01:00
* Copyright (C) 2006-2013 Genode Labs GmbH
2011-12-22 16:19:25 +01:00
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
/* Genode */
#include <base/printf.h>
/* Core */
#include <util.h>
#include <pd_session_component.h>
#include <cpu_session_component.h>
using namespace Genode;
int Pd_session_component::bind_thread(Thread_capability thread)
{
return _thread_ep.apply(thread, [&] (Cpu_thread_component *cpu_thread) {
if (!cpu_thread) return -1;
2011-12-22 16:19:25 +01:00
if (cpu_thread->bound()) {
PWRN("rebinding of threads not supported");
return -2;
}
2011-12-22 16:19:25 +01:00
Platform_thread *p_thread = cpu_thread->platform_thread();
2011-12-22 16:19:25 +01:00
int res = _pd.bind_thread(p_thread);
if (res)
return res;
2011-12-22 16:19:25 +01:00
cpu_thread->bound(true);
return 0;
});
2011-12-22 16:19:25 +01:00
}
int Pd_session_component::assign_parent(Parent_capability parent)
{
return _pd.assign_parent(parent);
}