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