1.1 --- a/client.c Tue Feb 28 22:33:52 2023 +0100
1.2 +++ b/client.c Thu Mar 23 00:32:22 2023 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * Client code generation.
1.6 *
1.7 - * Copyright (C) 2019, 2020, 2021 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2019, 2020, 2021, 2022, 2023 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 @@ -125,7 +125,9 @@
1.13
1.14 /* Send the request. */
1.15
1.16 - fprintf(fp, client_function_body_call, opcode, "_endp");
1.17 + fprintf(fp, have_attribute(sig->attributes, "oneway") ?
1.18 + client_function_body_call_oneway : client_function_body_call,
1.19 + opcode, "_endp");
1.20
1.21 /* Retrieve output parameters from the message. */
1.22
2.1 --- a/dispatch.c Tue Feb 28 22:33:52 2023 +0100
2.2 +++ b/dispatch.c Thu Mar 23 00:32:22 2023 +0100
2.3 @@ -1,7 +1,7 @@
2.4 /*
2.5 * Generation of server dispatch and handle functions.
2.6 *
2.7 - * Copyright (C) 2019, 2022 Paul Boddie <paul@boddie.org.uk>
2.8 + * Copyright (C) 2019, 2022, 2023 Paul Boddie <paul@boddie.org.uk>
2.9 *
2.10 * This program is free software; you can redistribute it and/or
2.11 * modify it under the terms of the GNU General Public License as
2.12 @@ -48,6 +48,8 @@
2.13
2.14 if (have_attribute(sig->attributes, "completion"))
2.15 s = dispatch_function_wrapper_case;
2.16 + else if (have_attribute(sig->attributes, "oneway"))
2.17 + s = dispatch_function_oneway_wrapper_case;
2.18 else
2.19 s = dispatch_function_reply_wrapper_case;
2.20
3.1 --- a/docs/idl.1 Tue Feb 28 22:33:52 2023 +0100
3.2 +++ b/docs/idl.1 Thu Mar 23 00:32:22 2023 +0100
3.3 @@ -1,4 +1,4 @@
3.4 -.TH IDL "1" "2022-12-09" "idl 2022-12-09" "User Commands"
3.5 +.TH IDL "1" "2023-03-23" "idl 2023-03-23" "User Commands"
3.6
3.7 .SH NAME
3.8 idl \- L4Re IDL parser and code generator
3.9 @@ -232,6 +232,9 @@
3.10 appropriate reply data. See the \fBCOMPLETION OPERATIONS\fR section for more
3.11 details.
3.12 .TP
3.13 +\fBoneway\fR
3.14 +An indication that calls involving the given operation do not expect a reply.
3.15 +.TP
3.16 \fBopcode(\fIopcode_value\fB)\fR
3.17 An operation code (opcode) applying to the given operation. Without a protocol
3.18 value applying to an interface, clients will specify the given
3.19 @@ -465,6 +468,11 @@
3.20 preprocessor, generating code that may then not behave exactly as intended,
3.21 although the code should be well-formed.
3.22 .PP
3.23 +The \fBcompletion\fR and \fBoneway\fR attributes should be mutually exclusive,
3.24 +and it should not be possible to use \fBinout\fR and \fBout\fR parameters on
3.25 +operations annotated with the \fBoneway\fR attribute. However, these
3.26 +restrictions are not currently enforced.
3.27 +.PP
3.28 File inclusion is currently limited to loading files that all reside in the same
3.29 location, although include paths could be supported.
3.30 .PP
3.31 @@ -478,7 +486,7 @@
3.32 The project Web site: http://projects.boddie.org.uk/idl4re
3.33
3.34 .SH COPYRIGHT
3.35 -Copyright \(co 2019, 2020, 2022 Paul Boddie <paul@boddie.org.uk>
3.36 +Copyright \(co 2019, 2020, 2022, 2023 Paul Boddie <paul@boddie.org.uk>
3.37 .PP
3.38 This program is free software; you may redistribute it under the terms of
3.39 the GNU General Public License version 2 or (at your option) a later version.
3.40 @@ -491,3 +499,5 @@
3.41 DCE: http://www.opengroup.org/dce/
3.42 .TP
3.43 DICE: https://wiki.tudos.org/Dice_IDL_compiler
3.44 +.TP
3.45 +IDL4: https://www.l4ka.org/downloads/idl4_manual.pdf
4.1 --- a/examples/notifier.idl Tue Feb 28 22:33:52 2023 +0100
4.2 +++ b/examples/notifier.idl Thu Mar 23 00:32:22 2023 +0100
4.3 @@ -4,5 +4,5 @@
4.4 {
4.5 /* Send notification events. */
4.6
4.7 - [opcode(25)] void notify(in notify_flags_t flags);
4.8 + [opcode(25), oneway] void notify(in notify_flags_t flags);
4.9 };
5.1 --- a/templates.h Tue Feb 28 22:33:52 2023 +0100
5.2 +++ b/templates.h Thu Mar 23 00:32:22 2023 +0100
5.3 @@ -52,6 +52,12 @@
5.4 " if (err)\n" \
5.5 " return err;\n"
5.6
5.7 +#define client_function_body_call_oneway \
5.8 +"\n ipc_message_send(&msg, %s, %s);\n\n" \
5.9 +" err = l4_error(msg.tag);\n" \
5.10 +" if (err)\n" \
5.11 +" return err;\n"
5.12 +
5.13 #define client_function_body_epilogue \
5.14 "\n ipc_message_free(&msg);\n" \
5.15 " return L4_EOK;\n"
5.16 @@ -154,6 +160,12 @@
5.17 " ipc_message_send_error(msg, %s_%s(msg, %s));\n" \
5.18 " break;\n\n"
5.19
5.20 +#define dispatch_function_oneway_wrapper_case \
5.21 +" case %s:\n" \
5.22 +" err = %s_%s(msg, %s);\n" \
5.23 +" (void) err;\n" \
5.24 +" break;\n\n"
5.25 +
5.26 #define dispatch_function_reply_wrapper_case \
5.27 " case %s:\n" \
5.28 " err = %s_%s(msg, %s);\n" \