@@ -55,13 +55,13 @@ impl<P: Plic> PLIC<P> {
55
55
56
56
/// Returns `true` if a machine external interrupt is pending.
57
57
#[ inline]
58
- pub fn is_interrupting ( & self ) -> bool {
58
+ pub fn is_interrupting ( self ) -> bool {
59
59
mip:: read ( ) . mext ( )
60
60
}
61
61
62
62
/// Returns true if machine external interrupts are enabled.
63
63
#[ inline]
64
- pub fn is_enabled ( & self ) -> bool {
64
+ pub fn is_enabled ( self ) -> bool {
65
65
mie:: read ( ) . mext ( )
66
66
}
67
67
@@ -71,13 +71,13 @@ impl<P: Plic> PLIC<P> {
71
71
///
72
72
/// Enabling the `PLIC` may break mask-based critical sections.
73
73
#[ inline]
74
- pub unsafe fn enable ( & self ) {
74
+ pub unsafe fn enable ( self ) {
75
75
mie:: set_mext ( ) ;
76
76
}
77
77
78
78
/// Disables machine external interrupts to prevent the PLIC from triggering interrupts.
79
79
#[ inline]
80
- pub fn disable ( & self ) {
80
+ pub fn disable ( self ) {
81
81
// SAFETY: it is safe to disable interrupts
82
82
unsafe { mie:: clear_mext ( ) } ;
83
83
}
@@ -87,7 +87,7 @@ impl<P: Plic> PLIC<P> {
87
87
/// This register allows to set the priority level of each interrupt source.
88
88
/// The priority level of each interrupt source is shared among all the contexts.
89
89
#[ inline]
90
- pub const fn priorities ( & self ) -> priorities:: PRIORITIES {
90
+ pub const fn priorities ( self ) -> priorities:: PRIORITIES {
91
91
// SAFETY: valid address
92
92
unsafe { priorities:: PRIORITIES :: new ( P :: BASE + Self :: PRIORITIES_OFFSET ) }
93
93
}
@@ -96,14 +96,14 @@ impl<P: Plic> PLIC<P> {
96
96
///
97
97
/// This register allows to check if a particular interrupt source is pending.
98
98
#[ inline]
99
- pub const fn pendings ( & self ) -> pendings:: PENDINGS {
99
+ pub const fn pendings ( self ) -> pendings:: PENDINGS {
100
100
// SAFETY: valid address
101
101
unsafe { pendings:: PENDINGS :: new ( P :: BASE + Self :: PENDINGS_OFFSET ) }
102
102
}
103
103
104
104
/// Returns a proxy to access to all the PLIC registers of a given HART context.
105
105
#[ inline]
106
- pub fn ctx < H : HartIdNumber > ( & self , hart_id : H ) -> CTX < P > {
106
+ pub fn ctx < H : HartIdNumber > ( self , hart_id : H ) -> CTX < P > {
107
107
// SAFETY: valid context number
108
108
unsafe { CTX :: new ( hart_id. number ( ) as _ ) }
109
109
}
@@ -115,7 +115,7 @@ impl<P: Plic> PLIC<P> {
115
115
/// This function determines the current HART ID by reading the [`mhartid`] CSR.
116
116
/// Thus, it can only be used in M-mode. For S-mode, use [`PLIC::ctx`] instead.
117
117
#[ inline]
118
- pub fn ctx_mhartid ( & self ) -> CTX < P > {
118
+ pub fn ctx_mhartid ( self ) -> CTX < P > {
119
119
let hart_id = mhartid:: read ( ) ;
120
120
// SAFETY: `hart_id` is valid for the target and is the current hart
121
121
unsafe { CTX :: new ( hart_id as _ ) }
0 commit comments