1.1 --- a/libipc/lib/src/direct.c Fri Jan 19 23:58:54 2024 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,87 +0,0 @@
1.4 -/*
1.5 - * Interprocess communication abstractions.
1.6 - *
1.7 - * Copyright (C) 2018, 2019, 2021, 2023 Paul Boddie <paul@boddie.org.uk>
1.8 - *
1.9 - * This program is free software; you can redistribute it and/or
1.10 - * modify it under the terms of the GNU General Public License as
1.11 - * published by the Free Software Foundation; either version 2 of
1.12 - * the License, or (at your option) any later version.
1.13 - *
1.14 - * This program is distributed in the hope that it will be useful,
1.15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.17 - * GNU General Public License for more details.
1.18 - *
1.19 - * You should have received a copy of the GNU General Public License
1.20 - * along with this program; if not, write to the Free Software
1.21 - * Foundation, Inc., 51 Franklin Street, Fifth Floor,
1.22 - * Boston, MA 02110-1301, USA
1.23 - */
1.24 -
1.25 -#include <l4/sys/utcb.h>
1.26 -
1.27 -#include "direct.h"
1.28 -#include "util_ipc.h"
1.29 -
1.30 -
1.31 -
1.32 -/* Direct operations. */
1.33 -
1.34 -/* Reserve the given number of slots from zero for incoming capabilities. */
1.35 -
1.36 -long ipc_expect_capabilities(int number)
1.37 -{
1.38 - return _expect_capabilities(l4_utcb_br(), number);
1.39 -}
1.40 -
1.41 -/* Reserve a slot for an incoming capability. */
1.42 -
1.43 -long ipc_expect_capability(int item)
1.44 -{
1.45 - return _expect_capability(l4_utcb_br(), item);
1.46 -}
1.47 -
1.48 -/* Export a capability at the given position in the message. */
1.49 -
1.50 -void ipc_export_capability(l4_msgtag_t tag, int item, l4_cap_idx_t ref)
1.51 -{
1.52 - _export_capability(tag, l4_utcb_mr(), item, ref);
1.53 -}
1.54 -
1.55 -/* Import the capability at the given item position, updating the buffer
1.56 - registers for future capabilities. */
1.57 -
1.58 -long ipc_import_capability(l4_msgtag_t tag, int item, l4_cap_idx_t *ref)
1.59 -{
1.60 - int local;
1.61 - long err = _import_capability(tag, l4_utcb_br(), l4_utcb_mr(), item, ref, &local);
1.62 -
1.63 - if (err)
1.64 - return err;
1.65 -
1.66 - if (local)
1.67 - return L4_EOK;
1.68 -
1.69 - return ipc_expect_capability(item);
1.70 -}
1.71 -
1.72 -/* Import a dataspace, mapping it to an address, updating the buffer registers
1.73 - for future capabilities. */
1.74 -
1.75 -long ipc_import_dataspace(l4_msgtag_t tag, int item, l4re_ds_t *mem, l4_addr_t *addr)
1.76 -{
1.77 - int local;
1.78 - long err = _import_dataspace(tag, l4_utcb_br(), l4_utcb_mr(), item, mem, addr, &local);
1.79 -
1.80 - if (err)
1.81 - return err;
1.82 -
1.83 - if (local)
1.84 - return L4_EOK;
1.85 -
1.86 - return ipc_expect_capability(item);
1.87 -}
1.88 -
1.89 -/* vim: tabstop=2 expandtab shiftwidth=2
1.90 -*/