Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add uefi::boot module#1255

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

nicholasbishop
Copy link
Member

The initial version containsallocate_pages/allocate_pool and the correspondingfree functions.

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See theRewriting History guide for help.
  • Update the changelog (if necessary)

ty: AllocateType,
mem_ty: MemoryType,
count: usize,
) -> Result<PhysicalAddress> {
Copy link
Member

Choose a reason for hiding this comment

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

Seems like an API inconsistency withallocate_pool, which returnsResult<NonNull<u8>>.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

That's true. This inconsistency is present in ourBootServices methods and in the UEFI spec;AllocatePool produces avoid* pointer, whileAllocatePages produces aEFI_PHYSICAL_ADDRESS. Notably,EFI_PHYSICAL_ADDRESS is always aUINT64 rather than being pointer sized, so there is a real difference in behavior. The docstring notes this in the context of ia32 PAE (I copied it from theBootServices method, the text was originally added inthis commit).

That said, I think in almost all cases the first thing a caller is going to do with theEFI_PHYSICAL_ADDRESS is cast it to a pointer, and I can't currently think of any real-world counter example. So, while I don't feel very strongly in either direction, I don't mind converting this to returnNonNull<u8> instead ofPhysicalAddress.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Updated. For full consistency, I also changed both free functions to useNonNull<u8> as well.

phip1611 reacted with thumbs up emoji
The initial version contains allocate_pages/allocate_pool and the corresponding`free` functions.Unlike the `BootServices` methods, these functions all use `NonNull<u8>` forconsistency.
@phip1611phip1611enabled auto-mergeJuly 27, 2024 10:25
@phip1611phip1611 added this pull request to themerge queueJul 27, 2024
Merged via the queue intorust-osdev:main with commit64c26a4Jul 27, 2024
12 checks passed
@nicholasbishopnicholasbishop deleted the bishop-add-boot-mod branchJuly 27, 2024 13:04
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@phip1611phip1611phip1611 approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@nicholasbishop@phip1611

[8]ページ先頭

©2009-2025 Movatter.jp