base: simplification of the IPC code

This commit replaces the stateful 'Ipc_client' type with the plain
function 'ipc_call' that takes all the needed state as arguments.
The stateful 'Ipc_server' class is retained but it moved from the public
API to the internal ipc_server.h header. The kernel-specific
implementations were cleaned up and simplified. E.g., the 'wait'
function does no longer exist. The badge and exception code are no
longer carried in the message buffers but are handled in kernel-specific
ways.

Issue #610
Issue #1832
This commit is contained in:
Norman Feske
2016-03-15 20:01:59 +01:00
committed by Christian Helmuth
parent 47878bd3e1
commit cda07b7da0
33 changed files with 1106 additions and 1115 deletions

View File

@ -152,25 +152,47 @@ namespace Genode {
/**
* Type used for transmitting the opcode of a RPC function (used for RPC call)
*/
typedef int Rpc_opcode;
struct Rpc_opcode
{
long value = 0;
explicit Rpc_opcode(int value) : value(value) { }
};
/**
* Type used for transmitting exception information (used for RPC reply)
*/
typedef int Rpc_exception_code;
struct Rpc_exception_code
{
long value;
enum {
SUCCESS = 0,
/**
* Special exception code used to respond to illegal opcodes
*/
enum { RPC_INVALID_OPCODE = -1 };
/**
* Server-side object does not exist
*
* This exception code is not meant to be reflected from the server
* to the client. On kernels with capability support, the condition
* can never occur. On kernels without capability protection, the
* code is merely used for diagnostic purposes at the server side.
*/
INVALID_OBJECT = -1,
/**
* Special exception code used to respond to illegal opcodes
*/
INVALID_OPCODE = -2,
/**
* Opcode base used for passing exception information
*/
enum { RPC_EXCEPTION_BASE = -1000 };
/**
* Opcode base used for passing exception information
*/
EXCEPTION_BASE = -1000
};
explicit Rpc_exception_code(int value) : value(value) { }
};
/**