1.1 --- a/libfsserver/lib/pipes/pipe_paging.cc Thu May 20 00:01:53 2021 +0200
1.2 +++ b/libfsserver/lib/pipes/pipe_paging.cc Mon Jun 07 00:50:14 2021 +0200
1.3 @@ -44,21 +44,26 @@
1.4 for (unsigned int i = 0; i < 2; i++)
1.5 _regions[i] = NULL;
1.6
1.7 - /* Initialise IRQ objects for notifications. */
1.8 + /* Initialise IRQ objects and flags for notifications. */
1.9
1.10 for (unsigned int i = 0; i < 2; i++)
1.11 + {
1.12 _irqs[i] = L4_INVALID_CAP;
1.13 + _flags[i] = 0;
1.14 + }
1.15 }
1.16
1.17 /* Create an IRQ to subscribe to an endpoint's notifications. */
1.18
1.19 -l4_cap_idx_t PipePaging::subscribe(bool writing)
1.20 +l4_cap_idx_t PipePaging::subscribe(bool writing, notify_flags_t flags)
1.21 {
1.22 int i = writing ? 1 : 0;
1.23
1.24 if (l4_is_invalid_cap(_irqs[i]))
1.25 ipc_create_irq(&_irqs[i]);
1.26
1.27 + _flags[i] = flags;
1.28 +
1.29 return _irqs[i];
1.30 }
1.31
1.32 @@ -72,18 +77,19 @@
1.33 {
1.34 ipc_cap_free_um(_irqs[i]);
1.35 _irqs[i] = L4_INVALID_CAP;
1.36 + _flags[i] = 0;
1.37 }
1.38 }
1.39
1.40 /* Notify the other endpoint. */
1.41
1.42 -void PipePaging::notify(bool writing)
1.43 +void PipePaging::notify(bool writing, notify_flags_t flags)
1.44 {
1.45 /* Let the writer notify the reader, and the other way round. */
1.46
1.47 int i = writing ? 0 : 1;
1.48
1.49 - if (l4_is_valid_cap(_irqs[i]))
1.50 + if (l4_is_valid_cap(_irqs[i]) && (flags & _flags[i]))
1.51 l4_irq_trigger(_irqs[i]);
1.52 }
1.53
1.54 @@ -170,7 +176,7 @@
1.55
1.56 /* Let the writer notify the reader. */
1.57
1.58 - notify(true);
1.59 + notify(true, NOTIFY_CONTENT_AVAILABLE);
1.60
1.61 /* Return the next region's mapper. */
1.62
1.63 @@ -205,7 +211,7 @@
1.64
1.65 /* Let the reader notify the writer. */
1.66
1.67 - notify(false);
1.68 + notify(false, NOTIFY_SPACE_AVAILABLE);
1.69
1.70 /* Return the next region's mapper. */
1.71