1.1 --- a/libipc/include/ipc/server.h Mon Mar 20 14:52:03 2023 +0100
1.2 +++ b/libipc/include/ipc/server.h Mon Mar 20 18:08:44 2023 +0100
1.3 @@ -43,16 +43,37 @@
1.4 #define ipc_server_add_config(CONFIG, TYPE, POINTER, THREAD) \
1.5 _ipc_server_add_config(CONFIG, &config_##TYPE, (TYPE *) POINTER, THREAD)
1.6
1.7 +
1.8 +
1.9 /* A handler function type. */
1.10
1.11 typedef void (*ipc_server_handler_type)(ipc_message_t *, void *);
1.12
1.13 +
1.14 +
1.15 /* A finaliser function type. */
1.16
1.17 struct ipc_server_config_type;
1.18
1.19 typedef void (*ipc_server_finaliser_type)(struct ipc_server_config_type *);
1.20
1.21 +
1.22 +
1.23 +/* A generic type for server endpoints. */
1.24 +
1.25 +typedef struct ipc_server_endpoint_type
1.26 +{
1.27 + struct ipc_server_config_type *config;
1.28 +
1.29 + /* Receive deletion notifications via an IRQ for the associated
1.30 + configuration. This is only defined for IRQ endpoints. */
1.31 +
1.32 + l4_cap_idx_t irq;
1.33 +
1.34 +} ipc_server_endpoint_type;
1.35 +
1.36 +
1.37 +
1.38 /* A server configuration type. */
1.39
1.40 typedef struct ipc_server_config_type
1.41 @@ -77,18 +98,18 @@
1.42
1.43 int config_thread;
1.44
1.45 - /* Thread and IPC capabilities. */
1.46 + /* Thread and IPC gate capabilities. */
1.47
1.48 - l4_cap_idx_t thread;
1.49 - l4_cap_idx_t server;
1.50 + l4_cap_idx_t thread, server;
1.51
1.52 - /* Receive deletion notifications via an IRQ. */
1.53 + /* The generic endpoint object and IRQ endpoint. */
1.54
1.55 - int notifications;
1.56 - l4_cap_idx_t irq;
1.57 + ipc_server_endpoint_type endpoint, irq_endpoint;
1.58
1.59 } ipc_server_config_type;
1.60
1.61 +
1.62 +
1.63 /* Server configuration defaults. */
1.64
1.65 typedef struct ipc_server_default_config_type
1.66 @@ -102,11 +123,12 @@
1.67
1.68 /* Associate a notification IRQ with an IPC gate in the main thread. */
1.69
1.70 -long ipc_server_apply_irq(l4_cap_idx_t cap, l4_cap_idx_t *irq);
1.71 +long ipc_server_apply_irq(l4_cap_idx_t cap, l4_cap_idx_t *irq, l4_umword_t id);
1.72
1.73 /* Associate a notification IRQ with an IPC gate in the given thread. */
1.74
1.75 -long ipc_server_apply_irq_for_thread(l4_cap_idx_t cap, l4_cap_idx_t *irq, l4_cap_idx_t thread);
1.76 +long ipc_server_apply_irq_for_thread(l4_cap_idx_t cap, l4_cap_idx_t *irq,
1.77 + l4_umword_t id, l4_cap_idx_t thread);
1.78
1.79 /* Bind the main thread to a named IPC gate capability. */
1.80