2011-12-22 16:19:25 +01:00
|
|
|
/*
|
|
|
|
* \brief Core-specific region manager session
|
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2006-07-12
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2012-01-03 15:35:05 +01:00
|
|
|
* Copyright (C) 2006-2012 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__CORE_RM_SESSION_H_
|
|
|
|
#define _CORE__INCLUDE__CORE_RM_SESSION_H_
|
|
|
|
|
|
|
|
/* Genode includes */
|
|
|
|
#include <base/rpc_server.h>
|
|
|
|
|
|
|
|
/* core includes */
|
|
|
|
#include <dataspace_component.h>
|
|
|
|
|
|
|
|
namespace Genode {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Region manager that uses the physical dataspace
|
|
|
|
* addresses directly as virtual addresses.
|
|
|
|
*/
|
|
|
|
class Core_rm_session : public Rm_session
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
|
|
|
Rpc_entrypoint *_ds_ep;
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
Core_rm_session(Rpc_entrypoint *ds_ep): _ds_ep(ds_ep) { }
|
|
|
|
|
|
|
|
Local_addr attach(Dataspace_capability ds_cap, size_t size=0,
|
|
|
|
off_t offset=0, bool use_local_addr = false,
|
2012-04-16 18:55:18 +02:00
|
|
|
Local_addr local_addr = 0,
|
|
|
|
bool executable = false)
|
2011-12-22 16:19:25 +01:00
|
|
|
{
|
2012-12-14 10:03:55 +01:00
|
|
|
Object_pool<Dataspace_component>::Guard
|
|
|
|
ds(_ds_ep->lookup_and_lock(ds_cap));
|
2011-12-22 16:19:25 +01:00
|
|
|
if (!ds)
|
|
|
|
throw Invalid_dataspace();
|
|
|
|
|
|
|
|
return (void *)ds->phys_addr();
|
|
|
|
}
|
|
|
|
|
|
|
|
void detach(Local_addr local_addr) { }
|
|
|
|
|
|
|
|
Pager_capability add_client(Thread_capability thread) {
|
|
|
|
return Pager_capability(); }
|
|
|
|
|
|
|
|
void fault_handler(Signal_context_capability handler) { }
|
|
|
|
|
|
|
|
State state() { return State(); }
|
|
|
|
|
|
|
|
Dataspace_capability dataspace() { return Dataspace_capability(); }
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _CORE__INCLUDE__CORE_RM_SESSION_H_ */
|