File tree Expand file tree Collapse file tree
aarch32-cpu/src/generic_timer Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11//! Code and types for Generic Timer support at EL2 on Armv8-R.
22
3+ use core:: marker:: PhantomData ;
4+
35use crate :: register;
46
57use super :: { El1PhysicalTimer , El1VirtualTimer , GenericTimer } ;
@@ -160,18 +162,30 @@ impl GenericTimer for El2VirtualTimer {
160162 }
161163}
162164
163- /// Represents our Hypervisor-specific Physical Timer when we are running at EL1.
164- pub struct El2HypPhysicalTimer ( ) ;
165+ /// Represents our Hypervisor-specific Physical Timer.
166+ ///
167+ /// This is designed for use by a hypervisor, whilst an EL1 application
168+ /// concurrently uses the Physical Timer and/or the Virtual Timer.
169+ ///
170+ /// This type is not [Send] because it is a per-core type and should not be moved across
171+ /// cores on an SMP system.
172+ pub struct El2HypPhysicalTimer {
173+ _phantom : PhantomData < * const u8 > ,
174+ }
165175
166176impl El2HypPhysicalTimer {
167177 /// Create a Timer handle for the EL2-specific Hyp Physical Timer.
168178 ///
169179 /// # Safety
170180 ///
171181 /// Only create one of these at any given time, as they access shared
172- /// mutable state within the processor and do read-modify-writes on that state.
182+ /// mutable state within the processor and do read-modify-writes on that
183+ /// state. This timer is distinct from the Physical Timer and the Virtual
184+ /// Timer, and so can exist concurrently.
173185 pub unsafe fn new ( ) -> El2HypPhysicalTimer {
174- El2HypPhysicalTimer ( )
186+ El2HypPhysicalTimer {
187+ _phantom : PhantomData ,
188+ }
175189 }
176190}
177191
You can’t perform that action at this time.
0 commit comments