4 * This file is part of the Valgrind port to L4Re.
6 * (c) 2009-2010 Aaron Pohle <apohle@os.inf.tu-dresden.de>,
7 * Bjoern Doebel <doebel@os.inf.tu-dresden.de>
8 * economic rights: Technische Universitaet Dresden (Germany)
15 * L4Re's VCon server could have been declared as:
17 * virtual int dispatch() = 0;
18 * virtual int read() = 0;
19 * vitrual int write() = 0;
22 * However, someone disliked the idea of having these virtual
23 * functions for performance reasons (vtable lookup). Therefore,
24 * the class is now declared as
26 * class vcon_svr<SVR> {
27 * SVR* self() { return static_cast<SVR*>(this); }
30 * So in order to implement a valid VCon server class, we need to
31 * inherit from this server class _and_ pass our class name as the
32 * template parameter at the same time.
34 class vcon_srv : public L4Re::Util::Vcon_svr<Vcap::vcon_srv>
37 int vcon_write(const char *buffer, unsigned size)
39 static char const *prefix = "\033[35m";
40 static char const *suffix = "\033[0m";
41 Char buf[L4_VCON_WRITE_SIZE] = {0, };
43 VG_(sprintf)(buf, "%s", prefix);
44 VG_(memcpy)(buf + VG_(strlen)((Char const*)prefix), buffer, size);
45 VG_(sprintf)(buf + VG_(strlen)((Char const *)prefix) + size,
48 VG_(printf)("%s", buf);
53 int vcon_read(char *buffer, unsigned size)
55 enter_kdebug("vcon_read");
59 L4::Cap<void> vcon_get_irq()
61 enter_kdebug("vcon_get_irq");
62 return L4::Cap<void>(L4_INVALID_CAP);
67 enter_kdebug("vcon_end");