-
Notifications
You must be signed in to change notification settings - Fork 155
feat: Added the "from_pfn" in PhysFrame #593
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
Merged
+123
−5
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
25ff43a
fix: :ambulance: Fixed the `Star` register's selector checking
zhangxuan2011 8cedd1a
feat: :sparkles: Added a function called `from_pfn`
zhangxuan2011 bbb1776
feat(paging): :sparkles: Added `from_pfn_unchecked`, `try_from_pfn`, …
zhangxuan2011 0f6126d
docs([aging): :memo: Updated docs
zhangxuan2011 6810ebb
revert(syscall): :bug: Revert to previous star writer
zhangxuan2011 4a52e0e
fix(paging): :bug: Fixed that the mul might cause overflow / panic
zhangxuan2011 3a5107f
feat(paging): :sparkles: Added new error type about invalid pfn
zhangxuan2011 b94acdc
perf(addr): :fire: Removed unnessary docs and code
zhangxuan2011 8f2866a
improve documentation
Freax13 8cc3adb
rename InvalidPfn to PfnNotValid
Freax13 4c75925
constify PhysFrame::from_pfn and PhysFrame::try_from_pfn
Freax13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
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.
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.
Let's add a panic section to the doc comment.
Let's also mention that the conversion takes the page size into consideration. For example, converting pfn 512 with page size 4K will not return the same address compared to converting pfn 512 with page size 2M.
The way I usually see it used,
pfnis based around the smallest page size on the system. For example, AFAIK, on x86-64, Linux always computes the pfn with a 4K page size even though the hardware also supports other page sizes. Your proposal is not to do that and instead consider the page size. I'm fine with that, I just want to make sure that we communicate that to our users.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.
We just use pfn * page size, the panick seems not needed...
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.
That's fair.
Let's still add a section explaining how we interpret PFNs with respect to different page sizes though.