freebsd add numa domain api

This commit is contained in:
David Carlier 2021-10-23 08:12:01 +01:00
parent 71b2de4681
commit 91810ce1d2
2 changed files with 30 additions and 0 deletions

View file

@ -1814,6 +1814,7 @@ fn test_freebsd(target: &str) {
"sys/capsicum.h",
[freebsdlast]:"sys/auxv.h",
"sys/cpuset.h",
[freebsdlast]:"sys/domainset.h",
"sys/event.h",
"sys/extattr.h",
"sys/file.h",

View file

@ -6,6 +6,7 @@ pub type ino_t = ::c_ulong;
pub type shmatt_t = ::c_uint;
pub type kpaddr_t = u64;
pub type kssize_t = i64;
pub type domainset_t = __c_anonymous_domainset;
s! {
pub struct shmid_ds {
@ -49,6 +50,10 @@ s! {
pub kp_offset: ::off_t,
pub kp_len: ::size_t,
}
pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
}
}
s_no_extra_traits! {
@ -222,6 +227,13 @@ pub const KF_TYPE_EVENTFD: ::c_int = 13;
pub const SPECNAMELEN: ::c_int = 255;
pub const KI_NSPARE_PTR: usize = 5;
/// domainset policies
pub const DOMAINSET_POLICY_INVALID: ::c_int = 0;
pub const DOMAINSET_POLICY_ROUNDROBIN: ::c_int = 1;
pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
f! {
pub fn SOCKCRED2SIZE(ngrps: usize) -> usize {
let ngrps = if ngrps > 0 {
@ -261,6 +273,23 @@ extern "C" {
pub fn setproctitle_fast(fmt: *const ::c_char, ...);
pub fn timingsafe_bcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn timingsafe_memcmp(a: *const ::c_void, b: *const ::c_void, len: ::size_t) -> ::c_int;
pub fn cpuset_getdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *mut ::domainset_t,
policy: *mut ::c_int,
) -> ::c_int;
pub fn cpuset_setdomain(
level: ::cpulevel_t,
which: ::cpuwhich_t,
id: ::id_t,
setsize: ::size_t,
mask: *const ::domainset_t,
policy: ::c_int,
) -> ::c_int;
}
#[link(name = "kvm")]