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

change cpu_flags's type to RFlags #324

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

Freax13
Copy link
Member

@Freax13 Freax13 commented Nov 10, 2021

#262 mentions that we should use correct types for InterruptStackFrameValue. This pr changes cpu_flags from u64 to RFlags, adds #[repr(transparent)] to RFlags and upgrades the bitflags dependency to the latest version. This last change is needed because "unknown" bits weren't officially supported until version 1.2.0, starting with 1.2.0 crate authors must define what bit representations are valid for a type.

Copy link
Contributor

@josephlr josephlr left a comment

Choose a reason for hiding this comment

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

@Freax13 thanks! I wasn't aware of bitflags/bitflags#188, which describes how "unknown" bits work with 1.2.0. I think this is a very reasonable change.

The docs for from_bits_unchecked also explain how the type has to decide if/when to allow "unknown" bytes.

@josephlr josephlr merged commit 9f2114c into rust-osdev:next Nov 11, 2021
@josephlr josephlr mentioned this pull request Nov 11, 2021
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants