mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
parent
e8b97ad684
commit
5ac3c335dc
@ -655,7 +655,6 @@ set default_test_pkgs {
|
||||
test-ds_ownership
|
||||
test-dynamic_config
|
||||
test-dynamic_config_loader
|
||||
test-dynamic_config_slave
|
||||
test-entrypoint
|
||||
test-expat
|
||||
test-fault_detection
|
||||
|
@ -1 +0,0 @@
|
||||
Test for changing the configuration of a slave at runtime.
|
@ -1,2 +0,0 @@
|
||||
_/src/init
|
||||
_/src/test-dynamic_config
|
@ -1 +0,0 @@
|
||||
2021-04-19 4f56b11f9dd922fe8d70c771a90b6fd998b0f78a
|
@ -1,37 +0,0 @@
|
||||
<runtime ram="32M" caps="1000" binary="init">
|
||||
|
||||
<requires> <timer/> </requires>
|
||||
|
||||
<events>
|
||||
<timeout meaning="failed" sec="20" />
|
||||
<log meaning="succeeded">
|
||||
[init -> test-dynamic_config_master -> test-dynamic_config] obtained counter value 11 from config
|
||||
</log>
|
||||
</events>
|
||||
|
||||
<content>
|
||||
<rom label="ld.lib.so"/>
|
||||
<rom label="test-dynamic_config"/>
|
||||
<rom label="test-dynamic_config_master"/>
|
||||
</content>
|
||||
|
||||
<config>
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="CPU"/>
|
||||
<service name="RM"/>
|
||||
<service name="PD"/>
|
||||
<service name="IRQ"/>
|
||||
<service name="IO_PORT"/>
|
||||
<service name="LOG"/>
|
||||
<service name="Timer"/>
|
||||
</parent-provides>
|
||||
<default-route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</default-route>
|
||||
<default caps="200"/>
|
||||
<start name="test-dynamic_config_master">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
</start>
|
||||
</config>
|
||||
</runtime>
|
@ -1,80 +0,0 @@
|
||||
/*
|
||||
* \brief Test for changing the configuration of a slave at runtime
|
||||
* \author Norman Feske
|
||||
* \date 2012-04-04
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2012-2017 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU Affero General Public License version 3.
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/component.h>
|
||||
#include <os/static_parent_services.h>
|
||||
#include <os/slave.h>
|
||||
#include <timer_session/connection.h>
|
||||
|
||||
|
||||
namespace Test {
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
struct Policy;
|
||||
struct Main;
|
||||
}
|
||||
|
||||
|
||||
struct Test::Policy
|
||||
:
|
||||
private Static_parent_services<Cpu_session, Rom_session,
|
||||
Pd_session, Log_session>,
|
||||
public Slave::Policy
|
||||
{
|
||||
Policy(Env &env, Name const &name)
|
||||
:
|
||||
Static_parent_services(env),
|
||||
Slave::Policy(env, name, name, *this, env.ep().rpc_ep(),
|
||||
Cap_quota{100}, Ram_quota{1024*1024})
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
struct Test::Main
|
||||
{
|
||||
Env &_env;
|
||||
|
||||
Policy _policy { _env, "test-dynamic_config" };
|
||||
|
||||
unsigned _cnt = 0;
|
||||
|
||||
void _configure()
|
||||
{
|
||||
String<256> const config("<config><counter>", _cnt, "</counter></config>");
|
||||
_policy.configure(config.string());
|
||||
_cnt++;
|
||||
}
|
||||
|
||||
Child _child { _env.rm(), _env.ep().rpc_ep(), _policy };
|
||||
|
||||
Timer::Connection timer { _env };
|
||||
|
||||
Signal_handler<Main> _timeout_handler { _env.ep(), *this, &Main::_handle_timeout };
|
||||
|
||||
void _handle_timeout() { _configure(); }
|
||||
|
||||
Main(Env &env) : _env(env)
|
||||
{
|
||||
/* update slave config at regular intervals */
|
||||
timer.sigh(_timeout_handler);
|
||||
timer.trigger_periodic(250*1000);
|
||||
|
||||
/* define initial config for slave before returning to entrypoint */
|
||||
_configure();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void Component::construct(Genode::Env &env) { static Test::Main main(env); }
|
@ -1,3 +0,0 @@
|
||||
TARGET = test-dynamic_config_master
|
||||
SRC_CC = main.cc
|
||||
LIBS = base
|
Loading…
x
Reference in New Issue
Block a user