paul@9 | 1 | #pragma once |
paul@9 | 2 | |
paul@10 | 3 | #include "opener_context_object_interface.h" |
paul@9 | 4 | #include "simple_pager.h" |
paul@9 | 5 | |
paul@9 | 6 | |
paul@9 | 7 | |
paul@9 | 8 | /* Forward declaration. */ |
paul@9 | 9 | |
paul@10 | 10 | class OpenerResource; |
paul@9 | 11 | |
paul@9 | 12 | |
paul@9 | 13 | |
paul@9 | 14 | /* Support for indicating files to be opened. */ |
paul@9 | 15 | |
paul@10 | 16 | class OpenerContextResource : public SimplePager, public OpenerContextObject |
paul@9 | 17 | { |
paul@9 | 18 | protected: |
paul@10 | 19 | OpenerResource *_opener; |
paul@9 | 20 | |
paul@9 | 21 | public: |
paul@10 | 22 | explicit OpenerContextResource(OpenerResource *opener, Memory *memory=NULL); |
paul@10 | 23 | |
paul@10 | 24 | /* Server details. */ |
paul@10 | 25 | |
paul@10 | 26 | int expected_items(); |
paul@9 | 27 | |
paul@10 | 28 | ipc_server_handler_type handler(); |
paul@10 | 29 | |
paul@10 | 30 | void *interface() |
paul@10 | 31 | { return static_cast<OpenerContextObject *>(this); } |
paul@10 | 32 | |
paul@10 | 33 | /* Data access methods. */ |
paul@9 | 34 | |
paul@9 | 35 | char *get_path(); |
paul@10 | 36 | |
paul@10 | 37 | /* Opener context interface methods. */ |
paul@10 | 38 | |
paul@51 | 39 | long open(flags_t flags, size_t *size, l4_cap_idx_t *file); |
paul@10 | 40 | |
paul@10 | 41 | /* Pager/dataspace methods. */ |
paul@10 | 42 | |
paul@51 | 43 | long map(unsigned long offset, l4_addr_t hot_spot, flags_t flags, |
paul@10 | 44 | l4_snd_fpage_t *region) |
paul@10 | 45 | { return SimplePager::map(offset, hot_spot, flags, region); } |
paul@10 | 46 | |
paul@10 | 47 | long info(unsigned long *size, unsigned long *flags) |
paul@10 | 48 | { return SimplePager::info(size, flags); } |
paul@9 | 49 | }; |
paul@9 | 50 | |
paul@9 | 51 | // vim: tabstop=4 expandtab shiftwidth=4 |