https://github.com/mkroening/interrupts
Cross-architecture utilities for temporarily disabling interrupts and signals.
https://github.com/mkroening/interrupts
interrupts osdev rust
Last synced: about 1 year ago
JSON representation
Cross-architecture utilities for temporarily disabling interrupts and signals.
- Host: GitHub
- URL: https://github.com/mkroening/interrupts
- Owner: mkroening
- License: apache-2.0
- Created: 2023-09-18T14:51:23.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-17T14:29:00.000Z (about 1 year ago)
- Last Synced: 2025-05-17T15:31:19.581Z (about 1 year ago)
- Topics: interrupts, osdev, rust
- Language: Rust
- Homepage: https://crates.io/crates/interrupts
- Size: 49.8 KB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# interrupts
[](https://crates.io/crates/interrupts)
[](https://docs.rs/interrupts)
[](https://github.com/mkroening/interrupts/actions/workflows/ci.yml)
Cross-architecture utilities for temporarily disabling interrupts and signals.
Use [`disable`] to disable interrupts with a guard:
```rust
// interrupts may or may not be enabled
let guard = interrupts::disable();
// interrupts are disabled
drop(guard);
// interrupts are restored to the previous state
```
Use [`without`] to run a closure with disabled interrupts:
```rust
// interrupts may or may not be enabled
interrupts::without(|| {
// interrupts are disabled
});
// interrupts are restored to the previous state
```
For API documentation, see the [docs].
[`disable`]: https://docs.rs/interrupts/latest/interrupts/fn.disable.html
[`without`]: https://docs.rs/interrupts/latest/interrupts/fn.without.html
[docs]: https://docs.rs/interrupts
## Related Crates
- [interrupt-ref-cell] (A `RefCell` for sharing data with interrupt handlers or signal handlers on the same thread.)
- [interrupt-mutex] (A mutex for sharing data with interrupt handlers or signal handlers.)
[interrupt-ref-cell]: https://crates.io/crates/interrupt-ref-cell
[interrupt-mutex]: https://crates.io/crates/interrupt-mutex
## License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.