1.1 --- a/message.c Thu Mar 23 00:32:22 2023 +0100
1.2 +++ b/message.c Sun Jan 14 23:22:03 2024 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * Generation of message structure access operations.
1.6 *
1.7 - * Copyright (C) 2019, 2022 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2019, 2022, 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 @@ -79,12 +79,13 @@
1.13
1.14 for (index = 0; param != NULL; param = param->tail)
1.15 {
1.16 - /* Permit the specification of receive window flexpage input items for
1.17 - "out fpage" parameters. */
1.18 + /* Permit the specification of receive window flexpage and returned
1.19 + capability items for "out fpage" and "out cap" parameters, even when
1.20 + processing inputs to an operation. */
1.21
1.22 if ((param->cls & cls) &&
1.23 ((param->specifier & direction) ||
1.24 - specify_receive_fpage(param, component, writing)))
1.25 + specify_receive_item(param, component, writing)))
1.26 {
1.27 name = get_parameter_name(param->identifiers);
1.28 access = access_name(param, component, writing);
1.29 @@ -109,8 +110,17 @@
1.30 fprintf(fp, " ipc_message_add_%s(%smsg, %s%s);\n",
1.31 suffix, addr, access, name);
1.32 else
1.33 - fprintf(fp, " ipc_message_import_%s(%smsg, %d, %s%s);\n",
1.34 - suffix, addr, index, access, name);
1.35 + {
1.36 + /* For servers, update the buffer registers for future capabilities,
1.37 + allocating new capability slots. */
1.38 +
1.39 + if (component == SERVER_ROLE)
1.40 + fprintf(fp, " ipc_message_import_and_expect_%s(%smsg, %d, %s%s);\n",
1.41 + suffix, addr, index, access, name);
1.42 + else
1.43 + fprintf(fp, " ipc_message_import_%s(%smsg, %d, %s%s);\n",
1.44 + suffix, addr, index, access, name);
1.45 + }
1.46 index++;
1.47 break;
1.48