| ... | @@ -3922,6 +3922,7 @@ pub const cpu_subtype_t = integer_t; | ... | @@ -3922,6 +3922,7 @@ pub const cpu_subtype_t = integer_t; |
| 3922 | pub const cpu_threadtype_t = integer_t; | 3922 | pub const cpu_threadtype_t = integer_t; |
| 3923 | pub const host_flavor_t = integer_t; | 3923 | pub const host_flavor_t = integer_t; |
| 3924 | pub const host_info_t = *integer_t; | 3924 | pub const host_info_t = *integer_t; |
| | 3925 | pub const host_info64_t = *integer_t; |
| 3925 | pub const host_can_has_debugger_info = extern struct { | 3926 | pub const host_can_has_debugger_info = extern struct { |
| 3926 | can_has_debugger: boolean_t, | 3927 | can_has_debugger: boolean_t, |
| 3927 | }; | 3928 | }; |
| ... | @@ -3985,6 +3986,10 @@ pub const host_preferred_user_arch = extern struct { | ... | @@ -3985,6 +3986,10 @@ pub const host_preferred_user_arch = extern struct { |
| 3985 | pub const host_preferred_user_arch_data_t = host_preferred_user_arch; | 3986 | pub const host_preferred_user_arch_data_t = host_preferred_user_arch; |
| 3986 | pub const host_preferred_user_arch_t = *host_preferred_user_arch; | 3987 | pub const host_preferred_user_arch_t = *host_preferred_user_arch; |
| 3987 | | 3988 | |
| | 3989 | fn HostCount(comptime HT: type) mach_msg_type_number_t { |
| | 3990 | return @intCast(mach_msg_type_number_t, @sizeOf(HT) / @sizeOf(integer_t)); |
| | 3991 | } |
| | 3992 | |
| 3988 | pub const HOST = struct { | 3993 | pub const HOST = struct { |
| 3989 | pub const BASIC_INFO = 1; | 3994 | pub const BASIC_INFO = 1; |
| 3990 | pub const SCHED_INFO = 3; | 3995 | pub const SCHED_INFO = 3; |
| ... | @@ -3999,14 +4004,19 @@ pub const HOST = struct { | ... | @@ -3999,14 +4004,19 @@ pub const HOST = struct { |
| 3999 | pub const LOAD_INFO = 1; | 4004 | pub const LOAD_INFO = 1; |
| 4000 | pub const VM_INFO = 2; | 4005 | pub const VM_INFO = 2; |
| 4001 | pub const CPU_LOAD_INFO = 3; | 4006 | pub const CPU_LOAD_INFO = 3; |
| 4002 | pub const CAN_HAS_DEBUGGER_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_can_has_debugger_info_data_t) / @sizeOf(integer_t)); | 4007 | pub const VM_INFO64 = 4; |
| 4003 | pub const SCHED_INFO_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_sched_info_data_t) / @sizeOf(integer_t)); | 4008 | pub const EXTMOD_INFO64 = 5; |
| 4004 | pub const RESOURCES_SIZES_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(kernel_resource_sizes_data_t) / @sizeOf(integer_t)); | 4009 | pub const EXPIRED_TASK_INFO = 6; |
| 4005 | pub const PRIORITY_INFO_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_priority_info_data_t) / @sizeOf(integer_t)); | 4010 | pub const CAN_HAS_DEBUGGER_COUNT = HostCount(host_can_has_debugger_info_data_t); |
| 4006 | pub const CPU_LOAD_INFO_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_cpu_load_info_data_t) / @sizeOf(integer_t)); | 4011 | pub const SCHED_INFO_COUNT = HostCount(host_sched_info_data_t); |
| 4007 | pub const LOAD_INFO_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_load_info_data_t) / @sizeOf(integer_t)); | 4012 | pub const RESOURCES_SIZES_COUNT = HostCount(kernel_resource_sizes_data_t); |
| 4008 | pub const PREFERRED_USER_ARCH_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_preferred_user_arch_data_t) / @sizeOf(integer_t)); | 4013 | pub const PRIORITY_INFO_COUNT = HostCount(host_priority_info_data_t); |
| 4009 | pub const VM_INFO_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(vm_statistics_data_t) / @sizeOf(integer_t)); | 4014 | pub const CPU_LOAD_INFO_COUNT = HostCount(host_cpu_load_info_data_t); |
| | 4015 | pub const LOAD_INFO_COUNT = HostCount(host_load_info_data_t); |
| | 4016 | pub const PREFERRED_USER_ARCH_COUNT = HostCount(host_preferred_user_arch_data_t); |
| | 4017 | pub const VM_INFO_COUNT = HostCount(vm_statistics_data_t); |
| | 4018 | pub const VM_INFO64_COUNT = HostCount(vm_statistics64_data_t); |
| | 4019 | pub const EXTMOD_INFO64_COUNT = HostCount(vm_extmod_statistics_data_t); |
| 4010 | }; | 4020 | }; |
| 4011 | | 4021 | |
| 4012 | pub const host_basic_info = packed struct(u32) { | 4022 | pub const host_basic_info = packed struct(u32) { |
| ... | @@ -4025,6 +4035,7 @@ pub const host_basic_info = packed struct(u32) { | ... | @@ -4025,6 +4035,7 @@ pub const host_basic_info = packed struct(u32) { |
| 4025 | | 4035 | |
| 4026 | pub extern "c" fn host_info(host: host_t, flavor: host_flavor_t, info_out: host_info_t, info_outCnt: [*]mach_msg_type_number_t) kern_return_t; | 4036 | pub extern "c" fn host_info(host: host_t, flavor: host_flavor_t, info_out: host_info_t, info_outCnt: [*]mach_msg_type_number_t) kern_return_t; |
| 4027 | pub extern "c" fn host_statistics(priv: host_t, flavor: host_flavor_t, info_out: host_info_t, info_outCnt: [*]mach_msg_type_number_t) kern_return_t; | 4037 | pub extern "c" fn host_statistics(priv: host_t, flavor: host_flavor_t, info_out: host_info_t, info_outCnt: [*]mach_msg_type_number_t) kern_return_t; |
| | 4038 | pub extern "c" fn host_statistics64(priv: host_t, flavor: host_flavor_t, info_out: host_info64_t, info64_outCnt: [*]mach_msg_type_number_t) kern_return_t; |
| 4028 | | 4039 | |
| 4029 | pub const vm_statistics = extern struct { | 4040 | pub const vm_statistics = extern struct { |
| 4030 | free_count: natural_t, | 4041 | free_count: natural_t, |
| ... | @@ -4076,3 +4087,17 @@ pub const vm_statistics64 align(8) = extern struct { | ... | @@ -4076,3 +4087,17 @@ pub const vm_statistics64 align(8) = extern struct { |
| 4076 | | 4087 | |
| 4077 | pub const vm_statistics64_t = *vm_statistics64; | 4088 | pub const vm_statistics64_t = *vm_statistics64; |
| 4078 | pub const vm_statistics64_data_t = vm_statistics64; | 4089 | pub const vm_statistics64_data_t = vm_statistics64; |
| | 4090 | |
| | 4091 | pub const vm_extmod_statistics align(8) = extern struct { |
| | 4092 | task_for_pid_count: i64, |
| | 4093 | task_for_pid_caller_count: i64, |
| | 4094 | thread_creation_count: i64, |
| | 4095 | thread_creation_caller_count: i64, |
| | 4096 | thread_set_state_count: i64, |
| | 4097 | thread_set_state_caller_count: i64, |
| | 4098 | }; |
| | 4099 | |
| | 4100 | pub const vm_extmod_statistics_t = *vm_extmod_statistics; |
| | 4101 | pub const vm_extmod_statistics_data_t = vm_extmod_statistics; |
| | 4102 | |
| | 4103 | pub extern "c" fn vm_stats(info: ?*anyopaque, count: *c_uint) kern_return_t; |