# HG changeset patch # User Paul Boddie # Date 1709854014 -3600 # Node ID 8a6efbb9fd4d91adeb4a36ba02e18506df184bc8 # Parent 446ea2c35a7417a0290121fd6527cd4b825d5e84 Updated region mapper type usage. diff -r 446ea2c35a74 -r 8a6efbb9fd4d libexec/include/exec/elf.h --- a/libexec/include/exec/elf.h Fri Mar 08 00:26:16 2024 +0100 +++ b/libexec/include/exec/elf.h Fri Mar 08 00:26:54 2024 +0100 @@ -1,7 +1,7 @@ /* * ELF payload decoding support. * - * Copyright (C) 2022, 2023 Paul Boddie + * Copyright (C) 2022, 2023, 2024 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -41,7 +41,7 @@ offset_t file_offset(); l4_addr_t region_address(); offset_t region_size(); - l4re_rm_flags_t region_flags(); + rm_flags_t region_flags(); }; diff -r 446ea2c35a74 -r 8a6efbb9fd4d libexec/include/exec/segment.h --- a/libexec/include/exec/segment.h Fri Mar 08 00:26:16 2024 +0100 +++ b/libexec/include/exec/segment.h Fri Mar 08 00:26:54 2024 +0100 @@ -1,7 +1,7 @@ /* * Program memory segment support. * - * Copyright (C) 2022, 2023 Paul Boddie + * Copyright (C) 2022, 2023, 2024 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -21,13 +21,10 @@ #pragma once -#include -#include - -#include - #include #include +#include +#include @@ -42,7 +39,7 @@ /* Allocated memory. */ char *_buf; - l4re_ds_t _ds; + l4_cap_idx_t _ds; file_t *_file = NULL; bool _allocated = false, _attached = false; @@ -94,7 +91,7 @@ virtual offset_t file_offset() = 0; virtual l4_addr_t region_address() = 0; virtual offset_t region_size() = 0; - virtual l4re_rm_flags_t region_flags() = 0; + virtual rm_flags_t region_flags() = 0; }; @@ -114,14 +111,14 @@ /* Access flags. */ - l4re_rm_flags_t _flags; + rm_flags_t _flags; /* File access details. */ offset_t _file_offset, _file_contents; public: - explicit ExplicitSegment(l4_addr_t base, offset_t size, l4re_rm_flags_t flags, + explicit ExplicitSegment(l4_addr_t base, offset_t size, rm_flags_t flags, offset_t file_offset = 0, offset_t file_contents = 0); /* Generic property access. */ @@ -131,7 +128,7 @@ offset_t file_offset(); l4_addr_t region_address(); offset_t region_size(); - l4re_rm_flags_t region_flags(); + rm_flags_t region_flags(); }; /* vim: tabstop=2 expandtab shiftwidth=2 diff -r 446ea2c35a74 -r 8a6efbb9fd4d libexec/lib/src/elf.cc --- a/libexec/lib/src/elf.cc Fri Mar 08 00:26:16 2024 +0100 +++ b/libexec/lib/src/elf.cc Fri Mar 08 00:26:54 2024 +0100 @@ -1,7 +1,7 @@ /* * ELF payload decoding support. * - * Copyright (C) 2022, 2023 Paul Boddie + * Copyright (C) 2022, 2023, 2024 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -65,9 +65,9 @@ } template -l4re_rm_flags_t ProgramSegmentVariant::region_flags() +rm_flags_t ProgramSegmentVariant::region_flags() { - l4re_rm_flags_t flags = 0; + rm_flags_t flags = 0; if (_header->p_flags & PF_R) flags |= L4RE_RM_F_R; diff -r 446ea2c35a74 -r 8a6efbb9fd4d libexec/lib/src/segment.cc --- a/libexec/lib/src/segment.cc Fri Mar 08 00:26:16 2024 +0100 +++ b/libexec/lib/src/segment.cc Fri Mar 08 00:26:54 2024 +0100 @@ -1,7 +1,7 @@ /* * Program memory segment support. * - * Copyright (C) 2022, 2023 Paul Boddie + * Copyright (C) 2022, 2023, 2024 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -172,7 +172,7 @@ /* Initialise a memory segment using explicit parameters. */ ExplicitSegment::ExplicitSegment(l4_addr_t base, offset_t size, - l4re_rm_flags_t flags, offset_t file_offset, + rm_flags_t flags, offset_t file_offset, offset_t file_contents) : _base(base), _size(size), _flags(flags), _file_offset(file_offset), _file_contents(file_contents) @@ -209,7 +209,7 @@ /* Return the region flags for the segment. */ -l4re_rm_flags_t ExplicitSegment::region_flags() +rm_flags_t ExplicitSegment::region_flags() { return _flags; } diff -r 446ea2c35a74 -r 8a6efbb9fd4d libfsclient/include/fsclient/client.h --- a/libfsclient/include/fsclient/client.h Fri Mar 08 00:26:16 2024 +0100 +++ b/libfsclient/include/fsclient/client.h Fri Mar 08 00:26:54 2024 +0100 @@ -1,8 +1,7 @@ /* * Filesystem client functions. * - * Copyright (C) 2018, 2019, 2020, 2021, 2022, - * 2023 Paul Boddie + * Copyright (C) 2018-2024 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -76,8 +75,8 @@ long client_flush(file_t *file); void *client_mmap(file_t *file, offset_t position, offset_t length, offset_t start_visible, offset_t end_visible, - l4re_rm_flags_t region_flags); -l4re_rm_flags_t client_region_flags(prot_t prot, flags_t flags); + rm_flags_t region_flags); +rm_flags_t client_region_flags(prot_t prot, flags_t flags); /* Pipe region operations. */ diff -r 446ea2c35a74 -r 8a6efbb9fd4d libfsclient/include/fsclient/file.h --- a/libfsclient/include/fsclient/file.h Fri Mar 08 00:26:16 2024 +0100 +++ b/libfsclient/include/fsclient/file.h Fri Mar 08 00:26:54 2024 +0100 @@ -1,7 +1,7 @@ /* * File access convenience functions and types. * - * Copyright (C) 2021, 2022, 2023 Paul Boddie + * Copyright (C) 2021, 2022, 2023, 2024 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -110,11 +110,11 @@ long file_flush(file_t *file); long file_mmap(file_t *file, offset_t position, offset_t length, offset_t start_visible, offset_t end_visible, - l4re_rm_flags_t region_flags); + rm_flags_t region_flags); long file_mmap_only(file_t *file, offset_t position, offset_t length, offset_t start_visible, offset_t end_visible); -flags_t file_opening_flags(l4re_rm_flags_t rm_flags); -l4re_rm_flags_t file_region_flags(flags_t flags); +flags_t file_opening_flags(rm_flags_t rm_flags); +rm_flags_t file_region_flags(flags_t flags); long file_resize(file_t *file, offset_t size); /* File and region properties. */ diff -r 446ea2c35a74 -r 8a6efbb9fd4d libfsclient/lib/src/client.cc --- a/libfsclient/lib/src/client.cc Fri Mar 08 00:26:16 2024 +0100 +++ b/libfsclient/lib/src/client.cc Fri Mar 08 00:26:54 2024 +0100 @@ -45,17 +45,16 @@ /* Merging of region flags from protection and access flags. */ -static l4re_rm_flags_t _combine_region_flags(l4re_rm_flags_t region_flags, - flags_t flags) +static rm_flags_t _combine_region_flags(rm_flags_t region_flags, flags_t flags) { return region_flags & (file_region_flags(flags) | L4RE_RM_F_X); } /* Conversion of protection and access flags to region flags. */ -l4re_rm_flags_t client_region_flags(prot_t prot, flags_t flags) +rm_flags_t client_region_flags(prot_t prot, flags_t flags) { - l4re_rm_flags_t rm_flags = 0; + rm_flags_t rm_flags = 0; if (prot & PROT_READ) rm_flags |= L4RE_RM_F_R; @@ -576,7 +575,7 @@ void *client_mmap(file_t *file, offset_t position, offset_t length, offset_t start_visible, offset_t end_visible, - l4re_rm_flags_t region_flags) + rm_flags_t region_flags) { if (!client_opened(file) || file_mmap(file, position, length, start_visible, end_visible, region_flags)) diff -r 446ea2c35a74 -r 8a6efbb9fd4d libfsclient/lib/src/file.cc --- a/libfsclient/lib/src/file.cc Fri Mar 08 00:26:16 2024 +0100 +++ b/libfsclient/lib/src/file.cc Fri Mar 08 00:26:54 2024 +0100 @@ -366,7 +366,7 @@ long file_mmap(file_t *file, offset_t position, offset_t length, offset_t start_visible, offset_t end_visible, - l4re_rm_flags_t region_flags) + rm_flags_t region_flags) { long err; @@ -414,7 +414,7 @@ /* Return opening flags compatible with the given region flags. */ -flags_t file_opening_flags(l4re_rm_flags_t rm_flags) +flags_t file_opening_flags(rm_flags_t rm_flags) { if ((rm_flags & L4RE_RM_F_RW) == L4RE_RM_F_RW) return O_RDWR; @@ -426,9 +426,9 @@ /* Return mmap flags corresponding to the file access flags. */ -l4re_rm_flags_t file_region_flags(flags_t flags) +rm_flags_t file_region_flags(flags_t flags) { - l4re_rm_flags_t rm_flags; + rm_flags_t rm_flags; switch (flags & 3) {