// vi:ft=cpp /** * \file * \brief Type information server template. */ /* * (c) 2010 Alexander Warg * economic rights: Technische Universität Dresden (Germany) * * This file is part of TUD:OS and distributed under the terms of the * GNU General Public License 2. * Please see the COPYING-GPL-2 file for details. * * As a special exception, you may use this file as part of a free software * library without restriction. Specifically, if other files instantiate * templates or use macros or inline functions from this file, or you compile * this file and link it with other files to produce an executable, this * file does not by itself cause the resulting executable to be covered by * the GNU General Public License. This exception does not however * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. */ #pragma once #include #include namespace L4 { namespace Util { template long handle_meta_request(L4::Ipc_iostream &ios) { l4_umword_t op; ios >> op; switch (op) { case L4::Meta::O_num_ifaces: return 1; case L4::Meta::O_iface: { l4_umword_t ifx; ios >> ifx; if (ifx > 0) return -L4_ERANGE; L4::Ipc::Varg_t n(L4::kobject_typeid()->name()); L4::Ipc::Varg_t p(L4::kobject_typeid()->proto()); ios << n << p; return 0; } case L4::Meta::O_supports: { l4_mword_t proto; ios >> proto; return L4::kobject_typeid()->has_proto(proto); } default: return -L4_ENOSYS; } } }}