base: remove 'Native_thread' from public API

Issue #1832
This commit is contained in:
Norman Feske
2016-03-11 17:32:43 +01:00
committed by Christian Helmuth
parent dc0ebba1ec
commit da5d182ad3
77 changed files with 659 additions and 333 deletions

View File

@@ -80,7 +80,7 @@ class Vmm::Vcpu_dispatcher : public T
cpu_session->affinity(T::cap(), location);
/* request creation of a 'local' EC */
T::_tid.ec_sel = Native_thread::INVALID_INDEX - 1;
T::native_thread().ec_sel = Native_thread::INVALID_INDEX - 1;
T::start();
}
@@ -99,7 +99,7 @@ class Vmm::Vcpu_dispatcher : public T
cpu_session->affinity(T::cap(), location);
/* request creation of a 'local' EC */
T::_tid.ec_sel = Native_thread::INVALID_INDEX - 1;
T::native_thread().ec_sel = Native_thread::INVALID_INDEX - 1;
T::start();
}
@@ -117,7 +117,7 @@ class Vmm::Vcpu_dispatcher : public T
/* Create the portal at the desired selector index */
_native_pd.rcv_window(exc_base + EV);
Native_capability thread_cap(T::tid().ec_sel);
Native_capability thread_cap(T::native_thread().ec_sel);
Untyped_capability handler =
retry<Genode::Pd_session::Out_of_metadata>(
@@ -158,7 +158,7 @@ class Vmm::Vcpu_dispatcher : public T
*/
Nova::mword_t sel_sm_ec()
{
return T::tid().exc_pt_sel + Nova::SM_SEL_EC;
return T::native_thread().exc_pt_sel + Nova::SM_SEL_EC;
}
};

View File

@@ -23,6 +23,9 @@
#include <pd_session/connection.h>
#include <rm_session/connection.h>
/* NOVA includes */
#include <nova/native_thread.h>
namespace Vmm {
using namespace Genode;
@@ -118,13 +121,13 @@ class Vmm::Vcpu_same_pd : public Vmm::Vcpu_thread, Genode::Thread_base
Thread_base(WEIGHT, "vCPU", stack_size, Type::NORMAL, cpu_session)
{
/* release pre-allocated selectors of Thread */
Genode::cap_map()->remove(tid().exc_pt_sel, Nova::NUM_INITIAL_PT_LOG2);
Genode::cap_map()->remove(native_thread().exc_pt_sel, Nova::NUM_INITIAL_PT_LOG2);
/* allocate correct number of selectors */
this->tid().exc_pt_sel = cap_map()->insert(Nova::NUM_INITIAL_VCPU_PT_LOG2);
this->native_thread().exc_pt_sel = cap_map()->insert(Nova::NUM_INITIAL_VCPU_PT_LOG2);
/* tell generic thread code that this becomes a vCPU */
this->tid().is_vcpu = true;
this->native_thread().is_vcpu = true;
/* place the thread on CPU described by location object */
cpu_session->affinity(Thread_base::cap(), location);
@@ -134,14 +137,14 @@ class Vmm::Vcpu_same_pd : public Vmm::Vcpu_thread, Genode::Thread_base
{
using namespace Nova;
revoke(Nova::Obj_crd(this->tid().exc_pt_sel, NUM_INITIAL_VCPU_PT_LOG2));
cap_map()->remove(this->tid().exc_pt_sel, NUM_INITIAL_VCPU_PT_LOG2, false);
revoke(Nova::Obj_crd(this->native_thread().exc_pt_sel, NUM_INITIAL_VCPU_PT_LOG2));
cap_map()->remove(this->native_thread().exc_pt_sel, NUM_INITIAL_VCPU_PT_LOG2, false);
/* allocate selectors for ~Thread */
this->tid().exc_pt_sel = cap_map()->insert(Nova::NUM_INITIAL_PT_LOG2);
this->native_thread().exc_pt_sel = cap_map()->insert(Nova::NUM_INITIAL_PT_LOG2);
}
addr_t exc_base() { return this->tid().exc_pt_sel; }
addr_t exc_base() { return this->native_thread().exc_pt_sel; }
void start(Genode::addr_t sel_ec)
{