-
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
Multiple improvements to the inline assembly code #251
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 a lot! Looks all good to me. Displaying the feature requirements on docs.rs is a great idea!
Signed-off-by: Joe Richey <[email protected]>
This mostly makes the code shorter and easier to read Signed-off-by: Joe Richey <[email protected]>
This adds some previously omitted options to our inline asm! Note that instuctions that just push/pop the stack (but otherwise don't touch memory) can be marked `nomem`. We also don't mark instuctions as `nomem` if they could modify memory translation: This includes - writing segment registers - invlpg/invpcid - writing cr2/cr3/cr4 - writing any MSR (we still mark these as `nostack` though. The following are still marked `nomem`: - Reading any MSR (as this cannot have a side-effect) - Writing XCR0 Signed-off-by: Joe Richey <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
@phil-opp it looks like using Finally, I changed the docs to mention If this looks good to you, feel free to merge it. EDIT: I also updated the Changelog |
Also, update the docs attrube to point to both relevant features. Signed-off-by: Joe Richey <[email protected]>
Signed-off-by: Joe Richey <[email protected]>
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 a lot!
// HACK: we mark this function as preserves_flags to prevent Rust from restoring | ||
// saved flags after the "popf" below. See above note on safety. |
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 improving this comment, it's much clearer now!
Published as v0.14.2 |
See the individual commits for more information.
Amongst other things, this PR adds
external_asm
implementations for some functions that were missing it and documents those functions which still requireinline_asm
Example Docs: