2021-04-12 | Paul Boddie | file changeset files shortlog | Introduced distinct types instead of using the file offset type throughout. This makes a difference on 32-bit architectures where the address type will only be 32 bits wide, whereas the file offset type should be 64 bits wide. |
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@91 | 25 | long map(address_t offset, address_t hot_spot, flags_t flags, l4_snd_fpage_t *region); |
paul@10 | 26 | |
paul@91 | 27 | long info(length_t *size, flags_t *flags); |
paul@1 | 28 | }; |
paul@1 | 29 | |
paul@1 | 30 | // vim: tabstop=4 expandtab shiftwidth=4 |