// vi:set ft=cpp: -*- Mode: C++ -*-
/**
 * \file
 * \brief Type information server template.
 */
/*
 * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
 *     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 <l4/sys/meta>
#include <l4/sys/cxx/ipc_epiface>

namespace L4 { namespace Util {

template<typename KO, typename IOS>
long handle_meta_request(IOS &ios)
{
  using L4::Ipc::Msg::dispatch_call;
  typedef L4::Ipc::Detail::Meta_svr<KO> Msvr;
  l4_msgtag_t tag = dispatch_call<L4::Meta::Rpcs>((Msvr *)0, ios.utcb(),
                                                  ios.tag(), 0);
  ios.set_ipc_params(tag);
  return tag.label();
}

}}
