Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add all definitions from linux/ptp-clock.h #3865

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6a98f5f
Added all definitions from linux/ptp-clock.h
davidv1992 Sep 14, 2023
1ac5534
Apply suggestions from code review
folkertdev Aug 21, 2024
67d86fa
use `PTP_MAX_SAMPLES` in struct definitions
folkertdev Aug 21, 2024
20faa52
derive traits where possible
folkertdev Aug 21, 2024
5a1f2dc
adjust `ptp_clock_caps` to older version
folkertdev Aug 21, 2024
eabe270
clarify comment
folkertdev Aug 21, 2024
70d6a2b
use a `_IOC` const fn to generate constants
folkertdev Aug 21, 2024
cc93567
add `ptp_perout_request`
folkertdev Aug 22, 2024
f72d11a
deduplicate `s!` macro calls
folkertdev Aug 22, 2024
dc33d9c
fix style issue
folkertdev Aug 28, 2024
064e6e8
fix parsing problems
folkertdev Aug 28, 2024
4abfd63
add missed constants
folkertdev Aug 28, 2024
0fa9251
remove `PTP_MASK_CLEAR_ALL` and `PTP_MASK_EN_SINGLE` for now
folkertdev Aug 29, 2024
66c59b8
please musl
folkertdev Aug 29, 2024
f36c3de
another attempt at `ptp_clock_caps`
folkertdev Aug 29, 2024
be73cc7
uglier version of `ptp_clock_caps`
folkertdev Aug 31, 2024
d857c02
fixes after code review
folkertdev Nov 13, 2024
c0dea2a
add `ptp_pin_function`
folkertdev Nov 13, 2024
810e82d
define `PTP_CLOCK_CAPS_RSV_LEN`
folkertdev Nov 13, 2024
49cd9aa
move ioctl functions to `linux/mod.rs`
folkertdev Nov 13, 2024
97b4269
document that constant should be computed (when garando supports it)
folkertdev Nov 14, 2024
dbbf82c
update `ptp_sys_offset_extended` to latest version
folkertdev Nov 14, 2024
c9d29cc
todo -> fixme
Nov 19, 2024
f550a24
add symbols to semver/linux.txt
Nov 19, 2024
b3d2389
fix rebase problem
Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3552,6 +3552,8 @@ fn test_linux(target: &str) {
"linux/netlink.h",
// FIXME: requires Linux >= 5.6:
[!musl]: "linux/openat2.h",
// FIXME: some items require Linux >= 5.6:
"linux/ptp_clock.h",
[!musl]: "linux/ptrace.h",
"linux/quota.h",
"linux/random.h",
Expand Down Expand Up @@ -3701,6 +3703,11 @@ fn test_linux(target: &str) {
return true;
}

// FIXME: CI has old headers
if ty == "ptp_sys_offset_extended" {
return true;
}

// LFS64 types have been removed in musl 1.2.4+
if musl && (ty.ends_with("64") || ty.ends_with("64_t")) {
return true;
Expand Down Expand Up @@ -3886,7 +3893,8 @@ fn test_linux(target: &str) {
}
if musl {
// FIXME: Requires >= 5.0 kernel headers
if name == "SECCOMP_GET_NOTIF_SIZES"
if name == "PTP_SYS_OFFSET_EXTENDED"
|| name == "SECCOMP_GET_NOTIF_SIZES"
|| name == "SECCOMP_FILTER_FLAG_NEW_LISTENER"
|| name == "SECCOMP_FILTER_FLAG_TSYNC_ESRCH"
|| name == "SECCOMP_USER_NOTIF_FLAG_CONTINUE" // requires >= 5.5
Expand All @@ -3901,6 +3909,15 @@ fn test_linux(target: &str) {
|| name.starts_with("RTEXT_FILTER_")
|| name.starts_with("SO_J1939")
|| name.starts_with("SCM_J1939")
|| name == "PTP_CLOCK_GETCAPS2"
|| name == "PTP_ENABLE_PPS2"
|| name == "PTP_EXTTS_REQUEST2"
|| name == "PTP_PEROUT_REQUEST2"
|| name == "PTP_PIN_GETFUNC2"
|| name == "PTP_PIN_SETFUNC2"
|| name == "PTP_SYS_OFFSET2"
|| name == "PTP_SYS_OFFSET_PRECISE2"
|| name == "PTP_SYS_OFFSET_EXTENDED2"
{
return true;
}
Expand Down Expand Up @@ -4422,7 +4439,11 @@ fn test_linux(target: &str) {
// `__exit_status` type is a patch which is absent in musl
(struct_ == "utmpx" && field == "ut_exit" && musl) ||
// `can_addr` is an anonymous union
(struct_ == "sockaddr_can" && field == "can_addr")
(struct_ == "sockaddr_can" && field == "can_addr") ||
// `anonymous_1` is an anonymous union
(struct_ == "ptp_perout_request" && field == "anonymous_1") ||
// `anonymous_2` is an anonymous union
(struct_ == "ptp_perout_request" && field == "anonymous_2")
});

cfg.volatile_item(|i| {
Expand Down Expand Up @@ -4495,6 +4516,10 @@ fn test_linux(target: &str) {
(struct_ == "fanotify_event_info_fid" && field == "fsid") ||
// `handle` is a VLA
(struct_ == "fanotify_event_info_fid" && field == "handle") ||
// `anonymous_1` is an anonymous union
(struct_ == "ptp_perout_request" && field == "anonymous_1") ||
// `anonymous_2` is an anonymous union
(struct_ == "ptp_perout_request" && field == "anonymous_2") ||
// invalid application of 'sizeof' to incomplete type 'long unsigned int[]'
(musl && struct_ == "mcontext_t" && field == "__extcontext" && loongarch64)
});
Expand Down
36 changes: 36 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2252,6 +2252,30 @@ PTHREAD_PRIO_PROTECT
PTHREAD_PROCESS_PRIVATE
PTHREAD_PROCESS_SHARED
PTHREAD_STACK_MIN
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should get the public structs and typedefs as well

PTP_CLOCK_CAPS_RSV_LEN
PTP_CLOCK_GETCAPS
PTP_CLOCK_GETCAPS2
PTP_ENABLE_PPS
PTP_ENABLE_PPS2
PTP_EXTTS_REQUEST
PTP_EXTTS_REQUEST2
PTP_MAX_SAMPLES
PTP_PEROUT_REQUEST
PTP_PEROUT_REQUEST2
PTP_PF_EXTTS
PTP_PF_NONE
PTP_PF_PEROUT
PTP_PF_PHYSYNC
PTP_PIN_GETFUNC
PTP_PIN_GETFUNC2
PTP_PIN_SETFUNC
PTP_PIN_SETFUNC2
PTP_SYS_OFFSET
PTP_SYS_OFFSET2
PTP_SYS_OFFSET_EXTENDED
PTP_SYS_OFFSET_EXTENDED2
PTP_SYS_OFFSET_PRECISE
PTP_SYS_OFFSET_PRECISE2
PTRACE_ATTACH
PTRACE_CONT
PTRACE_DETACH
Expand Down Expand Up @@ -3557,6 +3581,8 @@ __WNOTHREAD
__c_anonymous_ifc_ifcu
__c_anonymous_ifr_ifru
__c_anonymous_ifru_map
__c_anonymous_ptp_perout_request_1
__c_anonymous_ptp_perout_request_2
__c_anonymous_sockaddr_can_can_addr
__c_anonymous_sockaddr_can_j1939
__c_anonymous_sockaddr_can_tp
Expand Down Expand Up @@ -3915,6 +3941,16 @@ pthread_spin_lock
pthread_spin_trylock
pthread_spin_unlock
pthread_spinlock_t
ptp_clock_caps
ptp_clock_time
ptp_extts_event
ptp_extts_request
ptp_perout_request
ptp_pin_desc
ptp_pin_function
ptp_sys_offset
ptp_sys_offset_extended
ptp_sys_offset_precise
ptrace
ptsname_r
pwrite64
Expand Down
Loading
Loading