@@ -9,17 +9,6 @@ pub mod amair0;
9
9
pub mod amair1;
10
10
pub mod ccsidr;
11
11
pub 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;
23
12
pub mod contextidr;
24
13
pub mod cpacr;
25
14
pub mod cpsr;
@@ -108,17 +97,6 @@ pub use amair0::Amair0;
108
97
pub use amair1:: Amair1 ;
109
98
pub use ccsidr:: Ccsidr ;
110
99
pub 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 ;
122
100
pub use contextidr:: Contextidr ;
123
101
pub use cpacr:: Cpacr ;
124
102
pub use cpsr:: Cpsr ;
@@ -220,6 +198,12 @@ pub trait SysReg {
220
198
221
199
/// 32-bit Readable System Registers
222
200
pub 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.
223
207
#[ inline]
224
208
unsafe fn read_raw ( ) -> u32 {
225
209
let r: u32 ;
@@ -246,6 +230,12 @@ pub trait SysRegRead: SysReg {
246
230
247
231
/// Writable 32-bit System Registers
248
232
pub 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.
249
239
#[ inline]
250
240
unsafe fn write_raw ( _value : u32 ) {
251
241
#[ cfg( target_arch = "arm" ) ]
@@ -276,6 +266,12 @@ pub trait SysReg64 {
276
266
277
267
/// 64-bit Readable System Registers
278
268
pub 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.
279
275
#[ inline]
280
276
unsafe fn read_raw ( ) -> u64 {
281
277
let r_lo: u32 ;
@@ -297,12 +293,18 @@ pub trait SysRegRead64: SysReg64 {
297
293
r_lo = 0 ;
298
294
r_hi = 0 ;
299
295
}
300
- ( r_hi as u64 ) << 32 | ( r_lo as u64 )
296
+ ( ( r_hi as u64 ) << 32 ) | ( r_lo as u64 )
301
297
}
302
298
}
303
299
304
300
/// Writable 64-bit System Registers
305
301
pub 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.
306
308
#[ inline]
307
309
unsafe fn write_raw ( _value : u64 ) {
308
310
#[ cfg( target_arch = "arm" ) ]
0 commit comments