Skip to content

Commit

Permalink
add ptp_clock_caps
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Nov 20, 2024
1 parent 117d6b0 commit a2478a1
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3945,6 +3945,7 @@ pthread_spin_lock
pthread_spin_trylock
pthread_spin_unlock
pthread_spinlock_t
ptp_clock_caps
ptp_clock_time
ptp_extts_event
ptp_extts_request
Expand Down
75 changes: 75 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,81 @@ s! {
}
}

cfg_if! {
if #[cfg(all(target_arch = "loongarch64", target_env = "musl"))] {
s! {
pub struct ptp_clock_caps {
pub max_adj: ::c_int,
pub n_alarm: ::c_int,
pub n_ext_ts: ::c_int,
pub n_per_out: ::c_int,
pub pps: ::c_int,
pub n_pins: ::c_int,
pub cross_timestamping: ::c_int,
pub adjust_phase: ::c_int,
pub rsv: [::c_int; 12],
}
}
} else if #[cfg(all(target_arch = "loongarch64", target_env = "gnu"))] {
s! {
pub struct ptp_clock_caps {
pub max_adj: ::c_int,
pub n_alarm: ::c_int,
pub n_ext_ts: ::c_int,
pub n_per_out: ::c_int,
pub pps: ::c_int,
pub n_pins: ::c_int,
pub cross_timestamping: ::c_int,
pub adjust_phase: ::c_int,
pub max_phase_adj: ::c_int,
pub rsv: [::c_int; 11],
}
}
} else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] {
s! {
pub struct ptp_clock_caps {
pub max_adj: ::c_int,
pub n_alarm: ::c_int,
pub n_ext_ts: ::c_int,
pub n_per_out: ::c_int,
pub pps: ::c_int,
pub n_pins: ::c_int,
pub cross_timestamping: ::c_int,
pub adjust_phase: ::c_int,
pub rsv: [::c_int; 12],
}
}
} else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
s! {
pub struct ptp_clock_caps {
pub max_adj: ::c_int,
pub n_alarm: ::c_int,
pub n_ext_ts: ::c_int,
pub n_per_out: ::c_int,
pub pps: ::c_int,
pub n_pins: ::c_int,
pub cross_timestamping: ::c_int,
pub rsv: [::c_int; 13],
}
}
} else {
s! {
pub struct ptp_clock_caps {
pub max_adj: ::c_int,
pub n_alarm: ::c_int,
pub n_ext_ts: ::c_int,
pub n_per_out: ::c_int,
pub pps: ::c_int,
pub n_pins: ::c_int,
pub cross_timestamping: ::c_int,
pub adjust_phase: ::c_int,
pub max_phase_adj: ::c_int,
pub rsv: [::c_int; 11],
}
}
}
}

cfg_if! {
if #[cfg(not(target_arch = "sparc64"))] {
s! {
Expand Down

0 comments on commit a2478a1

Please sign in to comment.