-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add all definitions from linux/ptp-clock.h #3559
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
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f66e60e
Added all definitions from linux/ptp-clock.h
davidv1992 aa5120f
Apply suggestions from code review
folkertdev 3073940
use `PTP_MAX_SAMPLES` in struct definitions
folkertdev d561984
derive traits where possible
folkertdev 42d149b
adjust `ptp_clock_caps` to older version
folkertdev e23acab
use a `_IOC` const fn to generate constants
folkertdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3542,6 +3542,8 @@ fn test_linux(target: &str) { | |
"linux/netlink.h", | ||
// FIXME: requires Linux >= 5.6: | ||
[!musl]: "linux/openat2.h", | ||
"linux/ptp_clock.h", | ||
// FIXME: requires Linux >= 5.6: | ||
[!musl]: "linux/ptrace.h", | ||
"linux/quota.h", | ||
"linux/random.h", | ||
|
@@ -3679,6 +3681,9 @@ fn test_linux(target: &str) { | |
if musl && ty == "seccomp_notif_sizes" { | ||
return true; | ||
} | ||
if musl && 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")) { | ||
|
@@ -3839,7 +3844,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 | ||
|
@@ -3854,6 +3860,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; | ||
} | ||
|
@@ -4362,7 +4377,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| { | ||
|
@@ -4420,7 +4439,11 @@ fn test_linux(target: &str) { | |
// the `ifc_ifcu` field is an anonymous union | ||
(struct_ == "ifconf" && field == "ifc_ifcu") || | ||
// glibc uses a single array `uregs` instead of individual fields. | ||
(struct_ == "user_regs" && arm) | ||
(struct_ == "user_regs" && arm) || | ||
// `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") | ||
Comment on lines
+4442
to
+4446
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure why but both this and block and the block above excluding these fields seem required for CI to be satisfied?! |
||
}); | ||
|
||
cfg.skip_roundtrip(move |s| match s { | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this referring to? uapi
ptp_clock.h
has been around since at least 4.0, not sure if this is intended forptrace.h
below but that doesn't make sense either.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3559 (comment) goes into why. it's not that the file doesn't exist before 5.6, but some of the constants are only added in this later version, so for the full functionality, 5.6 is required. I believe the same is true for
netlink.h
above, a file that is also very old but its api changed over time, so that is why I copied over that comment tooThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was asking mostly about why the
FIXME
is belowptp_clock.h
rather than above, looks like it is referring toptrace.h
rather thanptp_clock.h
- but I guess this didn't show up well on the review UI. That context is probably helpful though, maybe change the comment tosome fields require Linux >= 5.6