Skip to content

Commit a2478a1

Browse files
committed
add ptp_clock_caps
1 parent 117d6b0 commit a2478a1

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-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

+75
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,81 @@ s! {
12061206
}
12071207
}
12081208

1209+
cfg_if! {
1210+
if #[cfg(all(target_arch = "loongarch64", target_env = "musl"))] {
1211+
s! {
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 rsv: [::c_int; 12],
1222+
}
1223+
}
1224+
} else if #[cfg(all(target_arch = "loongarch64", target_env = "gnu"))] {
1225+
s! {
1226+
pub struct ptp_clock_caps {
1227+
pub max_adj: ::c_int,
1228+
pub n_alarm: ::c_int,
1229+
pub n_ext_ts: ::c_int,
1230+
pub n_per_out: ::c_int,
1231+
pub pps: ::c_int,
1232+
pub n_pins: ::c_int,
1233+
pub cross_timestamping: ::c_int,
1234+
pub adjust_phase: ::c_int,
1235+
pub max_phase_adj: ::c_int,
1236+
pub rsv: [::c_int; 11],
1237+
}
1238+
}
1239+
} else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] {
1240+
s! {
1241+
pub struct ptp_clock_caps {
1242+
pub max_adj: ::c_int,
1243+
pub n_alarm: ::c_int,
1244+
pub n_ext_ts: ::c_int,
1245+
pub n_per_out: ::c_int,
1246+
pub pps: ::c_int,
1247+
pub n_pins: ::c_int,
1248+
pub cross_timestamping: ::c_int,
1249+
pub adjust_phase: ::c_int,
1250+
pub rsv: [::c_int; 12],
1251+
}
1252+
}
1253+
} else if #[cfg(any(target_env = "musl", target_env = "ohos"))] {
1254+
s! {
1255+
pub struct ptp_clock_caps {
1256+
pub max_adj: ::c_int,
1257+
pub n_alarm: ::c_int,
1258+
pub n_ext_ts: ::c_int,
1259+
pub n_per_out: ::c_int,
1260+
pub pps: ::c_int,
1261+
pub n_pins: ::c_int,
1262+
pub cross_timestamping: ::c_int,
1263+
pub rsv: [::c_int; 13],
1264+
}
1265+
}
1266+
} else {
1267+
s! {
1268+
pub struct ptp_clock_caps {
1269+
pub max_adj: ::c_int,
1270+
pub n_alarm: ::c_int,
1271+
pub n_ext_ts: ::c_int,
1272+
pub n_per_out: ::c_int,
1273+
pub pps: ::c_int,
1274+
pub n_pins: ::c_int,
1275+
pub cross_timestamping: ::c_int,
1276+
pub adjust_phase: ::c_int,
1277+
pub max_phase_adj: ::c_int,
1278+
pub rsv: [::c_int; 11],
1279+
}
1280+
}
1281+
}
1282+
}
1283+
12091284
cfg_if! {
12101285
if #[cfg(not(target_arch = "sparc64"))] {
12111286
s! {

0 commit comments

Comments
 (0)