base: add affinity support to pager construction

Propagating the affinity information is needed to allow for assigning
a pager thread that is local to the CPU of the to-be-created thread.

issue #814
This commit is contained in:
Alexander Boettcher
2013-07-09 15:58:06 +02:00
committed by Norman Feske
parent e171683b8c
commit 4ae1faf14d
21 changed files with 94 additions and 16 deletions

View File

@@ -81,7 +81,7 @@ namespace Genode {
static Nova::Utcb * _check_handler(Thread_base *&, Pager_object *&);
public:
Pager_object(unsigned long badge);
Pager_object(unsigned long badge, unsigned affinity);
virtual ~Pager_object();

View File

@@ -257,7 +257,7 @@ static uint8_t create_portal(addr_t pt, addr_t pd, addr_t ec, Mtd mtd,
return res;
}
Pager_object::Pager_object(unsigned long badge)
Pager_object::Pager_object(unsigned long badge, unsigned affinity)
: Thread_base("pager:", PF_HANDLER_STACK_SIZE), _badge(badge)
{
class Create_exception_pt_failed { };

View File

@@ -131,6 +131,11 @@ namespace Genode {
*/
void affinity(unsigned cpu);
/**
* Get the executing CPU for this thread
*/
unsigned affinity();
/**
* Get thread name
*/

View File

@@ -46,6 +46,9 @@ void Platform_thread::affinity(unsigned int cpu_no)
}
unsigned Platform_thread::affinity() { return _cpu_no; }
int Platform_thread::start(void *ip, void *sp)
{
using namespace Nova;
@@ -323,7 +326,7 @@ Weak_ptr<Address_space> Platform_thread::address_space()
Platform_thread::Platform_thread(const char *name, unsigned, int thread_id)
:
_pd(0), _pager(0), _id_base(cap_selector_allocator()->alloc(1)),
_sel_exc_base(Native_thread::INVALID_INDEX), _cpu_no(0),
_sel_exc_base(Native_thread::INVALID_INDEX), _cpu_no(0), //XXX find out boot CPU
_is_main_thread(false), _is_vcpu(false)
{
strncpy(_name, name, sizeof(_name));