1.1 --- a/libexec/lib/src/process_creating.cc Sat Mar 04 19:03:27 2023 +0100
1.2 +++ b/libexec/lib/src/process_creating.cc Mon Mar 06 00:14:52 2023 +0100
1.3 @@ -109,12 +109,19 @@
1.4
1.5 long ProcessCreating::configure_task(l4_cap_idx_t pager)
1.6 {
1.7 + l4_cap_idx_t rparent;
1.8 long err = _process.configure_task();
1.9
1.10 if (err)
1.11 return err;
1.12
1.13 - return _process.set_parent(pager);
1.14 + err = _process.set_parent(pager, &rparent);
1.15 +
1.16 + if (err)
1.17 + return err;
1.18 +
1.19 + _exec_pager->set_parent(pager, rparent);
1.20 + return L4_EOK;
1.21 }
1.22
1.23 /* Create an unbound IPC gate for the region mapper and allocate it in the
1.24 @@ -212,11 +219,14 @@
1.25 /* Configure the environment for the thread, specifying the pager (and
1.26 exception handler plus region mapper). */
1.27
1.28 - long err = _process.configure_thread(pager);
1.29 + l4_cap_idx_t rpager = L4_INVALID_CAP;
1.30 + long err = _process.configure_thread(pager, &rpager);
1.31
1.32 if (err)
1.33 return err;
1.34
1.35 + _exec_pager->set_pager(pager, rpager);
1.36 +
1.37 /* Populate a thread stack with argument and environment details for the
1.38 region mapper, plus the initial server capability and region details. */
1.39
1.40 @@ -229,13 +239,13 @@
1.41
1.42 /* Start the region mapper thread in the appropriate stack. */
1.43
1.44 - l4_cap_idx_t thread;
1.45 - err = _process.thread_start(_rm_payload->entry_point(), rm_st, &thread);
1.46 + l4_cap_idx_t thread, rthread;
1.47 + err = _process.thread_start(_rm_payload->entry_point(), rm_st, &thread, &rthread);
1.48
1.49 if (err)
1.50 return err;
1.51
1.52 - ipc_cap_free_um(thread);
1.53 + _exec_pager->add_thread(thread, rthread);
1.54 return L4_EOK;
1.55 }
1.56
1.57 @@ -251,7 +261,8 @@
1.58 /* Configure the environment for the thread, specifying the pager (and
1.59 exception handler plus region mapper). */
1.60
1.61 - long err = _process.configure_thread(_ipc_gate, _ipc_gate_cap);
1.62 + l4_cap_idx_t rpager = _ipc_gate_cap;
1.63 + long err = _process.configure_thread(_ipc_gate, &rpager);
1.64
1.65 if (err)
1.66 return err;
1.67 @@ -266,13 +277,13 @@
1.68
1.69 /* Start the program thread in the appropriate stack. */
1.70
1.71 - l4_cap_idx_t thread;
1.72 - err = _process.thread_start(_program_payload->entry_point(), program_st, &thread);
1.73 + l4_cap_idx_t thread, rthread;
1.74 + err = _process.thread_start(_program_payload->entry_point(), program_st, &thread, &rthread);
1.75
1.76 if (err)
1.77 return err;
1.78
1.79 - ipc_cap_free_um(thread);
1.80 + _exec_pager->add_thread(thread, rthread);
1.81 return L4_EOK;
1.82 }
1.83
1.84 @@ -314,7 +325,6 @@
1.85
1.86 /* Note the task and IPC gate on the pager object. */
1.87
1.88 - _exec_pager->set_server(*process);
1.89 _exec_pager->set_task(_process.get_task());
1.90 _exec_pager->set_gate(_ipc_gate);
1.91