1.1 --- a/libexec/include/exec/process_creator_context_resource.h Thu Mar 07 22:41:40 2024 +0100 1.2 +++ b/libexec/include/exec/process_creator_context_resource.h Thu Mar 07 23:50:26 2024 +0100 1.3 @@ -65,8 +65,8 @@ 1.4 l4_snd_fpage_t *region) 1.5 { return SimplePager::map(offset, hot_spot, flags, region); } 1.6 1.7 - long info(offset_t *size, map_flags_t *flags) 1.8 - { return SimplePager::info(size, flags); } 1.9 + long info(ds_stats_t *stats) 1.10 + { return SimplePager::info(stats); } 1.11 }; 1.12 1.13 /* vim: tabstop=2 expandtab shiftwidth=2
2.1 --- a/libfsclient/lib/src/file.cc Thu Mar 07 22:41:40 2024 +0100 2.2 +++ b/libfsclient/lib/src/file.cc Thu Mar 07 23:50:26 2024 +0100 2.3 @@ -1,7 +1,7 @@ 2.4 /* 2.5 * File access convenience functions. 2.6 * 2.7 - * Copyright (C) 2021, 2022, 2023 Paul Boddie <paul@boddie.org.uk> 2.8 + * Copyright (C) 2021, 2022, 2023, 2024 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 @@ -267,8 +267,7 @@ 2.13 return -L4_EINVAL; 2.14 2.15 client_Opener opener(server); 2.16 - offset_t size; 2.17 - map_flags_t flags; 2.18 + ds_stats_t stats; 2.19 long err; 2.20 2.21 file_init(file); 2.22 @@ -280,14 +279,14 @@ 2.23 2.24 client_Dataspace context_ds(file->ref); 2.25 2.26 - err = context_ds.info(&size, &flags); 2.27 + err = context_ds.info(&stats); 2.28 if (err) 2.29 return err; 2.30 2.31 file->start_pos = 0; 2.32 - file->end_pos = size; 2.33 + file->end_pos = stats.size; 2.34 2.35 - return ipc_attach_dataspace(file->ref, size, (void **) &file->memory); 2.36 + return ipc_attach_dataspace(file->ref, stats.size, (void **) &file->memory); 2.37 } 2.38 2.39 /* Make a directory using the given context. */
3.1 --- a/libfsserver/include/fsserver/opener_context_resource.h Thu Mar 07 22:41:40 2024 +0100 3.2 +++ b/libfsserver/include/fsserver/opener_context_resource.h Thu Mar 07 23:50:26 2024 +0100 3.3 @@ -1,7 +1,7 @@ 3.4 /* 3.5 * A context resource offering support for opening files. 3.6 * 3.7 - * Copyright (C) 2021, 2022, 2023 Paul Boddie <paul@boddie.org.uk> 3.8 + * Copyright (C) 2021, 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk> 3.9 * 3.10 * This program is free software; you can redistribute it and/or 3.11 * modify it under the terms of the GNU General Public License as 3.12 @@ -68,8 +68,8 @@ 3.13 l4_snd_fpage_t *region) 3.14 { return SimplePager::map(offset, hot_spot, flags, region); } 3.15 3.16 - long info(offset_t *size, map_flags_t *flags) 3.17 - { return SimplePager::info(size, flags); } 3.18 + long info(ds_stats_t *stats) 3.19 + { return SimplePager::info(stats); } 3.20 }; 3.21 3.22 // vim: tabstop=4 expandtab shiftwidth=4
4.1 --- a/libfsserver/include/fsserver/simple_pager.h Thu Mar 07 22:41:40 2024 +0100 4.2 +++ b/libfsserver/include/fsserver/simple_pager.h Thu Mar 07 23:50:26 2024 +0100 4.3 @@ -1,7 +1,7 @@ 4.4 /* 4.5 * A simple pager exposing a single memory region. 4.6 * 4.7 - * Copyright (C) 2021, 2022, 2023 Paul Boddie <paul@boddie.org.uk> 4.8 + * Copyright (C) 2021, 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk> 4.9 * 4.10 * This program is free software; you can redistribute it and/or 4.11 * modify it under the terms of the GNU General Public License as 4.12 @@ -49,7 +49,7 @@ 4.13 4.14 long map(offset_t offset, map_address_t hot_spot, map_flags_t flags, l4_snd_fpage_t *region); 4.15 4.16 - long info(offset_t *size, map_flags_t *flags); 4.17 + long info(ds_stats_t *stats); 4.18 }; 4.19 4.20 // vim: tabstop=4 expandtab shiftwidth=4
5.1 --- a/libfsserver/lib/generic/simple_pager.cc Thu Mar 07 22:41:40 2024 +0100 5.2 +++ b/libfsserver/lib/generic/simple_pager.cc Thu Mar 07 23:50:26 2024 +0100 5.3 @@ -1,7 +1,7 @@ 5.4 /* 5.5 * A simple pager exposing a single memory region. 5.6 * 5.7 - * Copyright (C) 2021, 2022, 2023 Paul Boddie <paul@boddie.org.uk> 5.8 + * Copyright (C) 2021, 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk> 5.9 * 5.10 * This program is free software; you can redistribute it and/or 5.11 * modify it under the terms of the GNU General Public License as 5.12 @@ -95,10 +95,10 @@ 5.13 return IPC_MESSAGE_SENT; 5.14 } 5.15 5.16 -long SimplePager::info(offset_t *size, map_flags_t *flags) 5.17 +long SimplePager::info(ds_stats_t *stats) 5.18 { 5.19 - *size = _region->size(); 5.20 - *flags = L4_FPAGE_RW; 5.21 + stats->size = _region->size(); 5.22 + stats->flags = L4_FPAGE_RW; 5.23 5.24 return L4_EOK; 5.25 }
6.1 --- a/libipc/Control Thu Mar 07 22:41:40 2024 +0100 6.2 +++ b/libipc/Control Thu Mar 07 23:50:26 2024 +0100 6.3 @@ -1,3 +1,3 @@ 6.4 -requires: libc 6.5 +requires: libc libsystypes 6.6 provides: libipc 6.7 maintainer: paul@boddie.org.uk
7.1 --- a/libipc/include/ipc/mem_ipc.h Thu Mar 07 22:41:40 2024 +0100 7.2 +++ b/libipc/include/ipc/mem_ipc.h Thu Mar 07 23:50:26 2024 +0100 7.3 @@ -1,7 +1,7 @@ 7.4 /* 7.5 * Memory sharing abstractions. 7.6 * 7.7 - * Copyright (C) 2018, 2019, 2021, 2022 Paul Boddie <paul@boddie.org.uk> 7.8 + * Copyright (C) 2018, 2019, 2021, 2022, 2024 Paul Boddie <paul@boddie.org.uk> 7.9 * 7.10 * This program is free software; you can redistribute it and/or 7.11 * modify it under the terms of the GNU General Public License as 7.12 @@ -21,24 +21,23 @@ 7.13 7.14 #pragma once 7.15 7.16 -#include <l4/re/c/dataspace.h> 7.17 -#include <l4/re/c/rm.h> 7.18 #include <l4/sys/types.h> 7.19 +#include <systypes/base.h> 7.20 7.21 EXTERN_C_BEGIN 7.22 7.23 -long ipc_allocate(unsigned long size, void **addr, l4re_ds_t *ds); 7.24 +long ipc_allocate(unsigned long size, void **addr, l4_cap_idx_t *ds); 7.25 7.26 -long ipc_allocate_align(unsigned long size, l4re_rm_flags_t flags, 7.27 - unsigned char align, void **addr, l4re_ds_t *ds); 7.28 +long ipc_allocate_align(unsigned long size, rm_flags_t flags, 7.29 + unsigned char align, void **addr, l4_cap_idx_t *ds); 7.30 7.31 long ipc_new_dataspace(l4_mword_t size, l4_umword_t flags, l4_umword_t align, 7.32 - l4re_ds_t *ds); 7.33 + l4_cap_idx_t *ds); 7.34 7.35 -long ipc_attach_dataspace(l4re_ds_t ds, unsigned long size, void **addr); 7.36 +long ipc_attach_dataspace(l4_cap_idx_t ds, unsigned long size, void **addr); 7.37 7.38 -long ipc_attach_dataspace_align(l4re_ds_t ds, unsigned long size, 7.39 - l4re_rm_flags_t flags, unsigned char align, 7.40 +long ipc_attach_dataspace_align(l4_cap_idx_t ds, unsigned long size, 7.41 + rm_flags_t flags, unsigned char align, 7.42 void **addr); 7.43 7.44 long ipc_detach_dataspace(void *addr);
8.1 --- a/libipc/lib/src/Makefile Thu Mar 07 22:41:40 2024 +0100 8.2 +++ b/libipc/lib/src/Makefile Thu Mar 07 23:50:26 2024 +0100 8.3 @@ -4,7 +4,7 @@ 8.4 TARGET = libipc.a libipc.so 8.5 PC_FILENAME = libipc 8.6 SRC_C = cap_alloc.c irq.c map.c mem_ipc.c message.c semaphore.c server.c thread.c util_ipc.c 8.7 -REQUIRES_LIBS = l4re_c-util 8.8 +REQUIRES_LIBS = l4re_c-util libsystypes 8.9 8.10 PRIVATE_INCDIR += $(PKGDIR)/include/ipc 8.11 CONTRIB_INCDIR = libipc
9.1 --- a/libipc/lib/src/mem_ipc.c Thu Mar 07 22:41:40 2024 +0100 9.2 +++ b/libipc/lib/src/mem_ipc.c Thu Mar 07 23:50:26 2024 +0100 9.3 @@ -1,7 +1,7 @@ 9.4 /* 9.5 * Memory sharing abstractions. 9.6 * 9.7 - * Copyright (C) 2018, 2019, 2021, 2022 Paul Boddie <paul@boddie.org.uk> 9.8 + * Copyright (C) 2018, 2019, 2021, 2022, 2024 Paul Boddie <paul@boddie.org.uk> 9.9 * 9.10 * This program is free software; you can redistribute it and/or 9.11 * modify it under the terms of the GNU General Public License as 9.12 @@ -20,6 +20,7 @@ 9.13 */ 9.14 9.15 #include <l4/re/c/mem_alloc.h> 9.16 +#include <l4/re/c/rm.h> /* L4RE_RM_F_* */ 9.17 #include <l4/sys/err.h> 9.18 #include <l4/sys/types.h> 9.19 9.20 @@ -37,14 +38,14 @@ 9.21 9.22 /* Generic memory allocation. */ 9.23 9.24 -long ipc_allocate(unsigned long size, void **addr, l4re_ds_t *ds) 9.25 +long ipc_allocate(unsigned long size, void **addr, l4_cap_idx_t *ds) 9.26 { 9.27 return ipc_allocate_align(size, L4RE_RM_F_SEARCH_ADDR | L4RE_RM_F_RW, 9.28 L4_PAGESHIFT, addr, ds); 9.29 } 9.30 9.31 long ipc_allocate_align(unsigned long size, l4re_rm_flags_t flags, 9.32 - unsigned char align, void **addr, l4re_ds_t *ds) 9.33 + unsigned char align, void **addr, l4_cap_idx_t *ds) 9.34 { 9.35 /* Allocate and attach the memory for the dataspace. */ 9.36 9.37 @@ -66,7 +67,7 @@ 9.38 /* Create a dataspace. Equivalent to l4re_ma_alloc_align. */ 9.39 9.40 long ipc_new_dataspace(l4_mword_t size, l4_umword_t flags, l4_umword_t align, 9.41 - l4re_ds_t *ds) 9.42 + l4_cap_idx_t *ds) 9.43 { 9.44 /* Allocate a capability for the dataspace. */ 9.45 9.46 @@ -80,14 +81,14 @@ 9.47 9.48 /* Attach a dataspace region. Similar to l4re_rm_attach. */ 9.49 9.50 -long ipc_attach_dataspace(l4re_ds_t ds, unsigned long size, void **addr) 9.51 +long ipc_attach_dataspace(l4_cap_idx_t ds, unsigned long size, void **addr) 9.52 { 9.53 return ipc_attach_dataspace_align(ds, size, L4RE_RM_F_SEARCH_ADDR | L4RE_RM_F_RW, 9.54 L4_PAGESHIFT, addr); 9.55 } 9.56 9.57 -long ipc_attach_dataspace_align(l4re_ds_t ds, unsigned long size, 9.58 - l4re_rm_flags_t flags, unsigned char align, 9.59 +long ipc_attach_dataspace_align(l4_cap_idx_t ds, unsigned long size, 9.60 + rm_flags_t flags, unsigned char align, 9.61 void **addr) 9.62 { 9.63 long err;
10.1 --- a/libmem/lib/src/memory_incremental.cc Thu Mar 07 22:41:40 2024 +0100 10.2 +++ b/libmem/lib/src/memory_incremental.cc Thu Mar 07 23:50:26 2024 +0100 10.3 @@ -20,6 +20,7 @@ 10.4 */ 10.5 10.6 #include <l4/re/c/mem_alloc.h> 10.7 +#include <l4/re/c/rm.h> 10.8 10.9 #include "memory_incremental.h" 10.10
11.1 --- a/libsystypes/idl/dataspace.idl Thu Mar 07 22:41:40 2024 +0100 11.2 +++ b/libsystypes/idl/dataspace.idl Thu Mar 07 23:50:26 2024 +0100 11.3 @@ -26,7 +26,7 @@ 11.4 11.5 /* Obtain statistics about a dataspace. */ 11.6 11.7 - [opcode(2)] void info(out offset_t size, out map_flags_t flags); 11.8 + [opcode(2)] void info(out ds_stats_t stats); 11.9 11.10 /* Copy data between dataspaces. */ 11.11
12.1 --- a/libsystypes/include/systypes/base.h Thu Mar 07 22:41:40 2024 +0100 12.2 +++ b/libsystypes/include/systypes/base.h Thu Mar 07 23:50:26 2024 +0100 12.3 @@ -46,6 +46,18 @@ 12.4 typedef l4_uint64_t map_address_t; 12.5 typedef unsigned long map_flags_t; 12.6 12.7 +/* Dataspace types. 12.8 + See: pkg/l4re-core/l4re_c/include/dataspace.h */ 12.9 + 12.10 +typedef unsigned long ds_flags_t; 12.11 + 12.12 +typedef struct 12.13 +{ 12.14 + offset_t size; 12.15 + ds_flags_t flags; 12.16 + 12.17 +} ds_stats_t; 12.18 + 12.19 /* Conversions. */ 12.20 12.21 map_flags_t map_flags_for_fault(l4_umword_t flags);