paul@366 | 1 | /* |
paul@366 | 2 | * A system pager implementation residing in the same task as a program. |
paul@366 | 3 | * |
paul@366 | 4 | * Copyright (C) 2022 Paul Boddie <paul@boddie.org.uk> |
paul@366 | 5 | * |
paul@366 | 6 | * This program is free software; you can redistribute it and/or |
paul@366 | 7 | * modify it under the terms of the GNU General Public License as |
paul@366 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@366 | 9 | * the License, or (at your option) any later version. |
paul@366 | 10 | * |
paul@366 | 11 | * This program is distributed in the hope that it will be useful, |
paul@366 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@366 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@366 | 14 | * GNU General Public License for more details. |
paul@366 | 15 | * |
paul@366 | 16 | * You should have received a copy of the GNU General Public License |
paul@366 | 17 | * along with this program; if not, write to the Free Software |
paul@366 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@366 | 19 | * Boston, MA 02110-1301, USA |
paul@366 | 20 | */ |
paul@366 | 21 | |
paul@366 | 22 | #pragma once |
paul@366 | 23 | |
paul@366 | 24 | #include <exec/pager.h> |
paul@366 | 25 | |
paul@366 | 26 | |
paul@366 | 27 | |
paul@366 | 28 | /* A simple system pager also acting as a region mapper. */ |
paul@366 | 29 | |
paul@366 | 30 | class InternalPager : public ExecPager |
paul@366 | 31 | { |
paul@366 | 32 | public: |
paul@431 | 33 | explicit InternalPager(address_t start = 0, address_t end = 0); |
paul@366 | 34 | |
paul@366 | 35 | /* Notification methods, implementing PagerObject. */ |
paul@366 | 36 | |
paul@366 | 37 | virtual long exception(l4_exc_regs_t regs, |
paul@366 | 38 | l4_snd_fpage_t *region); |
paul@366 | 39 | |
paul@366 | 40 | virtual long page_fault(l4_umword_t pfa, l4_umword_t pc, |
paul@366 | 41 | l4_snd_fpage_t *region); |
paul@366 | 42 | |
paul@366 | 43 | /* Region manager/mapper methods. */ |
paul@366 | 44 | |
paul@419 | 45 | virtual long attach(address_t *start, address_t size, map_flags_t flags, |
paul@366 | 46 | l4_cap_idx_t ds, address_t offset, unsigned char align); |
paul@366 | 47 | }; |
paul@366 | 48 | |
paul@366 | 49 | /* vim: tabstop=2 expandtab shiftwidth=2 |
paul@366 | 50 | */ |