Skip to content

Commit

Permalink
Auto merge of #2568 - devnexen:dfbsd_ioctl_new_queries, r=Amanieu
Browse files Browse the repository at this point in the history
dragonflybsd adding few new ioctl queries
  • Loading branch information
bors committed Dec 4, 2021
2 parents 92b4680 + bbcd8c8 commit 1c07f7c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions libc-test/semver/dragonfly.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1c07f7c

Please sign in to comment.