-
Notifications
You must be signed in to change notification settings - Fork 133
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
gdt: make add_entry const #191
Conversation
This requires making the push method const as well, which means we need the `const_panic` feature (not too much of a risk as this feature is failly well along). I also moved the pointer calculation (for GDT and IDT) into their own (currently private) methods. Eventually these methods can be public, but that's only useful if they can be const, which would require a breaking change. The caclulation for the GDT pointer was also updated to use: ```rust self.next_free * size_of::<u64>() - 1 ``` instead of ```rust self.table.len() * size_of::<u64>() - 1 ``` Signed-off-by: Joe Richey <[email protected]>
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.
Looks all reasonable to me, thanks!
Could you clarify which change would be breaking? |
To make My current idea for a later PR:
|
Sounds good to me! However, I think we can make the |
Ideally, I would want to make the |
This requires making the push method const as well, which means we need
the
const_panic
feature (not too much of a risk as this feature isfailly well along).
I also moved the pointer calculation (for GDT and IDT) into their own
(currently private) methods. Eventually these methods can be public, but
that's only useful if they can be const, which would require a breaking change.
The caclulation for the GDT pointer was also updated to use:
instead of
Signed-off-by: Joe Richey [email protected]