paul@324 | 1 | /* |
paul@324 | 2 | * Mapped memory region support. |
paul@324 | 3 | * |
paul@324 | 4 | * Copyright (C) 2022 Paul Boddie <paul@boddie.org.uk> |
paul@324 | 5 | * |
paul@324 | 6 | * This program is free software; you can redistribute it and/or |
paul@324 | 7 | * modify it under the terms of the GNU General Public License as |
paul@324 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@324 | 9 | * the License, or (at your option) any later version. |
paul@324 | 10 | * |
paul@324 | 11 | * This program is distributed in the hope that it will be useful, |
paul@324 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@324 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@324 | 14 | * GNU General Public License for more details. |
paul@324 | 15 | * |
paul@324 | 16 | * You should have received a copy of the GNU General Public License |
paul@324 | 17 | * along with this program; if not, write to the Free Software |
paul@324 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@324 | 19 | * Boston, MA 02110-1301, USA |
paul@324 | 20 | */ |
paul@324 | 21 | |
paul@324 | 22 | #pragma once |
paul@324 | 23 | |
paul@324 | 24 | #include <l4/sys/types.h> |
paul@324 | 25 | |
paul@329 | 26 | #include <systypes/base.h> |
paul@329 | 27 | |
paul@324 | 28 | |
paul@324 | 29 | |
paul@324 | 30 | /* A mapped region abstraction. */ |
paul@324 | 31 | |
paul@324 | 32 | class MappedRegion |
paul@324 | 33 | { |
paul@324 | 34 | public: |
paul@324 | 35 | l4_addr_t start; |
paul@329 | 36 | offset_t size; |
paul@324 | 37 | l4_umword_t flags; |
paul@324 | 38 | l4_addr_t map_start; |
paul@373 | 39 | l4_cap_idx_t ds; |
paul@324 | 40 | |
paul@324 | 41 | explicit MappedRegion() |
paul@373 | 42 | : start(0), size(0), flags(0), map_start(0), ds(L4_INVALID_CAP) |
paul@324 | 43 | { |
paul@324 | 44 | } |
paul@324 | 45 | |
paul@329 | 46 | explicit MappedRegion(l4_addr_t start, l4_addr_t size, |
paul@373 | 47 | l4_umword_t flags, l4_addr_t map_start, |
paul@373 | 48 | l4_cap_idx_t ds = L4_INVALID_CAP) |
paul@373 | 49 | : start(start), size(size), flags(flags), map_start(map_start), ds(ds) |
paul@324 | 50 | { |
paul@324 | 51 | } |
paul@324 | 52 | }; |
paul@324 | 53 | |
paul@324 | 54 | /* vim: tabstop=2 expandtab shiftwidth=2 |
paul@324 | 55 | */ |