genode/repos/base/src/include/base/internal/ipc_server.h
Norman Feske f186587cab Unify ipc_msgbuf.h across base platforms
Besides unifying the Msgbuf_base classes across all platforms, this
patch merges the Ipc_marshaller functionality into Msgbuf_base, which
leads to several further simplifications. For example, this patch
eventually moves the Native_connection_state and removes all state
from the former Ipc_server to the actual server loop, which not only
makes the flow of control and information much more obvious, but is
also more flexible. I.e., on NOVA, we don't even have the notion of
reply-and-wait. Now, we are no longer forced to pretend otherwise.

Issue #1832
2016-04-25 10:47:59 +02:00

61 lines
1.3 KiB
C++

/*
* \brief IPC server
* \author Norman Feske
* \date 2016-03-16
*/
/*
* Copyright (C) 2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _INCLUDE__BASE__INTERNAL__IPC_SERVER_H_
#define _INCLUDE__BASE__INTERNAL__IPC_SERVER_H_
/* Genode includes */
#include <base/stdint.h>
#include <base/ipc.h>
namespace Genode {
struct Ipc_server;
/**
* Send reply to caller
*/
void ipc_reply(Native_capability caller, Rpc_exception_code,
Msgbuf_base &snd_msg);
typedef Native_capability Reply_capability;
struct Rpc_request
{
Reply_capability caller;
unsigned long badge = ~0;
Rpc_request() { }
Rpc_request(Reply_capability caller, unsigned long badge)
: caller(caller), badge(badge) { }
};
/**
* Send result of previous RPC request and wait for new one
*/
Rpc_request ipc_reply_wait(Reply_capability const &caller,
Rpc_exception_code reply_exc,
Msgbuf_base &reply_msg,
Msgbuf_base &request_msg);
}
struct Genode::Ipc_server : Native_capability
{
Ipc_server();
~Ipc_server();
};
#endif /* _INCLUDE__BASE__INTERNAL__IPC_SERVER_H_ */