1.1 --- a/libexec/include/exec/external_pager.h Sun Mar 26 17:54:27 2023 +0200
1.2 +++ b/libexec/include/exec/external_pager.h Sun Mar 26 22:13:08 2023 +0200
1.3 @@ -21,6 +21,8 @@
1.4
1.5 #pragma once
1.6
1.7 +#include <set>
1.8 +
1.9 #include <exec/elf.h>
1.10 #include <exec/pager.h>
1.11 #include <exec/process_monitor.h>
1.12 @@ -31,12 +33,21 @@
1.13
1.14
1.15
1.16 +/* Collection definitions. */
1.17 +
1.18 +typedef std::set<l4_cap_idx_t> Capabilities;
1.19 +
1.20 +
1.21 +
1.22 /* A simple system pager also acting as a region mapper. */
1.23
1.24 class ExternalPager : public ExecPager, public ParentPagerObject,
1.25 public Resource
1.26 {
1.27 protected:
1.28 + /* Dataspace capabilities associated with regions. */
1.29 +
1.30 + Capabilities _dataspaces;
1.31
1.32 /* Resources associated with the created process. */
1.33
2.1 --- a/libexec/include/exec/pager.h Sun Mar 26 17:54:27 2023 +0200
2.2 +++ b/libexec/include/exec/pager.h Sun Mar 26 22:13:08 2023 +0200
2.3 @@ -21,18 +21,10 @@
2.4
2.5 #pragma once
2.6
2.7 -#include <set>
2.8 -
2.9 #include <exec/memory_area.h>
2.10
2.11
2.12
2.13 -/* Collection definitions. */
2.14 -
2.15 -typedef std::set<l4_cap_idx_t> Capabilities;
2.16 -
2.17 -
2.18 -
2.19 /* A simple system pager also acting as a region mapper. */
2.20
2.21 class ExecPager
2.22 @@ -43,10 +35,6 @@
2.23
2.24 AvailableMemoryArea _area;
2.25
2.26 - /* Dataspace capabilities associated with regions. */
2.27 -
2.28 - Capabilities _dataspaces;
2.29 -
2.30 /* Region manager/mapper functionality. */
2.31
2.32 virtual long find(address_t *start, address_t *size, map_flags_t flags,
3.1 --- a/libexec/lib/src/internal_pager.cc Sun Mar 26 17:54:27 2023 +0200
3.2 +++ b/libexec/lib/src/internal_pager.cc Sun Mar 26 22:13:08 2023 +0200
3.3 @@ -60,13 +60,6 @@
3.4 void InternalPager::close()
3.5 {
3.6 printf("Internal pager closing...\n");
3.7 -
3.8 - /* Unmap all regions. */
3.9 -
3.10 - Capabilities::iterator itc;
3.11 -
3.12 - for (itc = _dataspaces.begin(); itc != _dataspaces.end(); itc++)
3.13 - ipc_cap_free_um(*itc);
3.14 }
3.15
3.16
3.17 @@ -159,10 +152,6 @@
3.18 {
3.19 MappedRegion r(*start, *start + size, flags & L4RE_DS_F_RIGHTS_MASK, ds);
3.20 area->add(r);
3.21 -
3.22 - /* Record dataspaces separately. */
3.23 -
3.24 - _dataspaces.insert(ds);
3.25 }
3.26 else
3.27 ipc_cap_free_um(ds);
3.28 @@ -185,18 +174,6 @@
3.29 *rsize = r->area_end() - r->area_start();
3.30 *ds = r->dataspace();
3.31 parent->remove(*r);
3.32 -
3.33 - /* Explicitly reply so that the dataspace can be released. */
3.34 -
3.35 - complete_RegionMapper_detach(*start, *rsize, *ds);
3.36 -
3.37 - /* Free the dataspace reference in this component. Since the same dataspace
3.38 - will have multiple capability indexes, it can be unconditionally
3.39 - released. */
3.40 -
3.41 - _dataspaces.erase(*ds);
3.42 - ipc_cap_free_um(*ds);
3.43 - return IPC_MESSAGE_SENT;
3.44 }
3.45
3.46 return err;