1.1 --- a/libexec/include/exec/external_pager.h Tue Mar 05 00:18:00 2024 +0100
1.2 +++ b/libexec/include/exec/external_pager.h Thu Mar 07 22:41:40 2024 +0100
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * A system pager implementation residing in a separate task.
1.6 *
1.7 - * Copyright (C) 2022, 2023 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2022, 2023, 2024 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 @@ -103,8 +103,8 @@
1.13
1.14 /* Region manager/mapper methods. */
1.15
1.16 - virtual long attach(address_t *start, address_t size, map_flags_t flags,
1.17 - l4_cap_idx_t ds, address_t offset, unsigned char align);
1.18 + virtual long attach(address_t *start, address_t size, rm_flags_t flags,
1.19 + l4_cap_idx_t ds, rm_offset_t offset, unsigned char align);
1.20
1.21 /* Parent methods. */
1.22
2.1 --- a/libexec/include/exec/internal_pager.h Tue Mar 05 00:18:00 2024 +0100
2.2 +++ b/libexec/include/exec/internal_pager.h Thu Mar 07 22:41:40 2024 +0100
2.3 @@ -1,7 +1,7 @@
2.4 /*
2.5 * A system pager implementation residing in the same task as a program.
2.6 *
2.7 - * Copyright (C) 2022, 2023 Paul Boddie <paul@boddie.org.uk>
2.8 + * Copyright (C) 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 @@ -56,13 +56,13 @@
2.13
2.14 /* Region manager/mapper methods. */
2.15
2.16 - virtual long attach(address_t *start, address_t size, map_flags_t flags,
2.17 - l4_cap_idx_t ds, address_t offset, unsigned char align);
2.18 + virtual long attach(address_t *start, address_t size, rm_flags_t flags,
2.19 + l4_cap_idx_t ds, rm_offset_t offset, unsigned char align);
2.20
2.21 - virtual long detach(address_t addr, address_t size, map_flags_t flags,
2.22 + virtual long detach(address_t addr, address_t size, rm_flags_t flags,
2.23 address_t *start, address_t *rsize, l4_cap_idx_t *ds);
2.24
2.25 - virtual long reserve_area(address_t *start, address_t size, map_flags_t flags,
2.26 + virtual long reserve_area(address_t *start, address_t size, rm_flags_t flags,
2.27 unsigned char align);
2.28 };
2.29
3.1 --- a/libexec/lib/src/external_pager.cc Tue Mar 05 00:18:00 2024 +0100
3.2 +++ b/libexec/lib/src/external_pager.cc Thu Mar 07 22:41:40 2024 +0100
3.3 @@ -232,8 +232,8 @@
3.4 the initialisation of a program by the C library which requires a region
3.5 mapper. */
3.6
3.7 -long ExternalPager::attach(address_t *start, address_t size, map_flags_t flags,
3.8 - l4_cap_idx_t ds, address_t offset,
3.9 +long ExternalPager::attach(address_t *start, address_t size, rm_flags_t flags,
3.10 + l4_cap_idx_t ds, rm_offset_t offset,
3.11 unsigned char align)
3.12 {
3.13 // NOTE: Determine the purpose of offset.
4.1 --- a/libexec/lib/src/internal_pager.cc Tue Mar 05 00:18:00 2024 +0100
4.2 +++ b/libexec/lib/src/internal_pager.cc Thu Mar 07 22:41:40 2024 +0100
4.3 @@ -1,7 +1,7 @@
4.4 /*
4.5 * A system pager implementation residing in the same task as a program.
4.6 *
4.7 - * Copyright (C) 2022, 2023 Paul Boddie <paul@boddie.org.uk>
4.8 + * Copyright (C) 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 @@ -137,8 +137,8 @@
4.13 the initialisation of a program by the C library which requires a region
4.14 mapper. */
4.15
4.16 -long InternalPager::attach(address_t *start, address_t size, map_flags_t flags,
4.17 - l4_cap_idx_t ds, address_t offset,
4.18 +long InternalPager::attach(address_t *start, address_t size, rm_flags_t flags,
4.19 + l4_cap_idx_t ds, rm_offset_t offset,
4.20 unsigned char align)
4.21 {
4.22 /* NOTE: The offset apparently indicates the offset within the dataspace of
4.23 @@ -160,7 +160,7 @@
4.24 return err;
4.25 }
4.26
4.27 -long InternalPager::detach(address_t addr, address_t size, map_flags_t flags,
4.28 +long InternalPager::detach(address_t addr, address_t size, rm_flags_t flags,
4.29 address_t *start, address_t *rsize, l4_cap_idx_t *ds)
4.30 {
4.31 (void) size; (void) flags;
4.32 @@ -183,7 +183,7 @@
4.33 }
4.34
4.35 long InternalPager::reserve_area(address_t *start, address_t size,
4.36 - map_flags_t flags, unsigned char align)
4.37 + rm_flags_t flags, unsigned char align)
4.38 {
4.39 MemoryArea *area;
4.40 long err = ExecPager::find(start, &size, flags, align, &area);
5.1 --- a/libsystypes/idl/region_mapper.idl Tue Mar 05 00:18:00 2024 +0100
5.2 +++ b/libsystypes/idl/region_mapper.idl Thu Mar 07 22:41:40 2024 +0100
5.3 @@ -1,5 +1,5 @@
5.4 #include <l4/re/protocols.h> /* L4RE_PROTO_RM */
5.5 -#include <systypes/base.h> /* address_t */
5.6 +#include <systypes/base.h> /* address_t, rm_flags_t, rm_offset_t */
5.7
5.8 /* A region mapper/manager interface.
5.9 See: pkg/l4re-core/l4re/util/include/region_mapping_svr_2 */
5.10 @@ -11,8 +11,8 @@
5.11 address to search for a suitable address for the region. */
5.12
5.13 [opcode(0)] void attach(inout address_t start, in address_t size,
5.14 - in map_flags_t flags, in cap ds,
5.15 - in address_t offset, in unsigned char align);
5.16 + in rm_flags_t flags, in cap ds,
5.17 + in rm_offset_t offset, in unsigned char align);
5.18
5.19 /* Detach memory from the task, searching from the given address for a region
5.20 of the given size. Return the start address, region size and dataspace.
5.21 @@ -24,20 +24,20 @@
5.22 This is not obvious from the L4Re definitions and the IPC type system. */
5.23
5.24 [opcode(1)] void detach(in address_t addr, in address_t size,
5.25 - in map_flags_t flags, out address_t start,
5.26 + in rm_flags_t flags, out address_t start,
5.27 out address_t rsize, out l4_cap_idx_t ds);
5.28
5.29 /* Find a region starting from the given address and having the given size.
5.30 Return the start address, region size and dataspace. */
5.31
5.32 [opcode(2)] void find(inout address_t addr, inout address_t size,
5.33 - out map_flags_t flags, out address_t offset,
5.34 + out rm_flags_t flags, out rm_offset_t offset,
5.35 out cap ds);
5.36
5.37 /* Reserve an area in the region map. */
5.38
5.39 [opcode(3)] void reserve_area(inout address_t start, in address_t size,
5.40 - in map_flags_t flags, in unsigned char align);
5.41 + in rm_flags_t flags, in unsigned char align);
5.42
5.43 /* Free (or unreserve) an area in the region map. */
5.44
6.1 --- a/libsystypes/include/systypes/base.h Tue Mar 05 00:18:00 2024 +0100
6.2 +++ b/libsystypes/include/systypes/base.h Thu Mar 07 22:41:40 2024 +0100
6.3 @@ -1,7 +1,7 @@
6.4 /*
6.5 * Base types used by various other types.
6.6 *
6.7 - * Copyright (C) 2019, 2021, 2022, 2023 Paul Boddie <paul@boddie.org.uk>
6.8 + * Copyright (C) 2019, 2021, 2022, 2023, 2024 Paul Boddie <paul@boddie.org.uk>
6.9 *
6.10 * This program is free software; you can redistribute it and/or
6.11 * modify it under the terms of the GNU General Public License as
6.12 @@ -34,6 +34,12 @@
6.13 typedef l4_uint64_t offset_t;
6.14 typedef l4_addr_t address_t; /* unsigned long */
6.15
6.16 +/* Region mapper types.
6.17 + See: pkg/l4re-core/l4re_c/include/rm.h */
6.18 +
6.19 +typedef l4_uint32_t rm_flags_t;
6.20 +typedef l4_uint64_t rm_offset_t;
6.21 +
6.22 /* Dataspace mapping flags.
6.23 See: pkg/l4re-core/l4re_c/include/dataspace.h */
6.24