1.1 --- a/program.c Fri Nov 01 23:38:25 2019 +0100
1.2 +++ b/program.c Sat Nov 02 00:36:10 2019 +0100
1.3 @@ -78,7 +78,14 @@
1.4
1.5 static char dispatcher_prologue[] =
1.6 "#include \"common_dispatch.h\"\n\n"
1.7 -"void dispatch(ipc_message_t *msg, void *_self)\n"
1.8 +"void handle(ipc_message_t *msg, void *obj)\n"
1.9 +"{\n"
1.10 +" ipc_message_open(msg);\n"
1.11 +" dispatch(msg, obj);\n"
1.12 +" ipc_message_reply(msg);\n"
1.13 +" ipc_message_discard(msg);\n"
1.14 +"}\n\n"
1.15 +"void dispatch(ipc_message_t *msg, void *obj)\n"
1.16 "{\n"
1.17 " switch (l4_msgtag_label(msg->tag))\n"
1.18 " {\n";
1.19 @@ -93,7 +100,8 @@
1.20 static char dispatcher_header_prologue[] =
1.21 "#pragma once\n\n"
1.22 "#include <ipc/message.h>\n\n"
1.23 -"void dispatch(ipc_message_t *msg, void *_self);\n\n";
1.24 +"void handle(ipc_message_t *msg, void *obj);\n\n"
1.25 +"void dispatch(ipc_message_t *msg, void *obj);\n\n";
1.26
1.27 static char header_prologue[] =
1.28 "#pragma once\n\n"
1.29 @@ -275,7 +283,7 @@
1.30 if (protocol != NULL)
1.31 {
1.32 fprintf(dispatcher_fp, " case %s:\n", protocol);
1.33 - fprintf(dispatcher_fp, " ipc_message_send_error(dispatch_%s(msg, _self));\n", iface->name);
1.34 + fprintf(dispatcher_fp, " ipc_message_send_error(dispatch_%s(msg, obj));\n", iface->name);
1.35 fprintf(dispatcher_fp, " break;\n\n");
1.36 }
1.37
1.38 @@ -576,14 +584,14 @@
1.39
1.40 void write_dispatcher_signature(FILE *fp, const char *name)
1.41 {
1.42 - fprintf(fp, "\nvoid dispatch_%s(ipc_message_t *msg, void *_self);\n", name);
1.43 + fprintf(fp, "\nvoid dispatch_%s(ipc_message_t *msg, void *obj);\n", name);
1.44 }
1.45
1.46 /* Generate a dispatch function for the different operations. */
1.47
1.48 void write_dispatcher(struct signature *sig, FILE *fp, struct interface *iface)
1.49 {
1.50 - fprintf(fp, "\nvoid dispatch_%s(ipc_message_t *msg, void *_self)\n{\n",
1.51 + fprintf(fp, "\nvoid dispatch_%s(ipc_message_t *msg, void *obj)\n{\n",
1.52 iface->name);
1.53
1.54 /* Interpret an operation indicator in the word data if a protocol applies to
1.55 @@ -615,7 +623,7 @@
1.56 /* Generate the case and invocation. */
1.57
1.58 fprintf(fp, " case %s:\n", opcode);
1.59 - fprintf(fp, " ipc_message_send_error(wrap_%s(msg, _self));\n", opname);
1.60 + fprintf(fp, " ipc_message_send_error(wrap_%s(msg, obj));\n", opname);
1.61 fprintf(fp, " break;\n\n");
1.62
1.63 /* Generate the other cases. */