1.1 --- a/libipc/lib/src/util_ipc.c Sun Jan 21 17:35:01 2024 +0100
1.2 +++ b/libipc/lib/src/util_ipc.c Sun Jan 21 17:56:36 2024 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * Interprocess communication abstractions.
1.6 *
1.7 - * Copyright (C) 2018, 2019, 2021, 2022, 2023 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2018-2024 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -126,8 +126,8 @@
1.13 /* Import from the message the capability at the given item position. */
1.14
1.15 long _import_capability(l4_msgtag_t tag, l4_buf_regs_t *bregs,
1.16 - l4_msg_regs_t *mregs, int item, l4_cap_idx_t *ref,
1.17 - int *local)
1.18 + l4_msg_regs_t *mregs, int item, int buf_item,
1.19 + l4_cap_idx_t *ref, int *local)
1.20 {
1.21 l4_snd_fpage_t fpage;
1.22 long err = _import_fpage(tag, bregs, mregs, item, &fpage);
1.23 @@ -142,7 +142,7 @@
1.24
1.25 if ((fpage.snd_base & 0x3e) == 0x38)
1.26 {
1.27 - *ref = bregs->br[item] & L4_CAP_MASK;
1.28 + *ref = bregs->br[buf_item] & L4_CAP_MASK;
1.29 *local = 0;
1.30 }
1.31
1.32 @@ -165,15 +165,15 @@
1.33 /* Import from the message a dataspace, mapping it to an address. */
1.34
1.35 long _import_dataspace(l4_msgtag_t tag, l4_buf_regs_t *bregs,
1.36 - l4_msg_regs_t *mregs, int item, l4re_ds_t *mem,
1.37 - l4_addr_t *addr, int *local)
1.38 + l4_msg_regs_t *mregs, int item, int buf_item,
1.39 + l4re_ds_t *mem, l4_addr_t *addr, int *local)
1.40 {
1.41 long err;
1.42 unsigned long size;
1.43
1.44 *mem = ipc_cap_alloc();
1.45
1.46 - err = _import_capability(tag, bregs, mregs, item, mem, local);
1.47 + err = _import_capability(tag, bregs, mregs, item, buf_item, mem, local);
1.48
1.49 if (err)
1.50 {