L4Re/departure

Changeset

506:4a5c85bf5bb2
2023-03-07 Paul Boddie raw files shortlog changelog graph Changed the internal pager capability name to avoid potential conflicts.
libexec/include/exec/common.h (file) libexec/lib/src/process_creating.cc (file) libexec/rm/region_mapper.cc (file)
     1.1 --- a/libexec/include/exec/common.h	Tue Mar 07 00:43:52 2023 +0100
     1.2 +++ b/libexec/include/exec/common.h	Tue Mar 07 16:44:43 2023 +0100
     1.3 @@ -1,7 +1,7 @@
     1.4  /*
     1.5   * Common structures and functions.
     1.6   *
     1.7 - * Copyright (C) 2022 Paul Boddie <paul@boddie.org.uk>
     1.8 + * Copyright (C) 2022, 2023 Paul Boddie <paul@boddie.org.uk>
     1.9   *
    1.10   * This program is free software; you can redistribute it and/or
    1.11   * modify it under the terms of the GNU General Public License as
    1.12 @@ -29,6 +29,12 @@
    1.13  
    1.14  EXTERN_C_BEGIN
    1.15  
    1.16 +/* Common definitions. */
    1.17 +
    1.18 +#define ENV_INTERNAL_PAGER_NAME "intpager"
    1.19 +
    1.20 +
    1.21 +
    1.22  /* Auxiliary vector key-value pair. */
    1.23  
    1.24  struct auxv_entry
     2.1 --- a/libexec/lib/src/process_creating.cc	Tue Mar 07 00:43:52 2023 +0100
     2.2 +++ b/libexec/lib/src/process_creating.cc	Tue Mar 07 16:44:43 2023 +0100
     2.3 @@ -21,6 +21,7 @@
     2.4  
     2.5  #include <l4/re/env.h>
     2.6  
     2.7 +#include <exec/common.h>
     2.8  #include <fsclient/client.h>
     2.9  #include <fsserver/resource_server.h>
    2.10  #include <ipc/cap_alloc.h>
    2.11 @@ -229,7 +230,7 @@
    2.12       mapping the capability and encoded in the entry below. */
    2.13  
    2.14    l4re_env_cap_entry_t rm_init_caps[] = {
    2.15 -    l4re_env_cap_entry_t("server", _ipc_gate_cap, L4_CAP_FPAGE_RWS),
    2.16 +    l4re_env_cap_entry_t(ENV_INTERNAL_PAGER_NAME, _ipc_gate_cap, L4_CAP_FPAGE_RWS),
    2.17      l4re_env_cap_entry_t()
    2.18      };
    2.19  
     3.1 --- a/libexec/rm/region_mapper.cc	Tue Mar 07 00:43:52 2023 +0100
     3.2 +++ b/libexec/rm/region_mapper.cc	Tue Mar 07 16:44:43 2023 +0100
     3.3 @@ -65,13 +65,13 @@
     3.4    /* Start the pager. */
     3.5  
     3.6    printf("Initialising pager...\n");
     3.7 -  printf("Pager capability: %lx\n", l4re_env_get_cap("server"));
     3.8 +  printf("Pager capability: %lx\n", l4re_env_get_cap(ENV_INTERNAL_PAGER_NAME));
     3.9    printf("Main thread: %lx\n", l4re_env()->main_thread);
    3.10  
    3.11    /* Initialise the server, enabling notifications. */
    3.12  
    3.13    ResourceServer server(&exec_pager);
    3.14 -  long err = server.bind("server");
    3.15 +  long err = server.bind(ENV_INTERNAL_PAGER_NAME);
    3.16  
    3.17    if (err)
    3.18    {