L4Re/departure

Changeset

307:f7b1aaad7f86
2022-04-26 Paul Boddie raw files shortlog changelog graph Added a function for defining flexpage receive windows.
libipc/include/ipc/util_ipc.h (file) libipc/lib/src/util_ipc.c (file)
     1.1 --- a/libipc/include/ipc/util_ipc.h	Tue Apr 26 00:38:25 2022 +0200
     1.2 +++ b/libipc/include/ipc/util_ipc.h	Tue Apr 26 16:34:54 2022 +0200
     1.3 @@ -1,7 +1,7 @@
     1.4  /*
     1.5   * Interprocess communication abstractions.
     1.6   *
     1.7 - * Copyright (C) 2018, 2019, 2021 Paul Boddie <paul@boddie.org.uk>
     1.8 + * Copyright (C) 2018, 2019, 2021, 2022 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 @@ -36,6 +36,7 @@
    1.13  
    1.14  long _expect_capabilities(l4_buf_regs_t *bregs, int number);
    1.15  long _expect_capability(l4_buf_regs_t *bregs, int item);
    1.16 +long _expect_fpage(l4_buf_regs_t *bregs, int item, l4_umword_t map_control, l4_fpage_t fpage);
    1.17  void _export_capability(l4_msgtag_t tag, l4_msg_regs_t *mregs, int item, l4_cap_idx_t ref);
    1.18  void _export_fpage(l4_msgtag_t tag, l4_msg_regs_t *mregs, int item, l4_snd_fpage_t fpage);
    1.19  void _export_page(l4_msgtag_t tag, l4_msg_regs_t *mregs, int item, l4_umword_t hot_spot, l4_fpage_t fpage);
     2.1 --- a/libipc/lib/src/util_ipc.c	Tue Apr 26 00:38:25 2022 +0200
     2.2 +++ b/libipc/lib/src/util_ipc.c	Tue Apr 26 16:34:54 2022 +0200
     2.3 @@ -1,7 +1,7 @@
     2.4  /*
     2.5   * Interprocess communication abstractions.
     2.6   *
     2.7 - * Copyright (C) 2018, 2019, 2021 Paul Boddie <paul@boddie.org.uk>
     2.8 + * Copyright (C) 2018, 2019, 2021, 2022 Paul Boddie <paul@boddie.org.uk>
     2.9   *
    2.10   * This program is free software; you can redistribute it and/or
    2.11   * modify it under the terms of the GNU General Public License as
    2.12 @@ -64,6 +64,17 @@
    2.13    return L4_EOK;
    2.14  }
    2.15  
    2.16 +/* Indicate that a flexpage is expected at the given position. */
    2.17 +
    2.18 +long _expect_fpage(l4_buf_regs_t *bregs, int item, l4_umword_t map_control, l4_fpage_t fpage)
    2.19 +{
    2.20 +  bregs->bdr = 0;
    2.21 +  bregs->br[item] = map_control;
    2.22 +  bregs->br[item + 1] = fpage.raw;
    2.23 +
    2.24 +  return L4_EOK;
    2.25 +}
    2.26 +
    2.27  /* Export in the message at the given position the given capability. */
    2.28  
    2.29  void _export_capability(l4_msgtag_t tag, l4_msg_regs_t *mregs, int item, l4_cap_idx_t ref)