2021-03-28 | Paul Boddie | file changeset files shortlog | Fixed the remove operation in the partitioned queue: flexpages will be added again when queued and their removal is necessary to prevent duplication. Added support for closing page queues and releasing their pages. |
paul@1 | 1 | #pragma once |
paul@1 | 2 | |
paul@1 | 3 | #include "dataspace_interface.h" |
paul@1 | 4 | #include "flexpage.h" |
paul@1 | 5 | #include "memory.h" |
paul@1 | 6 | #include "resource.h" |
paul@1 | 7 | |
paul@1 | 8 | |
paul@1 | 9 | |
paul@1 | 10 | /* A simple pager exposing a single memory region as a dataspace. */ |
paul@1 | 11 | |
paul@1 | 12 | class SimplePager : public Dataspace, public Resource |
paul@1 | 13 | { |
paul@1 | 14 | protected: |
paul@1 | 15 | Memory *_memory; |
paul@1 | 16 | Region *_region; |
paul@1 | 17 | |
paul@1 | 18 | public: |
paul@1 | 19 | explicit SimplePager(Memory *memory=NULL); |
paul@1 | 20 | |
paul@1 | 21 | void close(); |
paul@1 | 22 | |
paul@1 | 23 | /* Paging methods. */ |
paul@1 | 24 | |
paul@54 | 25 | long map(offset_t offset, l4_addr_t hot_spot, flags_t flags, l4_snd_fpage_t *region); |
paul@10 | 26 | |
paul@54 | 27 | long info(offset_t *size, flags_t *flags); |
paul@1 | 28 | }; |
paul@1 | 29 | |
paul@1 | 30 | // vim: tabstop=4 expandtab shiftwidth=4 |