# HG changeset patch # User Paul Boddie # Date 1705854901 -3600 # Node ID bb13d118f8024c47486f8d4826c930c71b3a900d # Parent a35ef745be1dda4459eb6ddc014a6ef403e8a357 Removed superfluous library functions. diff -r a35ef745be1d -r bb13d118f802 libipc/include/ipc/direct.h --- a/libipc/include/ipc/direct.h Fri Jan 19 23:58:54 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,40 +0,0 @@ -/* - * Interprocess communication operations. - * - * Copyright (C) 2018, 2019 Paul Boddie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA - */ - -#pragma once - -#include -#include -#include - - - -EXTERN_C_BEGIN - -/* Direct operations. */ - -long ipc_expect_capabilities(int number); -long ipc_expect_capability(int item); -void ipc_export_capability(l4_msgtag_t tag, int item, l4_cap_idx_t ref); -long ipc_import_capability(l4_msgtag_t tag, int item, l4_cap_idx_t *ref); -long ipc_import_dataspace(l4_msgtag_t tag, int item, l4re_ds_t *mem, l4_addr_t *addr); - -EXTERN_C_END diff -r a35ef745be1d -r bb13d118f802 libipc/lib/src/Makefile --- a/libipc/lib/src/Makefile Fri Jan 19 23:58:54 2024 +0100 +++ b/libipc/lib/src/Makefile Sun Jan 21 17:35:01 2024 +0100 @@ -3,7 +3,7 @@ TARGET = libipc.a libipc.so PC_FILENAME = libipc -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 +SRC_C = cap_alloc.c irq.c map.c mem_ipc.c message.c semaphore.c server.c thread.c util_ipc.c REQUIRES_LIBS = l4re_c-util PRIVATE_INCDIR += $(PKGDIR)/include/ipc diff -r a35ef745be1d -r bb13d118f802 libipc/lib/src/direct.c --- a/libipc/lib/src/direct.c Fri Jan 19 23:58:54 2024 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/* - * Interprocess communication abstractions. - * - * Copyright (C) 2018, 2019, 2021, 2023 Paul Boddie - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA - */ - -#include - -#include "direct.h" -#include "util_ipc.h" - - - -/* Direct operations. */ - -/* Reserve the given number of slots from zero for incoming capabilities. */ - -long ipc_expect_capabilities(int number) -{ - return _expect_capabilities(l4_utcb_br(), number); -} - -/* Reserve a slot for an incoming capability. */ - -long ipc_expect_capability(int item) -{ - return _expect_capability(l4_utcb_br(), item); -} - -/* Export a capability at the given position in the message. */ - -void ipc_export_capability(l4_msgtag_t tag, int item, l4_cap_idx_t ref) -{ - _export_capability(tag, l4_utcb_mr(), item, ref); -} - -/* Import the capability at the given item position, updating the buffer - registers for future capabilities. */ - -long ipc_import_capability(l4_msgtag_t tag, int item, l4_cap_idx_t *ref) -{ - int local; - long err = _import_capability(tag, l4_utcb_br(), l4_utcb_mr(), item, ref, &local); - - if (err) - return err; - - if (local) - return L4_EOK; - - return ipc_expect_capability(item); -} - -/* Import a dataspace, mapping it to an address, updating the buffer registers - for future capabilities. */ - -long ipc_import_dataspace(l4_msgtag_t tag, int item, l4re_ds_t *mem, l4_addr_t *addr) -{ - int local; - long err = _import_dataspace(tag, l4_utcb_br(), l4_utcb_mr(), item, mem, addr, &local); - - if (err) - return err; - - if (local) - return L4_EOK; - - return ipc_expect_capability(item); -} - -/* vim: tabstop=2 expandtab shiftwidth=2 -*/