@@ -27,6 +27,7 @@ pub type projid_t = ::c_int;
2727pub type zoneid_t = :: c_int ;
2828pub type psetid_t = :: c_int ;
2929pub type processorid_t = :: c_int ;
30+ pub type chipid_t = :: c_int ;
3031
3132pub type suseconds_t = :: c_long ;
3233pub type off_t = :: c_long ;
@@ -451,6 +452,13 @@ s! {
451452 pub lgrp: :: lgrp_id_t,
452453 pub aff: :: lgrp_affinity_t,
453454 }
455+
456+ pub struct processor_info_t {
457+ pub pi_state: :: c_int,
458+ pub pi_processor_type: [ :: c_char; PI_TYPELEN as usize ] ,
459+ pub pi_fputypes: [ :: c_char; PI_FPUTYPE as usize ] ,
460+ pub pi_clock: :: c_int,
461+ }
454462}
455463
456464s_no_extra_traits ! {
@@ -2343,6 +2351,20 @@ pub const LGRP_MEM_SZ_INSTALLED: ::lgrp_mem_size_flag_t = 1;
23432351pub const LGRP_VIEW_CALLER : :: lgrp_view_t = 0 ;
23442352pub const LGRP_VIEW_OS : :: lgrp_view_t = 1 ;
23452353
2354+ // sys/processor.h
2355+
2356+ pub const P_OFFLINE : :: c_int = 0x001 ;
2357+ pub const P_ONLINE : :: c_int = 0x002 ;
2358+ pub const P_STATUS : :: c_int = 0x003 ;
2359+ pub const P_FAULTED : :: c_int = 0x004 ;
2360+ pub const P_POWEROFF : :: c_int = 0x005 ;
2361+ pub const P_NOINTR : :: c_int = 0x006 ;
2362+ pub const P_SPARE : :: c_int = 0x007 ;
2363+ pub const P_DISABLED : :: c_int = 0x008 ;
2364+ pub const P_FORCED : :: c_int = 0x10000000 ;
2365+ pub const PI_TYPELEN : :: c_int = 16 ;
2366+ pub const PI_FPUTYPE : :: c_int = 32 ;
2367+
23462368// As per sys/socket.h, header alignment must be 8 bytes on SPARC
23472369// and 4 bytes everywhere else:
23482370#[ cfg( target_arch = "sparc64" ) ]
@@ -2910,6 +2932,7 @@ extern "C" {
29102932 old_binding : * mut processorid_t ,
29112933 ) -> :: c_int ;
29122934 pub fn p_online ( processorid : :: processorid_t , flag : :: c_int ) -> :: c_int ;
2935+ pub fn processor_info ( processorid : :: processorid_t , infop : * mut processor_info_t ) -> :: c_int ;
29132936
29142937 pub fn getexecname ( ) -> * const :: c_char ;
29152938
0 commit comments