summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc-test/build.rs1
-rw-r--r--libc-test/semver/dragonfly.txt11
-rw-r--r--src/unix/bsd/freebsdlike/dragonfly/mod.rs29
3 files changed, 41 insertions, 0 deletions
diff --git a/libc-test/build.rs b/libc-test/build.rs
index ccfd12e4a8..3a420a44c3 100644
--- a/libc-test/build.rs
+++ b/libc-test/build.rs
@@ -1214,6 +1214,7 @@ fn test_dragonflybsd(target: &str) {
"sys/event.h",
"sys/file.h",
"sys/ioctl.h",
+ "sys/cpuctl.h",
"sys/ipc.h",
"sys/kinfo.h",
"sys/ktrace.h",
diff --git a/libc-test/semver/dragonfly.txt b/libc-test/semver/dragonfly.txt
index 1475185979..a52f52d58c 100644
--- a/libc-test/semver/dragonfly.txt
+++ b/libc-test/semver/dragonfly.txt
@@ -143,6 +143,13 @@ CPU_CLR
CPU_ISSET
CPU_SET
CPU_ZERO
+CPUCTL_RSMSR
+CPUCTL_WRMSR
+CPUCTL_CPUID
+CPUCTL_UPDATE
+CPUCTL_MSRSBIT
+CPUCTL_MSRCBIT
+CPUCTL_CPUID_COUNT
CRNCYSTR
CRTSCTS
CRTS_IFLOW
@@ -1214,6 +1221,10 @@ clock_getres
clock_settime
cmsgcred
cmsghdr
+cpuctl_cpuid_args_t
+cpuctl_cpuid_count_args_t
+cpuctl_msr_args_t
+cpuctl_update_args_t
daemon
devname_r
difftime
diff --git a/src/unix/bsd/freebsdlike/dragonfly/mod.rs b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
index a997769da4..53d930686d 100644
--- a/src/unix/bsd/freebsdlike/dragonfly/mod.rs
+++ b/src/unix/bsd/freebsdlike/dragonfly/mod.rs
@@ -242,6 +242,27 @@ s! {
pub cp_sample_sp: u64,
pub cp_msg: [::c_char; 32],
}
+
+ pub struct cpuctl_msr_args_t {
+ pub msr: ::c_int,
+ pub data: u64,
+ }
+
+ pub struct cpuctl_cpuid_args_t {
+ pub level: ::c_int,
+ pub data: [u32; 4],
+ }
+
+ pub struct cpuctl_cpuid_count_args_t {
+ pub level: ::c_int,
+ pub level_type: ::c_int,
+ pub data: [u32; 4],
+ }
+
+ pub struct cpuctl_update_args_t {
+ pub data: *mut ::c_void,
+ pub size: ::size_t,
+ }
}
s_no_extra_traits! {
@@ -889,6 +910,14 @@ pub const CTL_P1003_1B_SIGQUEUE_MAX: ::c_int = 24;
pub const CTL_P1003_1B_TIMER_MAX: ::c_int = 25;
pub const CTL_P1003_1B_MAXID: ::c_int = 26;
+pub const CPUCTL_RSMSR: ::c_int = 0xc0106301;
+pub const CPUCTL_WRMSR: ::c_int = 0xc0106302;
+pub const CPUCTL_CPUID: ::c_int = 0xc0106303;
+pub const CPUCTL_UPDATE: ::c_int = 0xc0106304;
+pub const CPUCTL_MSRSBIT: ::c_int = 0xc0106305;
+pub const CPUCTL_MSRCBIT: ::c_int = 0xc0106306;
+pub const CPUCTL_CPUID_COUNT: ::c_int = 0xc0106307;
+
pub const EVFILT_READ: i16 = -1;
pub const EVFILT_WRITE: i16 = -2;
pub const EVFILT_AIO: i16 = -3;