cpu_session: Access thread state by value

This commit is contained in:
Martin Stein
2012-11-12 17:48:18 +01:00
committed by Norman Feske
parent 4dadd6a437
commit 05f5999e71
47 changed files with 353 additions and 199 deletions

View File

@@ -48,8 +48,11 @@ namespace Genode {
void cancel_blocking(Thread_capability thread) {
call<Rpc_cancel_blocking>(thread); }
int state(Thread_capability thread, Thread_state *dst_state) {
return call<Rpc_state>(thread, dst_state); }
Thread_state state(Thread_capability thread) {
return call<Rpc_get_state>(thread); }
void state(Thread_capability thread, Thread_state const &state) {
call<Rpc_set_state>(thread, state); }
void exception_handler(Thread_capability thread, Signal_context_capability handler) {
call<Rpc_exception_handler>(thread, handler); }

View File

@@ -133,7 +133,8 @@ namespace Genode {
void resume(Thread_capability thread_cap);
void cancel_blocking(Thread_capability);
int name(Thread_capability, char *, size_t);
int state(Thread_capability, Thread_state *);
Thread_state state(Thread_capability);
void state(Thread_capability, Thread_state const &);
void exception_handler(Thread_capability, Signal_context_capability);
unsigned num_cpus() const;
void affinity(Thread_capability, unsigned);

View File

@@ -18,6 +18,7 @@
#include <base/pager.h>
#include <base/thread_state.h>
#include <cpu_session/cpu_session.h>
namespace Genode {
@@ -64,7 +65,19 @@ namespace Genode {
Pager_object *pager() { return 0; }
void pager(Pager_object *) { }
int start(void *ip, void *sp) { return 0; }
int state(Thread_state *state_dst) { return 0; }
Thread_state state()
{
PDBG("Not implemented");
throw Cpu_session::State_access_failed();
}
void state(Thread_state)
{
PDBG("Not implemented");
throw Cpu_session::State_access_failed();
}
const char *name() { return _name; }
void affinity(unsigned) { }