-
Notifications
You must be signed in to change notification settings - Fork 133
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 exception vector type #303
Conversation
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.
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. |
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.
Looks good to me overall!
I think we should move the InterruptVector
struct to the structures::idt
module, to keep the root module clean.
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.
LGTM modulo my and @phil-opp's comments
I'm all for keeping the root module clean. But this type has far-ranging use and isn't |
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.
@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
InterruptVector
struct to thestructures::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
idt
related. 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 <[email protected]>
done |
Signed-off-by: Joe Richey <[email protected]>
These embeddable types can be used to parse the various errors.
cc @haraldh