L4Re/departure

Changeset

528:dc1441cbcb93
2023-03-20 Paul Boddie raw files shortlog changelog graph Reordered pager capability freeing to avoid warnings about invalid pagers.
libexec/lib/src/external_pager.cc (file)
     1.1 --- a/libexec/lib/src/external_pager.cc	Sun Mar 19 19:38:07 2023 +0100
     1.2 +++ b/libexec/lib/src/external_pager.cc	Mon Mar 20 09:23:22 2023 +0100
     1.3 @@ -299,11 +299,6 @@
     1.4  
     1.5      else if (l4_is_valid_cap(_task))
     1.6      {
     1.7 -      /* Parent and pager/region mapper. */
     1.8 -
     1.9 -      ipc_unmap_capability(_task, _mapped_parent);
    1.10 -      ipc_unmap_capability(_task, _mapped_pager);
    1.11 -
    1.12        /* Threads. For some reason, these cannot be released by the process, so
    1.13           they are also unmapped on its behalf. */
    1.14  
    1.15 @@ -314,6 +309,12 @@
    1.16  
    1.17        for (it = _mapped_threads.begin(); it != _mapped_threads.end(); it++)
    1.18          ipc_unmap_capability(_task, *it);
    1.19 +
    1.20 +      /* Parent and pager/region mapper. Freeing these after the threads should
    1.21 +         avoid warnings about invalid pager capabilities. */
    1.22 +
    1.23 +      ipc_unmap_capability(_task, _mapped_parent);
    1.24 +      ipc_unmap_capability(_task, _mapped_pager);
    1.25      }
    1.26    }
    1.27