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

Use registers struct rather than offsets, and fix soundness issues #1

Merged
merged 4 commits into from
Jul 22, 2024

Conversation

qwandor
Copy link
Contributor

@qwandor qwandor commented Jul 22, 2024

Using a Registers struct rather than manual offsets will make adding more features easier in future. I've also fixed a soundness issue, as neither Rtc::new nor the other methods were unsafe, which meant that it would allow a caller to read or write to invalid pointers from safe code, which is unsound. Added a changelog, and implemented Send and Sync.

Also added safety comments, made `Rtc::new` unsafe, and changed types of
methods to match register size.
Copy link
Contributor

@hky1999 hky1999 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@equation314 equation314 left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

src/lib.rs Show resolved Hide resolved
@equation314 equation314 merged commit 2d2fcc9 into arceos-org:main Jul 22, 2024
5 checks passed
@qwandor qwandor deleted the registers branch July 22, 2024 12:28
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.

3 participants