Create entrypoint sockets in core only

This patch alleviates the need for any non-core process to create Unix
domain sockets locally. All sockets used for RPC communication are
created by core and subsequently passed to the other processes via RPC
or the parent interface. The immediate benefit is that no process other
than core needs to access the 'rpath' directory in order to communicate.
However, access to 'rpath' is still needed for accessing dataspaces.

Core creates one socket pair per thread on demand on the first call of
the 'Linux_cpu_session::server_sd()' or 'Linux_cpu_session::client_sd()'
functions. 'Linux_cpu_session' is a Linux-specific extension to the CPU
session interface. In addition to the socket accessors, the extension
provides a mechanism to register the PID/TID of a thread. Those
information were formerly propagated into core along with the thread
name as argument to 'create_thread()'.

Because core creates socket pairs for entrypoints, it needs to know all
threads that are potential entrypoints. For lx_hybrid programs, we
hadn't had propagated any thread information into core, yet. Hence, this
patch also contains the code for registering threads of hybrid
applications at core.
This commit is contained in:
Norman Feske
2012-08-09 16:52:47 +02:00
parent f33c7c73bd
commit aee0a2061b
15 changed files with 543 additions and 72 deletions

View File

@ -27,7 +27,7 @@
#include <base/heap.h>
#include <parent/client.h>
#include <ram_session/client.h>
#include <cpu_session/client.h>
#include <linux_cpu_session/client.h>
#include <pd_session/client.h>
namespace Genode {
@ -341,7 +341,7 @@ namespace Genode {
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;
Linux_cpu_session_client _cpu_session_client;
Rm_session_mmap _rm_session_mmap;
Pd_session_client _pd_session_client;
Heap _heap;
@ -357,7 +357,7 @@ namespace Genode {
_ram_session_cap(static_cap_cast<Ram_session>(parent()->session("Env::ram_session", ""))),
_ram_session_client(_ram_session_cap),
_cpu_session_cap(static_cap_cast<Cpu_session>(parent()->session("Env::cpu_session", ""))),
_cpu_session_client(_cpu_session_cap),
_cpu_session_client(static_cap_cast<Linux_cpu_session>(parent()->session("Env::cpu_session", ""))),
_rm_session_mmap(false),
_pd_session_client(static_cap_cast<Pd_session>(parent()->session("Env::pd_session", ""))),
_heap(&_ram_session_client, &_rm_session_mmap)
@ -386,9 +386,9 @@ namespace Genode {
Ram_session_capability ram_session_cap() { return _ram_session_cap; }
Rm_session *rm_session() { return &_rm_session_mmap; }
Heap *heap() { return &_heap; }
Cpu_session *cpu_session() { return &_cpu_session_client; }
Linux_cpu_session *cpu_session() { return &_cpu_session_client; }
Cpu_session_capability cpu_session_cap() { return _cpu_session_cap; }
Pd_session *pd_session() { return 0; }
Pd_session *pd_session() { return &_pd_session_client; }
};
}