/*
- * (c) 2008-2009 Technische Universität Dresden
+ * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
+ * 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.
#include "shared.h"
-int
+static int
func_neg_call(L4::Cap<void> const &server, l4_uint32_t *result,
l4_uint32_t val)
{
- L4::Ipc_iostream s(l4_utcb());
+ L4::Ipc::Iostream s(l4_utcb());
s << l4_umword_t(Opcode::func_neg) << val;
- l4_msgtag_t res = s.call(server.cap());
- if (l4_ipc_error(res, l4_utcb()))
- return 1; // failure
+ int r = l4_error(s.call(server.cap(), Protocol::Calc));
+ if (r)
+ return r; // failure
s >> *result;
return 0; // ok
}
-int
+static int
func_sub_call(L4::Cap<void> const &server, l4_uint32_t *result,
l4_uint32_t val1, l4_uint32_t val2)
{
- L4::Ipc_iostream s(l4_utcb());
+ L4::Ipc::Iostream s(l4_utcb());
s << l4_umword_t(Opcode::func_sub) << val1 << val2;
- l4_msgtag_t res = s.call(server.cap(), Protocol::Calc);
- if (l4_ipc_error(res, l4_utcb()))
- return 1; // failure
+ int r = l4_error(s.call(server.cap(), Protocol::Calc));
+ if (r)
+ return r; // failure
s >> *result;
return 0; // ok
}
int
main()
{
-
L4::Cap<void> server = L4Re::Env::env()->get_cap<void>("calc_server");
if (!server.is_valid())
{