# HG changeset patch # User Paul Boddie # Date 1663334678 -7200 # Node ID fed02d483493d1ebda41f9aa92e2bd5b8024d1c4 # Parent f14d66e293b31d2a3ffdc64293d8c8b617789b40 Employed address_t instead of offset_t for region mapper quantities. Whilst the two types are equivalent on 64-bit platforms, they are distinct and thus different on 32-bit platforms. diff -r f14d66e293b3 -r fed02d483493 libexec/include/exec/external_pager.h --- a/libexec/include/exec/external_pager.h Fri Sep 16 15:17:22 2022 +0200 +++ b/libexec/include/exec/external_pager.h Fri Sep 16 15:24:38 2022 +0200 @@ -54,7 +54,7 @@ /* Region manager/mapper methods. */ - virtual long attach(address_t *start, offset_t size, map_flags_t flags, + virtual long attach(address_t *start, address_t size, map_flags_t flags, l4_cap_idx_t ds, address_t offset, unsigned char align); }; diff -r f14d66e293b3 -r fed02d483493 libexec/include/exec/internal_pager.h --- a/libexec/include/exec/internal_pager.h Fri Sep 16 15:17:22 2022 +0200 +++ b/libexec/include/exec/internal_pager.h Fri Sep 16 15:24:38 2022 +0200 @@ -55,7 +55,7 @@ /* Region manager/mapper methods. */ - virtual long attach(address_t *start, offset_t size, map_flags_t flags, + virtual long attach(address_t *start, address_t size, map_flags_t flags, l4_cap_idx_t ds, address_t offset, unsigned char align); }; diff -r f14d66e293b3 -r fed02d483493 libexec/include/exec/pager.h --- a/libexec/include/exec/pager.h Fri Sep 16 15:17:22 2022 +0200 +++ b/libexec/include/exec/pager.h Fri Sep 16 15:24:38 2022 +0200 @@ -42,7 +42,7 @@ /* Region manager/mapper methods. */ - virtual long attach(address_t *start, offset_t size, map_flags_t flags, + virtual long attach(address_t *start, address_t size, map_flags_t flags, l4_cap_idx_t ds, address_t offset, unsigned char align); }; diff -r f14d66e293b3 -r fed02d483493 libexec/lib/src/external_pager.cc --- a/libexec/lib/src/external_pager.cc Fri Sep 16 15:17:22 2022 +0200 +++ b/libexec/lib/src/external_pager.cc Fri Sep 16 15:24:38 2022 +0200 @@ -154,7 +154,7 @@ the initialisation of a program by the C library which requires a region mapper. */ -long ExternalPager::attach(address_t *start, offset_t size, map_flags_t flags, +long ExternalPager::attach(address_t *start, address_t size, map_flags_t flags, l4_cap_idx_t ds, address_t offset, unsigned char align) { @@ -165,8 +165,8 @@ if (align < L4_PAGESHIFT) align = L4_PAGESHIFT; - offset_t increment = 1UL << align; - offset_t region_size = round(size, increment); + address_t increment = 1UL << align; + address_t region_size = round(size, increment); /* Either attempt to find an address for the specified region, starting from any indicated address. */ diff -r f14d66e293b3 -r fed02d483493 libexec/lib/src/internal_pager.cc --- a/libexec/lib/src/internal_pager.cc Fri Sep 16 15:17:22 2022 +0200 +++ b/libexec/lib/src/internal_pager.cc Fri Sep 16 15:24:38 2022 +0200 @@ -110,9 +110,9 @@ if ((addr >= r.start) && (addr < r.start + r.size)) { - offset_t window_size = L4_PAGESIZE; + address_t window_size = L4_PAGESIZE; address_t window_base = trunc(addr, window_size); - offset_t offset = addr - r.start; + address_t offset = addr - r.start; address_t page_addr = trunc(addr, L4_PAGESIZE); address_t hot_spot = page_addr - window_base; @@ -153,7 +153,7 @@ the initialisation of a program by the C library which requires a region mapper. */ -long InternalPager::attach(address_t *start, offset_t size, map_flags_t flags, +long InternalPager::attach(address_t *start, address_t size, map_flags_t flags, l4_cap_idx_t ds, address_t offset, unsigned char align) { @@ -164,8 +164,8 @@ if (align < L4_PAGESHIFT) align = L4_PAGESHIFT; - offset_t increment = 1UL << align; - offset_t region_size = round(size, increment); + address_t increment = 1UL << align; + address_t region_size = round(size, increment); /* Either attempt to find an address for the specified region, starting from any indicated address. */ diff -r f14d66e293b3 -r fed02d483493 libsystypes/idl/region_mapper.idl --- a/libsystypes/idl/region_mapper.idl Fri Sep 16 15:17:22 2022 +0200 +++ b/libsystypes/idl/region_mapper.idl Fri Sep 16 15:24:38 2022 +0200 @@ -1,5 +1,5 @@ #include /* L4RE_PROTO_RM */ -#include /* address_t, offset_t */ +#include /* address_t */ /* A region mapper/manager interface. */ @@ -9,27 +9,27 @@ /* Attach the memory associated with a dataspace, employing the given start address to search for a suitable address for the region. */ - [opcode(0)] void attach(inout address_t start, in offset_t size, + [opcode(0)] void attach(inout address_t start, in address_t size, in map_flags_t flags, in cap ds, in address_t offset, in unsigned char align); /* Detach memory from the task, searching from the given address for a region of the given size. Return the start address, region size and dataspace. */ - [opcode(1)] void detach(in address_t addr, in offset_t size, + [opcode(1)] void detach(in address_t addr, in address_t size, in map_flags_t flags, out address_t start, - out offset_t rsize, out cap ds); + out address_t rsize, out cap ds); /* Find a region starting from the given address and having the given size. Return the start address, region size and dataspace. */ - [opcode(2)] void find(inout address_t addr, inout offset_t size, + [opcode(2)] void find(inout address_t addr, inout address_t size, out map_flags_t flags, out address_t offset, out cap ds); /* Reserve an area in the region map. */ - [opcode(3)] void reserve_area(inout address_t start, in offset_t size, + [opcode(3)] void reserve_area(inout address_t start, in address_t size, in map_flags_t flags, in unsigned char align); /* Free (or unreserve) an area in the region map. */