-
-
Notifications
You must be signed in to change notification settings - Fork 178
feat: Implement missing methods of DebugSupport
#290
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
feat: Implement missing methods of DebugSupport
#290
Conversation
Thanks for the patch! I haven't quite wrapped my head around the DebugSupport protocol, but I'll try to answer some of the questions.
I guess since the spec says that it's up to the caller to ensure that params are correct, it's probably a good idea to do whatever level of validation on the parameters we can. Assuming it doesn't have an unreasonable cost of course, but I don't see why it would here.
Since there are repeating values the newtype_enum macro won't quite do the right thing, but you could make your own newtype with an impl containing consts like this: https://github.com/rust-osdev/uefi-rs/blob/master/src/proto/device_path.rs#L164
I don't have a strong opinion either way, as long as the behavior is described in the docstring.
An alternative: add
I don't have a strong opinion either way. On the one hand, it's nice for completeness and isn't a big amount of code. On the other hand, as you say it's not likely to actually be used. |
Finish implementing `DebugSupport::ExceptionTypes` Adjust `DebugSupport` tests for currently supported architectures
assert_ne!( | ||
maximum_processor_index, | ||
usize::MAX, | ||
"get_maximum_processor_index() returning garbage, unless you really have 18,446,744,073,709,551,615 processors" |
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.
😀
Left a couple more comments, but otherwise this seems good to merge to me. |
I don't believe this is quite ready to merge, there are a few things that I'm looking for guidance on:
impl
block validate parameters before calling into firmware? Such as ensuring thatprocessor_index <= maximum_processor_index
?exception.rs
into a series ofnewtype_enum
for each arch? The caller could still mix up the EBC and real ISA exception types, but it'd be a bit safer than what I have now.#[allow(unused_must_use)]
on the individual test functions? All that really matters is that the calls returnEFI_SUCCESS
, we don't really do anything with the completion.Thank you for taking the time to look at this :)