@@ -27,6 +27,7 @@ pub type projid_t = ::c_int;
27
27
pub type zoneid_t = :: c_int ;
28
28
pub type psetid_t = :: c_int ;
29
29
pub type processorid_t = :: c_int ;
30
+ pub type chipid_t = :: c_int ;
30
31
31
32
pub type suseconds_t = :: c_long ;
32
33
pub type off_t = :: c_long ;
@@ -451,6 +452,13 @@ s! {
451
452
pub lgrp: :: lgrp_id_t,
452
453
pub aff: :: lgrp_affinity_t,
453
454
}
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
+ }
454
462
}
455
463
456
464
s_no_extra_traits ! {
@@ -2343,6 +2351,20 @@ pub const LGRP_MEM_SZ_INSTALLED: ::lgrp_mem_size_flag_t = 1;
2343
2351
pub const LGRP_VIEW_CALLER : :: lgrp_view_t = 0 ;
2344
2352
pub const LGRP_VIEW_OS : :: lgrp_view_t = 1 ;
2345
2353
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
+
2346
2368
// As per sys/socket.h, header alignment must be 8 bytes on SPARC
2347
2369
// and 4 bytes everywhere else:
2348
2370
#[ cfg( target_arch = "sparc64" ) ]
@@ -2910,6 +2932,7 @@ extern "C" {
2910
2932
old_binding : * mut processorid_t ,
2911
2933
) -> :: c_int ;
2912
2934
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 ;
2913
2936
2914
2937
pub fn getexecname ( ) -> * const :: c_char ;
2915
2938
0 commit comments