From 5447f965f1e109f7ac9aeb91c0e3906969a4adb8 Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Mon, 13 Mar 2023 01:41:57 -0400 Subject: Use c_string to define host_get_kernel_version and host_get_kernel_boot_info. The existing definitions for kernel_version_t and kernel_boot_info_t use (MACH_MSG_TYPE_STRING, length*8) which result in message types that have a single element of 512 or 4096 bytes (set as msgt_size). This results in MiG generating mach_msg_type_long_t. Using c_string has the benefit of moving this size to be defined as msgt_number which doesn't overflow. This will allow us to simplify the 64 bit RPC ABI since all msgt_size can be defined with just 8 bits (as it should be expected). The resulting implementation is the same but we still need to define new RPCs since server and user expect different mach_msg_type_t. Message-Id: --- include/mach/mach_host.defs | 16 ++++++++++++++++ include/mach/mach_types.defs | 4 ++++ 2 files changed, 20 insertions(+) (limited to 'include') diff --git a/include/mach/mach_host.defs b/include/mach/mach_host.defs index 223f4576..99b48b4b 100644 --- a/include/mach/mach_host.defs +++ b/include/mach/mach_host.defs @@ -163,6 +163,7 @@ routine task_get_assignment( /* * Get string describing current kernel version. + * Deprecated, use host_get_kernel_version. */ routine host_kernel_version( host : host_t; @@ -348,6 +349,7 @@ routine processor_control( /* * Get boot configuration information from kernel. + * Deprecated, use host_get_kernel_boot_info. */ routine host_get_boot_info( host_priv : host_priv_t; @@ -378,3 +380,17 @@ routine host_adjust_time64( host_priv : host_priv_t; in new_adjustment : time_value64_t; out old_adjustment : time_value64_t); + +/* + * Get string describing current kernel version. + */ +routine host_get_kernel_version( + host : host_t; + out kernel_version : new_kernel_version_t); + +/* + * Get boot configuration information from kernel. + */ +routine host_get_kernel_boot_info( + host_priv : host_priv_t; + out boot_info : new_kernel_boot_info_t); diff --git a/include/mach/mach_types.defs b/include/mach/mach_types.defs index 8f22137a..e02e3e8a 100644 --- a/include/mach/mach_types.defs +++ b/include/mach/mach_types.defs @@ -256,8 +256,12 @@ type processor_set_name_array_t = ^array[] of processor_set_name_t; type processor_set_info_t = array[*:1024] of integer_t; type kernel_version_t = (MACH_MSG_TYPE_STRING, 512*8); +type new_kernel_version_t = c_string[512] + ctype: kernel_version_t; type kernel_boot_info_t = (MACH_MSG_TYPE_STRING, 4096*8); +type new_kernel_boot_info_t = c_string[4096] + ctype: kernel_boot_info_t; type rpc_time_value_t = struct { rpc_long_integer_t seconds; -- cgit v1.2.3