-
Notifications
You must be signed in to change notification settings - Fork 22
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
simplify find_kernel for x86_64 #376
base: main
Are you sure you want to change the base?
Conversation
In cases where we want to page a range rather than a certain number of pages, use map_page to eliminate the need to calculate the page count.
containing_page calls already align the addresses down. As such, we do not need to align the addresses down ourselves.
Instead of checking if it is the first iteration of the loop in every iteration, handle the first iteration of the modules iterator outside the loop.
c909766
to
420b9e8
Compare
for m in modules { | ||
found_module = true; | ||
|
||
if start_address == 0 { |
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.
I assumed this line is to check if this is the first iteration of the loop (because the variable is initialized to 0) but if it is possible that some of the modules have 0 as their start value, my assumption is incorrect and the new code behaves differently. I don't think that is possible, though.
If you think these commits are best for reviewing, we don't have to squash before merging. That way it will remain easy to review in the future. :) |
e15f3bf
to
afa33dc
Compare
The commits are very small to ease review and I think at least some of them can be squashed before merging. If we decide not to squash them all into a single commit, I need to push the commits one-by-one for CI before merging.