File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 11//! Instrumentation Trace Macrocell
22//!
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+ //!
36//! *NOTE* Not available on Armv6-M and Armv8-M Baseline.
47
58use core:: cell:: UnsafeCell ;
@@ -198,12 +201,22 @@ pub enum ITMConfigurationError {
198201
199202impl ITM {
200203 /// Removes the software lock on the [`ITM`]. Must be called before any other [`ITM`] functions.
204+ ///
205+ /// See (coresight, B2.3.10).
201206 #[ inline]
202207 pub fn unlock ( & mut self ) {
203208 // NOTE(unsafe) atomic write to a stateless, write-only register
204209 unsafe { self . lar . write ( 0xC5AC_CE55 ) }
205210 }
206211
212+ /// Adds the software lock on the [`ITM`]. Should be called after any other [`ITM`] functions.
213+ ///
214+ /// See (coresight, B2.3.10).
215+ pub fn lock ( & mut self ) {
216+ // NOTE(unsafe) atomic write to a stateless, write-only register
217+ unsafe { self . lar . write ( 0 ) }
218+ }
219+
207220 /// Indicates whether the [`ITM`] is currently processing events.
208221 /// Returns `true` if [`ITM`] events are present and are being drained.
209222 #[ inline]
You can’t perform that action at this time.
0 commit comments