authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-31 11:03:52-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-31 11:03:52-07:00
log0043cdbecad72993214fa58b69767eba2a4fa189
tree3e1ae46268dc1eab9434da0da0d65092d1786701
parent8678d445c2dfe81918f0958df1d4da314f06db6f

Revert "std.c: further darwin's host statistics data"

This reverts commit cceadf52baff2590c1b38c469b1177918183dfe8.

1 files changed, 8 insertions(+), 33 deletions(-)

lib/std/c/darwin.zig+8-33
...@@ -3920,7 +3920,6 @@ pub const cpu_subtype_t = integer_t;...@@ -3920,7 +3920,6 @@ pub const cpu_subtype_t = integer_t;
3920pub const cpu_threadtype_t = integer_t;3920pub const cpu_threadtype_t = integer_t;
3921pub const host_flavor_t = integer_t;3921pub const host_flavor_t = integer_t;
3922pub const host_info_t = *integer_t;3922pub const host_info_t = *integer_t;
3923pub const host_info64_t = *integer_t;
3924pub const host_can_has_debugger_info = extern struct {3923pub const host_can_has_debugger_info = extern struct {
3925 can_has_debugger: boolean_t,3924 can_has_debugger: boolean_t,
3926};3925};
...@@ -3984,10 +3983,6 @@ pub const host_preferred_user_arch = extern struct {...@@ -3984,10 +3983,6 @@ pub const host_preferred_user_arch = extern struct {
3984pub const host_preferred_user_arch_data_t = host_preferred_user_arch;3983pub const host_preferred_user_arch_data_t = host_preferred_user_arch;
3985pub const host_preferred_user_arch_t = *host_preferred_user_arch;3984pub const host_preferred_user_arch_t = *host_preferred_user_arch;
39863985
3987fn HostCount(comptime HT: type) mach_msg_type_number_t {
3988 return @as(mach_msg_type_number_t, @intCast(@sizeOf(HT) / @sizeOf(integer_t)));
3989}
3990
3991pub const HOST = struct {3986pub const HOST = struct {
3992 pub const BASIC_INFO = 1;3987 pub const BASIC_INFO = 1;
3993 pub const SCHED_INFO = 3;3988 pub const SCHED_INFO = 3;
...@@ -4002,19 +3997,14 @@ pub const HOST = struct {...@@ -4002,19 +3997,14 @@ pub const HOST = struct {
4002 pub const LOAD_INFO = 1;3997 pub const LOAD_INFO = 1;
4003 pub const VM_INFO = 2;3998 pub const VM_INFO = 2;
4004 pub const CPU_LOAD_INFO = 3;3999 pub const CPU_LOAD_INFO = 3;
4005 pub const VM_INFO64 = 4;4000 pub const CAN_HAS_DEBUGGER_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_can_has_debugger_info_data_t) / @sizeOf(integer_t));
4006 pub const EXTMOD_INFO64 = 5;4001 pub const SCHED_INFO_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_sched_info_data_t) / @sizeOf(integer_t));
4007 pub const EXPIRED_TASK_INFO = 6;4002 pub const RESOURCES_SIZES_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(kernel_resource_sizes_data_t) / @sizeOf(integer_t));
4008 pub const CAN_HAS_DEBUGGER_COUNT = HostCount(host_can_has_debugger_info_data_t);4003 pub const PRIORITY_INFO_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_priority_info_data_t) / @sizeOf(integer_t));
4009 pub const SCHED_INFO_COUNT = HostCount(host_sched_info_data_t);4004 pub const CPU_LOAD_INFO_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_cpu_load_info_data_t) / @sizeOf(integer_t));
4010 pub const RESOURCES_SIZES_COUNT = HostCount(kernel_resource_sizes_data_t);4005 pub const LOAD_INFO_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_load_info_data_t) / @sizeOf(integer_t));
4011 pub const PRIORITY_INFO_COUNT = HostCount(host_priority_info_data_t);4006 pub const PREFERRED_USER_ARCH_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(host_preferred_user_arch_data_t) / @sizeOf(integer_t));
4012 pub const CPU_LOAD_INFO_COUNT = HostCount(host_cpu_load_info_data_t);4007 pub const VM_INFO_COUNT = @intCast(mach_msg_type_number_t, @sizeOf(vm_statistics_data_t) / @sizeOf(integer_t));
4013 pub const LOAD_INFO_COUNT = HostCount(host_load_info_data_t);
4014 pub const PREFERRED_USER_ARCH_COUNT = HostCount(host_preferred_user_arch_data_t);
4015 pub const VM_INFO_COUNT = HostCount(vm_statistics_data_t);
4016 pub const VM_INFO64_COUNT = HostCount(vm_statistics64_data_t);
4017 pub const EXTMOD_INFO64_COUNT = HostCount(vm_extmod_statistics_data_t);
4018};4008};
40194009
4020pub const host_basic_info = packed struct(u32) {4010pub const host_basic_info = packed struct(u32) {
...@@ -4033,7 +4023,6 @@ pub const host_basic_info = packed struct(u32) {...@@ -4033,7 +4023,6 @@ pub const host_basic_info = packed struct(u32) {
40334023
4034pub 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;4024pub 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;
4035pub 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;4025pub 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;
4036pub 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;
40374026
4038pub const vm_statistics = extern struct {4027pub const vm_statistics = extern struct {
4039 free_count: natural_t,4028 free_count: natural_t,
...@@ -4085,17 +4074,3 @@ pub const vm_statistics64 align(8) = extern struct {...@@ -4085,17 +4074,3 @@ pub const vm_statistics64 align(8) = extern struct {
40854074
4086pub const vm_statistics64_t = *vm_statistics64;4075pub const vm_statistics64_t = *vm_statistics64;
4087pub const vm_statistics64_data_t = vm_statistics64;4076pub const vm_statistics64_data_t = vm_statistics64;
4088
4089pub const vm_extmod_statistics align(8) = extern struct {
4090 task_for_pid_count: i64,
4091 task_for_pid_caller_count: i64,
4092 thread_creation_count: i64,
4093 thread_creation_caller_count: i64,
4094 thread_set_state_count: i64,
4095 thread_set_state_caller_count: i64,
4096};
4097
4098pub const vm_extmod_statistics_t = *vm_extmod_statistics;
4099pub const vm_extmod_statistics_data_t = vm_extmod_statistics;
4100
4101pub extern "c" fn vm_stats(info: ?*anyopaque, count: *c_uint) kern_return_t;