1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/files/file_pager.h Sat Mar 27 01:42:25 2021 +0100
1.3 @@ -0,0 +1,37 @@
1.4 +#pragma once
1.5 +
1.6 +#include "mapped_file_object_interface.h"
1.7 +#include "pager.h"
1.8 +
1.9 +/* A pager abstraction for a file. */
1.10 +
1.11 +class FilePager : public Pager, public MappedFileObject
1.12 +{
1.13 +public:
1.14 + fileid_t fileid;
1.15 +
1.16 + explicit FilePager(fileid_t fileid, PageMapper *mapper, flags_t flags);
1.17 +
1.18 + /* Server details. */
1.19 +
1.20 + int expected_items();
1.21 +
1.22 + ipc_server_handler_type handler();
1.23 +
1.24 + void *interface()
1.25 + { return static_cast<MappedFileObject *>(this); }
1.26 +
1.27 + /* File methods. */
1.28 +
1.29 + virtual long flush(offset_t populated_size, offset_t *size);
1.30 +
1.31 + virtual long resize(offset_t *size);
1.32 +
1.33 + /* Pager and mapped file methods. */
1.34 +
1.35 + virtual long map(unsigned long offset, l4_addr_t hot_spot, flags_t flags, l4_snd_fpage_t *region);
1.36 +
1.37 + virtual long mmap(offset_t position, offset_t length, offset_t *start_pos, offset_t *end_pos, offset_t *data_end);
1.38 +};
1.39 +
1.40 +// vim: tabstop=4 expandtab shiftwidth=4