]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/io/server/src/server.cc
Inital import
[l4.git] / l4 / pkg / io / server / src / server.cc
1 /*
2  * (c) 2010 Technische Universität Dresden
3  * This file is part of TUD:OS and distributed under the terms of the
4  * GNU General Public License 2.
5  * Please see the COPYING-GPL-2 file for details.
6  */
7 #include <l4/re/env>
8 #include <l4/re/namespace>
9 #include <l4/re/util/cap_alloc>
10 #include <l4/re/util/object_registry>
11 #include <l4/re/error_helper>
12
13 #include <l4/cxx/ipc_server>
14 #include <l4/cxx/iostream>
15 #include <l4/cxx/l4iostream>
16
17 #include "server.h"
18
19
20 L4::Cap<void> rcv_cap = L4Re::Util::cap_alloc.alloc<void>();
21
22 class Loop_hooks :
23   public L4::Ipc_svr::Ignore_errors,
24   public L4::Ipc_svr::Default_timeout,
25   public L4::Ipc_svr::Compound_reply
26 {
27 public:
28   static void setup_wait(L4::Ipc_istream &istr, bool)
29   {
30     istr.reset();
31     istr << L4::Small_buf(rcv_cap.cap(), L4_RCV_ITEM_LOCAL_ID);
32     l4_utcb_br()->bdr = 0;
33   }
34
35 };
36
37 static L4Re::Util::Registry_server<Loop_hooks> server;
38
39 L4Re::Util::Object_registry *registry = server.registry();
40
41 int server_loop()
42 {
43   server.loop();
44   return 0;
45 }
46