1.1 --- a/tests/dstest_exec.cc Sun Jun 05 21:30:59 2022 +0200
1.2 +++ b/tests/dstest_exec.cc Mon Jun 06 00:36:14 2022 +0200
1.3 @@ -286,24 +286,6 @@
1.4
1.5 static ExecPager exec_pager;
1.6
1.7 -static void init_pager(ipc_server_config_type *config)
1.8 -{
1.9 - ipc_server_init_config(config);
1.10 -
1.11 - config->expected_items = PagerObject_expected_items;
1.12 - config->handler = (ipc_server_handler_type) handle_PagerObject;
1.13 - config->handler_obj = static_cast<PagerObject *>(&exec_pager);
1.14 -}
1.15 -
1.16 -static long start_pager(ipc_server_config_type *config, pthread_t thread)
1.17 -{
1.18 - config->config_thread = 1;
1.19 - config->thread = pthread_l4_cap(thread);
1.20 -
1.21 - printf("Starting pager thread...\n");
1.22 - return ipc_server_start_config(config);
1.23 -}
1.24 -
1.25
1.26
1.27 int main(int argc, char *argv[])
1.28 @@ -334,16 +316,7 @@
1.29 return 1;
1.30 }
1.31
1.32 - /* Start the pager. */
1.33 -
1.34 - ipc_server_config_type config;
1.35 - pthread_t pager_thread;
1.36 - pthread_attr_t attr;
1.37 -
1.38 - pthread_attr_init(&attr);
1.39 - pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
1.40 -
1.41 - init_pager(&config);
1.42 + /* Initialise pager regions. */
1.43
1.44 for (unsigned int i = 0; i < payload->segments(); i++)
1.45 {
1.46 @@ -353,6 +326,17 @@
1.47
1.48 exec_pager.add(stack.region());
1.49
1.50 + /* Start the pager. */
1.51 +
1.52 + pthread_t pager_thread;
1.53 + pthread_attr_t attr;
1.54 +
1.55 + pthread_attr_init(&attr);
1.56 + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
1.57 +
1.58 + ipc_server_config_type config;
1.59 + ipc_server_init_for(&config, PagerObject, &exec_pager);
1.60 +
1.61 err = pthread_create(&pager_thread, &attr, ipc_server_start_mainloop, &config);
1.62
1.63 if (err)
1.64 @@ -361,7 +345,8 @@
1.65 return 1;
1.66 }
1.67
1.68 - err = start_pager(&config, pager_thread);
1.69 + printf("Starting pager thread...\n");
1.70 + err = ipc_server_start_config_thread(&config, pthread_l4_cap(pager_thread));
1.71
1.72 if (err)
1.73 {