1.1 --- a/docs/wiki/Servers Mon Mar 14 01:34:59 2022 +0100
1.2 +++ b/docs/wiki/Servers Tue Mar 15 19:21:53 2022 +0100
1.3 @@ -225,42 +225,36 @@
1.4 component can be exposed to other programs as follows:
1.5
1.6 {{{
1.7 -ipc_server_bind("server", (l4_umword_t) &obj, &server);
1.8 +ipc_server_loop_for(Calc, &obj, "server");
1.9 }}}
1.10
1.11 -Here, the `server` variable is of type `l4_cap_idx_t` (indicating a
1.12 -capability). The named capability is obtained and assigned to the variable,
1.13 -with the object itself presented to label incoming messages, indicating which
1.14 -IPC gate was involved in delivering the message.
1.15 -
1.16 -The details of waiting for messages, testing the label, and directing requests
1.17 -to the component are dealt with by another convenience function (or macro,
1.18 -more accurately):
1.19 -
1.20 -{{{
1.21 -ipc_server_loop_for(Calc, &obj);
1.22 -}}}
1.23 -
1.24 -Here, the following parameters are specified:
1.25 +This convenience function (or, more accurately, macro) binds the main thread
1.26 +to the named capability. This also handles the details of waiting for messages
1.27 +and directing requests to the component, with the following parameters being
1.28 +specified:
1.29
1.30 * The interface type involved
1.31
1.32 - * The object address which is used to check message labels
1.33 + * The object address for the component
1.34 +
1.35 + * The named capability through which incoming messages will be received
1.36
1.37 === Technical Details ===
1.38
1.39 -This macro invocation expands to a call to `ipc_server_loop` with the
1.40 +This macro invocation expands to a call to `_ipc_server_loop_for` with the
1.41 following parameters:
1.42
1.43 * The predefined number of items expected for the `Calc` interface, generated
1.44 automatically and provided by `Calc_expected_items`
1.45
1.46 - * The object address which is used to check message labels
1.47 + * The object address for the component
1.48
1.49 * A handler function for directing requests to the component, this being
1.50 provided by the generated `handle_Calc` function which must be cast to an
1.51 acceptable type as indicated
1.52
1.53 + * The named capability through which incoming messages will be received
1.54 +
1.55 Here, the macro casts the object address to the appropriate type. In simple
1.56 cases, this is a superfluous operation since the object type will be directly
1.57 compatible with the interface type used to expose the object, and such a