# HG changeset patch # User Paul Boddie # Date 1679527942 -3600 # Node ID 764d7c541daa496365c354997c431d0907e8289a # Parent d05994c8d1fe1e7e79a1932ac8ca582b2b49e3b1 Added support for "oneway" operations that do not produce a reply. diff -r d05994c8d1fe -r 764d7c541daa client.c --- a/client.c Tue Feb 28 22:33:52 2023 +0100 +++ b/client.c Thu Mar 23 00:32:22 2023 +0100 @@ -1,7 +1,7 @@ /* * Client code generation. * - * Copyright (C) 2019, 2020, 2021 Paul Boddie + * Copyright (C) 2019, 2020, 2021, 2022, 2023 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -125,7 +125,9 @@ /* Send the request. */ - fprintf(fp, client_function_body_call, opcode, "_endp"); + fprintf(fp, have_attribute(sig->attributes, "oneway") ? + client_function_body_call_oneway : client_function_body_call, + opcode, "_endp"); /* Retrieve output parameters from the message. */ diff -r d05994c8d1fe -r 764d7c541daa dispatch.c --- a/dispatch.c Tue Feb 28 22:33:52 2023 +0100 +++ b/dispatch.c Thu Mar 23 00:32:22 2023 +0100 @@ -1,7 +1,7 @@ /* * Generation of server dispatch and handle functions. * - * Copyright (C) 2019, 2022 Paul Boddie + * Copyright (C) 2019, 2022, 2023 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -48,6 +48,8 @@ if (have_attribute(sig->attributes, "completion")) s = dispatch_function_wrapper_case; + else if (have_attribute(sig->attributes, "oneway")) + s = dispatch_function_oneway_wrapper_case; else s = dispatch_function_reply_wrapper_case; diff -r d05994c8d1fe -r 764d7c541daa docs/idl.1 --- a/docs/idl.1 Tue Feb 28 22:33:52 2023 +0100 +++ b/docs/idl.1 Thu Mar 23 00:32:22 2023 +0100 @@ -1,4 +1,4 @@ -.TH IDL "1" "2022-12-09" "idl 2022-12-09" "User Commands" +.TH IDL "1" "2023-03-23" "idl 2023-03-23" "User Commands" .SH NAME idl \- L4Re IDL parser and code generator @@ -232,6 +232,9 @@ appropriate reply data. See the \fBCOMPLETION OPERATIONS\fR section for more details. .TP +\fBoneway\fR +An indication that calls involving the given operation do not expect a reply. +.TP \fBopcode(\fIopcode_value\fB)\fR An operation code (opcode) applying to the given operation. Without a protocol value applying to an interface, clients will specify the given @@ -465,6 +468,11 @@ preprocessor, generating code that may then not behave exactly as intended, although the code should be well-formed. .PP +The \fBcompletion\fR and \fBoneway\fR attributes should be mutually exclusive, +and it should not be possible to use \fBinout\fR and \fBout\fR parameters on +operations annotated with the \fBoneway\fR attribute. However, these +restrictions are not currently enforced. +.PP File inclusion is currently limited to loading files that all reside in the same location, although include paths could be supported. .PP @@ -478,7 +486,7 @@ The project Web site: http://projects.boddie.org.uk/idl4re .SH COPYRIGHT -Copyright \(co 2019, 2020, 2022 Paul Boddie +Copyright \(co 2019, 2020, 2022, 2023 Paul Boddie .PP This program is free software; you may redistribute it under the terms of the GNU General Public License version 2 or (at your option) a later version. @@ -491,3 +499,5 @@ DCE: http://www.opengroup.org/dce/ .TP DICE: https://wiki.tudos.org/Dice_IDL_compiler +.TP +IDL4: https://www.l4ka.org/downloads/idl4_manual.pdf diff -r d05994c8d1fe -r 764d7c541daa examples/notifier.idl --- a/examples/notifier.idl Tue Feb 28 22:33:52 2023 +0100 +++ b/examples/notifier.idl Thu Mar 23 00:32:22 2023 +0100 @@ -4,5 +4,5 @@ { /* Send notification events. */ - [opcode(25)] void notify(in notify_flags_t flags); + [opcode(25), oneway] void notify(in notify_flags_t flags); }; diff -r d05994c8d1fe -r 764d7c541daa templates.h --- a/templates.h Tue Feb 28 22:33:52 2023 +0100 +++ b/templates.h Thu Mar 23 00:32:22 2023 +0100 @@ -52,6 +52,12 @@ " if (err)\n" \ " return err;\n" +#define client_function_body_call_oneway \ +"\n ipc_message_send(&msg, %s, %s);\n\n" \ +" err = l4_error(msg.tag);\n" \ +" if (err)\n" \ +" return err;\n" + #define client_function_body_epilogue \ "\n ipc_message_free(&msg);\n" \ " return L4_EOK;\n" @@ -154,6 +160,12 @@ " ipc_message_send_error(msg, %s_%s(msg, %s));\n" \ " break;\n\n" +#define dispatch_function_oneway_wrapper_case \ +" case %s:\n" \ +" err = %s_%s(msg, %s);\n" \ +" (void) err;\n" \ +" break;\n\n" + #define dispatch_function_reply_wrapper_case \ " case %s:\n" \ " err = %s_%s(msg, %s);\n" \