1.1 --- a/libipc/include/ipc/direct.h Fri Jan 19 23:58:54 2024 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,40 +0,0 @@
1.4 -/*
1.5 - * Interprocess communication operations.
1.6 - *
1.7 - * Copyright (C) 2018, 2019 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 -#pragma once
1.26 -
1.27 -#include <l4/re/c/dataspace.h>
1.28 -#include <l4/sys/ipc.h>
1.29 -#include <l4/sys/types.h>
1.30 -
1.31 -
1.32 -
1.33 -EXTERN_C_BEGIN
1.34 -
1.35 -/* Direct operations. */
1.36 -
1.37 -long ipc_expect_capabilities(int number);
1.38 -long ipc_expect_capability(int item);
1.39 -void ipc_export_capability(l4_msgtag_t tag, int item, l4_cap_idx_t ref);
1.40 -long ipc_import_capability(l4_msgtag_t tag, int item, l4_cap_idx_t *ref);
1.41 -long ipc_import_dataspace(l4_msgtag_t tag, int item, l4re_ds_t *mem, l4_addr_t *addr);
1.42 -
1.43 -EXTERN_C_END
2.1 --- a/libipc/lib/src/Makefile Fri Jan 19 23:58:54 2024 +0100
2.2 +++ b/libipc/lib/src/Makefile Sun Jan 21 17:35:01 2024 +0100
2.3 @@ -3,7 +3,7 @@
2.4
2.5 TARGET = libipc.a libipc.so
2.6 PC_FILENAME = libipc
2.7 -SRC_C = cap_alloc.c direct.c irq.c map.c mem_ipc.c message.c semaphore.c server.c thread.c util_ipc.c
2.8 +SRC_C = cap_alloc.c irq.c map.c mem_ipc.c message.c semaphore.c server.c thread.c util_ipc.c
2.9 REQUIRES_LIBS = l4re_c-util
2.10
2.11 PRIVATE_INCDIR += $(PKGDIR)/include/ipc
3.1 --- a/libipc/lib/src/direct.c Fri Jan 19 23:58:54 2024 +0100
3.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
3.3 @@ -1,87 +0,0 @@
3.4 -/*
3.5 - * Interprocess communication abstractions.
3.6 - *
3.7 - * Copyright (C) 2018, 2019, 2021, 2023 Paul Boddie <paul@boddie.org.uk>
3.8 - *
3.9 - * This program is free software; you can redistribute it and/or
3.10 - * modify it under the terms of the GNU General Public License as
3.11 - * published by the Free Software Foundation; either version 2 of
3.12 - * the License, or (at your option) any later version.
3.13 - *
3.14 - * This program is distributed in the hope that it will be useful,
3.15 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
3.16 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3.17 - * GNU General Public License for more details.
3.18 - *
3.19 - * You should have received a copy of the GNU General Public License
3.20 - * along with this program; if not, write to the Free Software
3.21 - * Foundation, Inc., 51 Franklin Street, Fifth Floor,
3.22 - * Boston, MA 02110-1301, USA
3.23 - */
3.24 -
3.25 -#include <l4/sys/utcb.h>
3.26 -
3.27 -#include "direct.h"
3.28 -#include "util_ipc.h"
3.29 -
3.30 -
3.31 -
3.32 -/* Direct operations. */
3.33 -
3.34 -/* Reserve the given number of slots from zero for incoming capabilities. */
3.35 -
3.36 -long ipc_expect_capabilities(int number)
3.37 -{
3.38 - return _expect_capabilities(l4_utcb_br(), number);
3.39 -}
3.40 -
3.41 -/* Reserve a slot for an incoming capability. */
3.42 -
3.43 -long ipc_expect_capability(int item)
3.44 -{
3.45 - return _expect_capability(l4_utcb_br(), item);
3.46 -}
3.47 -
3.48 -/* Export a capability at the given position in the message. */
3.49 -
3.50 -void ipc_export_capability(l4_msgtag_t tag, int item, l4_cap_idx_t ref)
3.51 -{
3.52 - _export_capability(tag, l4_utcb_mr(), item, ref);
3.53 -}
3.54 -
3.55 -/* Import the capability at the given item position, updating the buffer
3.56 - registers for future capabilities. */
3.57 -
3.58 -long ipc_import_capability(l4_msgtag_t tag, int item, l4_cap_idx_t *ref)
3.59 -{
3.60 - int local;
3.61 - long err = _import_capability(tag, l4_utcb_br(), l4_utcb_mr(), item, ref, &local);
3.62 -
3.63 - if (err)
3.64 - return err;
3.65 -
3.66 - if (local)
3.67 - return L4_EOK;
3.68 -
3.69 - return ipc_expect_capability(item);
3.70 -}
3.71 -
3.72 -/* Import a dataspace, mapping it to an address, updating the buffer registers
3.73 - for future capabilities. */
3.74 -
3.75 -long ipc_import_dataspace(l4_msgtag_t tag, int item, l4re_ds_t *mem, l4_addr_t *addr)
3.76 -{
3.77 - int local;
3.78 - long err = _import_dataspace(tag, l4_utcb_br(), l4_utcb_mr(), item, mem, addr, &local);
3.79 -
3.80 - if (err)
3.81 - return err;
3.82 -
3.83 - if (local)
3.84 - return L4_EOK;
3.85 -
3.86 - return ipc_expect_capability(item);
3.87 -}
3.88 -
3.89 -/* vim: tabstop=2 expandtab shiftwidth=2
3.90 -*/