mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-04 17:53:07 +00:00
parent
f41d8d6b14
commit
1828f70037
@ -12,11 +12,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Genode includes */
|
/* Genode includes */
|
||||||
#include <libc/component.h>
|
|
||||||
#include <base/heap.h>
|
#include <base/heap.h>
|
||||||
#include <base/log.h>
|
#include <base/log.h>
|
||||||
#include <base/attached_ram_dataspace.h>
|
#include <base/attached_ram_dataspace.h>
|
||||||
|
#include <base/attached_rom_dataspace.h>
|
||||||
#include <os/session_policy.h>
|
#include <os/session_policy.h>
|
||||||
|
#include <libc/component.h>
|
||||||
#include <root/component.h>
|
#include <root/component.h>
|
||||||
#include <terminal_session/terminal_session.h>
|
#include <terminal_session/terminal_session.h>
|
||||||
|
|
||||||
@ -225,6 +226,7 @@ namespace Terminal {
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
Genode::Env &_env;
|
Genode::Env &_env;
|
||||||
|
Genode::Xml_node _config;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -234,7 +236,7 @@ namespace Terminal {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Genode::Session_label label = Genode::label_from_args(args);
|
Genode::Session_label label = Genode::label_from_args(args);
|
||||||
Genode::Session_policy policy(label);
|
Genode::Session_policy policy(label, _config);
|
||||||
|
|
||||||
char filename[256];
|
char filename[256];
|
||||||
policy.attribute("filename").value(filename, sizeof(filename));
|
policy.attribute("filename").value(filename, sizeof(filename));
|
||||||
@ -260,10 +262,11 @@ namespace Terminal {
|
|||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
Root_component(Genode::Env &env,
|
Root_component(Genode::Env &env,
|
||||||
|
Genode::Xml_node config,
|
||||||
Genode::Allocator *md_alloc)
|
Genode::Allocator *md_alloc)
|
||||||
:
|
:
|
||||||
Genode::Root_component<Session_component>(&env.ep().rpc_ep(), md_alloc),
|
Genode::Root_component<Session_component>(&env.ep().rpc_ep(), md_alloc),
|
||||||
_env(env)
|
_env(env), _config(config)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -273,10 +276,13 @@ struct Main
|
|||||||
{
|
{
|
||||||
Genode::Env &_env;
|
Genode::Env &_env;
|
||||||
|
|
||||||
|
Genode::Attached_rom_dataspace _config_rom { _env, "config" };
|
||||||
|
Genode::Xml_node _config { _config_rom.xml() };
|
||||||
|
|
||||||
Genode::Sliced_heap _sliced_heap { _env.ram(), _env.rm() };
|
Genode::Sliced_heap _sliced_heap { _env.ram(), _env.rm() };
|
||||||
|
|
||||||
/* create root interface for service */
|
/* create root interface for service */
|
||||||
Terminal::Root_component _root { _env, &_sliced_heap };
|
Terminal::Root_component _root { _env, _config, &_sliced_heap };
|
||||||
|
|
||||||
Main(Genode::Env &env) : _env(env)
|
Main(Genode::Env &env) : _env(env)
|
||||||
{
|
{
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include <root/component.h>
|
#include <root/component.h>
|
||||||
#include <terminal_session/terminal_session.h>
|
#include <terminal_session/terminal_session.h>
|
||||||
#include <base/attached_ram_dataspace.h>
|
#include <base/attached_ram_dataspace.h>
|
||||||
|
#include <base/attached_rom_dataspace.h>
|
||||||
#include <os/session_policy.h>
|
#include <os/session_policy.h>
|
||||||
|
|
||||||
#include <libc/component.h>
|
#include <libc/component.h>
|
||||||
@ -502,6 +503,7 @@ class Terminal::Root_component : public Genode::Root_component<Session_component
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
Genode::Env &_env;
|
Genode::Env &_env;
|
||||||
|
Genode::Xml_node _config;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
@ -516,7 +518,7 @@ class Terminal::Root_component : public Genode::Root_component<Session_component
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
Session_label const label = label_from_args(args);
|
Session_label const label = label_from_args(args);
|
||||||
Session_policy policy(label);
|
Session_policy policy(label, _config);
|
||||||
|
|
||||||
unsigned tcp_port = 0;
|
unsigned tcp_port = 0;
|
||||||
policy.attribute("port").value(&tcp_port);
|
policy.attribute("port").value(&tcp_port);
|
||||||
@ -537,11 +539,13 @@ class Terminal::Root_component : public Genode::Root_component<Session_component
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
Root_component(Genode::Env &env, Genode::Allocator &md_alloc)
|
Root_component(Genode::Env &env,
|
||||||
|
Genode::Xml_node config,
|
||||||
|
Genode::Allocator &md_alloc)
|
||||||
:
|
:
|
||||||
Genode::Root_component<Session_component>(&env.ep().rpc_ep(),
|
Genode::Root_component<Session_component>(&env.ep().rpc_ep(),
|
||||||
&md_alloc),
|
&md_alloc),
|
||||||
_env(env)
|
_env(env), _config(config)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -550,10 +554,13 @@ struct Main
|
|||||||
{
|
{
|
||||||
Genode::Env &_env;
|
Genode::Env &_env;
|
||||||
|
|
||||||
|
Genode::Attached_rom_dataspace _config_rom { _env, "config" };
|
||||||
|
Genode::Xml_node _config { _config_rom.xml() };
|
||||||
|
|
||||||
Genode::Sliced_heap _sliced_heap { _env.ram(), _env.rm() };
|
Genode::Sliced_heap _sliced_heap { _env.ram(), _env.rm() };
|
||||||
|
|
||||||
/* create root interface for service */
|
/* create root interface for service */
|
||||||
Terminal::Root_component _root { _env, _sliced_heap };
|
Terminal::Root_component _root { _env, _config, _sliced_heap };
|
||||||
|
|
||||||
Main(Genode::Env &env) : _env(env)
|
Main(Genode::Env &env) : _env(env)
|
||||||
{
|
{
|
||||||
|
@ -382,7 +382,7 @@ struct Input_filter::Main : Input_connection::Avail_handler,
|
|||||||
input_node.attribute_value("label", Label());
|
input_node.attribute_value("label", Label());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Input_connection &conn = *new (_heap)
|
new (_heap)
|
||||||
Registered<Input_connection>(_input_connections, _env,
|
Registered<Input_connection>(_input_connections, _env,
|
||||||
label, *this, _heap);
|
label, *this, _heap);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user