1.1 --- a/libipc/include/ipc/server.h Tue Mar 15 17:36:39 2022 +0100
1.2 +++ b/libipc/include/ipc/server.h Tue Mar 15 23:38:30 2022 +0100
1.3 @@ -34,6 +34,13 @@
1.4 (ipc_server_handler_type) handle_##TYPE, \
1.5 NAME)
1.6
1.7 +/* A convenience macro for adding a configuration to an existing server. */
1.8 +
1.9 +#define ipc_server_add_config(CONFIG, TYPE, POINTER, THREAD) \
1.10 + _ipc_server_add_config(CONFIG, TYPE##_expected_items, (TYPE *) POINTER, \
1.11 + (ipc_server_handler_type) handle_##TYPE, \
1.12 + THREAD)
1.13 +
1.14 /* A handler function type. */
1.15
1.16 typedef void (*ipc_server_handler_type)(ipc_message_t *, void *);
1.17 @@ -64,9 +71,9 @@
1.18 ipc_server_handler_type handler;
1.19 ipc_server_finaliser_type finaliser;
1.20
1.21 - /* Create a new thread. */
1.22 + /* Configure a thread instead of using the current thread. */
1.23
1.24 - int new_thread;
1.25 + int config_thread;
1.26
1.27 /* Thread and IPC capabilities. */
1.28
1.29 @@ -117,6 +124,12 @@
1.30 long _ipc_server_loop_for(int expected_items, void *handler_obj,
1.31 ipc_server_handler_type handler, const char *name);
1.32
1.33 +/* Add handling of incoming messages to an existing server. */
1.34 +
1.35 +long _ipc_server_add_config(ipc_server_config_type *config, int expected_items,
1.36 + void *handler_obj, ipc_server_handler_type handler,
1.37 + l4_cap_idx_t thread);
1.38 +
1.39 /* Handle incoming messages and IRQ notifications for a server. */
1.40
1.41 long ipc_server_managed_loop(int expected_items, ipc_server_config_type *config);
1.42 @@ -148,3 +161,6 @@
1.43 long ipc_server_start_config(ipc_server_config_type *config);
1.44
1.45 EXTERN_C_END
1.46 +
1.47 +/* vim: tabstop=2 expandtab shiftwidth=2
1.48 +*/