1.1 --- a/libexec/lib/src/process.cc Sun Dec 11 01:23:05 2022 +0100
1.2 +++ b/libexec/lib/src/process.cc Tue Dec 13 17:05:51 2022 +0100
1.3 @@ -62,8 +62,10 @@
1.4 _env.log = L4_BASE_LOG_CAP;
1.5 _env.scheduler = L4_BASE_SCHEDULER_CAP;
1.6 _env.mem_alloc = L4_EXEC_MA_CAP;
1.7 + _env.parent = L4_EXEC_PARENT_CAP;
1.8
1.9 - /* Capability details that are updated for each thread. */
1.10 + /* Capability details that are updated for each thread. Note that the region
1.11 + mapper is redefined, but it would traditionally employ the given index. */
1.12
1.13 _env.main_thread = L4_BASE_THREAD_CAP;
1.14 _env.rm = L4_EXEC_RM_CAP;
1.15 @@ -139,7 +141,8 @@
1.16 return map_capabilities(mapped_caps, false);
1.17 }
1.18
1.19 -/* Configure the thread environment. */
1.20 +/* Configure the thread environment, employing the given server as the region
1.21 + mapper. */
1.22
1.23 long Process::configure_thread(l4_cap_idx_t server, l4_cap_idx_t mapped_cap)
1.24 {
1.25 @@ -158,6 +161,13 @@
1.26 }
1.27 }
1.28
1.29 +/* Set the parent of the new thread. */
1.30 +
1.31 +long Process::set_parent(l4_cap_idx_t server)
1.32 +{
1.33 + return ipc_map_capability(_task, (struct ipc_mapped_cap) {_env.parent, server, L4_CAP_FPAGE_RWS, 0});
1.34 +}
1.35 +
1.36 /* Map capabilities into the task, counting them if indicated. */
1.37
1.38 long Process::map_capabilities(struct ipc_mapped_cap mapped_caps[],