mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-02 16:52:52 +00:00
Introduce server-role member to 'Child' class
This patch is needed to use children as services in a dynamic way (closing and reopening sessions).
This commit is contained in:
parent
4ba1669b39
commit
c2f23de2e7
@ -69,7 +69,8 @@ namespace Genode {
|
|||||||
*/
|
*/
|
||||||
virtual bool announce_service(const char *name,
|
virtual bool announce_service(const char *name,
|
||||||
Root_capability root,
|
Root_capability root,
|
||||||
Allocator *alloc)
|
Allocator *alloc,
|
||||||
|
Server *server)
|
||||||
{ return false; }
|
{ return false; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -296,6 +297,9 @@ namespace Genode {
|
|||||||
/* child policy */
|
/* child policy */
|
||||||
Child_policy *_policy;
|
Child_policy *_policy;
|
||||||
|
|
||||||
|
/* server role */
|
||||||
|
Server _server;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Session-argument buffer
|
* Session-argument buffer
|
||||||
*/
|
*/
|
||||||
@ -376,7 +380,8 @@ namespace Genode {
|
|||||||
_entrypoint(entrypoint),
|
_entrypoint(entrypoint),
|
||||||
_parent_cap(_entrypoint->manage(this)),
|
_parent_cap(_entrypoint->manage(this)),
|
||||||
_process(elf_ds, ram, cpu, rm, _parent_cap, policy->name(), 0),
|
_process(elf_ds, ram, cpu, rm, _parent_cap, policy->name(), 0),
|
||||||
_policy(policy)
|
_policy(policy),
|
||||||
|
_server(ram)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -437,7 +442,7 @@ namespace Genode {
|
|||||||
{
|
{
|
||||||
if (!name.is_valid_string()) return;
|
if (!name.is_valid_string()) return;
|
||||||
|
|
||||||
_policy->announce_service(name.string(), root, heap());
|
_policy->announce_service(name.string(), root, heap(), &_server);
|
||||||
}
|
}
|
||||||
|
|
||||||
Session_capability session(Service_name const &name, Session_args const &args)
|
Session_capability session(Service_name const &name, Session_args const &args)
|
||||||
|
@ -92,7 +92,8 @@ class Iso9660_boot_probe
|
|||||||
|
|
||||||
bool announce_service(char const *service_name,
|
bool announce_service(char const *service_name,
|
||||||
Genode::Root_capability root,
|
Genode::Root_capability root,
|
||||||
Genode::Allocator *alloc)
|
Genode::Allocator *alloc,
|
||||||
|
Genode::Server *server)
|
||||||
{
|
{
|
||||||
if (Genode::strcmp(service_name, "ROM") != 0)
|
if (Genode::strcmp(service_name, "ROM") != 0)
|
||||||
return false;
|
return false;
|
||||||
|
@ -61,7 +61,8 @@ class Ipxe_policy : public Genode::Slave_policy, public Nic::Provider
|
|||||||
|
|
||||||
bool announce_service(const char *service_name,
|
bool announce_service(const char *service_name,
|
||||||
Genode::Root_capability root,
|
Genode::Root_capability root,
|
||||||
Genode::Allocator *alloc)
|
Genode::Allocator *alloc,
|
||||||
|
Genode::Server *server)
|
||||||
{
|
{
|
||||||
if (Genode::strcmp(service_name, "Nic"))
|
if (Genode::strcmp(service_name, "Nic"))
|
||||||
return false;
|
return false;
|
||||||
@ -105,7 +106,8 @@ struct Ps2_policy : public Genode::Slave_policy
|
|||||||
|
|
||||||
bool announce_service(const char *service_name,
|
bool announce_service(const char *service_name,
|
||||||
Genode::Root_capability root,
|
Genode::Root_capability root,
|
||||||
Genode::Allocator *alloc)
|
Genode::Allocator *alloc,
|
||||||
|
Genode::Server *server)
|
||||||
{
|
{
|
||||||
if (Genode::strcmp(service_name, "Input"))
|
if (Genode::strcmp(service_name, "Input"))
|
||||||
return false;
|
return false;
|
||||||
@ -155,7 +157,8 @@ struct Usb_policy : public Genode::Slave_policy
|
|||||||
|
|
||||||
bool announce_service(const char *service_name,
|
bool announce_service(const char *service_name,
|
||||||
Genode::Root_capability root,
|
Genode::Root_capability root,
|
||||||
Genode::Allocator *alloc)
|
Genode::Allocator *alloc,
|
||||||
|
Genode::Server *server)
|
||||||
{
|
{
|
||||||
if (Genode::strcmp(service_name, "Input") == 0) {
|
if (Genode::strcmp(service_name, "Input") == 0) {
|
||||||
_input_source_registry_entry.connect(root);
|
_input_source_registry_entry.connect(root);
|
||||||
@ -202,7 +205,8 @@ class Atapi_policy : public Genode::Slave_policy
|
|||||||
|
|
||||||
bool announce_service(char const *service_name,
|
bool announce_service(char const *service_name,
|
||||||
Genode::Root_capability root,
|
Genode::Root_capability root,
|
||||||
Genode::Allocator *alloc)
|
Genode::Allocator *alloc,
|
||||||
|
Genode::Server *server)
|
||||||
{
|
{
|
||||||
if (Genode::strcmp(service_name, "Block"))
|
if (Genode::strcmp(service_name, "Block"))
|
||||||
return false;
|
return false;
|
||||||
|
@ -552,7 +552,8 @@ namespace Init {
|
|||||||
|
|
||||||
bool announce_service(const char *service_name,
|
bool announce_service(const char *service_name,
|
||||||
Genode::Root_capability root,
|
Genode::Root_capability root,
|
||||||
Genode::Allocator *alloc)
|
Genode::Allocator *alloc,
|
||||||
|
Genode::Server *server)
|
||||||
{
|
{
|
||||||
if (config_verbose)
|
if (config_verbose)
|
||||||
Genode::printf("child \"%s\" announces service \"%s\"\n",
|
Genode::printf("child \"%s\" announces service \"%s\"\n",
|
||||||
|
@ -309,7 +309,8 @@ namespace Init {
|
|||||||
|
|
||||||
bool announce_service(const char *service_name,
|
bool announce_service(const char *service_name,
|
||||||
Genode::Root_capability root,
|
Genode::Root_capability root,
|
||||||
Genode::Allocator *alloc)
|
Genode::Allocator *alloc,
|
||||||
|
Genode::Server *server)
|
||||||
{
|
{
|
||||||
if (_child_services->find(service_name)) {
|
if (_child_services->find(service_name)) {
|
||||||
PWRN("%s: service %s is already registered",
|
PWRN("%s: service %s is already registered",
|
||||||
|
@ -168,7 +168,8 @@ class Pci_policy : public Genode::Slave_policy, public Pci::Provider
|
|||||||
|
|
||||||
bool announce_service(const char *service_name,
|
bool announce_service(const char *service_name,
|
||||||
Genode::Root_capability root,
|
Genode::Root_capability root,
|
||||||
Genode::Allocator *alloc)
|
Genode::Allocator *alloc,
|
||||||
|
Genode::Server *server)
|
||||||
{
|
{
|
||||||
/* wait for 'pci_drv' to announce the PCI service */
|
/* wait for 'pci_drv' to announce the PCI service */
|
||||||
if (Genode::strcmp(service_name, "PCI"))
|
if (Genode::strcmp(service_name, "PCI"))
|
||||||
|
@ -307,7 +307,8 @@ namespace Gdb_monitor {
|
|||||||
|
|
||||||
bool announce_service(const char *name,
|
bool announce_service(const char *name,
|
||||||
Root_capability root,
|
Root_capability root,
|
||||||
Allocator *alloc)
|
Allocator *alloc,
|
||||||
|
Server *server)
|
||||||
{
|
{
|
||||||
/* create and announce proxy for the child's root interface */
|
/* create and announce proxy for the child's root interface */
|
||||||
Child_service_root *r = new (alloc)
|
Child_service_root *r = new (alloc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user