Adapt GDB monitor and Noux to CPU session changes

This commit is contained in:
Norman Feske 2012-08-02 17:10:46 +02:00
parent 9369057f90
commit d079ef51ae
5 changed files with 22 additions and 9 deletions

View File

@ -25,8 +25,11 @@ namespace Genode {
explicit Foc_cpu_session_client(Cpu_session_capability session)
: Rpc_client<Foc_cpu_session>(static_cap_cast<Foc_cpu_session>(session)) { }
Thread_capability create_thread(Name const &name) {
return call<Rpc_create_thread>(name); }
Thread_capability create_thread(Name const &name, addr_t utcb = 0) {
return call<Rpc_create_thread>(name, utcb); }
Ram_dataspace_capability utcb(Thread_capability thread) {
return call<Rpc_utcb>(thread); }
void kill_thread(Thread_capability thread) {
call<Rpc_kill_thread>(thread); }

View File

@ -37,6 +37,7 @@
#include <thread/capability.h>
#include <pager/capability.h>
#include <session/session.h>
#include <ram_session/ram_session.h>
namespace Genode {
@ -72,8 +73,7 @@ namespace Genode {
/**
* Get dataspace of the UTCB that is used by the specified thread
*/
virtual Ram_dataspace_capability
utcb(Thread_capability thread) = 0;
virtual Ram_dataspace_capability utcb(Thread_capability thread) = 0;
/**
* Kill an existing thread

View File

@ -63,10 +63,10 @@ Thread_capability Cpu_session_component::thread_cap(unsigned long lwpid)
}
Thread_capability Cpu_session_component::create_thread(Cpu_session::Name const &name)
Thread_capability Cpu_session_component::create_thread(Cpu_session::Name const &name, addr_t utcb)
{
Thread_capability thread_cap =
_parent_cpu_session.create_thread(name.string());
_parent_cpu_session.create_thread(name.string(), utcb);
if (thread_cap.valid()) {
Thread_info *thread_info = new (env()->heap()) Thread_info(thread_cap, new_lwpid++);
@ -77,6 +77,12 @@ Thread_capability Cpu_session_component::create_thread(Cpu_session::Name const &
}
Ram_dataspace_capability Cpu_session_component::utcb(Thread_capability thread)
{
return _parent_cpu_session.utcb(thread);
}
void Cpu_session_component::kill_thread(Thread_capability thread_cap)
{
Thread_info *thread_info = _thread_info(thread_cap);

View File

@ -54,7 +54,8 @@ class Cpu_session_component : public Rpc_object<Cpu_session>
** CPU session interface **
***************************/
Thread_capability create_thread(Name const &);
Thread_capability create_thread(Name const &, addr_t);
Ram_dataspace_capability utcb(Thread_capability thread);
void kill_thread(Thread_capability);
Thread_capability first();
Thread_capability next(Thread_capability);

View File

@ -70,7 +70,7 @@ namespace Noux {
** Cpu_session interface **
***************************/
Thread_capability create_thread(Name const &name)
Thread_capability create_thread(Name const &name, addr_t utcb)
{
/*
* Prevent any attempt to create more than the main
@ -81,12 +81,15 @@ namespace Noux {
while (1);
return Thread_capability();
}
_main_thread = _cpu.create_thread(name);
_main_thread = _cpu.create_thread(name, utcb);
PINF("created main thread");
return _main_thread;
}
Ram_dataspace_capability utcb(Thread_capability thread) {
return _cpu.utcb(thread); }
void kill_thread(Thread_capability thread) {
_cpu.kill_thread(thread); }