1 /* 2 * Interprocess communication abstractions. 3 * 4 * Copyright (C) 2018-2024 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/sys/ipc.h> 25 #include <l4/sys/utcb.h> 26 #include <l4/sys/types.h> 27 28 #include <sys/types.h> 29 30 31 32 EXTERN_C_BEGIN 33 34 /* Supporting operations. */ 35 36 long _expect_capabilities(l4_buf_regs_t *bregs, int number); 37 long _expect_capability(l4_buf_regs_t *bregs, int item); 38 long _expect_fpage(l4_buf_regs_t *bregs, int item, l4_umword_t map_control, l4_fpage_t fpage); 39 void _export_capability(l4_msgtag_t tag, l4_msg_regs_t *mregs, int item, l4_cap_idx_t ref); 40 void _export_fpage(l4_msgtag_t tag, l4_msg_regs_t *mregs, int item, l4_snd_fpage_t fpage); 41 void _export_page(l4_msgtag_t tag, l4_msg_regs_t *mregs, int item, l4_umword_t hot_spot, l4_fpage_t fpage); 42 void _free_expected_capabilities(l4_buf_regs_t *bregs, int start, int limit); 43 long _import_capability(l4_msgtag_t tag, l4_buf_regs_t *bregs, l4_msg_regs_t *mregs, int item, int buf_item, l4_cap_idx_t *ref, int *local); 44 long _import_dataspace(l4_msgtag_t tag, l4_buf_regs_t *bregs, l4_msg_regs_t *mregs, int item, int buf_item, l4_cap_idx_t *mem, l4_addr_t *addr, int *local); 45 long _import_fpage(l4_msgtag_t tag, l4_buf_regs_t *bregs, l4_msg_regs_t *mregs, int item, l4_snd_fpage_t *fpage); 46 47 /* Convenience operations. */ 48 49 l4_msgtag_t util_ipc_reply(l4_msgtag_t tag); 50 l4_msgtag_t util_ipc_request(l4_msgtag_t tag, l4_cap_idx_t endpoint); 51 l4_msgtag_t util_ipc_send(l4_msgtag_t tag, l4_cap_idx_t endpoint); 52 53 EXTERN_C_END