-
Notifications
You must be signed in to change notification settings - Fork 53
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
Use Rustix #180
Merged
Merged
Use Rustix #180
Conversation
This file contains 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
ids1024
added a commit
to ids1024/rustix
that referenced
this pull request
Nov 9, 2023
`<sys/ioccom.h>` defines `IOC_OUT` as `0x40000000UL`. But this is "out" from the perspective of the kernel, not the application. So this corresponds to `READ` rather than `WRITE`. Tested with Smithay/drm-rs#180. This also seems to be correct for NetBSD and OpenBSD.
ids1024
added a commit
to ids1024/rustix
that referenced
this pull request
Nov 9, 2023
`<sys/ioccom.h>` defines `IOC_OUT` as `0x40000000UL`. But this is "out" from the perspective of the kernel, not the application. So this corresponds to `READ` rather than `WRITE`. Tested on FreeBSD with Smithay/drm-rs#180. This also seems to be correct for NetBSD and OpenBSD.
ids1024
added a commit
to ids1024/rustix
that referenced
this pull request
Nov 10, 2023
`<sys/ioccom.h>` defines `IOC_OUT` as `0x40000000UL`. But this is "out" from the perspective of the kernel, not the application. So this corresponds to `READ` rather than `WRITE`. Tested on FreeBSD with Smithay/drm-rs#180. This also seems to be correct for NetBSD and OpenBSD.
sunfishcode
pushed a commit
to bytecodealliance/rustix
that referenced
this pull request
Nov 10, 2023
`<sys/ioccom.h>` defines `IOC_OUT` as `0x40000000UL`. But this is "out" from the perspective of the kernel, not the application. So this corresponds to `READ` rather than `WRITE`. Tested on FreeBSD with Smithay/drm-rs#180. This also seems to be correct for NetBSD and OpenBSD.
ids1024
force-pushed
the
rustix
branch
2 times, most recently
from
November 13, 2023 23:35
fb1d1f0
to
47260f1
Compare
Not *too* hard to update by defining macros like Nix had. It would be possible to replace use of the macro with just type aliases for opcodes, but it's still necessary to deal with `Getter`/`Setter`/`Updater`, and repeat the type.
Since torvalds/linux@d79cdc831 in 2013, the `GET_STATS` ioctl has been a no-op. A wrapper for this was not exported in the API here anyway.
Somehow Cargo didn't complain about the previous generated ioctl function being unused, but does now with the macro based on Rustix. Taking an `&mut` matches the API of `drmSetInterfaceVersion` in libdrm, so it makes sense to just stick with that.
This shouldn't be too much worse to use, and avoids any kind of public dependency of Rustix. So a new version of it won't be a breaking change.
With bytecodealliance/rustix#925 and bytecodealliance/rustix#926 merged and after a few more changes here, this should be good to merged. |
Drakulix
approved these changes
Nov 14, 2023
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.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Updates
drm-ffi
to use Rustix.Based on #179.
Not too hard to update by defining macros like Nix had, though it's probably not ideal.
The generic ioctl API for Rustix seems a bit awkward when dealing with APIs like drm that involve very large numbers of ioctls. Instead of generating functions with a macro like this, it's possible to define types aliases with
ReadWriteOpcode
, etc. But it's still necessary to deal withGetter
/Setter
, etc...