1 /*
2  * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3  *               Alexander Warg <warg@os.inf.tu-dresden.de>
4  *     economic rights: Technische Universität Dresden (Germany)
5  *
6  * This file is part of TUD:OS and distributed under the terms of the
7  * GNU General Public License 2.
8  * Please see the COPYING-GPL-2 file for details.
9  */
10 #pragma once
11 
12 #include <l4/sys/capability>
13 #include <l4/sys/vcon>
14 #include <l4/sys/cxx/ipc_epiface>
15 #include <l4/cxx/string>
16 
17 #include "server_obj.h"
18 
19 namespace Moe {
20 
21 class Log : public L4::Epiface_t<Log, L4::Vcon, Moe::Server_object>
22 {
23 private:
24   char const *_tag;
25   unsigned long _l;
26   unsigned char _color;
27   bool _in_line;
28 
29 public:
Log()30   Log() : _tag(0), _l(0), _color(0), _in_line(false) {}
set_tag(char const * tag,int len)31   void set_tag(char const *tag, int len)
32   { _tag = tag; _l = len; }
set_color(unsigned char color)33   void set_color(unsigned char color)
34   { _color = color; }
35 
tag()36   char const *tag() const { return _tag; }
color()37   unsigned char color() const { return _color; }
38 
~Log()39   virtual ~Log() {}
40 
41   static int color_value(cxx::String const &col);
42 
op_bind(L4::Icu::Rights,l4_umword_t,L4::Ipc::Snd_fpage)43   int op_bind(L4::Icu::Rights, l4_umword_t,
44               L4::Ipc::Snd_fpage)
45   { return -L4_ENOSYS; }
46 
op_unbind(L4::Icu::Rights,l4_umword_t,L4::Ipc::Snd_fpage)47   int op_unbind(L4::Icu::Rights, l4_umword_t,
48                 L4::Ipc::Snd_fpage)
49   { return -L4_ENOSYS; }
op_info(L4::Icu::Rights,L4::Icu::_Info &)50   int op_info(L4::Icu::Rights, L4::Icu::_Info &)
51   { return -L4_ENOSYS; }
op_msi_info(L4::Icu::Rights,l4_umword_t,l4_uint64_t,l4_icu_msi_info_t &)52   int op_msi_info(L4::Icu::Rights, l4_umword_t, l4_uint64_t,
53                   l4_icu_msi_info_t &)
54   { return -L4_ENOSYS; }
op_mask(L4::Icu::Rights,l4_umword_t)55   int op_mask(L4::Icu::Rights, l4_umword_t)
56   { return -L4_ENOSYS; }
op_unmask(L4::Icu::Rights,l4_umword_t)57   int op_unmask(L4::Icu::Rights, l4_umword_t)
58   { return -L4_ENOSYS; }
op_set_mode(L4::Icu::Rights,l4_umword_t,l4_umword_t)59   int op_set_mode(L4::Icu::Rights, l4_umword_t, l4_umword_t)
60   { return -L4_ENOSYS; }
61 
62   l4_msgtag_t op_dispatch(l4_utcb_t *utcb, l4_msgtag_t tag, L4::Vcon::Rights);
63 };
64 }
65