summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-03-13 01:41:57 -0400
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-03-13 20:26:26 +0100
commit5447f965f1e109f7ac9aeb91c0e3906969a4adb8 (patch)
treeb3571bc9da00758100f7bbe8d1a886948933173c /include
parentbba59e0f7a3cf1a008325b7919e9eb8a170c7c0a (diff)
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: <ZA63pS8j9J6NwuXY@jupiter.tail36e24.ts.net>
Diffstat (limited to 'include')
-rw-r--r--include/mach/mach_host.defs16
-rw-r--r--include/mach/mach_types.defs4
2 files changed, 20 insertions, 0 deletions
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;