1 /* 2 * Interprocess communication abstractions. 3 * 4 * Copyright (C) 2018, 2019, 2021, 2022 Paul Boddie <paul@boddie.org.uk> 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA 20 */ 21 22 #pragma once 23 24 #include <l4/re/c/dataspace.h> 25 #include <l4/sys/ipc.h> 26 #include <l4/sys/utcb.h> 27 #include <l4/sys/types.h> 28 29 #include <sys/types.h> 30 31 32 33 EXTERN_C_BEGIN 34 35 /* Supporting operations. */ 36 37 long _expect_capabilities(l4_buf_regs_t *bregs, int number); 38 long _expect_capability(l4_buf_regs_t *bregs, int item); 39 long _expect_fpage(l4_buf_regs_t *bregs, int item, l4_umword_t map_control, l4_fpage_t fpage); 40 void _export_capability(l4_msgtag_t tag, l4_msg_regs_t *mregs, int item, l4_cap_idx_t ref); 41 void _export_fpage(l4_msgtag_t tag, l4_msg_regs_t *mregs, int item, l4_snd_fpage_t fpage); 42 void _export_page(l4_msgtag_t tag, l4_msg_regs_t *mregs, int item, l4_umword_t hot_spot, l4_fpage_t fpage); 43 void _free_expected_capabilities(l4_buf_regs_t *bregs, int number); 44 long _import_capability(l4_msgtag_t tag, l4_buf_regs_t *bregs, l4_msg_regs_t *mregs, int item, l4_cap_idx_t *ref); 45 long _import_dataspace(l4_msgtag_t tag, l4_buf_regs_t *bregs, l4_msg_regs_t *mregs, int item, l4re_ds_t *mem, l4_addr_t *addr); 46 long _import_fpage(l4_msgtag_t tag, l4_buf_regs_t *bregs, l4_msg_regs_t *mregs, int item, l4_snd_fpage_t *fpage); 47 48 /* Convenience operations. */ 49 50 l4_msgtag_t util_ipc_reply(l4_msgtag_t tag); 51 l4_msgtag_t util_ipc_request(l4_msgtag_t tag, l4_cap_idx_t endpoint); 52 l4_msgtag_t util_ipc_send(l4_msgtag_t tag, l4_cap_idx_t endpoint); 53 54 EXTERN_C_END