1 #pragma once 2 3 #include <systypes/base.h> 4 5 #include "page_mapper.h" 6 #include "resource.h" 7 8 9 10 /* A pager exposing a dataspace. */ 11 12 class Pager : public Resource 13 { 14 protected: 15 offset_t _start, _size; 16 PageMapper *_mapper; 17 flags_t _flags; 18 19 public: 20 explicit Pager(PageMapper *mapper, flags_t flags); 21 22 virtual void close(); 23 24 /* Paging methods. */ 25 26 virtual long map(address_t offset, address_t hot_spot, flags_t flags, 27 l4_snd_fpage_t *region); 28 29 /* Limit methods. */ 30 31 offset_t get_data_size(); 32 33 /* File methods. */ 34 35 virtual long flush(offset_t populated_size, offset_t *size); 36 37 virtual long resize(offset_t *size); 38 39 /* Mapped file methods. */ 40 41 virtual long mmap(offset_t position, length_t length, offset_t *start_pos, 42 offset_t *end_pos, offset_t *size); 43 }; 44 45 // vim: tabstop=4 expandtab shiftwidth=4