1.1 --- a/libexec/rm/region_mapper.cc Sun Mar 19 00:46:24 2023 +0100
1.2 +++ b/libexec/rm/region_mapper.cc Sun Mar 19 00:48:15 2023 +0100
1.3 @@ -22,6 +22,9 @@
1.4 #include <l4/re/env.h>
1.5 #include <l4/sys/err.h>
1.6
1.7 +#include <stdio.h>
1.8 +#include <string.h>
1.9 +
1.10 #include <exec/common.h>
1.11 #include <exec/internal_pager.h>
1.12 #include <exec/stack.h>
1.13 @@ -38,12 +41,15 @@
1.14
1.15 int main(int argc, char *argv[])
1.16 {
1.17 + int debug = (argc > 1) && !strcmp(argv[1], "-v");
1.18 +
1.19 /* Initialise pager regions from region descriptions obtained via the
1.20 auxiliary data. */
1.21
1.22 l4re_aux_t *l4re_aux = exec_get_l4re_aux(argc, argv);
1.23
1.24 - printf("aux = {%s, %lx, %lx, %lx}\n", l4re_aux->binary, l4re_aux->kip_ds, l4re_aux->dbg_lvl, l4re_aux->ldr_flags);
1.25 + if (debug)
1.26 + printf("aux = {%s, %lx, %lx, %lx}\n", l4re_aux->binary, l4re_aux->kip_ds, l4re_aux->dbg_lvl, l4re_aux->ldr_flags);
1.27
1.28 /* Skip past the auxiliary structure itself. */
1.29
1.30 @@ -57,16 +63,21 @@
1.31
1.32 for (; region && (region->ds != L4_INVALID_CAP); region++)
1.33 {
1.34 - printf("Adding region: {%lx, %llx, %lx, %lx}\n", region->start, region->start + region->size, region->flags, region->ds);
1.35 + if (debug)
1.36 + printf("Adding region: {%lx, %llx, %lx, %lx}\n", region->start, region->start + region->size, region->flags, region->ds);
1.37 +
1.38 MappedRegion r(region->start, region->start + region->size, region->flags, region->ds);
1.39 exec_pager.add(r);
1.40 }
1.41
1.42 /* Start the pager. */
1.43
1.44 - printf("Initialising pager...\n");
1.45 - printf("Pager capability: %lx\n", l4re_env_get_cap(ENV_INTERNAL_PAGER_NAME));
1.46 - printf("Main thread: %lx\n", l4re_env()->main_thread);
1.47 + if (debug)
1.48 + {
1.49 + printf("Initialising pager...\n");
1.50 + printf("Pager capability: %lx\n", l4re_env_get_cap(ENV_INTERNAL_PAGER_NAME));
1.51 + printf("Main thread: %lx\n", l4re_env()->main_thread);
1.52 + }
1.53
1.54 /* Initialise the server, enabling notifications. */
1.55