1.1 --- a/libipc/lib/src/server.c Sat Jun 18 14:15:38 2022 +0200
1.2 +++ b/libipc/lib/src/server.c Sat Jun 18 22:31:17 2022 +0200
1.3 @@ -212,7 +212,7 @@
1.4 long ipc_server_managed_loop(int expected_items, ipc_server_config_type *config)
1.5 {
1.6 ipc_message_t msg;
1.7 - l4_umword_t label, irq_label = (l4_umword_t) config->irq;
1.8 + l4_umword_t label, irq_label;
1.9
1.10 /* Permit other endpoints by dynamically interpreting the label. */
1.11
1.12 @@ -225,11 +225,6 @@
1.13 if (err)
1.14 return err;
1.15
1.16 - /* Unmask the interrupt. */
1.17 -
1.18 - if (l4_is_valid_cap(config->irq))
1.19 - ipc_init_irq(config->irq);
1.20 -
1.21 /* Wait for an incoming message. */
1.22
1.23 while (1)
1.24 @@ -247,7 +242,9 @@
1.25
1.26 /* Message involves the IPC gate itself. */
1.27
1.28 - if (label != irq_label)
1.29 + irq_label = (l4_umword_t) config->irq;
1.30 +
1.31 + if (!config->notifications || (config->notifications && (label != irq_label)))
1.32 {
1.33 config_from_label = (ipc_server_config_type *) label;
1.34 config_from_label->handler(&msg, config_from_label->handler_obj);
1.35 @@ -255,7 +252,7 @@
1.36
1.37 /* Message involves the IRQ or a termination condition occurred. */
1.38
1.39 - if ((label == irq_label) || msg.terminating)
1.40 + else if ((config->notifications && (label == irq_label)) || msg.terminating)
1.41 break;
1.42 }
1.43
1.44 @@ -383,6 +380,10 @@
1.45
1.46 if (err)
1.47 return err;
1.48 +
1.49 + /* Unmask the interrupt. */
1.50 +
1.51 + ipc_init_irq(config->irq);
1.52 }
1.53
1.54 /* With a separate thread, return the last status value. Otherwise, invoke the