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 an enable_interrupts_and_hlt function that executes sti; hlt #138

Merged
merged 1 commit into from
Mar 8, 2020

Conversation

phil-opp
Copy link
Member

@phil-opp phil-opp commented Mar 8, 2020

This function atomically enable interrupts and put the CPU to sleep by executing the sti; hlt instruction sequence. Since the sti instruction keeps interrupts disabled until after the immediately following instruction (called "interrupt shadow"), no interrupt can occur between the two instructions.

@phil-opp phil-opp merged commit 77ecdc3 into master Mar 8, 2020
@phil-opp phil-opp deleted the enable_interrupts_and_hlt branch March 8, 2020 13:35
phil-opp added a commit that referenced this pull request Mar 8, 2020
@phil-opp
Copy link
Member Author

phil-opp commented Mar 8, 2020

Published as version 0.9.6

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.

None yet

1 participant