mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
Provide cpu_session_cap via environment object
Preparation to solve issue #10
This commit is contained in:
parent
a287831537
commit
664e0dc7cd
@ -338,6 +338,7 @@ namespace Genode {
|
||||
Local_parent _parent;
|
||||
Ram_session_capability _ram_session_cap;
|
||||
Expanding_ram_session_client _ram_session_client;
|
||||
Cpu_session_capability _cpu_session_cap;
|
||||
Cpu_session_client _cpu_session_client;
|
||||
Rm_session_mmap _rm_session_mmap;
|
||||
Heap _heap;
|
||||
@ -352,7 +353,8 @@ namespace Genode {
|
||||
_parent(_parent_cap()),
|
||||
_ram_session_cap(static_cap_cast<Ram_session>(parent()->session("Env::ram_session", ""))),
|
||||
_ram_session_client(_ram_session_cap),
|
||||
_cpu_session_client(static_cap_cast<Cpu_session>(parent()->session("Env::cpu_session", ""))),
|
||||
_cpu_session_cap(static_cap_cast<Cpu_session>(parent()->session("Env::cpu_session", ""))),
|
||||
_cpu_session_client(_cpu_session_cap),
|
||||
_rm_session_mmap(false),
|
||||
_heap(&_ram_session_client, &_rm_session_mmap)
|
||||
{ }
|
||||
@ -381,6 +383,7 @@ namespace Genode {
|
||||
Rm_session *rm_session() { return &_rm_session_mmap; }
|
||||
Heap *heap() { return &_heap; }
|
||||
Cpu_session *cpu_session() { return &_cpu_session_client; }
|
||||
Cpu_session_capability cpu_session_cap() { return _cpu_session_cap; }
|
||||
Pd_session *pd_session() { return 0; }
|
||||
};
|
||||
}
|
||||
|
@ -61,6 +61,8 @@ class Minimal_env : public Genode::Env
|
||||
|
||||
Genode::Ram_session_capability ram_session_cap() {
|
||||
return Genode::Ram_session_capability(); }
|
||||
Genode::Cpu_session_capability cpu_session_cap() {
|
||||
return Genode::Cpu_session_capability(); }
|
||||
};
|
||||
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <rm_session/rm_session.h>
|
||||
#include <ram_session/ram_session.h>
|
||||
#include <cpu_session/cpu_session.h>
|
||||
#include <cpu_session/capability.h>
|
||||
#include <pd_session/pd_session.h>
|
||||
#include <base/allocator.h>
|
||||
#include <base/snprintf.h>
|
||||
@ -56,6 +57,7 @@ namespace Genode {
|
||||
* This session is used to create threads.
|
||||
*/
|
||||
virtual Cpu_session *cpu_session() = 0;
|
||||
virtual Cpu_session_capability cpu_session_cap() = 0;
|
||||
|
||||
/**
|
||||
* Region manager session of the program
|
||||
|
@ -112,6 +112,7 @@ namespace Genode {
|
||||
{
|
||||
Ram_session_capability ram_cap;
|
||||
Expanding_ram_session_client ram;
|
||||
Cpu_session_capability cpu_cap;
|
||||
Cpu_session_client cpu;
|
||||
Expanding_rm_session_client rm;
|
||||
Pd_session_client pd;
|
||||
@ -120,7 +121,8 @@ namespace Genode {
|
||||
:
|
||||
ram_cap(static_cap_cast<Ram_session>(parent.session("Env::ram_session", ""))),
|
||||
ram(ram_cap),
|
||||
cpu(static_cap_cast<Cpu_session>(parent.session("Env::cpu_session", ""))),
|
||||
cpu_cap(static_cap_cast<Cpu_session>(parent.session("Env::cpu_session", ""))),
|
||||
cpu(cpu_cap),
|
||||
rm(static_cap_cast<Rm_session>(parent.session("Env::rm_session", ""))),
|
||||
pd(static_cap_cast<Pd_session>(parent.session("Env::pd_session", "")))
|
||||
{ }
|
||||
@ -168,6 +170,7 @@ namespace Genode {
|
||||
Ram_session *ram_session() { return &_resources.ram; }
|
||||
Ram_session_capability ram_session_cap() { return _resources.ram_cap; }
|
||||
Cpu_session *cpu_session() { return &_resources.cpu; }
|
||||
Cpu_session_capability cpu_session_cap() { return _resources.cpu_cap; }
|
||||
Rm_session *rm_session() { return &_resources.rm; }
|
||||
Pd_session *pd_session() { return &_resources.pd; }
|
||||
Allocator *heap() { return &_heap; }
|
||||
|
@ -407,6 +407,12 @@ void Child::exit(int exit_value)
|
||||
}
|
||||
|
||||
|
||||
Thread_capability Child::main_thread_cap() const
|
||||
{
|
||||
return _process.main_thread_cap();
|
||||
}
|
||||
|
||||
|
||||
Child::Child(Dataspace_capability elf_ds,
|
||||
Ram_session_capability ram,
|
||||
Cpu_session_capability cpu,
|
||||
|
@ -163,6 +163,12 @@ namespace Genode {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Cpu_session_capability cpu_session_cap() {
|
||||
PWRN("not implemented");
|
||||
return Cpu_session_capability();
|
||||
}
|
||||
|
||||
Pd_session *pd_session()
|
||||
{
|
||||
PWRN("not implemented");
|
||||
|
Loading…
x
Reference in New Issue
Block a user