base-linux: coding style

This commit is contained in:
Norman Feske
2020-11-17 10:55:49 +01:00
committed by Christian Helmuth
parent dc016cbd5c
commit 0dcb526ae5
39 changed files with 832 additions and 799 deletions

View File

@ -19,30 +19,30 @@
#include <base/rpc_client.h>
#include <util/string.h>
namespace Genode {
struct Linux_dataspace_client : Rpc_client<Linux_dataspace>
{
explicit Linux_dataspace_client(Dataspace_capability ds)
: Rpc_client<Linux_dataspace>(static_cap_cast<Linux_dataspace>(ds)) { }
namespace Genode { struct Linux_dataspace_client; }
/*********************************
** Generic dataspace interface **
*********************************/
size_t size() override { return call<Rpc_size>(); }
addr_t phys_addr() override { return call<Rpc_phys_addr>(); }
bool writable() override { return call<Rpc_writable>(); }
struct Genode::Linux_dataspace_client : Rpc_client<Linux_dataspace>
{
explicit Linux_dataspace_client(Dataspace_capability ds)
: Rpc_client<Linux_dataspace>(static_cap_cast<Linux_dataspace>(ds)) { }
/****************************************
** Linux-specific dataspace interface **
****************************************/
/*********************************
** Generic dataspace interface **
*********************************/
Filename fname() override { return call<Rpc_fname>(); }
Untyped_capability fd() override { return call<Rpc_fd>(); }
};
}
size_t size() override { return call<Rpc_size>(); }
addr_t phys_addr() override { return call<Rpc_phys_addr>(); }
bool writable() override { return call<Rpc_writable>(); }
/****************************************
** Linux-specific dataspace interface **
****************************************/
Filename fname() override { return call<Rpc_fname>(); }
Untyped_capability fd() override { return call<Rpc_fd>(); }
};
#endif /* _INCLUDE__LINUX_DATASPACE__CLIENT_H_ */

View File

@ -19,37 +19,37 @@
#include <base/ipc.h>
#include <base/rpc.h>
namespace Genode {
struct Linux_dataspace : Dataspace
{
enum { FNAME_LEN = 64 };
struct Filename { char buf[FNAME_LEN]; };
virtual ~Linux_dataspace() { }
/**
* Request name of file that represents the dataspace on Linux
*
* This function is used for calling execve on files passed as ROM
* dataspaces.
*/
virtual Filename fname() = 0;
/**
* Request file descriptor of the dataspace
*/
virtual Untyped_capability fd() = 0;
/*********************
** RPC declaration **
*********************/
namespace Genode { struct Linux_dataspace; }
GENODE_RPC(Rpc_fname, Filename, fname);
GENODE_RPC(Rpc_fd, Untyped_capability, fd);
GENODE_RPC_INTERFACE_INHERIT(Dataspace, Rpc_fname, Rpc_fd);
};
}
struct Genode::Linux_dataspace : Dataspace
{
enum { FNAME_LEN = 64 };
struct Filename { char buf[FNAME_LEN]; };
virtual ~Linux_dataspace() { }
/**
* Request name of file that represents the dataspace on Linux
*
* This function is used for calling execve on files passed as ROM
* dataspaces.
*/
virtual Filename fname() = 0;
/**
* Request file descriptor of the dataspace
*/
virtual Untyped_capability fd() = 0;
/*********************
** RPC declaration **
*********************/
GENODE_RPC(Rpc_fname, Filename, fname);
GENODE_RPC(Rpc_fd, Untyped_capability, fd);
GENODE_RPC_INTERFACE_INHERIT(Dataspace, Rpc_fname, Rpc_fd);
};
#endif /* _INCLUDE__LINUX_DATASPACE__LINUX_DATASPACE_H_ */