1
1
//! mip register
2
2
3
- use crate :: bits:: { bf_extract, bf_insert } ;
3
+ use crate :: bits:: bf_extract;
4
4
use riscv_pac:: CoreInterruptNumber ;
5
5
6
- read_write_csr ! {
6
+ read_only_csr ! {
7
7
/// `mip` register
8
8
Mip : 0x344 ,
9
9
mask: usize :: MAX ,
10
10
}
11
11
12
- read_write_csr_field ! {
12
+ read_only_csr_field ! {
13
13
Mip ,
14
14
/// Supervisor Software Interrupt Pending
15
15
ssoft: 1 ,
@@ -21,7 +21,7 @@ read_only_csr_field! {
21
21
msoft: 3 ,
22
22
}
23
23
24
- read_write_csr_field ! {
24
+ read_only_csr_field ! {
25
25
Mip ,
26
26
/// Supervisor Timer Interrupt Pending
27
27
stimer: 5 ,
@@ -33,7 +33,7 @@ read_only_csr_field! {
33
33
mtimer: 7 ,
34
34
}
35
35
36
- read_write_csr_field ! {
36
+ read_only_csr_field ! {
37
37
Mip ,
38
38
/// Supervisor External Interrupt Pending
39
39
sext: 9 ,
@@ -51,18 +51,6 @@ impl Mip {
51
51
pub fn is_pending < I : CoreInterruptNumber > ( & self , interrupt : I ) -> bool {
52
52
bf_extract ( self . bits , interrupt. number ( ) , 1 ) != 0
53
53
}
54
-
55
- /// Clear the pending state of a specific core interrupt source.
56
- ///
57
- /// # Safety
58
- ///
59
- /// Not all interrupt sources allow clearing of pending interrupts via the `mip` register.
60
- /// Instead, it may be necessary to perform an alternative action to clear the interrupt.
61
- /// Check the specification of your target chip for details.
62
- #[ inline]
63
- pub unsafe fn clear_pending < I : CoreInterruptNumber > ( & mut self , interrupt : I ) {
64
- self . bits = bf_insert ( self . bits , interrupt. number ( ) , 1 , 0 ) ;
65
- }
66
54
}
67
55
68
56
set ! ( 0x344 ) ;
@@ -85,6 +73,7 @@ set_clear_csr!(
85
73
/// Not all interrupt sources allow clearing of pending interrupts via the `mip` register.
86
74
/// Instead, it may be necessary to perform an alternative action to clear the interrupt.
87
75
/// Check the specification of your target chip for details.
76
+ #[ inline]
88
77
pub unsafe fn clear_pending < I : CoreInterruptNumber > ( interrupt : I ) {
89
78
_clear ( 1 << interrupt. number ( ) ) ;
90
79
}
0 commit comments