1.1 --- a/pipes/pipe_paging.h Sat Mar 27 01:42:25 2021 +0100
1.2 +++ b/pipes/pipe_paging.h Sat Mar 27 22:12:12 2021 +0100
1.3 @@ -1,9 +1,7 @@
1.4 #pragma once
1.5
1.6 -#include <list>
1.7 -
1.8 #include "page_mapper.h"
1.9 -#include "pages_conserving.h"
1.10 +#include "pages.h"
1.11 #include "pipe_accessor.h"
1.12
1.13 /* Pipe paging support, maintaining the sequence of active regions or sections
1.14 @@ -12,13 +10,18 @@
1.15 class PipePaging
1.16 {
1.17 protected:
1.18 - Memory *_memory;
1.19 - PagesConserving *_pages;
1.20 + Memory *_memory, *_memory_base;
1.21 + Pages *_pages;
1.22 + PageQueue *_queue;
1.23
1.24 /* Regions acting as files with their own accessors. */
1.25
1.26 - std::list<PageMapper *> _regions;
1.27 - std::list<PipeAccessor> _accessors;
1.28 + PageMapper *_regions[2];
1.29 + PipeAccessor _accessors[2];
1.30 +
1.31 + /* The first region is initially exposed to both reader and writer. */
1.32 +
1.33 + int _reading = 0, _writing = 0;
1.34
1.35 /* Pipe section/region size. */
1.36
1.37 @@ -35,21 +38,16 @@
1.38
1.39 virtual void detach();
1.40
1.41 - virtual PagesConserving *pages()
1.42 - { return _pages; }
1.43 -
1.44 virtual offset_t region_size()
1.45 { return _size; }
1.46
1.47 /* Region management. */
1.48
1.49 - virtual void add_region(PageMapper *mapper);
1.50 + virtual PageMapper *add_region();
1.51
1.52 - virtual PageMapper *first_region();
1.53 + virtual PageMapper *current_region();
1.54
1.55 virtual PageMapper *next_region();
1.56 -
1.57 - virtual PipeAccessor *accessor();
1.58 };
1.59
1.60 // vim: tabstop=4 expandtab shiftwidth=4