Skip to content

Commit 30b36b0

Browse files
committed
Improve docs
1 parent e884b55 commit 30b36b0

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

riscv/src/interrupt/machine.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ pub fn disable_interrupt<I: CoreInterruptNumber>(interrupt: I) {
107107
///
108108
/// # Note
109109
///
110-
/// Interrupts will only be triggered if interrupts are globally enabled in the hart.
111-
/// To do this, you must call [`enable`] after enabling the interrupt.
110+
/// Interrupts will only be triggered if globally enabled in the hart. To do this, use [`enable`].
112111
///
113112
/// # Safety
114113
///
@@ -128,6 +127,11 @@ pub fn disable() {
128127

129128
/// Enables interrupts globally in the current hart (machine mode).
130129
///
130+
/// # Note
131+
///
132+
/// Only enabled interrupt sources will be triggered.
133+
/// To enable specific interrupt sources, use [`enable_interrupt`].
134+
///
131135
/// # Safety
132136
///
133137
/// Enabling interrupts might break critical sections or other synchronization mechanisms.

riscv/src/interrupt/supervisor.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ pub fn disable_interrupt<I: CoreInterruptNumber>(interrupt: I) {
9999
///
100100
/// # Note
101101
///
102-
/// Interrupts will only be triggered if interrupts are globally enabled in the hart.
103-
/// To do this, you must call [`enable`] after enabling the interrupt.
102+
/// Interrupts will only be triggered if globally enabled in the hart. To do this, use [`enable`].
104103
///
105104
/// # Safety
106105
///
@@ -120,6 +119,11 @@ pub fn disable() {
120119

121120
/// Enables interrupts globally in the current hart (supervisor mode).
122121
///
122+
/// # Note
123+
///
124+
/// Only enabled interrupt sources will be triggered.
125+
/// To enable specific interrupt sources, use [`enable_interrupt`].
126+
///
123127
/// # Safety
124128
///
125129
/// Enabling interrupts might break critical sections or other synchronization mechanisms.

riscv/src/register/mie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! mie register
22
3-
use riscv_pac::CoreInterruptNumber;
43
use crate::bits::{bf_extract, bf_insert};
4+
use riscv_pac::CoreInterruptNumber;
55

66
read_write_csr! {
77
/// `mie` register

riscv/src/register/sie.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! sie register
22
3+
use crate::bits::{bf_extract, bf_insert};
34
use riscv_pac::CoreInterruptNumber;
4-
use crate::bits::{bf_insert, bf_extract};
55

66
read_write_csr! {
77
/// sie register

0 commit comments

Comments
 (0)