@@ -9,17 +9,6 @@ pub mod amair0;
99pub mod amair1;
1010pub mod ccsidr;
1111pub mod clidr;
12- pub mod cntfrq;
13- pub mod cntkctl;
14- pub mod cntp_ctl;
15- pub mod cntp_cval;
16- pub mod cntp_tval;
17- pub mod cntpct;
18- pub mod cntv_ctl;
19- pub mod cntv_cval;
20- pub mod cntv_tval;
21- pub mod cntvct;
22- pub mod cntvoff;
2312pub mod contextidr;
2413pub mod cpacr;
2514pub mod cpsr;
@@ -108,17 +97,6 @@ pub use amair0::Amair0;
10897pub use amair1:: Amair1 ;
10998pub use ccsidr:: Ccsidr ;
11099pub use clidr:: Clidr ;
111- pub use cntfrq:: Cntfrq ;
112- pub use cntkctl:: Cntkctl ;
113- pub use cntp_ctl:: CntpCtl ;
114- pub use cntp_cval:: CntpCval ;
115- pub use cntp_tval:: CntpTval ;
116- pub use cntpct:: CntPct ;
117- pub use cntv_ctl:: CntvCtl ;
118- pub use cntv_cval:: CntvCval ;
119- pub use cntv_tval:: CntvTval ;
120- pub use cntvct:: CntVct ;
121- pub use cntvoff:: CntVoff ;
122100pub use contextidr:: Contextidr ;
123101pub use cpacr:: Cpacr ;
124102pub use cpsr:: Cpsr ;
@@ -220,6 +198,12 @@ pub trait SysReg {
220198
221199/// 32-bit Readable System Registers
222200pub trait SysRegRead : SysReg {
201+ /// Read a value from this 32-bit register
202+ ///
203+ /// # Safety
204+ ///
205+ /// You need to read the Architecture Reference Manual because this read
206+ /// may have side-effects.
223207 #[ inline]
224208 unsafe fn read_raw ( ) -> u32 {
225209 let r: u32 ;
@@ -246,6 +230,12 @@ pub trait SysRegRead: SysReg {
246230
247231/// Writable 32-bit System Registers
248232pub trait SysRegWrite : SysReg {
233+ /// Write a value to this 32-bit register
234+ ///
235+ /// # Safety
236+ ///
237+ /// You need to read the Architecture Reference Manual to verify that you are
238+ /// writing valid data here.
249239 #[ inline]
250240 unsafe fn write_raw ( _value : u32 ) {
251241 #[ cfg( target_arch = "arm" ) ]
@@ -276,6 +266,12 @@ pub trait SysReg64 {
276266
277267/// 64-bit Readable System Registers
278268pub trait SysRegRead64 : SysReg64 {
269+ /// Read a value from this 64-bit register
270+ ///
271+ /// # Safety
272+ ///
273+ /// You need to read the Architecture Reference Manual because this read
274+ /// may have side-effects.
279275 #[ inline]
280276 unsafe fn read_raw ( ) -> u64 {
281277 let r_lo: u32 ;
@@ -297,12 +293,18 @@ pub trait SysRegRead64: SysReg64 {
297293 r_lo = 0 ;
298294 r_hi = 0 ;
299295 }
300- ( r_hi as u64 ) << 32 | ( r_lo as u64 )
296+ ( ( r_hi as u64 ) << 32 ) | ( r_lo as u64 )
301297 }
302298}
303299
304300/// Writable 64-bit System Registers
305301pub trait SysRegWrite64 : SysReg64 {
302+ /// Write a value to this 64-bit register
303+ ///
304+ /// # Safety
305+ ///
306+ /// You need to read the Architecture Reference Manual to verify that you are
307+ /// writing valid data here.
306308 #[ inline]
307309 unsafe fn write_raw ( _value : u64 ) {
308310 #[ cfg( target_arch = "arm" ) ]
0 commit comments