Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

relicensing: Rewrite PR "DevicePathToText and DevicePathFromText Protocol" #1528

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

nicholasbishop
Copy link
Member

See #1521. This rewrites code from supdrewin that we do not have relicensing approval for.

Checklist

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

#[derive(Clone, Copy, Debug)]
pub struct AllowShortcuts(pub bool);

/// Wrapper for a string internally allocated from
/// UEFI boot services memory.
/// UCS-2 string allocated from UEFI pool memory.
Copy link
Contributor

Choose a reason for hiding this comment

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

General question: Why do we have this type? I think, this can also be a CString16?

Do we at least want to write how it differs from CString16?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the docstring to clarify. Since this is allocated internally by UEFI, we'd have to do a second memory allocation to copy it to a CString16. (Or alternatively, the CString16 type could be modified to contain either a Vec or a pool allocation, and switch out how it's dropped at the end, but that's probably more complicated than it's worth.) I'm not necessarily opposed to doing something else here, like just accept an extra memory copy, but should probably think about that as part of #1303 since CString16 requires the alloc feature.

@nicholasbishop nicholasbishop force-pushed the bishop-rewrite-text branch 2 times, most recently from 6f92baa to eb0849f Compare January 26, 2025 01:53
@nicholasbishop
Copy link
Member Author

Friendly ping, does this look good?

@phip1611
Copy link
Contributor

phip1611 commented Feb 5, 2025

LGTM! Sorry for the delay!

@phip1611 phip1611 added this pull request to the merge queue Feb 5, 2025
Merged via the queue into rust-osdev:main with commit 811bc62 Feb 5, 2025
15 checks passed
@nicholasbishop nicholasbishop deleted the bishop-rewrite-text branch February 6, 2025 03:46
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants