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 #3559

Open
wants to merge 1 commit into
base: libc-0.2
Choose a base branch
from

Conversation

folkertdev
Copy link
Contributor

I've taken over this change from @davidv1992 (who is my colleague). #3353 is the original PR which can now be closed.

I'm also assuming this can/should be merged into the libc-0.2 branch (and main will be rebased on top of that at some point?).

@rustbot
Copy link
Collaborator

rustbot commented Jan 25, 2024

r? @JohnTitor

(rustbot has picked a reviewer for you, use r? to override)

Comment on lines +4331 to +4348
(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")
Copy link
Contributor Author

Choose a reason for hiding this comment

The 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?!

@JohnTitor
Copy link
Member

Could you resolve CI failure?
@rustbot author

@folkertdev
Copy link
Contributor Author

well that was more work that expected. A bunch of the constants and one struct are defined only in newer kernel versions (this causes problems on the 0.2 branch on musl, which uses an older kernel version)

and then on powerpc a bunch of the constants have different values.

Comment on lines +3741 to +3803
pub const PTP_CLOCK_GETCAPS: ::c_uint = 0x40503d01;
pub const PTP_EXTTS_REQUEST: ::c_uint = 0x80103d02;
pub const PTP_PEROUT_REQUEST: ::c_uint = 0x80383d03;
pub const PTP_ENABLE_PPS: ::c_uint = 0x80043d04;
pub const PTP_SYS_OFFSET: ::c_uint = 0x83403d05;
pub const PTP_PIN_GETFUNC: ::c_uint = 0xc0603d06;
pub const PTP_PIN_SETFUNC: ::c_uint = 0x80603d07;
pub const PTP_SYS_OFFSET_PRECISE: ::c_uint = 0xc0403d08;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

these are defined with some macros. There are rust versions here https://github.com/torvalds/linux/blob/8a696a29c6905594e4abf78eaafcb62165ac61f1/rust/kernel/ioctl.rs#L13

should those be used instead?

@folkertdev folkertdev force-pushed the add-ptp-clock branch 2 times, most recently from 35841d1 to d9c8b36 Compare January 28, 2024 16:20
@folkertdev
Copy link
Contributor Author

@JohnTitor this is actually waiting for review, but I don't think I can update the label? (not sure how this workflow is supposed to work?)

@folkertdev
Copy link
Contributor Author

ah, rustbot got more helpful in newer PRs

@rustbot review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants