2011-12-22 16:19:25 +01:00
|
|
|
/*
|
|
|
|
* \brief Timer service
|
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2006-08-15
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2015-04-14 13:56:26 +02:00
|
|
|
* Copyright (C) 2006-2015 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.
|
|
|
|
*/
|
|
|
|
|
2015-04-14 13:56:26 +02:00
|
|
|
/* Genode includes */
|
2011-12-22 16:19:25 +01:00
|
|
|
#include <base/env.h>
|
|
|
|
#include <base/sleep.h>
|
|
|
|
#include <base/heap.h>
|
|
|
|
#include <cap_session/connection.h>
|
2015-04-14 13:56:26 +02:00
|
|
|
#include <os/server.h>
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2015-04-14 13:56:26 +02:00
|
|
|
/* local includes */
|
2011-12-22 16:19:25 +01:00
|
|
|
#include "timer_root.h"
|
|
|
|
|
|
|
|
using namespace Genode;
|
|
|
|
using namespace Timer;
|
|
|
|
|
|
|
|
|
2015-04-14 13:56:26 +02:00
|
|
|
struct Main
|
2011-12-22 16:19:25 +01:00
|
|
|
{
|
2015-04-14 13:56:26 +02:00
|
|
|
Server::Entrypoint &ep;
|
|
|
|
Sliced_heap sliced_heap;
|
|
|
|
Timer::Root_component root;
|
|
|
|
|
|
|
|
Main(Server::Entrypoint &ep)
|
|
|
|
:
|
|
|
|
ep(ep),
|
|
|
|
sliced_heap(Genode::env()->ram_session(), Genode::env()->rm_session()),
|
|
|
|
root(ep, &sliced_heap, 0)
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
* Announce timer service at our parent.
|
|
|
|
*/
|
|
|
|
env()->parent()->announce(ep.manage(root));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/************
|
|
|
|
** Server **
|
|
|
|
************/
|
|
|
|
|
|
|
|
namespace Server {
|
|
|
|
char const *name() { return "timer_drv_ep"; }
|
|
|
|
size_t stack_size() { return 1024*sizeof(long); }
|
|
|
|
void construct(Entrypoint &ep) { static Main server(ep); }
|
2011-12-22 16:19:25 +01:00
|
|
|
}
|