Conversation
phil-opp
left a comment
There was a problem hiding this comment.
Thanks for the pull request! I think we already have some of these types, but adding the Exception enum sounds good to me (probably under a different name such as ExceptionCode or ExceptionKind).
|
@phil-opp Any chance you could review this promptly? I have a large pile of pull requests for other crates that now depend on this change. |
phil-opp
left a comment
There was a problem hiding this comment.
Looks good to me overall!
I think we should move the InterruptVector struct to the structures::idt module, to keep the root module clean.
I'm all for keeping the root module clean. But this type has far-ranging use and isn't |
josephlr
left a comment
There was a problem hiding this comment.
@npmccallum sorry for the delay in review. This now looks good to me.
First thing, after trying to write a little code (mostly in relation to #285), I think that this should be called ExceptionVector (sorry for flip-flopping on this). This is what Linux uses and avoids confusion with external interrupts (32-355) which are explicitly not covered by this type. Then the following code makes more sense:
fn common_exception_handler(ist: InterruptStackFrame, vector: ExceptionVector, error_code: Option<u64>) {
// Common interrupt handling logic
}I think we should move the
InterruptVectorstruct to thestructures::idtmodule, to keep the root module clean.I'm all for keeping the root module clean. But this type has far-ranging use and isn't
idtrelated. That's why I put it in root. Is there another place it should go?
You're correct that this type can be used outside of the IDT; however, that's certainly it's most common use, and where other users would expect to find it. Furthermore, as mentioned above, we might use this type in a common exception handling function, which would be used directly with the IDT.
For these reasons, lets move it to structures::idt. I'm happy to make these changes. After I merge this, we can release 0.14.5.
|
@npmccallum I made the changes, but I can't push them unless you enable the "allow edits from maintainers" option. |
Signed-off-by: Joe Richey <joerichey@google.com>
done |
These embeddable types can be used to parse the various errors.
cc @haraldh