Skip to content

Commit 51e3d56

Browse files
committed
add ptp_clock_caps
1 parent 117d6b0 commit 51e3d56

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

libc-test/semver/linux.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3945,6 +3945,7 @@ pthread_spin_lock
39453945
pthread_spin_trylock
39463946
pthread_spin_unlock
39473947
pthread_spinlock_t
3948+
ptp_clock_caps
39483949
ptp_clock_time
39493950
ptp_extts_event
39503951
ptp_extts_request

src/unix/linux_like/linux/mod.rs

+65
Original file line numberDiff line numberDiff line change
@@ -1195,6 +1195,71 @@ s! {
11951195
pub rsv: [::c_uint; 5],
11961196
}
11971197

1198+
cfg_if! {
1199+
if #[cfg(all(target_arch = "loongarch64", target_env = "musl"))] {
1200+
pub struct ptp_clock_caps {
1201+
pub max_adj: ::c_int,
1202+
pub n_alarm: ::c_int,
1203+
pub n_ext_ts: ::c_int,
1204+
pub n_per_out: ::c_int,
1205+
pub pps: ::c_int,
1206+
pub n_pins: ::c_int,
1207+
pub cross_timestamping: ::c_int,
1208+
pub adjust_phase: ::c_int,
1209+
pub rsv: [::c_int; 12],
1210+
}
1211+
} else if #[cfg(all(target_arch = "loongarch64", target_env = "gnu"))] {
1212+
pub struct ptp_clock_caps {
1213+
pub max_adj: ::c_int,
1214+
pub n_alarm: ::c_int,
1215+
pub n_ext_ts: ::c_int,
1216+
pub n_per_out: ::c_int,
1217+
pub pps: ::c_int,
1218+
pub n_pins: ::c_int,
1219+
pub cross_timestamping: ::c_int,
1220+
pub adjust_phase: ::c_int,
1221+
pub max_phase_adj: ::c_int,
1222+
pub rsv: [::c_int; 11],
1223+
}
1224+
} else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] {
1225+
pub struct ptp_clock_caps {
1226+
pub max_adj: ::c_int,
1227+
pub n_alarm: ::c_int,
1228+
pub n_ext_ts: ::c_int,
1229+
pub n_per_out: ::c_int,
1230+
pub pps: ::c_int,
1231+
pub n_pins: ::c_int,
1232+
pub cross_timestamping: ::c_int,
1233+
pub adjust_phase: ::c_int,
1234+
pub rsv: [::c_int; 12],
1235+
}
1236+
} else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
1237+
pub struct ptp_clock_caps {
1238+
pub max_adj: ::c_int,
1239+
pub n_alarm: ::c_int,
1240+
pub n_ext_ts: ::c_int,
1241+
pub n_per_out: ::c_int,
1242+
pub pps: ::c_int,
1243+
pub n_pins: ::c_int,
1244+
pub cross_timestamping: ::c_int,
1245+
pub rsv: [::c_int; 13],
1246+
}
1247+
} else {
1248+
pub struct ptp_clock_caps {
1249+
pub max_adj: ::c_int,
1250+
pub n_alarm: ::c_int,
1251+
pub n_ext_ts: ::c_int,
1252+
pub n_per_out: ::c_int,
1253+
pub pps: ::c_int,
1254+
pub n_pins: ::c_int,
1255+
pub cross_timestamping: ::c_int,
1256+
pub adjust_phase: ::c_int,
1257+
pub max_phase_adj: ::c_int,
1258+
pub rsv: [::c_int; 11],
1259+
}
1260+
}
1261+
}
1262+
11981263
// linux/if_xdp.h
11991264
pub struct xsk_tx_metadata_completion {
12001265
pub tx_timestamp: ::__u64,

0 commit comments

Comments
 (0)