base,os: Coding-style unification

Fixes #1432
This commit is contained in:
Norman Feske 2015-03-04 21:12:14 +01:00 committed by Christian Helmuth
parent 56ed7addbc
commit e8336acafc
227 changed files with 19073 additions and 18833 deletions

View File

@ -21,10 +21,15 @@
namespace Genode { namespace Genode {
struct Cpu_state;
struct Cpu_state_modes;
}
/** /**
* Basic CPU state * Basic CPU state
*/ */
struct Cpu_state struct Genode::Cpu_state
{ {
/** /**
* Native exception types * Native exception types
@ -51,10 +56,11 @@ namespace Genode {
addr_t cpu_exception; /* last hardware exception */ addr_t cpu_exception; /* last hardware exception */
}; };
/** /**
* Extend CPU state by banked registers * Extend CPU state by banked registers
*/ */
struct Cpu_state_modes : Cpu_state struct Genode::Cpu_state_modes : Cpu_state
{ {
/** /**
* Common banked registers for exception modes * Common banked registers for exception modes
@ -78,6 +84,5 @@ namespace Genode {
Mode_state mode[Mode_state::MAX]; /* exception mode registers */ Mode_state mode[Mode_state::MAX]; /* exception mode registers */
addr_t fiq_r[5]; /* fast-interrupt mode r8-r12 */ addr_t fiq_r[5]; /* fast-interrupt mode r8-r12 */
}; };
}
#endif /* _INCLUDE__ARM__CPU__CPU_STATE_H_ */ #endif /* _INCLUDE__ARM__CPU__CPU_STATE_H_ */

View File

@ -15,8 +15,8 @@
#ifndef _INCLUDE__ARM__CPU__STRING_H_ #ifndef _INCLUDE__ARM__CPU__STRING_H_
#define _INCLUDE__ARM__CPU__STRING_H_ #define _INCLUDE__ARM__CPU__STRING_H_
namespace Genode namespace Genode {
{
/** /**
* Copy memory block * Copy memory block
* *

View File

@ -16,8 +16,8 @@
#ifndef _INCLUDE__ARM__VFP__STRING_H_ #ifndef _INCLUDE__ARM__VFP__STRING_H_
#define _INCLUDE__ARM__VFP__STRING_H_ #define _INCLUDE__ARM__VFP__STRING_H_
namespace Genode namespace Genode {
{
/** /**
* Copy memory block * Copy memory block
* *

View File

@ -14,7 +14,8 @@
#ifndef _INCLUDE__BASE__AFFINITY_H_ #ifndef _INCLUDE__BASE__AFFINITY_H_
#define _INCLUDE__BASE__AFFINITY_H_ #define _INCLUDE__BASE__AFFINITY_H_
namespace Genode { namespace Genode { class Affinity; }
/** /**
* Affinity to CPU nodes * Affinity to CPU nodes
@ -29,7 +30,7 @@ namespace Genode {
* by 'Affinity::Space'. The rectangle within the grid is represented by * by 'Affinity::Space'. The rectangle within the grid is represented by
* 'Affinity::Location'. * 'Affinity::Location'.
*/ */
class Affinity class Genode::Affinity
{ {
public: public:
@ -182,10 +183,9 @@ namespace Genode {
}; };
Affinity::Location Affinity::Space::location_of_index(int index) Genode::Affinity::Location Genode::Affinity::Space::location_of_index(int index)
{ {
return Location(index % _width, (index / _width) % _height, 1, 1); return Location(index % _width, (index / _width) % _height, 1, 1);
} }
}
#endif /* _INCLUDE__BASE__AFFINITY_H_ */ #endif /* _INCLUDE__BASE__AFFINITY_H_ */

View File

@ -19,7 +19,32 @@
namespace Genode { namespace Genode {
struct Deallocator struct Deallocator;
struct Allocator;
struct Range_allocator;
/**
* Destroy object
*
* For destroying an object, we need to specify the allocator that was used
* by the object. Because we cannot pass the allocator directly to the
* delete expression, we mimic the expression by using this template
* function. The function explicitly calls the object destructor and
* operator delete afterwards.
*
* For details see https://github.com/genodelabs/genode/issues/1030.
*
* \param T implicit object type
*
* \param dealloc reference or pointer to allocator from which the object
* was allocated
* \param obj object to destroy
*/
template <typename T, typename DEALLOC> void destroy(DEALLOC && dealloc, T *obj);
}
struct Genode::Deallocator
{ {
/** /**
* Free block a previously allocated block * Free block a previously allocated block
@ -43,7 +68,7 @@ namespace Genode {
}; };
struct Allocator : Deallocator struct Genode::Allocator : Deallocator
{ {
/** /**
* Exception type * Exception type
@ -114,7 +139,7 @@ namespace Genode {
}; };
struct Range_allocator : Allocator struct Genode::Range_allocator : Allocator
{ {
/** /**
* Destructor * Destructor
@ -201,26 +226,6 @@ namespace Genode {
}; };
/**
* Destroy object
*
* For destroying an object, we need to specify the allocator that was used
* by the object. Because we cannot pass the allocator directly to the
* delete expression, we mimic the expression by using this template
* function. The function explicitly calls the object destructor and
* operator delete afterwards.
*
* For details see https://github.com/genodelabs/genode/issues/1030.
*
* \param T implicit object type
*
* \param dealloc reference or pointer to allocator from which the object
* was allocated
* \param obj object to destroy
*/
template <typename T, typename DEALLOC> void destroy(DEALLOC && dealloc, T *obj);
}
void *operator new (Genode::size_t, Genode::Allocator *); void *operator new (Genode::size_t, Genode::Allocator *);
void *operator new [] (Genode::size_t, Genode::Allocator *); void *operator new [] (Genode::size_t, Genode::Allocator *);

View File

@ -25,7 +25,20 @@
namespace Genode { namespace Genode {
class Allocator_avl_base : public Range_allocator class Allocator_avl_base;
template <typename, unsigned SLAB_BLOCK_SIZE = 256*sizeof(addr_t)>
class Allocator_avl_tpl;
/**
* Define AVL-based allocator without any meta data attached to each block
*/
class Empty { };
typedef Allocator_avl_tpl<Empty> Allocator_avl;
}
class Genode::Allocator_avl_base : public Range_allocator
{ {
private: private:
@ -264,8 +277,8 @@ namespace Genode {
* *
* \param BMDT block meta-data type * \param BMDT block meta-data type
*/ */
template <typename BMDT, unsigned SLAB_BLOCK_SIZE = 256 * sizeof(addr_t)> template <typename BMDT, unsigned SLAB_BLOCK_SIZE>
class Allocator_avl_tpl : public Allocator_avl_base class Genode::Allocator_avl_tpl : public Allocator_avl_base
{ {
protected: protected:
@ -328,12 +341,4 @@ namespace Genode {
} }
}; };
/**
* Define AVL-based allocator without any meta data attached to each block
*/
class Empty { };
typedef Allocator_avl_tpl<Empty> Allocator_avl;
}
#endif /* _INCLUDE__BASE__ALLOCATOR_AVL_H_ */ #endif /* _INCLUDE__BASE__ALLOCATOR_AVL_H_ */

View File

@ -18,13 +18,14 @@
#include <base/printf.h> #include <base/printf.h>
#include <base/stdint.h> #include <base/stdint.h>
namespace Genode { namespace Genode { class Allocator_guard; }
/** /**
* This class acts as guard for arbitrary allocators to limit * This class acts as guard for arbitrary allocators to limit
* memory exhaustion * memory exhaustion
*/ */
class Allocator_guard : public Allocator class Genode::Allocator_guard : public Allocator
{ {
private: private:
@ -67,7 +68,7 @@ namespace Genode {
* undefined in the error case * undefined in the error case
* \return true on success * \return true on success
*/ */
bool alloc(size_t size, void **out_addr) bool alloc(size_t size, void **out_addr) override
{ {
if ((_amount - _consumed) < (size + _allocator->overhead(size))) { if ((_amount - _consumed) < (size + _allocator->overhead(size))) {
PWRN("Quota exceeded! amount=%zu, size=%zu, consumed=%zu", PWRN("Quota exceeded! amount=%zu, size=%zu, consumed=%zu",
@ -83,7 +84,7 @@ namespace Genode {
/** /**
* Free block a previously allocated block * Free block a previously allocated block
*/ */
void free(void *addr, size_t size) void free(void *addr, size_t size) override
{ {
_allocator->free(addr, size); _allocator->free(addr, size);
_consumed -= size + _allocator->overhead(size); _consumed -= size + _allocator->overhead(size);
@ -92,7 +93,7 @@ namespace Genode {
/** /**
* Return amount of backing store consumed by the allocator * Return amount of backing store consumed by the allocator
*/ */
size_t consumed() { return _consumed; } size_t consumed() override { return _consumed; }
/** /**
* Return allocation limit * Return allocation limit
@ -102,11 +103,10 @@ namespace Genode {
/** /**
* Return meta-data overhead per block * Return meta-data overhead per block
*/ */
size_t overhead(size_t size) { return _allocator->overhead(size); } size_t overhead(size_t size) override { return _allocator->overhead(size); }
bool need_size_for_free() const override { bool need_size_for_free() const override {
return _allocator->need_size_for_free(); } return _allocator->need_size_for_free(); }
}; };
}
#endif /* _ALLOCATOR_GUARD_H_ */ #endif /* _ALLOCATOR_GUARD_H_ */

View File

@ -23,6 +23,8 @@
#include <base/exception.h> #include <base/exception.h>
namespace Genode { class Blocking_canceled : public Exception { }; } namespace Genode { class Blocking_canceled; }
class Genode::Blocking_canceled : public Exception { };
#endif /* _INCLUDE__BASE__BLOCKING_H_ */ #endif /* _INCLUDE__BASE__BLOCKING_H_ */

View File

@ -15,6 +15,8 @@
#define _INCLUDE__BASE__CACHE_H_ #define _INCLUDE__BASE__CACHE_H_
namespace Genode { namespace Genode {
enum Cache_attribute { UNCACHED, WRITE_COMBINED, CACHED }; enum Cache_attribute { UNCACHED, WRITE_COMBINED, CACHED };
} }
#endif /* _INCLUDE__BASE__CACHE_H_ */ #endif /* _INCLUDE__BASE__CACHE_H_ */

View File

@ -20,8 +20,11 @@
namespace Genode { namespace Genode {
class Thread_base; class Thread_base;
class Cancelable_lock;
}
class Cancelable_lock
class Genode::Cancelable_lock
{ {
private: private:
@ -90,6 +93,5 @@ namespace Genode {
*/ */
typedef Genode::Lock_guard<Cancelable_lock> Guard; typedef Genode::Lock_guard<Cancelable_lock> Guard;
}; };
}
#endif /* _INCLUDE__BASE__CANCELABLE_LOCK_H_ */ #endif /* _INCLUDE__BASE__CANCELABLE_LOCK_H_ */

View File

@ -33,6 +33,15 @@ namespace Genode {
*/ */
typedef Native_capability Untyped_capability; typedef Native_capability Untyped_capability;
template <typename> class Capability;
template <typename RPC_INTERFACE>
Capability<RPC_INTERFACE> reinterpret_cap_cast(Untyped_capability const &);
template <typename TO_RPC_INTERFACE, typename FROM_RPC_INTERFACE>
Capability<TO_RPC_INTERFACE> static_cap_cast(Capability<FROM_RPC_INTERFACE>);
}
/** /**
* Capability referring to a specific RPC interface * Capability referring to a specific RPC interface
@ -40,7 +49,7 @@ namespace Genode {
* \param RPC_INTERFACE class containing the RPC interface declaration * \param RPC_INTERFACE class containing the RPC interface declaration
*/ */
template <typename RPC_INTERFACE> template <typename RPC_INTERFACE>
class Capability : public Untyped_capability class Genode::Capability : public Untyped_capability
{ {
private: private:
@ -301,8 +310,8 @@ namespace Genode {
* Convert an untyped capability to a typed capability * Convert an untyped capability to a typed capability
*/ */
template <typename RPC_INTERFACE> template <typename RPC_INTERFACE>
Capability<RPC_INTERFACE> Genode::Capability<RPC_INTERFACE>
reinterpret_cap_cast(Untyped_capability const &untyped_cap) Genode::reinterpret_cap_cast(Untyped_capability const &untyped_cap)
{ {
/* /*
* The object layout of untyped and typed capabilities is identical. * The object layout of untyped and typed capabilities is identical.
@ -318,14 +327,13 @@ namespace Genode {
* interface type * interface type
*/ */
template <typename TO_RPC_INTERFACE, typename FROM_RPC_INTERFACE> template <typename TO_RPC_INTERFACE, typename FROM_RPC_INTERFACE>
Capability<TO_RPC_INTERFACE> Genode::Capability<TO_RPC_INTERFACE>
static_cap_cast(Capability<FROM_RPC_INTERFACE> cap) Genode::static_cap_cast(Capability<FROM_RPC_INTERFACE> cap)
{ {
/* check interface compatibility */ /* check interface compatibility */
(void)static_cast<TO_RPC_INTERFACE *>((FROM_RPC_INTERFACE *)0); (void)static_cast<TO_RPC_INTERFACE *>((FROM_RPC_INTERFACE *)0);
return reinterpret_cap_cast<TO_RPC_INTERFACE>(cap); return reinterpret_cap_cast<TO_RPC_INTERFACE>(cap);
} }
}
#endif /* _INCLUDE__BASE__CAPABILITY_H_ */ #endif /* _INCLUDE__BASE__CAPABILITY_H_ */

View File

@ -24,6 +24,11 @@
namespace Genode { namespace Genode {
struct Child_policy;
struct Child;
}
/** /**
* Child policy interface * Child policy interface
* *
@ -32,7 +37,7 @@ namespace Genode {
* it defines how session requests are resolved and how session arguments * it defines how session requests are resolved and how session arguments
* are passed to servers when creating sessions. * are passed to servers when creating sessions.
*/ */
struct Child_policy struct Genode::Child_policy
{ {
virtual ~Child_policy() { } virtual ~Child_policy() { }
@ -153,7 +158,7 @@ namespace Genode {
* to our account, and subsequently transfer the same amount from our * to our account, and subsequently transfer the same amount from our
* account to the client. * account to the client.
*/ */
class Child : protected Rpc_object<Parent> class Genode::Child : protected Rpc_object<Parent>
{ {
private: private:
@ -313,19 +318,18 @@ namespace Genode {
** Parent interface ** ** Parent interface **
**********************/ **********************/
void announce(Service_name const &, Root_capability); void announce(Service_name const &, Root_capability) override;
Session_capability session(Service_name const &, Session_args const &, Session_capability session(Service_name const &, Session_args const &,
Affinity const &); Affinity const &) override;
void upgrade(Session_capability, Upgrade_args const &); void upgrade(Session_capability, Upgrade_args const &) override;
void close(Session_capability); void close(Session_capability) override;
void exit(int); void exit(int) override;
Thread_capability main_thread_cap() const; Thread_capability main_thread_cap() const override;
void resource_avail_sigh(Signal_context_capability); void resource_avail_sigh(Signal_context_capability) override;
void resource_request(Resource_args const &); void resource_request(Resource_args const &) override;
void yield_sigh(Signal_context_capability); void yield_sigh(Signal_context_capability) override;
Resource_args yield_request(); Resource_args yield_request() override;
void yield_response(); void yield_response() override;
}; };
}
#endif /* _INCLUDE__BASE__CHILD_H_ */ #endif /* _INCLUDE__BASE__CHILD_H_ */

View File

@ -17,13 +17,14 @@
#include <base/env.h> #include <base/env.h>
#include <base/capability.h> #include <base/capability.h>
namespace Genode { namespace Genode { template <typename> class Connection; }
/** /**
* Representation of an open connection to a service * Representation of an open connection to a service
*/ */
template <typename SESSION_TYPE> template <typename SESSION_TYPE>
class Connection : public Noncopyable class Genode::Connection : public Noncopyable
{ {
public: public:
@ -110,6 +111,5 @@ namespace Genode {
return _session(affinity, format_args, list); return _session(affinity, format_args, list);
} }
}; };
}
#endif /* _INCLUDE__BASE__CONNECTION_H_ */ #endif /* _INCLUDE__BASE__CONNECTION_H_ */

View File

@ -16,9 +16,10 @@
#include <stdarg.h> #include <stdarg.h>
namespace Genode { namespace Genode { class Console; }
class Console
class Genode::Console
{ {
public: public:
@ -55,6 +56,5 @@ namespace Genode {
template <typename T> void _out_unsigned(T value, unsigned base = 10, int pad = 0); template <typename T> void _out_unsigned(T value, unsigned base = 10, int pad = 0);
template <typename T> void _out_signed(T value, unsigned base = 10); template <typename T> void _out_signed(T value, unsigned base = 10);
}; };
}
#endif /* _INCLUDE__BASE__CONSOLE_H_ */ #endif /* _INCLUDE__BASE__CONSOLE_H_ */

View File

@ -19,8 +19,11 @@
namespace Genode { namespace Genode {
class Elf_segment; class Elf_segment;
class Elf_binary;
}
class Elf_binary
class Genode::Elf_binary
{ {
public: public:
@ -113,7 +116,7 @@ namespace Genode {
}; };
class Elf_segment class Genode::Elf_segment
{ {
public: public:
@ -152,6 +155,5 @@ namespace Genode {
size_t _mem_size; size_t _mem_size;
Elf_binary::Flags _flags; Elf_binary::Flags _flags;
}; };
}
#endif /* _INCLUDE__BASE__ELF_H_ */ #endif /* _INCLUDE__BASE__ELF_H_ */

View File

@ -30,10 +30,22 @@
namespace Genode { namespace Genode {
class Env struct Env;
{
public:
extern Env *env();
/**
* Return parent capability
*
* Platforms have to implement this function for environment
* initialization.
*/
Parent_capability parent_cap();
}
struct Genode::Env
{
virtual ~Env() { } virtual ~Env() { }
/** /**
@ -75,15 +87,6 @@ namespace Genode {
virtual Allocator *heap() = 0; virtual Allocator *heap() = 0;
}; };
extern Env *env();
/**
* Return parent capability
*
* Platforms have to implement this function for environment
* initialization.
*/
Parent_capability parent_cap();
}
#endif /* _INCLUDE__BASE__ENV_H_ */ #endif /* _INCLUDE__BASE__ENV_H_ */

View File

@ -14,6 +14,8 @@
#ifndef _INCLUDE__BASE__EXCEPTION_H_ #ifndef _INCLUDE__BASE__EXCEPTION_H_
#define _INCLUDE__BASE__EXCEPTION_H_ #define _INCLUDE__BASE__EXCEPTION_H_
namespace Genode { class Exception { }; } namespace Genode { class Exception; }
class Genode::Exception { };
#endif /* _INCLUDE__BASE__EXCEPTION_H_ */ #endif /* _INCLUDE__BASE__EXCEPTION_H_ */

View File

@ -19,10 +19,13 @@
namespace Genode { namespace Genode {
class Flexpage struct Flexpage;
{ class Flexpage_iterator;
public: }
struct Genode::Flexpage
{
addr_t addr; addr_t addr;
addr_t hotspot; addr_t hotspot;
size_t log2_order; size_t log2_order;
@ -36,8 +39,8 @@ namespace Genode {
}; };
class Flexpage_iterator { class Genode::Flexpage_iterator
{
private: private:
addr_t _src_start, _src_size; addr_t _src_start, _src_size;
@ -61,7 +64,8 @@ namespace Genode {
Flexpage_iterator(addr_t src_start, size_t src_size, Flexpage_iterator(addr_t src_start, size_t src_size,
addr_t dst_start, size_t dst_size, addr_t dst_start, size_t dst_size,
addr_t hotspot) : addr_t hotspot)
:
_src_start(src_start), _src_size(src_size), _src_start(src_start), _src_size(src_size),
_dst_start(dst_start), _dst_size(dst_size), _dst_start(dst_start), _dst_size(dst_size),
_hotspot(hotspot), _offset(0) _hotspot(hotspot), _offset(0)
@ -109,5 +113,4 @@ namespace Genode {
} }
}; };
}
#endif /* _INCLUDE__BASE__FLEX_ITERATOR_H */ #endif /* _INCLUDE__BASE__FLEX_ITERATOR_H */

View File

@ -22,13 +22,18 @@
namespace Genode { namespace Genode {
class Heap;
class Sliced_heap;
}
/** /**
* Heap that uses dataspaces as backing store * Heap that uses dataspaces as backing store
* *
* The heap class provides an allocator that uses a list of dataspaces of a ram * The heap class provides an allocator that uses a list of dataspaces of a ram
* session as backing store. One dataspace may be used for holding multiple blocks. * session as backing store. One dataspace may be used for holding multiple blocks.
*/ */
class Heap : public Allocator class Genode::Heap : public Allocator
{ {
private: private:
@ -163,10 +168,10 @@ namespace Genode {
** Allocator interface ** ** Allocator interface **
*************************/ *************************/
bool alloc(size_t, void **); bool alloc(size_t, void **) override;
void free(void *, size_t); void free(void *, size_t) override;
size_t consumed() { return _quota_used; } size_t consumed() override { return _quota_used; }
size_t overhead(size_t size) { return _alloc.overhead(size); } size_t overhead(size_t size) override { return _alloc.overhead(size); }
bool need_size_for_free() const override { return false; } bool need_size_for_free() const override { return false; }
}; };
@ -174,7 +179,7 @@ namespace Genode {
/** /**
* Heap that allocates each block at a separate dataspace * Heap that allocates each block at a separate dataspace
*/ */
class Sliced_heap : public Allocator class Genode::Sliced_heap : public Allocator
{ {
private: private:
@ -209,6 +214,5 @@ namespace Genode {
size_t overhead(size_t size); size_t overhead(size_t size);
bool need_size_for_free() const override { return false; } bool need_size_for_free() const override { return false; }
}; };
}
#endif /* _INCLUDE__BASE__HEAP_H_ */ #endif /* _INCLUDE__BASE__HEAP_H_ */

View File

@ -38,18 +38,26 @@ namespace Genode {
enum Ipc_server_reply { IPC_REPLY }; enum Ipc_server_reply { IPC_REPLY };
enum Ipc_server_reply_wait { IPC_REPLY_WAIT }; enum Ipc_server_reply_wait { IPC_REPLY_WAIT };
class Ipc_error;
class Ipc_marshaller;
class Ipc_unmarshaller;
class Ipc_ostream;
class Ipc_istream;
class Ipc_client;
class Ipc_server;
}
/*********************
** Exception types **
*********************/
class Ipc_error : public Exception { }; /**
* Exception type
*/
class Genode::Ipc_error : public Exception { };
/** /**
* Marshal arguments into send message buffer * Marshal arguments into send message buffer
*/ */
class Ipc_marshaller class Genode::Ipc_marshaller
{ {
protected: protected:
@ -124,7 +132,7 @@ namespace Genode {
/** /**
* Unmarshal arguments from receive buffer * Unmarshal arguments from receive buffer
*/ */
class Ipc_unmarshaller class Genode::Ipc_unmarshaller
{ {
protected: protected:
@ -204,7 +212,7 @@ namespace Genode {
/** /**
* Stream for sending information via a capability to an endpoint * Stream for sending information via a capability to an endpoint
*/ */
class Ipc_ostream : public Ipc_marshaller class Genode::Ipc_ostream : public Ipc_marshaller
{ {
protected: protected:
@ -303,7 +311,7 @@ namespace Genode {
/** /**
* Stream for receiving information * Stream for receiving information
*/ */
class Ipc_istream : public Ipc_unmarshaller, public Native_capability class Genode::Ipc_istream : public Ipc_unmarshaller, public Native_capability
{ {
private: private:
@ -408,7 +416,7 @@ namespace Genode {
}; };
class Ipc_client: public Ipc_istream, public Ipc_ostream class Genode::Ipc_client: public Ipc_istream, public Ipc_ostream
{ {
protected: protected:
@ -515,7 +523,7 @@ namespace Genode {
}; };
class Ipc_server : public Ipc_istream, public Ipc_ostream class Genode::Ipc_server : public Ipc_istream, public Ipc_ostream
{ {
protected: protected:
@ -625,6 +633,5 @@ namespace Genode {
return *this; return *this;
} }
}; };
}
#endif /* _INCLUDE__BASE__IPC_GENERIC_H_ */ #endif /* _INCLUDE__BASE__IPC_GENERIC_H_ */

View File

@ -16,9 +16,10 @@
#include <base/cancelable_lock.h> #include <base/cancelable_lock.h>
namespace Genode { namespace Genode { class Lock; }
class Lock : public Cancelable_lock
class Genode::Lock : public Cancelable_lock
{ {
public: public:
@ -42,6 +43,5 @@ namespace Genode {
*/ */
typedef Lock_guard<Lock> Guard; typedef Lock_guard<Lock> Guard;
}; };
}
#endif /* _INCLUDE__BASE__LOCK_H_ */ #endif /* _INCLUDE__BASE__LOCK_H_ */

View File

@ -21,7 +21,8 @@
#ifndef _INCLUDE__BASE__LOCK_GUARD_H_ #ifndef _INCLUDE__BASE__LOCK_GUARD_H_
#define _INCLUDE__BASE__LOCK_GUARD_H_ #define _INCLUDE__BASE__LOCK_GUARD_H_
namespace Genode { namespace Genode { template <typename> class Lock_guard; }
/** /**
* Lock guard template * Lock guard template
@ -29,7 +30,7 @@ namespace Genode {
* \param LT lock type * \param LT lock type
*/ */
template <typename LT> template <typename LT>
class Lock_guard class Genode::Lock_guard
{ {
private: private:
@ -41,6 +42,5 @@ namespace Genode {
~Lock_guard() { _lock.unlock(); } ~Lock_guard() { _lock.unlock(); }
}; };
}
#endif /* _INCLUDE__BASE__LOCK_GUARD_H_ */ #endif /* _INCLUDE__BASE__LOCK_GUARD_H_ */

View File

@ -18,7 +18,8 @@
#ifndef _INCLUDE__BASE__NATIVE_CAPABILITY_H_ #ifndef _INCLUDE__BASE__NATIVE_CAPABILITY_H_
#define _INCLUDE__BASE__NATIVE_CAPABILITY_H_ #define _INCLUDE__BASE__NATIVE_CAPABILITY_H_
namespace Genode { namespace Genode { template <typename> class Native_capability_tpl; }
/** /**
* Generic parts of the platform-specific 'Native_capability' * Generic parts of the platform-specific 'Native_capability'
@ -41,7 +42,7 @@ namespace Genode {
* 'invalid' function produces an invalid destination. * 'invalid' function produces an invalid destination.
*/ */
template <typename POLICY> template <typename POLICY>
class Native_capability_tpl class Genode::Native_capability_tpl
{ {
public: public:
@ -113,7 +114,6 @@ namespace Genode {
*/ */
Dst dst() const { return _dst; } Dst dst() const { return _dst; }
}; };
}
#endif /* _INCLUDE__BASE__NATIVE_CAPABILITY_H_ */ #endif /* _INCLUDE__BASE__NATIVE_CAPABILITY_H_ */

View File

@ -19,7 +19,8 @@
#include <base/capability.h> #include <base/capability.h>
#include <base/lock.h> #include <base/lock.h>
namespace Genode { namespace Genode { template <typename> class Object_pool; }
/** /**
* Map object ids to local objects * Map object ids to local objects
@ -30,7 +31,7 @@ namespace Genode {
* objects managed by one and the same object pool. * objects managed by one and the same object pool.
*/ */
template <typename OBJ_TYPE> template <typename OBJ_TYPE>
class Object_pool class Genode::Object_pool
{ {
public: public:
@ -211,6 +212,5 @@ namespace Genode {
return obj_typed; return obj_typed;
} }
}; };
}
#endif /* _INCLUDE__BASE__OBJECT_POOL_H_ */ #endif /* _INCLUDE__BASE__OBJECT_POOL_H_ */

View File

@ -27,6 +27,14 @@
namespace Genode { namespace Genode {
class Pager_object;
class Pager_entrypoint;
class Pager_activation_base;
template <int> class Pager_activation;
}
/** /**
* Special server object for paging * Special server object for paging
* *
@ -34,7 +42,7 @@ namespace Genode {
* special implementation for page-fault handling, which does not allow to * special implementation for page-fault handling, which does not allow to
* define a "badge" for pager capabilities. * define a "badge" for pager capabilities.
*/ */
class Pager_object : public Object_pool<Pager_object>::Entry class Genode::Pager_object : public Object_pool<Pager_object>::Entry
{ {
protected: protected:
@ -117,11 +125,11 @@ namespace Genode {
void unresolved_page_fault_occurred(); void unresolved_page_fault_occurred();
}; };
/** /**
* A 'Pager_activation' processes one page fault of a 'Pager_object' at a time. * A 'Pager_activation' processes one page fault of a 'Pager_object' at a time.
*/ */
class Pager_entrypoint; class Genode::Pager_activation_base: public Thread_base
class Pager_activation_base: public Thread_base
{ {
private: private:
@ -173,7 +181,7 @@ namespace Genode {
* For a paging entry point can hold only one activation. So, paging is * For a paging entry point can hold only one activation. So, paging is
* strictly serialized for one entry point. * strictly serialized for one entry point.
*/ */
class Pager_entrypoint : public Object_pool<Pager_object> class Genode::Pager_entrypoint : public Object_pool<Pager_object>
{ {
private: private:
@ -205,13 +213,12 @@ namespace Genode {
template <int STACK_SIZE> template <int STACK_SIZE>
class Pager_activation : public Pager_activation_base class Genode::Pager_activation : public Pager_activation_base
{ {
public: public:
Pager_activation() : Pager_activation_base("pager", STACK_SIZE) Pager_activation() : Pager_activation_base("pager", STACK_SIZE)
{ start(); } { start(); }
}; };
}
#endif /* _INCLUDE__BASE__PAGER_H_ */ #endif /* _INCLUDE__BASE__PAGER_H_ */

View File

@ -20,9 +20,10 @@
#include <cpu_session/client.h> #include <cpu_session/client.h>
#include <parent/capability.h> #include <parent/capability.h>
namespace Genode { namespace Genode { class Process; }
class Process
class Genode::Process
{ {
private: private:
@ -90,6 +91,5 @@ namespace Genode {
Thread_capability main_thread_cap() const { return _thread0_cap; } Thread_capability main_thread_cap() const { return _thread0_cap; }
}; };
}
#endif /* _INCLUDE__BASE__PROCESS_H_ */ #endif /* _INCLUDE__BASE__PROCESS_H_ */

View File

@ -19,10 +19,15 @@
namespace Genode { namespace Genode {
class Rpc_in_buffer_base;
template <size_t> class Rpc_in_buffer;
}
/** /**
* Base class of 'Rpc_in_buffer' * Base class of 'Rpc_in_buffer'
*/ */
class Rpc_in_buffer_base class Genode::Rpc_in_buffer_base
{ {
protected: protected:
@ -56,8 +61,8 @@ namespace Genode {
/** /**
* Buffer with size constrain * Buffer with size constrain
*/ */
template <size_t MAX> template <Genode::size_t MAX>
class Rpc_in_buffer : public Rpc_in_buffer_base class Genode::Rpc_in_buffer : public Rpc_in_buffer_base
{ {
private: private:
@ -116,6 +121,5 @@ namespace Genode {
*/ */
char const *string() const { return is_valid_string() ? base() : ""; } char const *string() const { return is_valid_string() ? base() : ""; }
}; };
}
#endif /* _INCLUDE__BASE__RPC_ARGS_H_ */ #endif /* _INCLUDE__BASE__RPC_ARGS_H_ */

View File

@ -24,6 +24,12 @@
#include <cap_session/cap_session.h> #include <cap_session/cap_session.h>
namespace Genode { namespace Genode {
template <typename, typename> class Rpc_dispatcher;
class Rpc_object_base;
template <typename, typename> struct Rpc_object;
class Rpc_entrypoint;
}
/** /**
* RPC dispatcher implementing the specified RPC interface * RPC dispatcher implementing the specified RPC interface
@ -43,7 +49,7 @@ namespace Genode {
* omits virtual functions calls. * omits virtual functions calls.
*/ */
template <typename RPC_INTERFACE, typename SERVER = RPC_INTERFACE> template <typename RPC_INTERFACE, typename SERVER = RPC_INTERFACE>
class Rpc_dispatcher : public RPC_INTERFACE class Genode::Rpc_dispatcher : public RPC_INTERFACE
{ {
/** /**
* Shortcut for the type list of RPC functions provided by this server * Shortcut for the type list of RPC functions provided by this server
@ -175,7 +181,7 @@ namespace Genode {
}; };
class Rpc_object_base : public Object_pool<Rpc_object_base>::Entry class Genode::Rpc_object_base : public Object_pool<Rpc_object_base>::Entry
{ {
public: public:
@ -200,7 +206,7 @@ namespace Genode {
* when attaching a 'Rpc_object' to a 'Rpc_entrypoint'. * when attaching a 'Rpc_object' to a 'Rpc_entrypoint'.
*/ */
template <typename RPC_INTERFACE, typename SERVER = RPC_INTERFACE> template <typename RPC_INTERFACE, typename SERVER = RPC_INTERFACE>
struct Rpc_object : Rpc_object_base, Rpc_dispatcher<RPC_INTERFACE, SERVER> struct Genode::Rpc_object : Rpc_object_base, Rpc_dispatcher<RPC_INTERFACE, SERVER>
{ {
/***************************** /*****************************
** Server-object interface ** ** Server-object interface **
@ -230,7 +236,7 @@ namespace Genode {
* shortcut for the common case where the server's capability is handed * shortcut for the common case where the server's capability is handed
* over to other parties _after_ the server is completely initialized. * over to other parties _after_ the server is completely initialized.
*/ */
class Rpc_entrypoint : Thread_base, public Object_pool<Rpc_object_base> class Genode::Rpc_entrypoint : Thread_base, public Object_pool<Rpc_object_base>
{ {
private: private:
@ -388,6 +394,5 @@ namespace Genode {
*/ */
bool is_myself() const; bool is_myself() const;
}; };
}
#endif /* _INCLUDE__BASE__RPC_SERVER_H_ */ #endif /* _INCLUDE__BASE__RPC_SERVER_H_ */

View File

@ -21,13 +21,18 @@
namespace Genode { namespace Genode {
struct Semaphore_queue;
class Fifo_semaphore_queue;
template <typename, typename> class Semaphore_template;
}
/** /**
* Semaphore queue interface * Semaphore queue interface
*/ */
class Semaphore_queue struct Genode::Semaphore_queue
{ {
public:
/** /**
* Semaphore-queue elements * Semaphore-queue elements
* *
@ -62,7 +67,7 @@ namespace Genode {
/** /**
* First-in-first-out variant of the semaphore-queue interface * First-in-first-out variant of the semaphore-queue interface
*/ */
class Fifo_semaphore_queue : public Semaphore_queue class Genode::Fifo_semaphore_queue : public Semaphore_queue
{ {
public: public:
@ -94,7 +99,7 @@ namespace Genode {
* such as priority-sorted queueing can be easily supported. * such as priority-sorted queueing can be easily supported.
*/ */
template <typename QT, typename QTE> template <typename QT, typename QTE>
class Semaphore_template class Genode::Semaphore_template
{ {
protected: protected:
@ -166,6 +171,8 @@ namespace Genode {
}; };
namespace Genode {
/** /**
* Semaphore with default behaviour * Semaphore with default behaviour
*/ */

View File

@ -22,6 +22,16 @@
namespace Genode { namespace Genode {
class Client;
class Server;
class Service;
class Local_service;
class Parent_service;
class Child_service;
class Service_registry;
}
/** /**
* Client role * Client role
* *
@ -29,7 +39,7 @@ namespace Genode {
* available yet, we enqueue the client into a wait queue and wake him up * available yet, we enqueue the client into a wait queue and wake him up
* as soon as the requested service gets available. * as soon as the requested service gets available.
*/ */
class Client : public List<Client>::Element class Genode::Client : public List<Client>::Element
{ {
private: private:
@ -66,7 +76,7 @@ namespace Genode {
* most part, this class is used as an opaque key to represent the server * most part, this class is used as an opaque key to represent the server
* role. * role.
*/ */
class Server class Genode::Server
{ {
private: private:
@ -89,7 +99,7 @@ namespace Genode {
}; };
class Service : public List<Service>::Element class Genode::Service : public List<Service>::Element
{ {
public: public:
@ -166,7 +176,7 @@ namespace Genode {
/** /**
* Representation of a locally implemented service * Representation of a locally implemented service
*/ */
class Local_service : public Service class Genode::Local_service : public Service
{ {
private: private:
@ -177,7 +187,7 @@ namespace Genode {
Local_service(const char *name, Root *root) Local_service(const char *name, Root *root)
: Service(name), _root(root) { } : Service(name), _root(root) { }
Session_capability session(const char *args, Affinity const &affinity) Session_capability session(const char *args, Affinity const &affinity) override
{ {
try { return _root->session(args, affinity); } try { return _root->session(args, affinity); }
catch (Root::Invalid_args) { throw Invalid_args(); } catch (Root::Invalid_args) { throw Invalid_args(); }
@ -186,13 +196,13 @@ namespace Genode {
catch (Genode::Ipc_error) { throw Unavailable(); } catch (Genode::Ipc_error) { throw Unavailable(); }
} }
void upgrade(Session_capability session, const char *args) void upgrade(Session_capability session, const char *args) override
{ {
try { _root->upgrade(session, args); } try { _root->upgrade(session, args); }
catch (Genode::Ipc_error) { throw Unavailable(); } catch (Genode::Ipc_error) { throw Unavailable(); }
} }
void close(Session_capability session) void close(Session_capability session) override
{ {
try { _root->close(session); } try { _root->close(session); }
catch (Genode::Ipc_error) { throw Blocking_canceled(); } catch (Genode::Ipc_error) { throw Blocking_canceled(); }
@ -203,13 +213,13 @@ namespace Genode {
/** /**
* Representation of a service provided by our parent * Representation of a service provided by our parent
*/ */
class Parent_service : public Service class Genode::Parent_service : public Service
{ {
public: public:
Parent_service(const char *name) : Service(name) { } Parent_service(const char *name) : Service(name) { }
Session_capability session(const char *args, Affinity const &affinity) Session_capability session(const char *args, Affinity const &affinity) override
{ {
try { return env()->parent()->session(name(), args, affinity); } try { return env()->parent()->session(name(), args, affinity); }
catch (Parent::Unavailable) { catch (Parent::Unavailable) {
@ -220,13 +230,13 @@ namespace Genode {
catch (Genode::Ipc_error) { throw Unavailable(); } catch (Genode::Ipc_error) { throw Unavailable(); }
} }
void upgrade(Session_capability session, const char *args) void upgrade(Session_capability session, const char *args) override
{ {
try { env()->parent()->upgrade(session, args); } try { env()->parent()->upgrade(session, args); }
catch (Genode::Ipc_error) { throw Unavailable(); } catch (Genode::Ipc_error) { throw Unavailable(); }
} }
void close(Session_capability session) void close(Session_capability session) override
{ {
try { env()->parent()->close(session); } try { env()->parent()->close(session); }
catch (Genode::Ipc_error) { throw Blocking_canceled(); } catch (Genode::Ipc_error) { throw Blocking_canceled(); }
@ -237,7 +247,7 @@ namespace Genode {
/** /**
* Representation of a service that is implemented in a child * Representation of a service that is implemented in a child
*/ */
class Child_service : public Service class Genode::Child_service : public Service
{ {
private: private:
@ -259,9 +269,9 @@ namespace Genode {
Server *server) Server *server)
: Service(name), _root_cap(root), _root(root), _server(server) { } : Service(name), _root_cap(root), _root(root), _server(server) { }
Server *server() const { return _server; } Server *server() const override { return _server; }
Session_capability session(const char *args, Affinity const &affinity) Session_capability session(const char *args, Affinity const &affinity) override
{ {
if (!_root_cap.valid()) if (!_root_cap.valid())
throw Unavailable(); throw Unavailable();
@ -273,7 +283,7 @@ namespace Genode {
catch (Genode::Ipc_error) { throw Unavailable(); } catch (Genode::Ipc_error) { throw Unavailable(); }
} }
void upgrade(Session_capability sc, const char *args) void upgrade(Session_capability sc, const char *args) override
{ {
if (!_root_cap.valid()) if (!_root_cap.valid())
throw Unavailable(); throw Unavailable();
@ -285,7 +295,7 @@ namespace Genode {
catch (Genode::Ipc_error) { throw Unavailable(); } catch (Genode::Ipc_error) { throw Unavailable(); }
} }
void close(Session_capability sc) void close(Session_capability sc) override
{ {
try { _root.close(sc); } try { _root.close(sc); }
catch (Genode::Ipc_error) { throw Blocking_canceled(); } catch (Genode::Ipc_error) { throw Blocking_canceled(); }
@ -296,7 +306,7 @@ namespace Genode {
/** /**
* Container for holding service representations * Container for holding service representations
*/ */
class Service_registry class Genode::Service_registry
{ {
protected: protected:
@ -440,6 +450,5 @@ namespace Genode {
remove(_services.first()); remove(_services.first());
} }
}; };
}
#endif /* _INCLUDE__BASE__SERVICE_H_ */ #endif /* _INCLUDE__BASE__SERVICE_H_ */

View File

@ -11,10 +11,12 @@
#include <base/stdint.h> #include <base/stdint.h>
namespace Genode { namespace Genode {
class Shared_object; class Shared_object;
struct Address_info; struct Address_info;
}; };
class Genode::Shared_object class Genode::Shared_object
{ {
private: private:

View File

@ -30,6 +30,11 @@ namespace Genode {
class Signal_receiver; class Signal_receiver;
class Signal_context; class Signal_context;
class Signal_context_registry; class Signal_context_registry;
class Signal_transmitter;
class Signal;
class Signal_dispatcher_base;
template <typename> class Signal_dispatcher;
}
/** /**
@ -49,7 +54,7 @@ namespace Genode {
* can be used by the receiver to distinguish signals coming from different * can be used by the receiver to distinguish signals coming from different
* transmitters. * transmitters.
*/ */
class Signal class Genode::Signal
{ {
private: private:
@ -102,7 +107,6 @@ namespace Genode {
}; };
/** /**
* Signal transmitter * Signal transmitter
* *
@ -111,7 +115,7 @@ namespace Genode {
* transmitter such as the consumed memory 'sizeof(Signal_transmitter)' * transmitter such as the consumed memory 'sizeof(Signal_transmitter)'
* should be accounted to the owner of the context. * should be accounted to the owner of the context.
*/ */
class Signal_transmitter class Genode::Signal_transmitter
{ {
private: private:
@ -151,7 +155,7 @@ namespace Genode {
/** /**
* Signal receiver * Signal receiver
*/ */
class Signal_receiver : Noncopyable class Genode::Signal_receiver : Noncopyable
{ {
private: private:
@ -260,7 +264,7 @@ namespace Genode {
* signel. This enables the receiver to distinguish different signal sources * signel. This enables the receiver to distinguish different signal sources
* and dispatch incoming signals context-specific. * and dispatch incoming signals context-specific.
*/ */
class Signal_context class Genode::Signal_context
{ {
private: private:
@ -289,7 +293,6 @@ namespace Genode {
Lock _destroy_lock; /* prevent destruction while the Lock _destroy_lock; /* prevent destruction while the
context is in use */ context is in use */
/** /**
* Capability assigned to this context after being assocated with * Capability assigned to this context after being assocated with
* a 'Signal_receiver' via the 'manage' function. We store this * a 'Signal_receiver' via the 'manage' function. We store this
@ -342,7 +345,7 @@ namespace Genode {
/** /**
* Abstract interface to be implemented by signal dispatchers * Abstract interface to be implemented by signal dispatchers
*/ */
struct Signal_dispatcher_base : Signal_context struct Genode::Signal_dispatcher_base : Signal_context
{ {
virtual void dispatch(unsigned num) = 0; virtual void dispatch(unsigned num) = 0;
}; };
@ -361,7 +364,7 @@ namespace Genode {
* \param T type of signal-handling class * \param T type of signal-handling class
*/ */
template <typename T> template <typename T>
class Signal_dispatcher : public Signal_dispatcher_base, class Genode::Signal_dispatcher : public Signal_dispatcher_base,
public Signal_context_capability public Signal_context_capability
{ {
private: private:
@ -392,6 +395,5 @@ namespace Genode {
void dispatch(unsigned num) { (obj.*member)(num); } void dispatch(unsigned num) { (obj.*member)(num); }
}; };
}
#endif /* _INCLUDE__BASE__SIGNAL_H__ */ #endif /* _INCLUDE__BASE__SIGNAL_H__ */

View File

@ -20,13 +20,15 @@
namespace Genode { namespace Genode {
class Slab; class Slab;
class Slab_block;
class Slab_entry; class Slab_entry;
class Allocator; }
/** /**
* A slab block holds an array of slab entries. * A slab block holds an array of slab entries.
*/ */
class Slab_block class Genode::Slab_block
{ {
public: public:
@ -118,7 +120,7 @@ namespace Genode {
}; };
class Slab_entry class Genode::Slab_entry
{ {
private: private:
@ -160,7 +162,7 @@ namespace Genode {
/** /**
* Slab allocator * Slab allocator
*/ */
class Slab : public Allocator class Genode::Slab : public Allocator
{ {
private: private:
@ -253,6 +255,5 @@ namespace Genode {
size_t overhead(size_t) { return _block_size/_num_elem; } size_t overhead(size_t) { return _block_size/_num_elem; }
bool need_size_for_free() const override { return false; } bool need_size_for_free() const override { return false; }
}; };
}
#endif /* _INCLUDE__BASE__SLAB_H_ */ #endif /* _INCLUDE__BASE__SLAB_H_ */

View File

@ -19,7 +19,19 @@
namespace Genode { namespace Genode {
class String_console : public Console class String_console;
/**
* Print format string into character buffer
*
* \return number of characters written to destination buffer
*/
inline int snprintf(char *, size_t, const char *, ...)
__attribute__((format(printf, 3, 4)));
}
class Genode::String_console : public Console
{ {
private: private:
@ -49,7 +61,7 @@ namespace Genode {
** Console interface ** ** Console interface **
***********************/ ***********************/
void _out_char(char c) void _out_char(char c) override
{ {
/* ensure to leave space for null-termination */ /* ensure to leave space for null-termination */
if (_w_offset + 2 > _dst_len) if (_w_offset + 2 > _dst_len)
@ -60,13 +72,8 @@ namespace Genode {
} }
}; };
/**
* Print format string into character buffer inline int Genode::snprintf(char *dst, size_t dst_len, const char *format, ...)
*
* \return number of characters written to destination buffer
*/
inline int snprintf(char *, size_t, const char *, ...) __attribute__((format(printf, 3, 4)));
inline int snprintf(char *dst, size_t dst_len, const char *format, ...)
{ {
va_list list; va_list list;
va_start(list, format); va_start(list, format);
@ -77,6 +84,5 @@ namespace Genode {
va_end(list); va_end(list);
return sc.len(); return sc.len();
} }
}
#endif /* _INCLUDE__BASE__SNPRINTF_H_ */ #endif /* _INCLUDE__BASE__SNPRINTF_H_ */

View File

@ -19,6 +19,11 @@
namespace Genode { namespace Genode {
template <typename> class Synchronized_allocator;
template <typename> class Synchronized_range_allocator;
}
/** /**
* Lock-guarded allocator * Lock-guarded allocator
* *
@ -29,7 +34,7 @@ namespace Genode {
* interface * interface
*/ */
template <typename ALLOCATOR_IMPL> template <typename ALLOCATOR_IMPL>
class Synchronized_allocator : public Allocator class Genode::Synchronized_allocator : public Allocator
{ {
private: private:
@ -69,25 +74,25 @@ namespace Genode {
** Allocator interface ** ** Allocator interface **
*************************/ *************************/
bool alloc(size_t size, void **out_addr) bool alloc(size_t size, void **out_addr) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.alloc(size, out_addr); return _alloc.alloc(size, out_addr);
} }
void free(void *addr, size_t size) void free(void *addr, size_t size) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
_alloc.free(addr, size); _alloc.free(addr, size);
} }
size_t consumed() size_t consumed() override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.consumed(); return _alloc.consumed();
} }
size_t overhead(size_t size) size_t overhead(size_t size) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.overhead(size); return _alloc.overhead(size);
@ -100,6 +105,7 @@ namespace Genode {
} }
}; };
/** /**
* Lock-guarded range allocator * Lock-guarded range allocator
* *
@ -110,7 +116,7 @@ namespace Genode {
* interface * interface
*/ */
template <typename ALLOCATOR_IMPL> template <typename ALLOCATOR_IMPL>
class Synchronized_range_allocator : public Range_allocator class Genode::Synchronized_range_allocator : public Range_allocator
{ {
private: private:
@ -173,25 +179,25 @@ namespace Genode {
** Allocator interface ** ** Allocator interface **
*************************/ *************************/
bool alloc(size_t size, void **out_addr) bool alloc(size_t size, void **out_addr) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.alloc(size, out_addr); return _alloc.alloc(size, out_addr);
} }
void free(void *addr, size_t size) void free(void *addr, size_t size) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
_alloc.free(addr, size); _alloc.free(addr, size);
} }
size_t consumed() size_t consumed() override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.consumed(); return _alloc.consumed();
} }
size_t overhead(size_t size) size_t overhead(size_t size) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.overhead(size); return _alloc.overhead(size);
@ -208,48 +214,48 @@ namespace Genode {
** Range-allocator interface ** ** Range-allocator interface **
*******************************/ *******************************/
int add_range(addr_t base, size_t size) int add_range(addr_t base, size_t size) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.add_range(base, size); return _alloc.add_range(base, size);
} }
int remove_range(addr_t base, size_t size) int remove_range(addr_t base, size_t size) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.remove_range(base, size); return _alloc.remove_range(base, size);
} }
Alloc_return alloc_aligned(size_t size, void **out_addr, int align = 0, addr_t from = 0, addr_t to = ~0UL) Alloc_return alloc_aligned(size_t size, void **out_addr, int align = 0,
addr_t from = 0, addr_t to = ~0UL) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.alloc_aligned(size, out_addr, align, from, to); return _alloc.alloc_aligned(size, out_addr, align, from, to);
} }
Alloc_return alloc_addr(size_t size, addr_t addr) Alloc_return alloc_addr(size_t size, addr_t addr) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.alloc_addr(size, addr); return _alloc.alloc_addr(size, addr);
} }
void free(void *addr) void free(void *addr) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
_alloc.free(addr); _alloc.free(addr);
} }
size_t avail() size_t avail() override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.avail(); return _alloc.avail();
} }
bool valid_addr(addr_t addr) bool valid_addr(addr_t addr) override
{ {
Lock::Guard lock_guard(*_lock); Lock::Guard lock_guard(*_lock);
return _alloc.valid_addr(addr); return _alloc.valid_addr(addr);
} }
}; };
}
#endif /* _INCLUDE__BASE__SYNC_ALLOCATOR_H_ */ #endif /* _INCLUDE__BASE__SYNC_ALLOCATOR_H_ */

View File

@ -9,23 +9,23 @@
* area, each thread has a fixed-sized slot, a thread context. The layout of * area, each thread has a fixed-sized slot, a thread context. The layout of
* each thread context looks as follows * each thread context looks as follows
* *
* ! lower address * ; lower address
* ! ... * ; ...
* ! ============================ <- aligned at the virtual context size * ; ============================ <- aligned at the virtual context size
* ! * ;
* ! empty * ; empty
* ! * ;
* ! ---------------------------- * ; ----------------------------
* ! * ;
* ! stack * ; stack
* ! (top) <- initial stack pointer * ; (top) <- initial stack pointer
* ! ---------------------------- <- address of 'Context' object * ; ---------------------------- <- address of 'Context' object
* ! additional context members * ; additional context members
* ! ---------------------------- * ; ----------------------------
* ! UTCB * ; UTCB
* ! ============================ <- aligned at the virtual context size * ; ============================ <- aligned at the virtual context size
* ! ... * ; ...
* ! higher address * ; higher address
* *
* On some platforms, a user-level thread-control block (UTCB) area contains * On some platforms, a user-level thread-control block (UTCB) area contains
* data shared between the user-level thread and the kernel. It is typically * data shared between the user-level thread and the kernel. It is typically
@ -69,6 +69,10 @@
namespace Genode { namespace Genode {
class Rm_session; class Rm_session;
class Thread_base;
template <unsigned> class Thread;
}
/** /**
* Concurrent control flow * Concurrent control flow
@ -76,7 +80,7 @@ namespace Genode {
* A 'Thread_base' object corresponds to a physical thread. The execution * A 'Thread_base' object corresponds to a physical thread. The execution
* starts at the 'entry()' function as soon as 'start()' is called. * starts at the 'entry()' function as soon as 'start()' is called.
*/ */
class Thread_base class Genode::Thread_base
{ {
public: public:
@ -509,7 +513,7 @@ namespace Genode {
template <unsigned STACK_SIZE> template <unsigned STACK_SIZE>
class Thread : public Thread_base class Genode::Thread : public Thread_base
{ {
public: public:
@ -547,6 +551,5 @@ namespace Genode {
: Thread_base(0, name, STACK_SIZE, Type::NORMAL, cpu_session) : Thread_base(0, name, STACK_SIZE, Type::NORMAL, cpu_session)
{ } { }
}; };
}
#endif /* _INCLUDE__BASE__THREAD_H_ */ #endif /* _INCLUDE__BASE__THREAD_H_ */

View File

@ -19,9 +19,8 @@
#include <base/thread_state_base.h> #include <base/thread_state_base.h>
namespace Genode { namespace Genode { struct Thread_state; }
struct Thread_state : Thread_state_base { }; struct Genode::Thread_state : Thread_state_base { };
}
#endif /* _INCLUDE__BASE__THREAD_STATE_H_ */ #endif /* _INCLUDE__BASE__THREAD_STATE_H_ */

View File

@ -18,14 +18,13 @@
#include <cpu/cpu_state.h> #include <cpu/cpu_state.h>
namespace Genode { namespace Genode { struct Thread_state_base; }
struct Thread_state_base : Cpu_state struct Genode::Thread_state_base : Cpu_state
{ {
bool unresolved_page_fault; bool unresolved_page_fault;
Thread_state_base() : unresolved_page_fault(false) { }; Thread_state_base() : unresolved_page_fault(false) { };
}; };
}
#endif /* _INCLUDE__BASE__THREAD_STATE_BASE_H_ */ #endif /* _INCLUDE__BASE__THREAD_STATE_BASE_H_ */

View File

@ -18,6 +18,7 @@
#include <base/trace/policy.h> #include <base/trace/policy.h>
namespace Genode { namespace Trace { namespace Genode { namespace Trace {
struct Rpc_call; struct Rpc_call;
struct Rpc_returned; struct Rpc_returned;
struct Rpc_dispatch; struct Rpc_dispatch;

View File

@ -16,13 +16,12 @@
#include <base/slab.h> #include <base/slab.h>
namespace Genode { namespace Genode { template <typename, size_t> struct Tslab; }
template <typename T, size_t BLOCK_SIZE>
class Tslab : public Slab template <typename T, Genode::size_t BLOCK_SIZE>
struct Genode::Tslab : Slab
{ {
public:
Tslab(Allocator *backing_store, Tslab(Allocator *backing_store,
Slab_block *initial_sb = 0) Slab_block *initial_sb = 0)
: Slab(sizeof(T), BLOCK_SIZE, initial_sb, backing_store) : Slab(sizeof(T), BLOCK_SIZE, initial_sb, backing_store)
@ -30,6 +29,5 @@ namespace Genode {
T *first_object() { return (T *)Slab::first_used_elem(); } T *first_object() { return (T *)Slab::first_used_elem(); }
}; };
}
#endif /* _INCLUDE__BASE__TSLAB_H_ */ #endif /* _INCLUDE__BASE__TSLAB_H_ */

View File

@ -21,9 +21,10 @@
#include <base/native_types.h> #include <base/native_types.h>
#include <session/session.h> #include <session/session.h>
namespace Genode { namespace Genode { struct Cap_session; }
struct Cap_session : Session
struct Genode::Cap_session : Session
{ {
static const char *service_name() { return "CAP"; } static const char *service_name() { return "CAP"; }
@ -54,6 +55,5 @@ namespace Genode {
GENODE_RPC(Rpc_free, void, free, Native_capability); GENODE_RPC(Rpc_free, void, free, Native_capability);
GENODE_RPC_INTERFACE(Rpc_alloc, Rpc_free); GENODE_RPC_INTERFACE(Rpc_alloc, Rpc_free);
}; };
}
#endif /* _INCLUDE__CAP_SESSION__CAP_SESSION_H_ */ #endif /* _INCLUDE__CAP_SESSION__CAP_SESSION_H_ */

View File

@ -18,18 +18,18 @@
#include <cap_session/cap_session.h> #include <cap_session/cap_session.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Cap_session_client; }
struct Cap_session_client : Rpc_client<Cap_session>
struct Genode::Cap_session_client : Rpc_client<Cap_session>
{ {
explicit Cap_session_client(Cap_session_capability session) explicit Cap_session_client(Cap_session_capability session)
: Rpc_client<Cap_session>(session) { } : Rpc_client<Cap_session>(session) { }
Native_capability alloc(Native_capability ep) { Native_capability alloc(Native_capability ep) override {
return call<Rpc_alloc>(ep); } return call<Rpc_alloc>(ep); }
void free(Native_capability cap) { call<Rpc_free>(cap); } void free(Native_capability cap) override { call<Rpc_free>(cap); }
}; };
}
#endif /* _INCLUDE__CAP_SESSION__CLIENT_H_ */ #endif /* _INCLUDE__CAP_SESSION__CLIENT_H_ */

View File

@ -17,9 +17,10 @@
#include <cap_session/client.h> #include <cap_session/client.h>
#include <base/connection.h> #include <base/connection.h>
namespace Genode { namespace Genode { struct Cap_connection; }
struct Cap_connection : Connection<Cap_session>, Cap_session_client
struct Genode::Cap_connection : Connection<Cap_session>, Cap_session_client
{ {
Cap_connection() Cap_connection()
: :
@ -27,6 +28,5 @@ namespace Genode {
Cap_session_client(cap()) Cap_session_client(cap())
{ } { }
}; };
}
#endif /* _INCLUDE__CAP_SESSION__CONNECTION_H_ */ #endif /* _INCLUDE__CAP_SESSION__CONNECTION_H_ */

View File

@ -22,7 +22,6 @@ namespace Genode {
* Make D-Cache and I-Cache coherent * Make D-Cache and I-Cache coherent
*/ */
void cache_coherent(Genode::addr_t addr, Genode::size_t size); void cache_coherent(Genode::addr_t addr, Genode::size_t size);
} }
#endif /* _INCLUDE__CPU__CACHE_H_ */ #endif /* _INCLUDE__CPU__CACHE_H_ */

View File

@ -17,78 +17,78 @@
#include <cpu_session/capability.h> #include <cpu_session/capability.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Cpu_session_client; }
struct Cpu_session_client : Rpc_client<Cpu_session>
struct Genode::Cpu_session_client : Rpc_client<Cpu_session>
{ {
explicit Cpu_session_client(Cpu_session_capability session) explicit Cpu_session_client(Cpu_session_capability session)
: Rpc_client<Cpu_session>(session) { } : Rpc_client<Cpu_session>(session) { }
Thread_capability Thread_capability
create_thread(size_t quota, Name const &name, addr_t utcb = 0) { create_thread(size_t quota, Name const &name, addr_t utcb = 0) override {
return call<Rpc_create_thread>(quota, name, utcb); } return call<Rpc_create_thread>(quota, name, utcb); }
Ram_dataspace_capability utcb(Thread_capability thread) { Ram_dataspace_capability utcb(Thread_capability thread) override {
return call<Rpc_utcb>(thread); } return call<Rpc_utcb>(thread); }
void kill_thread(Thread_capability thread) { void kill_thread(Thread_capability thread) override {
call<Rpc_kill_thread>(thread); } call<Rpc_kill_thread>(thread); }
int set_pager(Thread_capability thread, Pager_capability pager) { int set_pager(Thread_capability thread, Pager_capability pager) override {
return call<Rpc_set_pager>(thread, pager); } return call<Rpc_set_pager>(thread, pager); }
int start(Thread_capability thread, addr_t ip, addr_t sp) { int start(Thread_capability thread, addr_t ip, addr_t sp) override {
return call<Rpc_start>(thread, ip, sp); } return call<Rpc_start>(thread, ip, sp); }
void pause(Thread_capability thread) { void pause(Thread_capability thread) override {
call<Rpc_pause>(thread); } call<Rpc_pause>(thread); }
void resume(Thread_capability thread) { void resume(Thread_capability thread) override {
call<Rpc_resume>(thread); } call<Rpc_resume>(thread); }
void cancel_blocking(Thread_capability thread) { void cancel_blocking(Thread_capability thread) override {
call<Rpc_cancel_blocking>(thread); } call<Rpc_cancel_blocking>(thread); }
Thread_state state(Thread_capability thread) { Thread_state state(Thread_capability thread) override {
return call<Rpc_get_state>(thread); } return call<Rpc_get_state>(thread); }
void state(Thread_capability thread, Thread_state const &state) { void state(Thread_capability thread, Thread_state const &state) override {
call<Rpc_set_state>(thread, state); } call<Rpc_set_state>(thread, state); }
void exception_handler(Thread_capability thread, Signal_context_capability handler) { void exception_handler(Thread_capability thread, Signal_context_capability handler) override {
call<Rpc_exception_handler>(thread, handler); } call<Rpc_exception_handler>(thread, handler); }
void single_step(Thread_capability thread, bool enable) { void single_step(Thread_capability thread, bool enable) override {
call<Rpc_single_step>(thread, enable); } call<Rpc_single_step>(thread, enable); }
Affinity::Space affinity_space() const { Affinity::Space affinity_space() const override {
return call<Rpc_affinity_space>(); } return call<Rpc_affinity_space>(); }
void affinity(Thread_capability thread, Affinity::Location location) { void affinity(Thread_capability thread, Affinity::Location location) override {
call<Rpc_affinity>(thread, location); } call<Rpc_affinity>(thread, location); }
Dataspace_capability trace_control() { Dataspace_capability trace_control() override {
return call<Rpc_trace_control>(); } return call<Rpc_trace_control>(); }
unsigned trace_control_index(Thread_capability thread) { unsigned trace_control_index(Thread_capability thread) override {
return call<Rpc_trace_control_index>(thread); } return call<Rpc_trace_control_index>(thread); }
Dataspace_capability trace_buffer(Thread_capability thread) { Dataspace_capability trace_buffer(Thread_capability thread) override {
return call<Rpc_trace_buffer>(thread); } return call<Rpc_trace_buffer>(thread); }
Dataspace_capability trace_policy(Thread_capability thread) { Dataspace_capability trace_policy(Thread_capability thread) override {
return call<Rpc_trace_policy>(thread); } return call<Rpc_trace_policy>(thread); }
int ref_account(Cpu_session_capability session) { int ref_account(Cpu_session_capability session) override {
return call<Rpc_ref_account>(session); } return call<Rpc_ref_account>(session); }
int transfer_quota(Cpu_session_capability session, size_t amount) { int transfer_quota(Cpu_session_capability session, size_t amount) override {
return call<Rpc_transfer_quota>(session, amount); } return call<Rpc_transfer_quota>(session, amount); }
size_t quota() { return call<Rpc_quota>(); } size_t quota() override { return call<Rpc_quota>(); }
size_t used() { return call<Rpc_used>(); } size_t used() override { return call<Rpc_used>(); }
}; };
}
#endif /* _INCLUDE__CPU_SESSION__CLIENT_H_ */ #endif /* _INCLUDE__CPU_SESSION__CLIENT_H_ */

View File

@ -17,9 +17,10 @@
#include <cpu_session/client.h> #include <cpu_session/client.h>
#include <base/connection.h> #include <base/connection.h>
namespace Genode { namespace Genode { struct Cpu_connection; }
struct Cpu_connection : Connection<Cpu_session>, Cpu_session_client
struct Genode::Cpu_connection : Connection<Cpu_session>, Cpu_session_client
{ {
enum { RAM_QUOTA = 32*1024 }; enum { RAM_QUOTA = 32*1024 };
@ -39,6 +40,5 @@ namespace Genode {
priority, label)), priority, label)),
Cpu_session_client(cap()) { } Cpu_session_client(cap()) { }
}; };
}
#endif /* _INCLUDE__CPU_SESSION__CONNECTION_H_ */ #endif /* _INCLUDE__CPU_SESSION__CONNECTION_H_ */

View File

@ -2,21 +2,6 @@
* \brief CPU (processing time) manager session interface * \brief CPU (processing time) manager session interface
* \author Christian Helmuth * \author Christian Helmuth
* \date 2006-06-27 * \date 2006-06-27
*
* :Question:
*
* Why are thread operations not methods of the thread but
* methods of the CPU session?
*
* :Answer:
*
* This enables the CPU session to impose policies on thread
* operations. These policies are based on the session
* construction arguments. If thread operations would be
* provided as thread methods, Thread would need to consult
* its container object (its CPU session) about the authorization
* of each operation and, thereby, would introduce a circular
* dependency between CPU session and Thread.
*/ */
/* /*
@ -41,9 +26,10 @@
#include <session/session.h> #include <session/session.h>
#include <ram_session/ram_session.h> #include <ram_session/ram_session.h>
namespace Genode { namespace Genode { struct Cpu_session; }
struct Cpu_session : Session
struct Genode::Cpu_session : Session
{ {
/********************* /*********************
** Exception types ** ** Exception types **
@ -379,6 +365,5 @@ namespace Genode {
Meta::Empty> Meta::Empty>
> > > > > > > > > > > > > > > > > > > > > Rpc_functions; > > > > > > > > > > > > > > > > > > > > > Rpc_functions;
}; };
}
#endif /* _INCLUDE__CPU_SESSION__CPU_SESSION_H_ */ #endif /* _INCLUDE__CPU_SESSION__CPU_SESSION_H_ */

View File

@ -17,17 +17,17 @@
#include <dataspace/capability.h> #include <dataspace/capability.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Dataspace_client; }
struct Dataspace_client : Rpc_client<Dataspace>
struct Genode::Dataspace_client : Rpc_client<Dataspace>
{ {
explicit Dataspace_client(Dataspace_capability ds) explicit Dataspace_client(Dataspace_capability ds)
: Rpc_client<Dataspace>(ds) { } : Rpc_client<Dataspace>(ds) { }
size_t size() { return call<Rpc_size>(); } size_t size() override { return call<Rpc_size>(); }
addr_t phys_addr() { return call<Rpc_phys_addr>(); } addr_t phys_addr() override { return call<Rpc_phys_addr>(); }
bool writable() { return call<Rpc_writable>(); } bool writable() override { return call<Rpc_writable>(); }
}; };
}
#endif /* _INCLUDE__DATASPACE__CLIENT_H_ */ #endif /* _INCLUDE__DATASPACE__CLIENT_H_ */

View File

@ -17,9 +17,10 @@
#include <base/stdint.h> #include <base/stdint.h>
#include <base/rpc.h> #include <base/rpc.h>
namespace Genode { namespace Genode { struct Dataspace; }
struct Dataspace
struct Genode::Dataspace
{ {
virtual ~Dataspace() { } virtual ~Dataspace() { }
@ -49,6 +50,5 @@ namespace Genode {
GENODE_RPC_INTERFACE(Rpc_size, Rpc_phys_addr, Rpc_writable); GENODE_RPC_INTERFACE(Rpc_size, Rpc_phys_addr, Rpc_writable);
}; };
}
#endif /* _INCLUDE__DATASPACE__DATASPACE_H_ */ #endif /* _INCLUDE__DATASPACE__DATASPACE_H_ */

View File

@ -19,12 +19,13 @@
/* Genode includes */ /* Genode includes */
#include <util/mmio.h> #include <util/mmio.h>
namespace Genode namespace Genode { class Epit_base; }
{
/** /**
* Core timer * Core timer
*/ */
class Epit_base : public Mmio class Genode::Epit_base : public Mmio
{ {
protected: protected:
@ -186,6 +187,5 @@ namespace Genode
return read<Sr::Ocif>() ? 0 : read<Cnt>(); return read<Sr::Ocif>() ? 0 : read<Cnt>();
} }
}; };
}
#endif /* _INCLUDE__DRIVERS__TIMER__EPIT_BASE_H_ */ #endif /* _INCLUDE__DRIVERS__TIMER__EPIT_BASE_H_ */

View File

@ -17,12 +17,13 @@
/* Genode includes */ /* Genode includes */
#include <util/mmio.h> #include <util/mmio.h>
namespace Genode namespace Genode { class Exynos_uart_base; }
{
/** /**
* Exynos UART driver base * Exynos UART driver base
*/ */
class Exynos_uart_base : Mmio class Genode::Exynos_uart_base : Mmio
{ {
protected: protected:
@ -240,7 +241,6 @@ namespace Genode
write<Utxh::Transmit_data>(c); write<Utxh::Transmit_data>(c);
} }
}; };
}
#endif /* _INCLUDE__DRIVERS__UART__EXYNOS_UART_BASE_H_ */ #endif /* _INCLUDE__DRIVERS__UART__EXYNOS_UART_BASE_H_ */

View File

@ -18,12 +18,13 @@
/* Genode includes */ /* Genode includes */
#include <util/mmio.h> #include <util/mmio.h>
namespace Genode namespace Genode { class Imx_uart_base; }
{
/** /**
* Driver base for i.MX UART-module * Driver base for i.MX UART-module
*/ */
class Imx_uart_base : Mmio class Genode::Imx_uart_base : Mmio
{ {
/** /**
* Control register 1 * Control register 1
@ -268,7 +269,6 @@ namespace Genode
_put_char(c); _put_char(c);
} }
}; };
}
#endif /* _INCLUDE__DRIVERS__UART__IMX_UART_BASE_H_ */ #endif /* _INCLUDE__DRIVERS__UART__IMX_UART_BASE_H_ */

View File

@ -17,12 +17,13 @@
/* Genode includes */ /* Genode includes */
#include <util/mmio.h> #include <util/mmio.h>
namespace Genode namespace Genode { class Pl011_base; }
{
/** /**
* Driver base for the PrimeCell UART PL011 Revision r1p3 * Driver base for the PrimeCell UART PL011 Revision r1p3
*/ */
class Pl011_base : Mmio class Genode::Pl011_base : Mmio
{ {
protected: protected:
@ -126,7 +127,6 @@ namespace Genode
*/ */
inline void put_char(char const c); inline void put_char(char const c);
}; };
}
Genode::Pl011_base::Pl011_base(addr_t const base, uint32_t const clock, Genode::Pl011_base::Pl011_base(addr_t const base, uint32_t const clock,

View File

@ -17,15 +17,16 @@
/* Genode includes */ /* Genode includes */
#include <util/mmio.h> #include <util/mmio.h>
namespace Genode namespace Genode { class Tl16c750_base; }
{
/** /**
* Base driver Texas instruments TL16C750 UART module * Base driver Texas instruments TL16C750 UART module
* *
* In contrast to the abilities of the TL16C750, this driver targets only * In contrast to the abilities of the TL16C750, this driver targets only
* the basic UART functionalities. * the basic UART functionalities.
*/ */
class Tl16c750_base : public Mmio class Genode::Tl16c750_base : public Mmio
{ {
protected: protected:
/** /**
@ -241,7 +242,6 @@ namespace Genode
write<Uart_thr::Thr>(c); write<Uart_thr::Thr>(c);
} }
}; };
}
#endif /* _INCLUDE__DRIVERS__UART__TL16C750_BASE_H_ */ #endif /* _INCLUDE__DRIVERS__UART__TL16C750_BASE_H_ */

View File

@ -17,15 +17,15 @@
#include <io_mem_session/capability.h> #include <io_mem_session/capability.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Io_mem_session_client; }
struct Io_mem_session_client : Rpc_client<Io_mem_session>
struct Genode::Io_mem_session_client : Rpc_client<Io_mem_session>
{ {
explicit Io_mem_session_client(Io_mem_session_capability session) explicit Io_mem_session_client(Io_mem_session_capability session)
: Rpc_client<Io_mem_session>(session) { } : Rpc_client<Io_mem_session>(session) { }
Io_mem_dataspace_capability dataspace() { return call<Rpc_dataspace>(); } Io_mem_dataspace_capability dataspace() override { return call<Rpc_dataspace>(); }
}; };
}
#endif /* _INCLUDE__IO_MEM_SESSION__CLIENT_H_ */ #endif /* _INCLUDE__IO_MEM_SESSION__CLIENT_H_ */

View File

@ -17,9 +17,10 @@
#include <io_mem_session/client.h> #include <io_mem_session/client.h>
#include <base/connection.h> #include <base/connection.h>
namespace Genode { namespace Genode { struct Io_mem_connection; }
struct Io_mem_connection : Connection<Io_mem_session>, Io_mem_session_client
struct Genode::Io_mem_connection : Connection<Io_mem_session>, Io_mem_session_client
{ {
/** /**
* Constructor * Constructor
@ -37,6 +38,5 @@ namespace Genode {
Io_mem_session_client(cap()) Io_mem_session_client(cap())
{ } { }
}; };
}
#endif /* _INCLUDE__IO_MEM_SESSION__CONNECTION_H_ */ #endif /* _INCLUDE__IO_MEM_SESSION__CONNECTION_H_ */

View File

@ -19,11 +19,17 @@
namespace Genode { namespace Genode {
struct Io_mem_dataspace : Dataspace { }; struct Io_mem_dataspace;
struct Io_mem_session;
typedef Capability<Io_mem_dataspace> Io_mem_dataspace_capability; typedef Capability<Io_mem_dataspace> Io_mem_dataspace_capability;
}
struct Io_mem_session : Session
struct Genode::Io_mem_dataspace : Dataspace { };
struct Genode::Io_mem_session : Session
{ {
static const char *service_name() { return "IO_MEM"; } static const char *service_name() { return "IO_MEM"; }
@ -43,9 +49,7 @@ namespace Genode {
*********************/ *********************/
GENODE_RPC(Rpc_dataspace, Io_mem_dataspace_capability, dataspace); GENODE_RPC(Rpc_dataspace, Io_mem_dataspace_capability, dataspace);
GENODE_RPC_INTERFACE(Rpc_dataspace); GENODE_RPC_INTERFACE(Rpc_dataspace);
}; };
}
#endif /* _INCLUDE__IO_MEM_SESSION__IO_MEM_SESSION_H_ */ #endif /* _INCLUDE__IO_MEM_SESSION__IO_MEM_SESSION_H_ */

View File

@ -17,31 +17,31 @@
#include <io_port_session/capability.h> #include <io_port_session/capability.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Io_port_session_client; }
struct Io_port_session_client : Rpc_client<Io_port_session>
struct Genode::Io_port_session_client : Rpc_client<Io_port_session>
{ {
explicit Io_port_session_client(Io_port_session_capability session) explicit Io_port_session_client(Io_port_session_capability session)
: Rpc_client<Io_port_session>(session) { } : Rpc_client<Io_port_session>(session) { }
unsigned char inb(unsigned short address) { unsigned char inb(unsigned short address) override {
return call<Rpc_inb>(address); } return call<Rpc_inb>(address); }
unsigned short inw(unsigned short address) { unsigned short inw(unsigned short address) override {
return call<Rpc_inw>(address); } return call<Rpc_inw>(address); }
unsigned inl(unsigned short address) { unsigned inl(unsigned short address) override {
return call<Rpc_inl>(address); } return call<Rpc_inl>(address); }
void outb(unsigned short address, unsigned char value) { void outb(unsigned short address, unsigned char value) override {
call<Rpc_outb>(address, value); } call<Rpc_outb>(address, value); }
void outw(unsigned short address, unsigned short value) { void outw(unsigned short address, unsigned short value) override {
call<Rpc_outw>(address, value); } call<Rpc_outw>(address, value); }
void outl(unsigned short address, unsigned value) { void outl(unsigned short address, unsigned value) override {
call<Rpc_outl>(address, value); } call<Rpc_outl>(address, value); }
}; };
}
#endif /* _INCLUDE__IO_PORT_SESSION__CLIENT_H_ */ #endif /* _INCLUDE__IO_PORT_SESSION__CLIENT_H_ */

View File

@ -17,9 +17,10 @@
#include <io_port_session/client.h> #include <io_port_session/client.h>
#include <base/connection.h> #include <base/connection.h>
namespace Genode { namespace Genode { struct Io_port_connection; }
struct Io_port_connection : Connection<Io_port_session>,
struct Genode::Io_port_connection : Connection<Io_port_session>,
Io_port_session_client Io_port_session_client
{ {
/** /**
@ -37,6 +38,5 @@ namespace Genode {
Io_port_session_client(cap()) Io_port_session_client(cap())
{ } { }
}; };
}
#endif /* _INCLUDE__IO_PORT_SESSION__CONNECTION_H_ */ #endif /* _INCLUDE__IO_PORT_SESSION__CONNECTION_H_ */

View File

@ -28,9 +28,10 @@
#include <base/capability.h> #include <base/capability.h>
#include <session/session.h> #include <session/session.h>
namespace Genode { namespace Genode { struct Io_port_session; }
struct Io_port_session : Session
struct Genode::Io_port_session : Session
{ {
static const char *service_name() { return "IO_PORT"; } static const char *service_name() { return "IO_PORT"; }
@ -111,6 +112,5 @@ namespace Genode {
GENODE_RPC_INTERFACE(Rpc_inb, Rpc_inw, Rpc_inl, Rpc_outb, Rpc_outw, Rpc_outl); GENODE_RPC_INTERFACE(Rpc_inb, Rpc_inw, Rpc_inl, Rpc_outb, Rpc_outw, Rpc_outl);
}; };
}
#endif /* _INCLUDE__IO_PORT_SESSION__IO_PORT_SESSION_H_ */ #endif /* _INCLUDE__IO_PORT_SESSION__IO_PORT_SESSION_H_ */

View File

@ -17,15 +17,15 @@
#include <irq_session/capability.h> #include <irq_session/capability.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Irq_session_client; }
struct Irq_session_client : Rpc_client<Irq_session>
struct Genode::Irq_session_client : Rpc_client<Irq_session>
{ {
explicit Irq_session_client(Irq_session_capability session) explicit Irq_session_client(Irq_session_capability session)
: Rpc_client<Irq_session>(session) { } : Rpc_client<Irq_session>(session) { }
void wait_for_irq() { call<Rpc_wait_for_irq>(); } void wait_for_irq() override { call<Rpc_wait_for_irq>(); }
}; };
}
#endif /* _INCLUDE__IRQ_SESSION__CLIENT_H_ */ #endif /* _INCLUDE__IRQ_SESSION__CLIENT_H_ */

View File

@ -17,9 +17,9 @@
#include <irq_session/client.h> #include <irq_session/client.h>
#include <base/connection.h> #include <base/connection.h>
namespace Genode { namespace Genode { struct Irq_connection; }
struct Irq_connection : Connection<Irq_session>, Irq_session_client struct Genode::Irq_connection : Connection<Irq_session>, Irq_session_client
{ {
/** /**
* Constructor * Constructor
@ -38,6 +38,5 @@ namespace Genode {
Irq_session_client(cap()) Irq_session_client(cap())
{ } { }
}; };
}
#endif /* _INCLUDE__IRQ_SESSION__CONNECTION_H_ */ #endif /* _INCLUDE__IRQ_SESSION__CONNECTION_H_ */

View File

@ -24,11 +24,11 @@
#include <base/capability.h> #include <base/capability.h>
#include <session/session.h> #include <session/session.h>
namespace Genode { namespace Genode { struct Irq_session; }
struct Irq_session : Session
struct Genode::Irq_session : Session
{ {
/** /**
* Interrupt trigger * Interrupt trigger
*/ */
@ -53,6 +53,5 @@ namespace Genode {
GENODE_RPC(Rpc_wait_for_irq, void, wait_for_irq); GENODE_RPC(Rpc_wait_for_irq, void, wait_for_irq);
GENODE_RPC_INTERFACE(Rpc_wait_for_irq); GENODE_RPC_INTERFACE(Rpc_wait_for_irq);
}; };
}
#endif /* _INCLUDE__IRQ_SESSION__IRQ_SESSION_H_ */ #endif /* _INCLUDE__IRQ_SESSION__IRQ_SESSION_H_ */

View File

@ -17,16 +17,16 @@
#include <log_session/capability.h> #include <log_session/capability.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Log_session_client; }
struct Log_session_client : Rpc_client<Log_session>
struct Genode::Log_session_client : Rpc_client<Log_session>
{ {
explicit Log_session_client(Log_session_capability session) explicit Log_session_client(Log_session_capability session)
: Rpc_client<Log_session>(session) { } : Rpc_client<Log_session>(session) { }
size_t write(String const &string) { size_t write(String const &string) override {
return call<Rpc_write>(string); } return call<Rpc_write>(string); }
}; };
}
#endif /* _INCLUDE__LOG_SESSION__CLIENT_H_ */ #endif /* _INCLUDE__LOG_SESSION__CLIENT_H_ */

View File

@ -17,9 +17,10 @@
#include <log_session/client.h> #include <log_session/client.h>
#include <base/connection.h> #include <base/connection.h>
namespace Genode { namespace Genode { struct Log_connection; }
struct Log_connection : Connection<Log_session>, Log_session_client
struct Genode::Log_connection : Connection<Log_session>, Log_session_client
{ {
Log_connection() Log_connection()
: :
@ -27,6 +28,5 @@ namespace Genode {
Log_session_client(cap()) Log_session_client(cap())
{ } { }
}; };
}
#endif /* _INCLUDE__LOG_SESSION__CONNECTION_H_ */ #endif /* _INCLUDE__LOG_SESSION__CONNECTION_H_ */

View File

@ -19,9 +19,10 @@
#include <base/rpc_args.h> #include <base/rpc_args.h>
#include <session/session.h> #include <session/session.h>
namespace Genode { namespace Genode { struct Log_session; }
struct Log_session : Session
struct Genode::Log_session : Session
{ {
static const char *service_name() { return "LOG"; } static const char *service_name() { return "LOG"; }
@ -44,6 +45,5 @@ namespace Genode {
GENODE_RPC(Rpc_write, size_t, write, String const &); GENODE_RPC(Rpc_write, size_t, write, String const &);
GENODE_RPC_INTERFACE(Rpc_write); GENODE_RPC_INTERFACE(Rpc_write);
}; };
}
#endif /* _INCLUDE__LOG_SESSION__LOG_SESSION_H_ */ #endif /* _INCLUDE__LOG_SESSION__LOG_SESSION_H_ */

View File

@ -17,44 +17,44 @@
#include <parent/capability.h> #include <parent/capability.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Parent_client; }
struct Parent_client : Rpc_client<Parent>
struct Genode::Parent_client : Rpc_client<Parent>
{ {
explicit Parent_client(Parent_capability parent) explicit Parent_client(Parent_capability parent)
: Rpc_client<Parent>(parent) { } : Rpc_client<Parent>(parent) { }
void exit(int exit_value) { call<Rpc_exit>(exit_value); } void exit(int exit_value) override { call<Rpc_exit>(exit_value); }
void announce(Service_name const &service, Root_capability root) { void announce(Service_name const &service, Root_capability root) override {
call<Rpc_announce>(service, root); } call<Rpc_announce>(service, root); }
Session_capability session(Service_name const &service, Session_capability session(Service_name const &service,
Session_args const &args, Session_args const &args,
Affinity const &affinity) { Affinity const &affinity) override {
return call<Rpc_session>(service, args, affinity); } return call<Rpc_session>(service, args, affinity); }
void upgrade(Session_capability to_session, Upgrade_args const &args) { void upgrade(Session_capability to_session, Upgrade_args const &args) override {
call<Rpc_upgrade>(to_session, args); } call<Rpc_upgrade>(to_session, args); }
void close(Session_capability session) { call<Rpc_close>(session); } void close(Session_capability session) override { call<Rpc_close>(session); }
Thread_capability main_thread_cap() const { Thread_capability main_thread_cap() const override {
return call<Rpc_main_thread>(); } return call<Rpc_main_thread>(); }
void resource_avail_sigh(Signal_context_capability sigh) { void resource_avail_sigh(Signal_context_capability sigh) override {
call<Rpc_resource_avail_sigh>(sigh); } call<Rpc_resource_avail_sigh>(sigh); }
void resource_request(Resource_args const &args) { void resource_request(Resource_args const &args) override {
call<Rpc_resource_request>(args); } call<Rpc_resource_request>(args); }
void yield_sigh(Signal_context_capability sigh) { void yield_sigh(Signal_context_capability sigh) override {
call<Rpc_yield_sigh>(sigh); } call<Rpc_yield_sigh>(sigh); }
Resource_args yield_request() { return call<Rpc_yield_request>(); } Resource_args yield_request() override { return call<Rpc_yield_request>(); }
void yield_response() { call<Rpc_yield_response>(); } void yield_response() override { call<Rpc_yield_response>(); }
}; };
}
#endif /* _INCLUDE__PARENT__CLIENT_H_ */ #endif /* _INCLUDE__PARENT__CLIENT_H_ */

View File

@ -21,9 +21,10 @@
#include <session/capability.h> #include <session/capability.h>
#include <root/capability.h> #include <root/capability.h>
namespace Genode { namespace Genode { class Parent; }
class Parent
class Genode::Parent
{ {
private: private:
@ -263,7 +264,6 @@ namespace Genode {
Meta::Empty> Meta::Empty>
> > > > > > > > > > Rpc_functions; > > > > > > > > > > Rpc_functions;
}; };
}
template <typename ROOT_INTERFACE> template <typename ROOT_INTERFACE>

View File

@ -17,21 +17,21 @@
#include <pd_session/capability.h> #include <pd_session/capability.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Pd_session_client; }
struct Pd_session_client : Rpc_client<Pd_session>
struct Genode::Pd_session_client : Rpc_client<Pd_session>
{ {
explicit Pd_session_client(Pd_session_capability session) explicit Pd_session_client(Pd_session_capability session)
: Rpc_client<Pd_session>(session) { } : Rpc_client<Pd_session>(session) { }
int bind_thread(Thread_capability thread) { int bind_thread(Thread_capability thread) override {
return call<Rpc_bind_thread>(thread); } return call<Rpc_bind_thread>(thread); }
int assign_parent(Parent_capability parent) { int assign_parent(Parent_capability parent) override {
return call<Rpc_assign_parent>(parent); } return call<Rpc_assign_parent>(parent); }
bool assign_pci(addr_t) { return false; } bool assign_pci(addr_t) { return false; }
}; };
}
#endif /* _INCLUDE__PD_SESSION__CLIENT_H_ */ #endif /* _INCLUDE__PD_SESSION__CLIENT_H_ */

View File

@ -17,9 +17,10 @@
#include <pd_session/client.h> #include <pd_session/client.h>
#include <base/connection.h> #include <base/connection.h>
namespace Genode { namespace Genode { struct Pd_connection; }
struct Pd_connection : Connection<Pd_session>, Pd_session_client
struct Genode::Pd_connection : Connection<Pd_session>, Pd_session_client
{ {
/** /**
* Constructor * Constructor
@ -32,6 +33,5 @@ namespace Genode {
Pd_session_client(cap()) Pd_session_client(cap())
{ } { }
}; };
}
#endif /* _INCLUDE__PD_SESSION__CONNECTION_H_ */ #endif /* _INCLUDE__PD_SESSION__CONNECTION_H_ */

View File

@ -20,9 +20,10 @@
#include <parent/capability.h> #include <parent/capability.h>
#include <session/session.h> #include <session/session.h>
namespace Genode { namespace Genode { struct Pd_session; }
struct Pd_session : Session
struct Genode::Pd_session : Session
{ {
static const char *service_name() { return "PD"; } static const char *service_name() { return "PD"; }
@ -58,6 +59,5 @@ namespace Genode {
GENODE_RPC_INTERFACE(Rpc_bind_thread, Rpc_assign_parent); GENODE_RPC_INTERFACE(Rpc_bind_thread, Rpc_assign_parent);
}; };
}
#endif /* _INCLUDE__PD_SESSION__PD_SESSION_H_ */ #endif /* _INCLUDE__PD_SESSION__PD_SESSION_H_ */

View File

@ -17,12 +17,13 @@
/* Genode includes */ /* Genode includes */
#include <platform_exynos5/board_base.h> #include <platform_exynos5/board_base.h>
namespace Genode namespace Genode { struct Board_base; }
{
/** /**
* Board driver base * Board driver base
*/ */
struct Board_base : Exynos5 struct Genode::Board_base : Exynos5
{ {
enum enum
{ {
@ -45,6 +46,5 @@ namespace Genode
SECURITY_EXTENSION = 1, SECURITY_EXTENSION = 1,
}; };
}; };
}
#endif /* _INCLUDE__DRIVERS__BOARD_BASE_H_ */ #endif /* _INCLUDE__DRIVERS__BOARD_BASE_H_ */

View File

@ -14,12 +14,13 @@
#ifndef _INCLUDE__PLATFORM__IMX53__DRIVERS__BOARD_BASE_SUPPORT_H_ #ifndef _INCLUDE__PLATFORM__IMX53__DRIVERS__BOARD_BASE_SUPPORT_H_
#define _INCLUDE__PLATFORM__IMX53__DRIVERS__BOARD_BASE_SUPPORT_H_ #define _INCLUDE__PLATFORM__IMX53__DRIVERS__BOARD_BASE_SUPPORT_H_
namespace Imx53 namespace Imx53 { struct Board_base; }
{
/** /**
* i.MX53 motherboard * i.MX53 motherboard
*/ */
struct Board_base struct Imx53::Board_base
{ {
enum { enum {
MMIO_BASE = 0x0, MMIO_BASE = 0x0,
@ -111,7 +112,6 @@ namespace Imx53
CACHE_LINE_SIZE_LOG2 = 6, CACHE_LINE_SIZE_LOG2 = 6,
}; };
}; };
}
#endif /* _INCLUDE__PLATFORM__IMX53__DRIVERS__BOARD_BASE_SUPPORT_H_ */ #endif /* _INCLUDE__PLATFORM__IMX53__DRIVERS__BOARD_BASE_SUPPORT_H_ */

View File

@ -17,12 +17,13 @@
/* Genode includes */ /* Genode includes */
#include <platform/imx53/drivers/board_base_support.h> #include <platform/imx53/drivers/board_base_support.h>
namespace Genode namespace Genode { struct Board_base; }
{
/** /**
* i.MX53 starter board * i.MX53 starter board
*/ */
struct Board_base : Imx53::Board_base struct Genode::Board_base : Imx53::Board_base
{ {
enum { enum {
RAM0_BASE = 0x70000000, RAM0_BASE = 0x70000000,
@ -31,7 +32,6 @@ namespace Genode
RAM1_SIZE = 0x20000000, RAM1_SIZE = 0x20000000,
}; };
}; };
}
#endif /* _INCLUDE__PLATFORM__IMX53_QSB__DRIVERS__BOARD_BASE_H_ */ #endif /* _INCLUDE__PLATFORM__IMX53_QSB__DRIVERS__BOARD_BASE_H_ */

View File

@ -17,12 +17,13 @@
/* Genode includes */ /* Genode includes */
#include <platform_exynos5/board_base.h> #include <platform_exynos5/board_base.h>
namespace Genode namespace Genode { struct Board_base; }
{
/** /**
* Board driver base * Board driver base
*/ */
struct Board_base : Exynos5 struct Genode::Board_base : Exynos5
{ {
enum enum
{ {
@ -33,6 +34,5 @@ namespace Genode
SECURITY_EXTENSION = 0, SECURITY_EXTENSION = 0,
}; };
}; };
}
#endif /* _INCLUDE__DRIVERS__BOARD_BASE_H_ */ #endif /* _INCLUDE__DRIVERS__BOARD_BASE_H_ */

View File

@ -14,15 +14,16 @@
#ifndef _INCLUDE__DRIVERS__BOARD_BASE_H_ #ifndef _INCLUDE__DRIVERS__BOARD_BASE_H_
#define _INCLUDE__DRIVERS__BOARD_BASE_H_ #define _INCLUDE__DRIVERS__BOARD_BASE_H_
namespace Genode namespace Genode { struct Board_base; }
{
/** /**
* Driver for the OMAP4 PandaBoard revision A2 * Driver for the OMAP4 PandaBoard revision A2
*/ */
struct Board_base struct Genode::Board_base
{
enum
{ {
enum {
/* device IO memory */ /* device IO memory */
MMIO_0_BASE = 0x48000000, MMIO_0_BASE = 0x48000000,
MMIO_0_SIZE = 0x01000000, MMIO_0_SIZE = 0x01000000,
@ -99,10 +100,8 @@ namespace Genode
/* wether board provides security extension */ /* wether board provides security extension */
SECURITY_EXTENSION = 0, SECURITY_EXTENSION = 0,
}; };
}; };
}
#endif /* _INCLUDE__DRIVERS__BOARD_BASE_H_ */ #endif /* _INCLUDE__DRIVERS__BOARD_BASE_H_ */

View File

@ -14,15 +14,16 @@
#ifndef _INCLUDE__DRIVERS__BOARD_BASE_H_ #ifndef _INCLUDE__DRIVERS__BOARD_BASE_H_
#define _INCLUDE__DRIVERS__BOARD_BASE_H_ #define _INCLUDE__DRIVERS__BOARD_BASE_H_
namespace Genode namespace Genode { struct Board_base; }
{
/** /**
* Driver for the Realview PBXA9 board * Driver for the Realview PBXA9 board
*/ */
struct Board_base struct Genode::Board_base
{
enum
{ {
enum {
/* normal RAM */ /* normal RAM */
RAM_0_BASE = 0x70000000, RAM_0_BASE = 0x70000000,
RAM_0_SIZE = 0x20000000, RAM_0_SIZE = 0x20000000,
@ -83,7 +84,6 @@ namespace Genode
SECURITY_EXTENSION = 0, SECURITY_EXTENSION = 0,
}; };
}; };
}
#endif /* _INCLUDE__DRIVERS__BOARD_BASE_H_ */ #endif /* _INCLUDE__DRIVERS__BOARD_BASE_H_ */

View File

@ -17,9 +17,10 @@
/* Genode includes */ /* Genode includes */
#include <util/mmio.h> #include <util/mmio.h>
namespace Genode namespace Genode { struct Board_base; }
{
struct Board_base
struct Genode::Board_base
{ {
enum { enum {
RAM_0_BASE = 0x00000000, RAM_0_BASE = 0x00000000,
@ -68,7 +69,6 @@ namespace Genode
L2_ONLY = 2, L2_ONLY = 2,
UNCACHED = 3 }; UNCACHED = 3 };
}; };
}
#endif /* _INCLUDE__PLATFORM__BOARD_BASE_H_ */ #endif /* _INCLUDE__PLATFORM__BOARD_BASE_H_ */

View File

@ -17,12 +17,13 @@
/* Genode includes */ /* Genode includes */
#include <platform/imx53/drivers/board_base_support.h> #include <platform/imx53/drivers/board_base_support.h>
namespace Genode namespace Genode { struct Board_base; }
{
/** /**
* i.MX53 starter board * i.MX53 starter board
*/ */
struct Board_base : Imx53::Board_base struct Genode::Board_base : Imx53::Board_base
{ {
enum { enum {
/* /*
@ -36,7 +37,6 @@ namespace Genode
RAM1_SIZE = 0x10000000, RAM1_SIZE = 0x10000000,
}; };
}; };
}
#endif /* _INCLUDE__PLATFORM__IMX53_QSB__DRIVERS__BOARD_BASE_H_ */ #endif /* _INCLUDE__PLATFORM__IMX53_QSB__DRIVERS__BOARD_BASE_H_ */

View File

@ -14,14 +14,15 @@
#ifndef _INCLUDE__PLATFORM__VEA9X4__DRIVERS__BOARD_BASE_H_ #ifndef _INCLUDE__PLATFORM__VEA9X4__DRIVERS__BOARD_BASE_H_
#define _INCLUDE__PLATFORM__VEA9X4__DRIVERS__BOARD_BASE_H_ #define _INCLUDE__PLATFORM__VEA9X4__DRIVERS__BOARD_BASE_H_
namespace Genode namespace Genode { struct Board_base; }
{
/** /**
* Driver for the Versatile Express A9X4 board * Driver for the Versatile Express A9X4 board
* *
* Implies the uATX motherboard and the CoreTile Express A9X4 daughterboard * Implies the uATX motherboard and the CoreTile Express A9X4 daughterboard
*/ */
struct Board_base struct Genode::Board_base
{ {
enum enum
{ {
@ -77,7 +78,6 @@ namespace Genode
CACHE_LINE_SIZE_LOG2 = 2, /* FIXME get correct value from board spec */ CACHE_LINE_SIZE_LOG2 = 2, /* FIXME get correct value from board spec */
}; };
}; };
}
#endif /* _INCLUDE__PLATFORM__VEA9X4__DRIVERS__BOARD_BASE_H_ */ #endif /* _INCLUDE__PLATFORM__VEA9X4__DRIVERS__BOARD_BASE_H_ */

View File

@ -14,18 +14,14 @@
#ifndef _EXYNOS5__BOARD_BASE_H_ #ifndef _EXYNOS5__BOARD_BASE_H_
#define _EXYNOS5__BOARD_BASE_H_ #define _EXYNOS5__BOARD_BASE_H_
namespace Genode namespace Genode { struct Exynos5; }
{
/** /**
* Board-driver base * Board-driver base
*/ */
class Exynos5; struct Genode::Exynos5
}
class Genode::Exynos5
{ {
public:
enum { enum {
/* normal RAM */ /* normal RAM */
RAM_0_BASE = 0x40000000, RAM_0_BASE = 0x40000000,

View File

@ -18,29 +18,29 @@
#include <ram_session/ram_session.h> #include <ram_session/ram_session.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Ram_session_client; }
struct Ram_session_client : Rpc_client<Ram_session>
struct Genode::Ram_session_client : Rpc_client<Ram_session>
{ {
explicit Ram_session_client(Ram_session_capability session) explicit Ram_session_client(Ram_session_capability session)
: Rpc_client<Ram_session>(session) { } : Rpc_client<Ram_session>(session) { }
Ram_dataspace_capability alloc(size_t size, Ram_dataspace_capability alloc(size_t size,
Cache_attribute cached = CACHED) { Cache_attribute cached = CACHED) override {
return call<Rpc_alloc>(size, cached); } return call<Rpc_alloc>(size, cached); }
void free(Ram_dataspace_capability ds) { call<Rpc_free>(ds); } void free(Ram_dataspace_capability ds) override { call<Rpc_free>(ds); }
int ref_account(Ram_session_capability ram_session) { int ref_account(Ram_session_capability ram_session) override {
return call<Rpc_ref_account>(ram_session); } return call<Rpc_ref_account>(ram_session); }
int transfer_quota(Ram_session_capability ram_session, size_t amount) { int transfer_quota(Ram_session_capability ram_session, size_t amount) override {
return call<Rpc_transfer_quota>(ram_session, amount); } return call<Rpc_transfer_quota>(ram_session, amount); }
size_t quota() { return call<Rpc_quota>(); } size_t quota() override { return call<Rpc_quota>(); }
size_t used() { return call<Rpc_used>(); } size_t used() override { return call<Rpc_used>(); }
}; };
}
#endif /* _INCLUDE__RAM_SESSION__CLIENT_H_ */ #endif /* _INCLUDE__RAM_SESSION__CLIENT_H_ */

View File

@ -17,9 +17,8 @@
#include <ram_session/client.h> #include <ram_session/client.h>
#include <base/connection.h> #include <base/connection.h>
namespace Genode { namespace Genode { struct Ram_connection; }
struct Ram_connection;
}
struct Genode::Ram_connection : Connection<Ram_session>, Ram_session_client struct Genode::Ram_connection : Connection<Ram_session>, Ram_session_client
{ {

View File

@ -24,11 +24,17 @@
namespace Genode { namespace Genode {
struct Ram_dataspace : Dataspace { }; struct Ram_dataspace;
typedef Capability<Ram_dataspace> Ram_dataspace_capability; typedef Capability<Ram_dataspace> Ram_dataspace_capability;
struct Ram_session : Session struct Ram_session;
}
struct Genode::Ram_dataspace : Dataspace { };
struct Genode::Ram_session : Session
{ {
static const char *service_name() { return "RAM"; } static const char *service_name() { return "RAM"; }
@ -111,6 +117,7 @@ namespace Genode {
return q > u ? q - u : 0; return q > u ? q - u : 0;
} }
/********************* /*********************
** RPC declaration ** ** RPC declaration **
*********************/ *********************/
@ -127,6 +134,5 @@ namespace Genode {
GENODE_RPC_INTERFACE(Rpc_alloc, Rpc_free, Rpc_ref_account, GENODE_RPC_INTERFACE(Rpc_alloc, Rpc_free, Rpc_ref_account,
Rpc_transfer_quota, Rpc_quota, Rpc_used); Rpc_transfer_quota, Rpc_quota, Rpc_used);
}; };
}
#endif /* _INCLUDE__RAM_SESSION__RAM_SESSION_H_ */ #endif /* _INCLUDE__RAM_SESSION__RAM_SESSION_H_ */

View File

@ -17,9 +17,10 @@
#include <rm_session/capability.h> #include <rm_session/capability.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Rm_session_client; }
struct Rm_session_client : Rpc_client<Rm_session>
struct Genode::Rm_session_client : Rpc_client<Rm_session>
{ {
explicit Rm_session_client(Rm_session_capability session) explicit Rm_session_client(Rm_session_capability session)
: Rpc_client<Rm_session>(session) { } : Rpc_client<Rm_session>(session) { }
@ -27,31 +28,30 @@ namespace Genode {
Local_addr attach(Dataspace_capability ds, size_t size = 0, Local_addr attach(Dataspace_capability ds, size_t size = 0,
off_t offset = 0, bool use_local_addr = false, off_t offset = 0, bool use_local_addr = false,
Local_addr local_addr = (void *)0, Local_addr local_addr = (void *)0,
bool executable = false) bool executable = false) override
{ {
return call<Rpc_attach>(ds, size, offset, return call<Rpc_attach>(ds, size, offset,
use_local_addr, local_addr, use_local_addr, local_addr,
executable); executable);
} }
void detach(Local_addr local_addr) { void detach(Local_addr local_addr) override {
call<Rpc_detach>(local_addr); } call<Rpc_detach>(local_addr); }
Pager_capability add_client(Thread_capability thread) { Pager_capability add_client(Thread_capability thread) override {
return call<Rpc_add_client>(thread); } return call<Rpc_add_client>(thread); }
void remove_client(Pager_capability pager) { void remove_client(Pager_capability pager) override {
call<Rpc_remove_client>(pager); } call<Rpc_remove_client>(pager); }
void fault_handler(Signal_context_capability handler) { void fault_handler(Signal_context_capability handler) override {
call<Rpc_fault_handler>(handler); } call<Rpc_fault_handler>(handler); }
State state() { State state() override {
return call<Rpc_state>(); } return call<Rpc_state>(); }
Dataspace_capability dataspace() { Dataspace_capability dataspace() override {
return call<Rpc_dataspace>(); } return call<Rpc_dataspace>(); }
}; };
}
#endif /* _INCLUDE__RM_SESSION__CLIENT_H_ */ #endif /* _INCLUDE__RM_SESSION__CLIENT_H_ */

View File

@ -17,9 +17,10 @@
#include <rm_session/client.h> #include <rm_session/client.h>
#include <base/connection.h> #include <base/connection.h>
namespace Genode { namespace Genode { struct Rm_connection; }
struct Rm_connection : Connection<Rm_session>, Rm_session_client
struct Genode::Rm_connection : Connection<Rm_session>, Rm_session_client
{ {
enum { RAM_QUOTA = 64*1024 }; enum { RAM_QUOTA = 64*1024 };
@ -35,6 +36,5 @@ namespace Genode {
start, size)), start, size)),
Rm_session_client(cap()) { } Rm_session_client(cap()) { }
}; };
}
#endif /* _INCLUDE__RM_SESSION__CONNECTION_H_ */ #endif /* _INCLUDE__RM_SESSION__CONNECTION_H_ */

View File

@ -22,9 +22,10 @@
#include <pager/capability.h> #include <pager/capability.h>
#include <session/session.h> #include <session/session.h>
namespace Genode { namespace Genode { struct Rm_session; }
struct Rm_session : Session
struct Genode::Rm_session : Session
{ {
enum Fault_type { enum Fault_type {
READY = 0, READ_FAULT = 1, WRITE_FAULT = 2, EXEC_FAULT = 3 }; READY = 0, READ_FAULT = 1, WRITE_FAULT = 2, EXEC_FAULT = 3 };
@ -215,6 +216,5 @@ namespace Genode {
Rpc_remove_client, Rpc_fault_handler, Rpc_state, Rpc_remove_client, Rpc_fault_handler, Rpc_state,
Rpc_dataspace); Rpc_dataspace);
}; };
}
#endif /* _INCLUDE__RM_SESSION__RM_SESSION_H_ */ #endif /* _INCLUDE__RM_SESSION__RM_SESSION_H_ */

View File

@ -19,6 +19,7 @@
namespace Genode { struct Rom_session_client; } namespace Genode { struct Rom_session_client; }
struct Genode::Rom_session_client : Rpc_client<Rom_session> struct Genode::Rom_session_client : Rpc_client<Rom_session>
{ {
explicit Rom_session_client(Rom_session_capability session) explicit Rom_session_client(Rom_session_capability session)

View File

@ -18,9 +18,10 @@
#include <base/connection.h> #include <base/connection.h>
#include <base/printf.h> #include <base/printf.h>
namespace Genode { namespace Genode { class Rom_connection; }
class Rom_connection : public Connection<Rom_session>,
class Genode::Rom_connection : public Connection<Rom_session>,
public Rom_session_client public Rom_session_client
{ {
public: public:
@ -45,16 +46,16 @@ namespace Genode {
/** /**
* Constructor * Constructor
* *
* \param filename name of ROM file * \param module_name name of ROM module
* \param label initial session label * \param label initial session label
* *
* \throw Rom_connection_failed * \throw Rom_connection_failed
*/ */
Rom_connection(const char *filename, const char *label = 0) : Rom_connection(const char *module_name, const char *label = 0)
Connection<Rom_session>(_create_session(filename, label)), :
Connection<Rom_session>(_create_session(module_name, label)),
Rom_session_client(cap()) Rom_session_client(cap())
{ } { }
}; };
}
#endif /* _INCLUDE__ROM_SESSION__CONNECTION_H_ */ #endif /* _INCLUDE__ROM_SESSION__CONNECTION_H_ */

View File

@ -23,14 +23,16 @@
namespace Genode { namespace Genode {
struct Rom_dataspace : Dataspace { }; struct Rom_dataspace;
struct Rom_session; struct Rom_session;
typedef Capability<Rom_dataspace> Rom_dataspace_capability; typedef Capability<Rom_dataspace> Rom_dataspace_capability;
} }
struct Genode::Rom_dataspace : Dataspace { };
struct Genode::Rom_session : Session struct Genode::Rom_session : Session
{ {
static const char *service_name() { return "ROM"; } static const char *service_name() { return "ROM"; }

View File

@ -17,22 +17,22 @@
#include <root/capability.h> #include <root/capability.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Root_client; }
struct Root_client : Rpc_client<Root>
struct Genode::Root_client : Rpc_client<Root>
{ {
explicit Root_client(Root_capability root) explicit Root_client(Root_capability root)
: Rpc_client<Root>(root) { } : Rpc_client<Root>(root) { }
Session_capability session(Session_args const &args, Affinity const &affinity) { Session_capability session(Session_args const &args, Affinity const &affinity) override {
return call<Rpc_session>(args, affinity); } return call<Rpc_session>(args, affinity); }
void upgrade(Session_capability session, Upgrade_args const &args) { void upgrade(Session_capability session, Upgrade_args const &args) override {
call<Rpc_upgrade>(session, args); } call<Rpc_upgrade>(session, args); }
void close(Session_capability session) { void close(Session_capability session) override {
call<Rpc_close>(session); } call<Rpc_close>(session); }
}; };
}
#endif /* _INCLUDE__ROOT__CLIENT_H_ */ #endif /* _INCLUDE__ROOT__CLIENT_H_ */

View File

@ -26,10 +26,16 @@
namespace Genode { namespace Genode {
class Single_client;
class Multiple_clients;
template <typename, typename POLICY = Multiple_clients> class Root_component;
}
/** /**
* Session creation policy for a single-client service * Session creation policy for a single-client service
*/ */
class Single_client class Genode::Single_client
{ {
private: private:
@ -54,7 +60,7 @@ namespace Genode {
/** /**
* Session-creation policy for a multi-client service * Session-creation policy for a multi-client service
*/ */
struct Multiple_clients struct Genode::Multiple_clients
{ {
void aquire(const char *) { } void aquire(const char *) { }
void release() { } void release() { }
@ -87,8 +93,9 @@ namespace Genode {
* The default policy 'Multiple_clients' imposes no restrictions on the * The default policy 'Multiple_clients' imposes no restrictions on the
* creation of new sessions. * creation of new sessions.
*/ */
template <typename SESSION_TYPE, typename POLICY = Multiple_clients> template <typename SESSION_TYPE, typename POLICY>
class Root_component : public Rpc_object<Typed_root<SESSION_TYPE> >, private POLICY class Genode::Root_component : public Rpc_object<Typed_root<SESSION_TYPE> >,
private POLICY
{ {
private: private:
@ -189,7 +196,7 @@ namespace Genode {
********************/ ********************/
Session_capability session(Root::Session_args const &args, Session_capability session(Root::Session_args const &args,
Affinity const &affinity) Affinity const &affinity) override
{ {
if (!args.is_valid_string()) throw Root::Invalid_args(); if (!args.is_valid_string()) throw Root::Invalid_args();
@ -233,7 +240,7 @@ namespace Genode {
return _ep->manage(s); return _ep->manage(s);
} }
void upgrade(Session_capability session, Root::Upgrade_args const &args) void upgrade(Session_capability session, Root::Upgrade_args const &args) override
{ {
if (!args.is_valid_string()) throw Root::Invalid_args(); if (!args.is_valid_string()) throw Root::Invalid_args();
@ -244,7 +251,7 @@ namespace Genode {
_upgrade_session(s, args.string()); _upgrade_session(s, args.string());
} }
void close(Session_capability session) void close(Session_capability session) override
{ {
SESSION_TYPE * s = SESSION_TYPE * s =
dynamic_cast<SESSION_TYPE *>(_ep->lookup_and_lock(session)); dynamic_cast<SESSION_TYPE *>(_ep->lookup_and_lock(session));
@ -259,6 +266,5 @@ namespace Genode {
return; return;
} }
}; };
}
#endif /* _INCLUDE__ROOT__COMPONENT_H_ */ #endif /* _INCLUDE__ROOT__COMPONENT_H_ */

View File

@ -22,7 +22,12 @@
namespace Genode { namespace Genode {
struct Root struct Root;
template <typename> struct Typed_root;
}
struct Genode::Root
{ {
/********************* /*********************
** Exception types ** ** Exception types **
@ -86,10 +91,9 @@ namespace Genode {
* a service. * a service.
*/ */
template <typename SESSION_TYPE> template <typename SESSION_TYPE>
struct Typed_root : Root struct Genode::Typed_root : Root
{ {
typedef SESSION_TYPE Session_type; typedef SESSION_TYPE Session_type;
}; };
}
#endif /* _INCLUDE__ROOT__ROOT_H_ */ #endif /* _INCLUDE__ROOT__ROOT_H_ */

View File

@ -21,7 +21,8 @@
*/ */
#include <base/rpc.h> #include <base/rpc.h>
namespace Genode { namespace Genode { class Session; }
/** /**
* Base class of session interfaces * Base class of session interfaces
@ -31,8 +32,6 @@ namespace Genode {
* This function returns the name of the service provided via the session * This function returns the name of the service provided via the session
* interface. * interface.
*/ */
class Session { }; class Genode::Session { };
}
#endif /* _INCLUDE__SESSION_H_ */ #endif /* _INCLUDE__SESSION_H_ */

View File

@ -19,25 +19,25 @@
#include <base/rpc_client.h> #include <base/rpc_client.h>
#include <signal_session/source_client.h> #include <signal_session/source_client.h>
namespace Genode { namespace Genode { struct Signal_session_client; }
struct Signal_session_client : Rpc_client<Signal_session>
struct Genode::Signal_session_client : Rpc_client<Signal_session>
{ {
explicit Signal_session_client(Signal_session_capability session) explicit Signal_session_client(Signal_session_capability session)
: Rpc_client<Signal_session>(session) { } : Rpc_client<Signal_session>(session) { }
Signal_source_capability signal_source() { Signal_source_capability signal_source() override {
return call<Rpc_signal_source>(); } return call<Rpc_signal_source>(); }
Signal_context_capability alloc_context(long imprint) { Signal_context_capability alloc_context(long imprint) override {
return call<Rpc_alloc_context>(imprint); } return call<Rpc_alloc_context>(imprint); }
void free_context(Signal_context_capability cap) { void free_context(Signal_context_capability cap) override {
call<Rpc_free_context>(cap); } call<Rpc_free_context>(cap); }
void submit(Signal_context_capability receiver, unsigned cnt = 1) { void submit(Signal_context_capability receiver, unsigned cnt = 1) override {
call<Rpc_submit>(receiver, cnt); } call<Rpc_submit>(receiver, cnt); }
}; };
}
#endif /* _INCLUDE__CAP_SESSION__CLIENT_H_ */ #endif /* _INCLUDE__CAP_SESSION__CLIENT_H_ */

View File

@ -17,9 +17,10 @@
#include <signal_session/client.h> #include <signal_session/client.h>
#include <base/connection.h> #include <base/connection.h>
namespace Genode { namespace Genode { struct Signal_connection; }
struct Signal_connection : Connection<Signal_session>, Signal_session_client
struct Genode::Signal_connection : Connection<Signal_session>, Signal_session_client
{ {
Signal_connection() Signal_connection()
: :
@ -27,6 +28,5 @@ namespace Genode {
Signal_session_client(cap()) Signal_session_client(cap())
{ } { }
}; };
}
#endif /* _INCLUDE__CAP_SESSION__CONNECTION_H_ */ #endif /* _INCLUDE__CAP_SESSION__CONNECTION_H_ */

View File

@ -24,13 +24,15 @@ namespace Genode {
class Signal_context; class Signal_context;
class Signal_receiver; class Signal_receiver;
typedef Capability<Signal_receiver> Signal_receiver_capability; typedef Capability<Signal_receiver> Signal_receiver_capability;
typedef Capability<Signal_context> Signal_context_capability; typedef Capability<Signal_context> Signal_context_capability;
typedef Capability<Signal_source> Signal_source_capability; typedef Capability<Signal_source> Signal_source_capability;
struct Signal_session;
}
struct Signal_session : Session
struct Genode::Signal_session : Session
{ {
static const char *service_name() { return "SIGNAL"; } static const char *service_name() { return "SIGNAL"; }
@ -93,6 +95,5 @@ namespace Genode {
GENODE_RPC_INTERFACE(Rpc_submit, Rpc_signal_source, Rpc_alloc_context, GENODE_RPC_INTERFACE(Rpc_submit, Rpc_signal_source, Rpc_alloc_context,
Rpc_free_context); Rpc_free_context);
}; };
}
#endif /* _INCLUDE__CAP_SESSION__CAP_SESSION_H_ */ #endif /* _INCLUDE__CAP_SESSION__CAP_SESSION_H_ */

View File

@ -21,7 +21,8 @@
#include <base/rpc.h> #include <base/rpc.h>
namespace Genode { namespace Genode { struct Signal_source; }
/** /**
* Blocking part of the signal-session interface * Blocking part of the signal-session interface
@ -32,7 +33,7 @@ namespace Genode {
* Therefore, the blocking part is implemented a separate interface, * Therefore, the blocking part is implemented a separate interface,
* which can be used by an independent thread. * which can be used by an independent thread.
*/ */
struct Signal_source struct Genode::Signal_source
{ {
class Signal class Signal
{ {
@ -70,6 +71,5 @@ namespace Genode {
GENODE_RPC(Rpc_wait_for_signal, Signal, wait_for_signal); GENODE_RPC(Rpc_wait_for_signal, Signal, wait_for_signal);
GENODE_RPC_INTERFACE(Rpc_wait_for_signal); GENODE_RPC_INTERFACE(Rpc_wait_for_signal);
}; };
}
#endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_H_ */ #endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_H_ */

View File

@ -19,15 +19,15 @@
#include <signal_session/source.h> #include <signal_session/source.h>
#include <base/rpc_client.h> #include <base/rpc_client.h>
namespace Genode { namespace Genode { struct Signal_source_client; }
struct Signal_source_client : Rpc_client<Signal_source>
struct Genode::Signal_source_client : Rpc_client<Signal_source>
{ {
Signal_source_client(Signal_source_capability signal_source) Signal_source_client(Signal_source_capability signal_source)
: Rpc_client<Signal_source>(signal_source) { } : Rpc_client<Signal_source>(signal_source) { }
Signal wait_for_signal() { return call<Rpc_wait_for_signal>(); } Signal wait_for_signal() override { return call<Rpc_wait_for_signal>(); }
}; };
}
#endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_CLIENT_H_ */ #endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_CLIENT_H_ */

View File

@ -21,8 +21,8 @@
#include <signal_session/source.h> #include <signal_session/source.h>
#include <base/rpc_server.h> #include <base/rpc_server.h>
namespace Genode { namespace Genode { struct Signal_source_rpc_object; }
struct Signal_source_rpc_object : Rpc_object<Signal_source> { };
} struct Genode::Signal_source_rpc_object : Rpc_object<Signal_source> { };
#endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_RPC_OBJECT_H_ */ #endif /* _INCLUDE__SIGNAL_SESSION__SOURCE_RPC_OBJECT_H_ */

Some files were not shown because too many files have changed in this diff Show More