File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
//! Instrumentation Trace Macrocell
2
2
//!
3
+ //! The documentation in this module contains references to ARM specifications, namely:
4
+ //! - coresight: [*ARM CoreSight Architecture Specification*, Version 3.0](https://developer.arm.com/documentation/ihi0029/latest).
5
+ //!
3
6
//! *NOTE* Not available on Armv6-M and Armv8-M Baseline.
4
7
5
8
use core:: cell:: UnsafeCell ;
@@ -198,12 +201,23 @@ pub enum ITMConfigurationError {
198
201
199
202
impl ITM {
200
203
/// Removes the software lock on the [`ITM`]. Must be called before any other [`ITM`] functions.
204
+ ///
205
+ /// See (coresight, B2.3.10).
201
206
#[ inline]
202
207
pub fn unlock ( & mut self ) {
203
208
// NOTE(unsafe) atomic write to a stateless, write-only register
204
209
unsafe { self . lar . write ( 0xC5AC_CE55 ) }
205
210
}
206
211
212
+ /// Adds the software lock on the [`ITM`]. Should be called after any other [`ITM`] functions.
213
+ ///
214
+ /// See (coresight, B2.3.10).
215
+ #[ inline]
216
+ pub fn lock ( & mut self ) {
217
+ // NOTE(unsafe) atomic write to a stateless, write-only register
218
+ unsafe { self . lar . write ( 0 ) }
219
+ }
220
+
207
221
/// Indicates whether the [`ITM`] is currently processing events.
208
222
/// Returns `true` if [`ITM`] events are present and are being drained.
209
223
#[ inline]
You can’t perform that action at this time.
0 commit comments