# HG changeset patch # User Paul Boddie # Date 1679861588 -7200 # Node ID 2760d95e223b4204831af206cd7c0bddac9c01e5 # Parent 5b8ea85e76681d3cf728e686ede2e25a1c3d2143 Removed the deallocation of dataspace capabilities from the internal pager since they are local capabilities that are obtained from and managed by the program. diff -r 5b8ea85e7668 -r 2760d95e223b libexec/include/exec/external_pager.h --- a/libexec/include/exec/external_pager.h Sun Mar 26 17:54:27 2023 +0200 +++ b/libexec/include/exec/external_pager.h Sun Mar 26 22:13:08 2023 +0200 @@ -21,6 +21,8 @@ #pragma once +#include + #include #include #include @@ -31,12 +33,21 @@ +/* Collection definitions. */ + +typedef std::set Capabilities; + + + /* A simple system pager also acting as a region mapper. */ class ExternalPager : public ExecPager, public ParentPagerObject, public Resource { protected: + /* Dataspace capabilities associated with regions. */ + + Capabilities _dataspaces; /* Resources associated with the created process. */ diff -r 5b8ea85e7668 -r 2760d95e223b libexec/include/exec/pager.h --- a/libexec/include/exec/pager.h Sun Mar 26 17:54:27 2023 +0200 +++ b/libexec/include/exec/pager.h Sun Mar 26 22:13:08 2023 +0200 @@ -21,18 +21,10 @@ #pragma once -#include - #include -/* Collection definitions. */ - -typedef std::set Capabilities; - - - /* A simple system pager also acting as a region mapper. */ class ExecPager @@ -43,10 +35,6 @@ AvailableMemoryArea _area; - /* Dataspace capabilities associated with regions. */ - - Capabilities _dataspaces; - /* Region manager/mapper functionality. */ virtual long find(address_t *start, address_t *size, map_flags_t flags, diff -r 5b8ea85e7668 -r 2760d95e223b libexec/lib/src/internal_pager.cc --- a/libexec/lib/src/internal_pager.cc Sun Mar 26 17:54:27 2023 +0200 +++ b/libexec/lib/src/internal_pager.cc Sun Mar 26 22:13:08 2023 +0200 @@ -60,13 +60,6 @@ void InternalPager::close() { printf("Internal pager closing...\n"); - - /* Unmap all regions. */ - - Capabilities::iterator itc; - - for (itc = _dataspaces.begin(); itc != _dataspaces.end(); itc++) - ipc_cap_free_um(*itc); } @@ -159,10 +152,6 @@ { MappedRegion r(*start, *start + size, flags & L4RE_DS_F_RIGHTS_MASK, ds); area->add(r); - - /* Record dataspaces separately. */ - - _dataspaces.insert(ds); } else ipc_cap_free_um(ds); @@ -185,18 +174,6 @@ *rsize = r->area_end() - r->area_start(); *ds = r->dataspace(); parent->remove(*r); - - /* Explicitly reply so that the dataspace can be released. */ - - complete_RegionMapper_detach(*start, *rsize, *ds); - - /* Free the dataspace reference in this component. Since the same dataspace - will have multiple capability indexes, it can be unconditionally - released. */ - - _dataspaces.erase(*ds); - ipc_cap_free_um(*ds); - return IPC_MESSAGE_SENT; } return err;