1.1 --- a/libfsserver/lib/pipes/pipe_pager.cc Sat May 15 23:38:39 2021 +0200
1.2 +++ b/libfsserver/lib/pipes/pipe_pager.cc Tue May 18 00:55:20 2021 +0200
1.3 @@ -55,6 +55,10 @@
1.4 void PipePager::close()
1.5 {
1.6 _paging->detach();
1.7 +
1.8 + /* Notify the other endpoint. */
1.9 +
1.10 + _paging->notify(_writing);
1.11 }
1.12
1.13 /* Support paging. */
1.14 @@ -66,6 +70,14 @@
1.15
1.16
1.17
1.18 +/* Return whether the pipe is closed or partly closed. */
1.19 +
1.20 +long PipePager::closed(int *closed)
1.21 +{
1.22 + *closed = _paging->closed();
1.23 + return L4_EOK;
1.24 +}
1.25 +
1.26 /* Return details of the current region. */
1.27
1.28 long PipePager::current_region(offset_t *populated_size, offset_t *size)
1.29 @@ -131,4 +143,37 @@
1.30 return -L4_EBUSY;
1.31 }
1.32
1.33 +
1.34 +
1.35 +/* Update the populated size of a pipe region and notify the other endpoint. */
1.36 +
1.37 +long PipePager::flush(offset_t populated_size, offset_t *size)
1.38 +{
1.39 + if (_mapper != NULL)
1.40 + _mapper->set_data_size(populated_size);
1.41 +
1.42 + *size = _size;
1.43 +
1.44 + _paging->notify(_writing);
1.45 + return L4_EOK;
1.46 +}
1.47 +
1.48 +
1.49 +
1.50 +/* Subscribe to notifications. */
1.51 +
1.52 +long PipePager::subscribe(flags_t flags, l4_cap_idx_t *irq)
1.53 +{
1.54 + // NOTE: Need to interpret flags.
1.55 +
1.56 + *irq = _paging->subscribe(_writing);
1.57 + return L4_EOK;
1.58 +}
1.59 +
1.60 +long PipePager::unsubscribe()
1.61 +{
1.62 + _paging->unsubscribe(_writing);
1.63 + return L4_EOK;
1.64 +}
1.65 +
1.66 // vim: tabstop=4 expandtab shiftwidth=4