diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2022-11-22 23:46:31 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-11-25 01:26:26 +0100 |
commit | d30481122a5d24ad6b921062f93b9172ef922fc3 (patch) | |
tree | 04795cf3ca05fd8133f325cd053c87020b0bec3d /i386 | |
parent | 448e3d676a35e027219c5db224204892dc026b3b (diff) | |
download | gnumach-d30481122a5d24ad6b921062f93b9172ef922fc3.tar.gz gnumach-d30481122a5d24ad6b921062f93b9172ef922fc3.tar.bz2 gnumach-d30481122a5d24ad6b921062f93b9172ef922fc3.zip |
Update mach_debug interfaces to use struct.
The new interfaces will be compatible both with a 64 bits kernel and
userland and 64 bits kernel and 32 bit userland. Also removed many
of the uses of natural_t where an unsigned int suffices. Ideally we
should replace natural_t with something more portable such as uintptr_t
or a basic int type for counters since for the most part we don't
need counters to have the same width as the pointer type.
* i386/include/mach/i386/vm_types.h: Define rpc_unsigned_long.
* include/mach/mach_types.defs: Define type rpc_vm_offset_t.
* include/mach_debug/hash_info.h: Use unsigned int instead of natural_t.
* include/mach_debug/mach_debug_types.defs: Update cache_info_t,
hash_info_bucket_t, vm_region_info_t, vm_object_info_t and
vm_page_info_t to use struct.
* include/mach_debug/slab_info.h: Use rpc_vm_size_t and
rpc_unsigned_long for compatibility with 32 bits userland.
* include/mach_debug/vm_info.h: Update struct fields to use the correct
types and avoid natural_t whenever we just want to keep a count of
something.
Message-Id: <Y32lp1SuV01ImCx9@viriathus>
Diffstat (limited to 'i386')
-rwxr-xr-x | i386/include/mach/i386/machine_types.defs | 14 | ||||
-rw-r--r-- | i386/include/mach/i386/vm_types.h | 2 |
2 files changed, 16 insertions, 0 deletions
diff --git a/i386/include/mach/i386/machine_types.defs b/i386/include/mach/i386/machine_types.defs index dfbc521e..0e94999b 100755 --- a/i386/include/mach/i386/machine_types.defs +++ b/i386/include/mach/i386/machine_types.defs @@ -59,6 +59,20 @@ type natural_t = uint32_t; type integer_t = int32_t; /* + * unsigned long for kernel <-> userland interfaces size depends on the architecture + * of both kernel and userland. + */ +#if defined(KERNEL) && defined(USER32) +type rpc_unsigned_long = uint32_t; +#else /* KERNEL and USER32 */ +#if defined(__x86_64__) +type rpc_unsigned_long = uint64_t; +#else /* __x86_64__ */ +type rpc_unsigned_long = uint32_t; +#endif /* __x86_64__ */ +#endif /* KERNEL_SERVER and USER32 */ + +/* * Physical address size */ type rpc_phys_addr_t = uint64_t; diff --git a/i386/include/mach/i386/vm_types.h b/i386/include/mach/i386/vm_types.h index 7a43d75d..9daaa15e 100644 --- a/i386/include/mach/i386/vm_types.h +++ b/i386/include/mach/i386/vm_types.h @@ -116,12 +116,14 @@ static inline __mach_uint32_t convert_vm_to_user(__mach_uint64_t kaddr) assert(kaddr <= 0xFFFFFFFF); return (__mach_uint32_t)kaddr; } +typedef __mach_uint32_t rpc_unsigned_long; #else /* MACH_KERNEL */ typedef vm_offset_t rpc_vm_address_t; typedef vm_offset_t rpc_vm_offset_t; typedef vm_size_t rpc_vm_size_t; #define convert_vm_to_user null_conversion #define convert_vm_from_user null_conversion +typedef unsigned long rpc_unsigned_long; #endif /* MACH_KERNEL */ #endif /* __ASSEMBLER__ */ |