genode/repos/base/src/core/include/cap_root.h

54 lines
1.1 KiB
C
Raw Normal View History

2011-12-22 16:19:25 +01:00
/*
* \brief CAP root interface
* \author Norman Feske
* \date 2006-07-06
*/
/*
2013-01-10 21:44:47 +01:00
* Copyright (C) 2006-2013 Genode Labs GmbH
2011-12-22 16:19:25 +01:00
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
#ifndef _CORE__INCLUDE__CAP_ROOT_H_
#define _CORE__INCLUDE__CAP_ROOT_H_
/* Genode includes */
#include <root/component.h>
/* core includes */
#include <cap_session_component.h>
namespace Genode {
class Cap_root : public Root_component<Cap_session_component>
{
private:
2013-01-24 11:35:27 +01:00
Allocator *_md_alloc;
2011-12-22 16:19:25 +01:00
protected:
Cap_session_component *_create_session(const char *args) {
return new (md_alloc()) Cap_session_component(_md_alloc, args); }
2011-12-22 16:19:25 +01:00
public:
/**
* Constructor
*
* \param session_ep entry point for managing session objects
* \param md_alloc meta-data allocator to be used by root component
*/
Cap_root(Rpc_entrypoint *session_ep,
Allocator *md_alloc)
:
Root_component<Cap_session_component>(session_ep, md_alloc),
_md_alloc(md_alloc)
{ }
2011-12-22 16:19:25 +01:00
};
}
#endif /* _CORE__INCLUDE__CAP_ROOT_H_ */