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

Add #[repr(C)] to AllocateType #1186

Conversation

LightAndLight
Copy link
Contributor

@LightAndLight LightAndLight mentioned this pull request Jun 8, 2024
@nicholasbishop
Copy link
Contributor

I don't think a repr is needed here, because this type is never passed directly to/from the firmware. It's used in BootServices::allocate_pages, which matches on the enum value and converts it to raw type and addr values:

let (ty, mut addr) = match ty {
AllocateType::AnyPages => (0, 0),
AllocateType::MaxAddress(addr) => (1, addr),
AllocateType::Address(addr) => (2, addr),
};

@LightAndLight
Copy link
Contributor Author

You're right. Also, the AllocateBuffer docs say that the type parameter is currently ignored.

@LightAndLight LightAndLight deleted the lightandlight/allocatetype-repr-c branch June 9, 2024 21:53
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.

2 participants